ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Mikhail Zabaluev <mhz@alt-linux.org>
To: м-р <mandrake-russian@altlinux.ru>
Subject: [mdk-re] Re: скрипт на питоне help!!!
Date: Tue Nov 20 00:45:13 2001
Message-ID: <20011119215720.GC1930@localhost.localdomain> (raw)
In-Reply-To: <20011119215847.52fbaddb.info@atmsk.ru>

Hello AVL,

On Mon, Nov 19, 2001 at 09:58:47PM +0300, AVL wrote:
>
> дописываю тут скриптик на питоне.
> уперся в гадость.
> 
> преобразование типов в следующих строчках не работает.
> 
>         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

Похоже, в Font_Xml_Record находится вовсе не строка.

P.S. А зачем у Вас везде точки с запятой?

-- 
Stay tuned,
  MhZ                                     JID: mookid@jabber.org
___________
Having a wonderful wine, wish you were beer.



  parent reply	other threads:[~2001-11-20  0:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-19 21:36 [mdk-re] " 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 ` Mikhail Zabaluev [this message]
2001-11-20  2:02   ` [mdk-re] " AVL

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011119215720.GC1930@localhost.localdomain \
    --to=mhz@alt-linux.org \
    --cc=mandrake-russian@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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