ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Victor Sovetov <victor@comcon.kiev.ua>
To: "mandrake-russian@altlinux.ru" <mandrake-russian@altlinux.ru>
Subject: Re: [mdk-re] скрипт на питоне help!!!
Date: Mon Nov 19 21:47:06 2001
Message-ID: <Pine.LNX.4.33L.0111192057400.1964-100000@wind.gnizdo> (raw)
In-Reply-To: <20011119215847.52fbaddb.info@atmsk.ru>

On Mon, 19 Nov 2001, 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
>
>
> если print AfmSize; то все в порядке а вот тоже самое подставить в
> шаблон никак. :(
> что делать?
>

Мей би:

 temp = string.replace(temp,'%AfmSize%',str(AfmSize));

:)

Sincerely,

--Victor Sovetov





  reply	other threads:[~2001-11-19 21:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-19 21:36 AVL
2001-11-19 21:47 ` Victor Sovetov [this message]
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

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=Pine.LNX.4.33L.0111192057400.1964-100000@wind.gnizdo \
    --to=victor@comcon.kiev.ua \
    --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