By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,846 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,846 IT Pros & Developers. It's quick & easy.

open("output/mainwindow.h",'w') doesn't create a folder for me

P: n/a
Hello
I have done python for some time now. I'm forgetting things.

This is the faulty line : outfile = open("output/mainwindow.h",'w')

I thought it would have created the folder ouput and the file
mainwindow.h for me but it's throwing an error

May 2 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
no*************@gmail.com wrote:
Hello
I have done python for some time now. I'm forgetting things.

This is the faulty line : outfile = open("output/mainwindow.h",'w')

I thought it would have created the folder ouput and the file
mainwindow.h for me but it's throwing an error
No, you have to create the folder first. Try os.makedirs()
--
Michael Hoffman
May 2 '07 #2

P: n/a
On May 2, 10:06 am, Michael Hoffman <cam.ac...@mh391.invalidwrote:
noagbodjivic...@gmail.com wrote:
Hello
I have done python for some time now. I'm forgetting things.
This is the faulty line : outfile = open("output/mainwindow.h",'w')
I thought it would have created the folder ouput and the file
mainwindow.h for me but it's throwing an error

No, you have to create the folder first. Try os.makedirs()
--
Michael Hoffman
Thanks Mike

May 2 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.