[Tutor] Creating folders in windows...

Mike Hansen Mike.Hansen at atmel.com
Thu Oct 12 00:06:38 CEST 2006


	From: tutor-bounces at python.org [mailto:tutor-bounces at python.org]
On Behalf Of Chris Hengge
	Sent: Wednesday, October 11, 2006 4:00 PM
	To: Python Tutor
	Subject: [Tutor] Creating folders in windows...
	I found this from a 2004 mailing on this list..
	Doesn't work... there is no mkdir in os.path (old style maybe?)
	>>> os.path.mkdir('folder')
	Traceback (most recent call last):

	File "<input>", line 1, in ?
	AttributeError: 'module' object has no attribute 'mkdir'
	>>> dir(os.path)
	['__all__', '__builtins__', '__doc__', '__file__', '__name__',
'abspath', 'altsep', 
	'basename', 'commonprefix', 'curdir', 'defpath', 'devnull',
'dirname', 'exists', 
	'expanduser', 'expandvars', 'extsep', 'getatime', 'getctime',
'getmtime', 'getsize', 
	'isabs', 'isdir', 'isfile', 'islink', 'ismount', 'join',
'lexists', 'normcase', 
	'normpath', 'os', 'pardir', 'pathsep', 'realpath', 'sep',
'split', 'splitdrive', 
	'splitext', 'splitunc', 'stat', 'supports_unicode_filenames',
'sys', 'walk']
	Anyways... could someone please point me in the right direction?

	I can use os.system('md test'), but that isn't cross platform...
	Hopefully nothing is wrong with my python installation.
	You might try os.mkdir instead of os.path.mkdir

More information about the Tutor mailing list