-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
retool discussion on .py file extension in episode 01 #32
Comments
Personally I'd remove it. People don't need to know it's a convention. I mean really, when would you not give it a py extension!? I think we could add more about conventions and style somewhere - like PEP8 etc. It may be mentioned in a later ep but I'd like it a bit more up front personally. |
They won't question that it should be .py, but there's a lot of misunderstanding about what file extensions do to a a file. I'd argue that it's worthwhile to have some discussion about how extensions themselves are conventions and don't change the contents, and that this is just a plain text file that happens to be named with .py, but it could go elsewhere. This will actually be important set up information for reading in data files that are also plain text. Perhaps in the IDE discussion because it reinforces that you are free to choose any plain text platform, and then you could talk about why some try to reinforce good PEP8 style. |
@richyvk i normally leave out the .py when i'm making command line tools using python. I put a shebang up top, make the into an executable. But, I agree with @elliewix that it's worth having a quick chat about file extensions, because then we can also talk about shebangs and why they exist in some python files. Also, it'll be nice to tell people why renaming a file from .txt to .py and running that file in python works but yet when you rename a .xlsx to a .csv might confuse your computer. |
@elainewong Interesting. I've never used shebangs - don't really know anything about them. I didn't know the shebang made ti executable either. This is a UNIX thing right, so not in Windows? Anyway, let's add something in about this stuff somewhere in ep 1 then! |
Current text has: "This is convention, not a requirement."
I'd suggest either removing this or expanding it. I feel like this would open space for a tangent or questions that aren't necessary to cover for this tutorial. That said, you could retool it a bit to fend off the tangental or pedantic questions (I can't be the only one who gets those). The fact that file extensions are just a flag for your system and changing them doesn't change the contents is new information to a lot of people and can generate a lot of questions.
Possible change: "As with all file extensions, this is a convention and not a requirement."
or
"Python script files are plain text files, and thus can be opened in any plain text viewer. They are noted with a .py so software applications can recognize that they are Python, but no specific text viewer is required to view the contents."
I'd put this in as a PR, but thought it worthy of a discussion or consensus first.
The text was updated successfully, but these errors were encountered: