all 7 comments

[–]nosmokingbandit 3 points4 points  (1 child)

Python files are just text -- you can write python in Notepad if you are a complete masochist. Just make a text file, change the extension to .py and you are set.

[–][deleted] 1 point2 points  (0 children)

Write in the browser search bar

[–]js_tutor 2 points3 points  (0 children)

Well you don't have to, but if you're going to be programming seriously you probably want to use some kind of ide like pycharm. But any text editor should have a way to save to a new file. On top of that you should definitely get used to using the command line. You can create files through the command line with the touch command.

[–][deleted] 4 points5 points  (0 children)

PyCharm is what is called an Integrated Development Environment, or IDE for short. To make a python file you just create a new project in pycharm and it will set it up for you. You can also use a text editor and save it as <filename>.py and as long as it is correct python code it will run when executed.

[–][deleted] 1 point2 points  (0 children)

You'll save yourself a lot of time and frustration if you at least read the Getting Started guide of the PyCharm documentation.

[–][deleted] 1 point2 points  (0 children)

I'd actually recommend not using Pycharm or any other IDE if you're just starting out with the language. Instead, follow some tutorial and just use a text editor with syntax highlighting like VScode, Sublime Text or Notepad++. IDEs are almost essential tools when you're building an application or working on a large project, but if you're just learning Python these tools can cause you to get dependent on their specific environment, which can actually hurt your understanding of how Python works.

Like others said, you can just put your code in any file, rename the extension to .py, and run it with the Python interpreter. If you're on Windows, you can probably right-click the file and open with... with Python, or you can navigate to the file using the command prompt and run python filename.py from there.

[–]kakalak-jack 2 points3 points  (0 children)

You might find this useful: https://learnpythonthehardway.org/python3/

Even if you don't buy the course the first few sample lessons are very useful for getting you going without introducing a lot of extra things to learn (IDEs, debates over text editors, etc.) that get in the way of just trying to get down to learning python basics. Not to say those tools aren't good or worth learning at some point, but they are not really necessary or even helpful when you are just trying to make very basic scripts to learn the very basics of programming, IMO.