Posts: 4,647
Threads: 1,494
Joined: Sep 2016
Nov-12-2017, 06:04 AM
(This post was last modified: Nov-12-2017, 06:05 AM by Skaperen.)
python already uses
.py and
.pyc and
.pyo ... are there any others: i've started using these:
.pyi - insertable (not necessarily importable) snippets of code that can be useful to inserted while creating a
.py file.
.pyd - insertable or importable files that are data being added to a program, such as a list of US states.
.pyt - insertable or importable files that are text being added to a program, such as different licenses.
your thoughts?
*** ducks behind the big blue couch ***
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 1,298
Threads: 38
Joined: Sep 2016
You forgot
.pyw (though that may apply only to Windows).
Sounds like you're just reinventing the wheel and making life just a little more complicated.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
this started for me when i had some files that were snippets of code i could insert into python code. at first i used the extension .py for everything. but that was getting them mixed up with python code that was suppose to be a complete command or module. it first it seemed i needed to read each file to see if it began with #! which was making a lot of my commands big and complex. at least the ones without #! were short so grep didn't need to read so much. i started writing a command to detect these (the file command did not ... in some cases it said it was ascii text and in others it said it was python source) then got the idea of an extension (
.pyi) as i could get emacs to recognize then that way a lot easier, and recognize them in big one-time commands a lot easier (for example, a one-time command to upload all python-insertable files to a specific location). so, i started doing it that way. i have solved similar issues with other things not involving python, before, with general good luck. then i realized i had some files that were data or text assignments (can import) or quote encodings (inserted after a dangling assignment) and decided
.pyi was not enough for these. too bad Linux did not have meta-attributes for files.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
there would be too much interfacing the database to other things ... i think extensions keeps it simple.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.