newbie variables question

Erno Kuusela erno-news at erno.iki.fi
Sun Apr 1 16:57:48 EDT 2001


In article <mailman.986005960.10805.python-list at python.org>, Michael
Hall <py.list at mulga.com.au> writes:

| But this does work:

| os.system('mv /tmp/install.log %s/install.log' %s SYSPRODIR)

[there's a typo, replace he second %s with %]

| Is this the normal/best way to do this in Python ... seems a little
| convoluted me, like there must be a simpler way. Bash for example would be
| happy with something like:

| mv /tmp/install.log $SYSPRODIR/install.log

there's a module for doing string interpolation like this
at <URL:http://www.lfw.org/python/>.

  -- erno



More information about the Python-list mailing list