Help with Python Program

python
ide

#1

There was no topic for me to ask this in so idk.
Anyways, I need help. I’ve gotten pretty far in the Python course and I want start making my own programs. I downloaded Python 2 but I’ve had trouble going from Codecademy to the real Python program.
Does anyone have any tips? One problem is that everytime I run code and have an error I can’t reobtain my code.


#2

When you open the interactive console, what are the top lines? Please copy everything above >>> and paste it into a reply. Thanks.


#3

Rather than typing directly into python, write your code to a file and run python on that file


#4

They wouldn’t be the first ones to not know about New File in the File menu of the Shell.


#5

That’s the how, not the what. And the tools used may vary since they’re not python


#6

You may find it beneficial to run through the Python 2.x tutorial available here:

https://docs.python.org/2.7/tutorial/

You’ll find that a good chunk of the material there covers the same ground as the Codecademy course, but it should give you a good intro to running code against your local Python installation.

Alternatively, if you’re a Codecademy Pro subscriber, Lesson 13 which is the Python Final Project deals with setting up a Python development environment on your own computer. :slight_smile:


#7

Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.


#8

Try using python 3.3, I find it works better than Python 2 does. If it does not work, Make sure all of your code is correct. If you need any more help do not hesitate to message me.

-Ranjeet


#9

click on file and new file to get a blank page of python as the window you will have now is the module where you run the proggramme


#10

What you have is the Shell. Opening a New File will give you an editor window where you can compose and save code. Use the Run menu to launch the program in the Shell (or press F5). Each time you Run, it restarts the Shell. If you wish to inspect variables, keep the Shell running after the program stops. From the the command prompt you can call functions and query variables.


#11

How do I open a new file?


#12

In the File menu of the Shell, click New File.

Suggest you write a comment in the editor and Save the file right off the hop so that you can set the working directory before you accidentally save it in the Python codebase folder.

Create a new folder in your Documents folder called ‘Python’ and inside that, a new folder to store your project, then in there save the file with a working name.

my_project.py

Now you are free to write your code and Save anytime you make changes (File > Save) or Ctrl+s.

You need to save before you can Run (F5).


#13

I dont see new file anywhere


#14

What options are available in the File menu?


#15

I’m really not keen on talking about this in terms of IDLE

Instead:

  1. Open text editor of choice
  2. Write code
  3. Save, and note the location
  4. execute python with filepath as argument

These are all super basic operations.

And how exactly they are carried out depends entirely on their system, it’s up to them to figure out

And if one chooses to use IDLE to carry those things out, it should be incredibly obvious how to do that simply because of the limited options available and knowing what operations one wants to do.


#16

Nevermind. I have determined the solution by myself, but thank you for the help. <3


#17

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.