Forcing import of sitecustomize.py

J

Jamie

Hi all,

I'm deploying a python application packaged as an executable with py2exe.
I'm forcing the import of sitecustomize.py to set the default encoding and
this works fine when I'm running the executable (i.e. the main script).
However, in another script I'm using the executable as an archive to import
from and in this scenario sitecustomize.py is not imported. Is there any way
I can force the import of sitecustomize.py in this scenario? I'd prefer to
leave everything packaged up and not ship an extra sitecustomize.py file.

Cheers,

Jamie
 
T

Thomas F.B.

I'm deploying a python application packaged as an executable with py2exe.
I'm forcing the import of sitecustomize.py to set the default encoding...

"Don't do this!" (MHO)

I used sitecustomize.py, too. But after having nothing but trouble with
3rd party modules, py2exe, McMillan Installer etc. etc. I decided to write
my applications in such a way that they do not depend on a specific
default encoding. (E.g. things which worked with one version of py2exe
etc. did not work with the next version etc.)

My opinion:

sitecustomize.py is fine for small python scripts which you use on your
own system (admin scripts, daily work etc.). It allows you to program
without caring about encodings and stuff (i.e. to be lazy :) But for
applications which you want to deploy, I would not recommend to make use
of or to rely on the default encoding set in sitecustomize.py.

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,084
Latest member
HansGeorgi

Latest Threads

Top