how to get rid of pyc files ?

David Lyon david.lyon at preisshare.net
Sun May 24 19:21:21 EDT 2009


On Sun, 24 May 2009 15:01:51 +0200, Stef Mientki <stef.mientki at gmail.com>
wrote:
> hello,
> 
> Moving my entire program section between windows and Ubuntu,
> sometimes causes problems, due to the existence of pyc-files
> (and probably because my program still has hard coded paths).
> 
> Is there a way to prevent generating pyc-files ?
> Or is there a way to redirect the generated pyc-files to a dedicated 
> location ?

Yes.. I see your problem...

try something else.... linking the files in linux...

Try this:

 - create a windows "run-directory" as in 'mkdir win-run'

 - create symbolic link in the win-run directory for each script
    
    - 'cd win-run'

    - 'ln -s /home/user/mypythondir/hello.py hello.py'

    - for every source file...


Now you'll be able to run both...

Under windows the .pyc files will be created in the
win-run directory and under linux in /home/user/mypythondir

David




More information about the Python-list mailing list