Re: Python file location
Thanks to all for suggestions. Linux has "too much freedom" :-) Regards, Allen -- https://mail.python.org/mailman/listinfo/python-list
Re: Python file location
windhorn writes: > I have an older laptop I use for programming, particularly Python and > Octave, running a variety of Debian Linux, and I am curious if there > is a "standard" place in the file system to store this type of program > file. OK, I know they should go in a repository and be managed by an > IDE but this seems like way overkill for the kind of programming that > I do, normally a single file. Any suggestions welcome, thanks. How about /usr/local/bin? That should already be included in $PATH. Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python file location
On 30/03/2023 09.47, windhorn wrote: I have an older laptop I use for programming, particularly Python and Octave, running a variety of Debian Linux, and I am curious if there is a "standard" place in the file system to store this type of program file. OK, I know they should go in a repository and be managed by an IDE but this seems like way overkill for the kind of programming that I do, normally a single file. Any suggestions welcome, thanks. My home-directory has a sub-dir called Projects. Larger and identifiable projects are put in their own sub-dir of that. There are also 'buckets' which contain (usually single) files such as you describe, eg PythonTraining, NotesInClass, and the one used when folk 'here' ask code-questions: "experiments". NB "Projects" may or may not be Python-based, eg may be the name of a course, with sub-directories off that for each lecture or tutorial. Python doesn't actually care where code is placed. The act of running a script causes Python to add the script's directory to the PYTHONPATH. That means that it will 'find' any files used by/from the script, relative to that dir. Accordingly, use a dir-structure is probably more about exerting some order over what would otherwise quickly become a confusion! As you say, I see little point in making "experiments" into a repo. The life-time of any such code is that of the thread/conversation (Note to self: should clean-up some of the old-stuff in there). The others are set-up under git. That to enable the use of a GitLab instance* as a form of off-site backup, or as a means of exchange with others (at the project-level). Again, agreeing with you: if PyCharm is not running, it might not be worth (waiting while) firing it up just to check some 'experiment'. In which case, either the task can be accomplished using the Python REPL, or maybe a simple text-editor will be quite sufficient to copy-paste code from an email-message and provide a basis for the-whatever (in a file called "Allan.py", for example), and from which a suggested-solution may be posted afterwards... YMMV! * New Zealand Open Source Society perq of membership -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list
Re: Python file location
On Thu, 30 Mar 2023 at 11:08, windhorn wrote: > > I have an older laptop I use for programming, particularly Python and Octave, > running a variety of Debian Linux, and I am curious if there is a "standard" > place in the file system to store this type of program file. OK, I know they > should go in a repository and be managed by an IDE but this seems like way > overkill for the kind of programming that I do, normally a single file. Any > suggestions welcome, thanks. > Standard? No. Do whatever you like :) But there are a few useful conventions. Personally, I keep all my random tools in a shed - specifically, ~/shed, which is a single git repository in which I throw all sorts of random junk, mostly those single-file scripts that don't have any other real identity. (Some of them do end up growing more files. It's rather ill-defined as a concept.) You could also just leave them in your home directory. That's pretty decent too. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Python file location
On 29Mar2023 13:47, windhorn wrote: I have an older laptop I use for programming, particularly Python and Octave, running a variety of Debian Linux, and I am curious if there is a "standard" place in the file system to store this type of program file. OK, I know they should go in a repository and be managed by an IDE but this seems like way overkill for the kind of programming that I do, normally a single file. Any suggestions welcome, thanks. Are you writing personal scripts? ~/bin then. Person modules you import in your personal scripts? I put these in ~/lib/python/cs/ for my modules, which are all named "cs.*" (avoids conflict). But that's just me. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list
Python file location
I have an older laptop I use for programming, particularly Python and Octave, running a variety of Debian Linux, and I am curious if there is a "standard" place in the file system to store this type of program file. OK, I know they should go in a repository and be managed by an IDE but this seems like way overkill for the kind of programming that I do, normally a single file. Any suggestions welcome, thanks. Regards, Allen -- https://mail.python.org/mailman/listinfo/python-list