newbie variables question

Michael Hall py.list at mulga.com.au
Fri Mar 30 19:56:13 EST 2001


I've been trying to do this:

SYSPRODIR = /home/admin/systemprofile
os.system('mv /tmp/install.log SYSPRODIR/install.log')

No matter how I play around with single and double quotes, this won't
work.

But this does work:

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

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

while PHP is happy with things like:

include ("$SYSPRODIR/install.log");

Thanks for any advice. I haven't found any clear info about this in
Learning Python yet.

Mick





More information about the Python-list mailing list