Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #37250 > unrolled thread
| Started by | monosij.forums@gmail.com |
|---|---|
| First post | 2013-01-21 20:55 -0800 |
| Last post | 2013-05-03 11:54 -0700 |
| Articles | 5 — 3 participants |
Back to article view | Back to comp.lang.python
pycache directories monosij.forums@gmail.com - 2013-01-21 20:55 -0800
Re: pycache directories Terry Reedy <tjreedy@udel.edu> - 2013-01-22 01:01 -0500
Re: pycache directories monosij.forums@gmail.com - 2013-01-22 15:44 -0800
Re: pycache directories monosij.forums@gmail.com - 2013-01-22 15:44 -0800
Re: pycache directories jorvis@gmail.com - 2013-05-03 11:54 -0700
| From | monosij.forums@gmail.com |
|---|---|
| Date | 2013-01-21 20:55 -0800 |
| Subject | pycache directories |
| Message-ID | <841fcc01-df05-4a8b-8b4f-1217c49aac44@googlegroups.com> |
I am doing some OO python3 where I am using multiple dirs/sub-dirs. So everything works fine, however when I run code __pycache__ directories are being created in every directory touched by the execution. Is it possible to set a configuration to be able to create these pycache directories in a specific location? Coming from the Java world - am used to the /src, /bin aspects - so somewhat prefer the 'executables' out of the way. I am using python3 on Ubuntu so wondering if there is some environ setting? Thanks for your help.
[toc] | [next] | [standalone]
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2013-01-22 01:01 -0500 |
| Message-ID | <mailman.778.1358834539.2939.python-list@python.org> |
| In reply to | #37250 |
On 1/21/2013 11:55 PM, monosij.forums@gmail.com wrote: > I am doing some OO python3 where I am using multiple dirs/sub-dirs. > > So everything works fine, however when I run code __pycache__ > directories are being created in every directory touched by the > execution. This is much better than having multiple .pyc files in every directory, as in Py2. You should soon learn to ignore them. > Is it possible to set a configuration to be able to create these > pycache directories in a specific location? No. (I am very sure.) You can however, not have the .pyc files written, but that means recompile with every run. So that option is meant for running off a read-only medium. -- Terry Jan Reedy
[toc] | [prev] | [next] | [standalone]
| From | monosij.forums@gmail.com |
|---|---|
| Date | 2013-01-22 15:44 -0800 |
| Message-ID | <437b29ed-14ae-4b22-9cb2-48ab629bf7ba@googlegroups.com> |
| In reply to | #37251 |
On Tuesday, January 22, 2013 1:01:44 AM UTC-5, Terry Reedy wrote: > > > I am doing some OO python3 where I am using multiple dirs/sub-dirs. > > > > > > So everything works fine, however when I run code __pycache__ > > > directories are being created in every directory touched by the > > > execution. > > > > This is much better than having multiple .pyc files in every directory, > > as in Py2. You should soon learn to ignore them. > > > > > Is it possible to set a configuration to be able to create these > > > pycache directories in a specific location? > > > > No. (I am very sure.) You can however, not have the .pyc files written, > > but that means recompile with every run. So that option is meant for > > running off a read-only medium. > > > > -- > > Terry Jan Reedy Thanks Terry. I understand needing to adjust. Appreciate this forum. Monosij
[toc] | [prev] | [next] | [standalone]
| From | monosij.forums@gmail.com |
|---|---|
| Date | 2013-01-22 15:44 -0800 |
| Message-ID | <mailman.847.1358900809.2939.python-list@python.org> |
| In reply to | #37251 |
On Tuesday, January 22, 2013 1:01:44 AM UTC-5, Terry Reedy wrote: > > > I am doing some OO python3 where I am using multiple dirs/sub-dirs. > > > > > > So everything works fine, however when I run code __pycache__ > > > directories are being created in every directory touched by the > > > execution. > > > > This is much better than having multiple .pyc files in every directory, > > as in Py2. You should soon learn to ignore them. > > > > > Is it possible to set a configuration to be able to create these > > > pycache directories in a specific location? > > > > No. (I am very sure.) You can however, not have the .pyc files written, > > but that means recompile with every run. So that option is meant for > > running off a read-only medium. > > > > -- > > Terry Jan Reedy Thanks Terry. I understand needing to adjust. Appreciate this forum. Monosij
[toc] | [prev] | [next] | [standalone]
| From | jorvis@gmail.com |
|---|---|
| Date | 2013-05-03 11:54 -0700 |
| Message-ID | <dabbde1c-3a07-461f-ab81-e09e5a57810b@googlegroups.com> |
| In reply to | #37250 |
I agree, this would be a good feature. I redirect my emacs backups to a single directory too so that they're not distributed all over the file system. While I don't know how to do that with the things python creates, I've read a few ways you can disable their creation altogether (assuming you don't care or need the benefit of their use): You can run python with -B or set the environmental variable PYTHONDONTWRITEBYTECODE=1 For fun, lots of developer discussion about its original creation here: http://www.gossamer-threads.com/lists/python/dev/815510
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web