Bottom Page

Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 file extension for python
#1
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 ***
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Quote
#2
Hm... I would use some file name prefix or suffix. And I am doing it like that. The programs and the systems depend on file extension when it comes to text files. If the file is executable ( a script ), the shebang line will work regardless of the file extension. But this is valid for Linux/Unix systems. Don't know about Mac OS.
metulburr likes this post
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Quote
#3
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
Quote
#4
I don't see the point to invent your own extensions. Who else, but you will know what they mean. Not to mention that
pyd - https://docs.python.org/3.6/faq/windows....e-as-a-dll
pyt -  http://desktop.arcgis.com/en/arcmap/10.3...lboxes.htm
Quote
#5
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.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Quote
#6
It sounds like a database is what you need
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Quote
#7
there would be too much interfacing the database to other things ... i think extensions keeps it simple.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  IDLEX Extension - A Promising IDE For Python. adt 2 568 Sep-27-2019, 09:58 PM
Last Post: snippsat

Forum Jump:


Users browsing this thread: 1 Guest(s)