On 7/12/05, Mathieu Renauld <[EMAIL PROTECTED]> wrote:
> Hi!
> First forgive me for the language mistakes (I'm french)!!

Your English is more understandable than some native English writers
I've seen :)

> 
> I try to make a program using wxPython and Python 2.4.
> There's a function which creates a file like that:
> file = open('myfile.py','w')
> 
> when I launch the program from a shell (python test.py), it work perfectly
> and the file is created, but once I've 'compiled' it with py2app, the
> created app doesn't create anything.
> If somebody has already met that problem, please help me !! thanks!

I'd imagine it did create the file... you just have to know where to
look. When you fire up an app, your working directory is *inside the
app bundle*. This is good for many things, but not for writing files.
(If you look inside the .app bundle, you'll find your myfile.py down
in there...)

For the purposes of testing, you might try something like this:

import user
import os
fn = os.path.join(user.home, "myfile.py")
file = open(fn, "w")

That will create the file in your home directory.

Kevin
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to