seperate directory for .pyc files

A

Amit Gupta

Python'ites

Is there an environment variable or some settings, that python can use
to know the directory name for dumping .pyc files.

Not a hard-requirement, I just don't like pyc files alongwith py files
in my work area.

Thanks
A
 
J

Jeff Schwab

Amit said:
Python'ites

Is there an environment variable or some settings, that python can use
to know the directory name for dumping .pyc files.

Not a hard-requirement, I just don't like pyc files alongwith py files
in my work area.

Does this help?

# ls.py
import subprocess
import sys

pipe = subprocess.Popen(
["ls"] + sys.argv[1:], stdout=subprocess.PIPE)

paths = pipe.communicate()[0].rstrip().split('\n')

for path in paths:
if not path.endswith(".pyc"):
print path
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top