473,326 Members | 2,081 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,326 software developers and data experts.

supress creation of .pyc files

Hi,

Is there a way to import a file without creating
a .pyc file?

Of course you can delete the pyc in my script after
the import statement, but maybe there is a switch
that I have not found yet.

The imported file is a config file, not a script.

Thomas
--
Thomas Güttler, http://www.thomas-guettler.de/
Jul 18 '05 #1
3 1397
On Wed, 16 Feb 2005 14:53:22 +0100, Thomas Guettler wrote:
The imported file is a config file, not a script.


You could use execfile() to read the file, and not import.

Jeremy

Jul 18 '05 #2
In article <pa****************************@thomas-guettler.de>,
Thomas Guettler <gu*****@thomas-guettler.de> wrote:
Hi,

Is there a way to import a file without creating
a .pyc file?

Of course you can delete the pyc in my script after
the import statement, but maybe there is a switch
that I have not found yet.

The imported file is a config file, not a script.

Thomas


If you're on unix, you can put the .py files you want to import in a new
directory, then change the permissions on this directory so that you do
not have write permission for it.

rg
Jul 18 '05 #3
Thomas Guettler wrote:
Is there a way to import a file without creating
a .pyc file?


That is part of PEP 304, which is not implemented
yet, and apparently currently stalled due to lack
of interest.

Regards,
Martin
Jul 18 '05 #4

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

Similar topics

3
by: SK | last post by:
I have a file. i get the creation time using File.GetCreationTime. then i go and delete that file. and then create it again and print the File.GetCreationTime. It is giving me the old creation...
2
by: David Fickbohm | last post by:
People, I am trying to determine the creation date of files in a folder. I am using the following code to find the folder and confirm that files exist in the folder. If someone could give me an...
1
by: David | last post by:
I have a custom control that contains a class that Inherits the panel control. I am trying to catch a keydown event in this class and then supress it from the rest of the control as well as the...
2
by: khani | last post by:
Hi i have following situation in cystal report in detail section i have a field say name.now i have five duplication record like this zahid zahid zahid zahid
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.