seperate directory for .pyc files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amit Gupta

    seperate directory for .pyc files

    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
  • Gabriel Genellina

    #2
    Re: seperate directory for .pyc files

    En Fri, 15 Feb 2008 23:11:28 -0200, Amit Gupta <emailamit@gmai l.com>
    escribió:
    Is there an environment variable or some settings, that python can use
    to know the directory name for dumping .pyc files.
    No.

    --
    Gabriel Genellina

    Comment

    • Jeff Schwab

      #3
      Re: seperate directory for .pyc files

      Amit Gupta wrote:
      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.Pope n(
      ["ls"] + sys.argv[1:], stdout=subproce ss.PIPE)

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

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

      Comment

      Working...