ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [mdk-re] скрипт на питоне help!!!
@ 2001-11-19 21:36 AVL
  2001-11-19 21:47 ` Victor Sovetov
  2001-11-20  0:45 ` [mdk-re] " Mikhail Zabaluev
  0 siblings, 2 replies; 6+ messages in thread
From: AVL @ 2001-11-19 21:36 UTC (permalink / raw)
  To: м-р

дописываю тут скриптик на питоне.
уперся в гадость.

преобразование типов в следующих строчках не работает.

        StatAfm=os.stat(FileAfm);
	AfmSize=StatAfm[6];
	AfmMtime=StatAfm[8];
	
        StatPfb=os.stat(FilePfb);
	PfbSize=StatPfb[6];
	PfbMtime=StatPfb[8];
	
	temp = Font_Xml_Record;

#	temp = string.replace(temp,'%AfmSize%',AfmSize);
#	temp = string.replace(temp,'%AfmMtime%',eval(AfmMtime));
#	temp = string.replace(temp,'%PfbSize%',eval(StatPfb[6]));
#	temp = string.replace(temp,'%PfbMtime%',eval(StatPfb[8]));

вот эти закоментаренные строчки порождают ошибку:

[avl@avl paratype]$ ./GPinst
Traceback (most recent call last):
  File "./GPinst", line 83, in ?
    temp = string.replace(temp,'%AfmSize%',AfmSize);
  File "/usr/lib/python2.1/string.py", line 369, in replace
    return s.replace(old, new, maxsplit)
TypeError: expected a character buffer object


если print AfmSize; то все в порядке а вот тоже самое подставить в шаблон никак. :(
что делать?



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-11-20  2:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-19 21:36 [mdk-re] скрипт на питоне help!!! AVL
2001-11-19 21:47 ` Victor Sovetov
2001-11-19 22:37   ` AVL
2001-11-19 22:47     ` AVL
2001-11-20  0:45 ` [mdk-re] " Mikhail Zabaluev
2001-11-20  2:02   ` AVL

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git