newbie variables question

Emile van Sebille emile at fenx.com
Sat Mar 31 08:03:20 EST 2001


This is the normal way to get variables into strings.

--

Emile van Sebille
emile at fenx.com

---------
"Michael Hall" <py.list at mulga.com.au> wrote in message
news:mailman.986005960.10805.python-list at python.org...
>
> 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