Python installation editing and execution on Windows

#1

Hi Guys

I am half way through my Python 3 course. There are two practice projects that I should be able to do. But that requires installing and getting started with Python on my Windows 7 - 64 bit OS.
I have installed Python 3.7 through Python website ‘https://www.python.org/downloads/’. But am having no luck beyond that.
I read that typing Py in my command prompt would let me know if the installation was successful.
1. I opened my command prompt by typing cmd in start menu and hitting enter.
Its file path is c:\windows\system32\cmd.exe - py

**2.**Typed Py and enter.


The message appeared, which according to the installation files meant that it has been successful.

3. I also have Python exe file stored at c:\user\user2\app.data…\python37-32\python.exe
I made a shortcut of this exe file on desktop and when I run it it executes print codes just like cmd window.
But other than that i am having trouble editing or executing functions etc. I am not able to access files or folders using cd, ls commands.

Question 1 - Which window (cmd or python exe) should I use. What’s the difference between the two other than file path?
**Question 2-**Would they run python programs from the text or code editor. That is i write the code in editor and open file in prompt windows to run it?
**Question 3-**Do I really need these prompt windows for my code. the user interface is depressing and having used codecademy interface I was hoping to set up a UI on similar lines.
Question 4- I read that I need an editor to write my codes and pip to install packages. Will an editor also interpret my code or would I need to install interpreter separately?
Question 5- If cmd and python.exe are the way to go, how do I access the files and folder as every time I try and execute cd - error msg shows up.

I hope your reply will help me understand computer language interpretation better.

When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!

If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer! :slight_smile:

#2

You should have IDLE in the installation folder.

..\Python\Pythonxx-xx\Lib\idlelib\idle.pyw

Open that Shell, and in the File menu, click New File to open an editor window. You can have as many of them open as you need. Pin this to your Start Menu or the Taskbar.

#3

Hi mtf

I followed the path. thank you. that was very helpful. I opened idle file type with no console .

This is the page i got.

Question : what is it trying to tell?

I chose new file and wrote an trial program and saved the file as sum.py and saved it under path python\python xx -xx\ … \Files\sum.py

Ran this program and got the python shell with the result .

Thank you.

But i have further questions. Would you please help me with those as well.

How do I integrate these two environment now. The editor and the Python shell ( am I right to call it interpreter?).
I read about spyder and other IDE’s.

Why did no other text on ‘installing and running python’ mentions the idle lib file?

Thank you.

1 Like
#4

When you shut everything down and go back to Windows, what happens when you click the IDLE shortcut on your desktop? It should open the Shell. That is the interactive interpreter that accepts any Python command at the >>> prompt.

That is the path I use to get to the Editor.

Open Shell
File > New File (editor)

As for where it is mentioned in the installation instructions you have me at a loss. It took me a minute when I first installed Python but once discovered I just made sure to have working shortcuts pinned to the Start Menu and the Taskbar.

I never have more than one Shell application running, but can have multiple editor instances open at once. For my own use, I do not use the Files folder in the Python folder, but have a separate folder in My Documents (and one on my D drive that gets used the most). You may wish to do the same so your installation folder does not contain any of your work and is left essentially OOB.

How you set up your work environment will be up to you.

#5

Hi

I just didn’t know that I needed to access shell shortcut from lib files. Its not mentioned anywhere. This is the first ever programming language I have downloaded and installed, may be that’s why. Thank you for setting me in right direction.

1 Like