473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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
Feb 16 '08 #1
2 1242
En Fri, 15 Feb 2008 23:11:28 -0200, Amit Gupta <em*******@gmail.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

Feb 16 '08 #2
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.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
Feb 16 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: o'seally | last post by:
solaris/linux admins/rookie_developers that battle with this error are probably all frustrated when it happens. i bet you're also somehow frustrated by this seemingly unsolvable error :-) ...take...
5
by: Anand K Rayudu | last post by:
Hi all, I am trying to find a way to get the files recursively in a given directory, The following code is failing, can some one please suggest what could be problem here from os import...
6
by: Hemant Shah | last post by:
Folks, I need to move HOME directory of an instance to another directory. What is the best way of doing it? Is changing password file enough? or dies DB2 store this info in it's own config? ...
3
by: S. Han | last post by:
I'm using Directory.GetFiles to enumerate files in a directory. The problem is if you have to enumerate all files + subdirectories recursively, it takes too much memory, and it fails. Is there...
2
by: David | last post by:
Hi all, I am fairly new to C#. so go easy on me :-) Anyhow, I have a class file that I have set up properties and a method. I am calling this class file directly from and aspx.cs file. So...
2
by: Eric | last post by:
I have a header server(.ascx) control that I want to use with all my existing seperate web apps. These web apps are configured as seperate web apps in IIS but when I try to build my solutiuon...
5
by: Bas Hendriks | last post by:
Has anyone any idea how asp.net find it's files back after compiling them to the temporary asp.net directory? I found on numerous webpages that the directorynames are chosen random but cannot find...
7
by: MarkusJNZ | last post by:
Hi, I have a website called www.websitename.com which is an ASP.NET 2.0 website. I need to create another application (Which I want to be totally seperate from the above website) but for...
2
by: Jorgen Bodde | last post by:
Hi all, I want to make a small batch copy tool that scans for certain files, and copies them to a specified directory. Since the files are huge (AVI / DIVX) typical 300 to 700 Mb, I want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.