Noobie Question: Using strings and paths in mkdir (os.mkdir("/test/"a))

Shaun smacpher at gmail.com
Fri Apr 22 03:13:05 EDT 2005


Hello!

I can't seem to get paths and variables working together:

import os
a = 'books'
os.chdir( '/test')
os.mkdir("/test/"a)

the last line does not seem to work.  os.mkdir(a) makes the directory
books, but i want this directory as a subdirectory of test.

I also tried: os.mkdir("/test/",a), and trying to make b = 'test' and
then os.mkdir(a b).

Does someone have any ideas or a link they can give me, I looked under
strings in the python tutorial and library manual but I guess not in
the right spot.

Thanks for your help!

Shaun



More information about the Python-list mailing list