[wxPython] Missing .pyc file

Is there any reason why a wxPython program would not generate a .pyc
file? I had this simple code, which is actually from the tutorial, that
won't generate a .pyc file. So the loading takes time whenever I ran
it.

I'm using

Linux
Python 2.2
wxPython 2.3.2.1
wxGTK 2.3.2.1

Tks.

AL

Alfredo P. Ricafort wrote:

Is there any reason why a wxPython program would not generate a .pyc
file? I had this simple code, which is actually from the tutorial, that
won't generate a .pyc file. So the loading takes time whenever I ran
it.

I'm using

Linux
Python 2.2
wxPython 2.3.2.1
wxGTK 2.3.2.1

First guess: Does the user who runs the code have write permission in the directory where the python file is located?

David

Are you aware that .pyc files are only created
when you do an import?

What happens if you manually import the program
from the python interpreter? Won't that create
a .pyc-file?

I'm not so sure you'll gain a lot in upstart time
with a .pyc-file though. You have a decent amount
of libraries to load. If it's a small program, the
byte code compilation will be rather fast.

···

At 23:01 2002-10-19 +0800, Alfredo P. Ricafort wrote:

Is there any reason why a wxPython program would not generate a .pyc
file? I had this simple code, which is actually from the tutorial, that
won't generate a .pyc file. So the loading takes time whenever I ran
it.

--
Magnus Lyckå, Thinkware AB
Älvans väg 99, SE-907 50 UMEÅ
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se

oops.... I just found out that you have be in an interactive mode to
generate a bytecode. I thought all along that a .pyc file will be
generated no matter which way you execute a python program.

···

On Sat, 2002-10-19 at 23:11, David C. Fox wrote:

Alfredo P. Ricafort wrote:

> Is there any reason why a wxPython program would not generate a .pyc
> file? I had this simple code, which is actually from the tutorial, that
> won't generate a .pyc file. So the loading takes time whenever I ran
> it.
>
> I'm using
>
> Linux
> Python 2.2
> wxPython 2.3.2.1
> wxGTK 2.3.2.1
>

First guess: Does the user who runs the code have write permission in
the directory where the python file is located?

David

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

No, it's not the interactive mode that matters.
.pyc-files are generated on import. If you run
a.py, and a.py has an "import b", a b.pyc will
be generated, unless there is already a b.pyc
with a more recent timestamp than b.py.

But as I said, you don't have a big speed gain
from having pre-compiled a small module if i has
to load a lot of modules anyway.

In general, building your application so that the
program file you run directly is fairly small, is
often a good idea.

···

At 23:40 2002-10-19 +0800, Alfredo P. Ricafort wrote:

oops.... I just found out that you have be in an interactive mode to
generate a bytecode. I thought all along that a .pyc file will be
generated no matter which way you execute a python program.

--
Magnus Lyckå, Thinkware AB
Älvans väg 99, SE-907 50 UMEÅ
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se