Stupid question: saving from notepad with extension not .txt

  • Thread starter Thread starter nrqed
  • Start date Start date
  • Tags Tags
    Extension Stupid
Click For Summary
SUMMARY

To save a Python program in Notepad without the .txt extension, users must select the "All Files" option in the save dialog box. This allows them to specify the desired filename with the .py extension directly. A user confirmed that after initially failing, they successfully saved their file as "myprogram.py" by using this method. This straightforward approach resolves the issue of unwanted file extensions when saving code in Notepad.

PREREQUISITES
  • Basic understanding of Python programming
  • Familiarity with Notepad as a text editor
  • Knowledge of file extensions and their significance
  • Experience with Windows file management
NEXT STEPS
  • Explore advanced text editors for Python, such as Visual Studio Code or PyCharm
  • Learn about file handling in Python, including reading and writing files
  • Investigate best practices for naming files and managing file extensions
  • Understand the differences between various text editors and their features for coding
USEFUL FOR

Beginner Python developers, users transitioning from basic text editors to programming environments, and anyone looking to improve their file management skills in Windows.

nrqed
Science Advisor
Messages
3,762
Reaction score
297
I think the heading pretty much says it all!
I want to write a python program and I am typing it in Notepad. when I save it, it adds .txt to my filename "myprogram.py".
How do I avoid that? (I know, it's a stupid question!)

Pat
 
Computer science news on Phys.org
The save dialog box should have a dropdown menu which allows you to save the file as .txt or * (all files). If you pick the * option then you can have it save as .py.

I'm not totally sure, but it is worth a try.
 
dduardo said:
The save dialog box should have a dropdown menu which allows you to save the file as .txt or * (all files). If you pick the * option then you can have it save as .py.

I'm not totally sure, but it is worth a try.

I could have sworn I *had* tried that and it did not work! But I tried it again (gicing a new filename) and it did work! Doh!

thanks! Your post at least prompted me to try again!

:-)


Pat
 

Similar threads

  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 22 ·
Replies
22
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
7
Views
3K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K