0

I know some basics of Java and C++, and am looking to learn Python

I am trying to develop some random stuffs to get a good feel of how it works, but i can only make 1 line scripts that run every time i press enter to go to the next line.

I've seen tutorial videos where they can just open up files from a menu and type away until they eventually run the program.

I'm using IDLE, and i don't see options to open up new stuffs; I can only make one or two line programs. When i tried to make a calculator program, i didnt know how to run it because it ran every line of code i typed in unless there were ...'s under the >>>'s.

I think it's because i am in interactive mode, whatever that is.
How do i turn it off, if that's the problem?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • What's your actual question? – Klaus D. Jul 27 '17 at 03:55
  • Possible duplicate of [Running Python script from IDLE on Windows 7 64 bit](https://stackoverflow.com/questions/6513967/running-python-script-from-idle-on-windows-7-64-bit) – perigon Jul 27 '17 at 04:00
  • Open IDLE and press Control-N to create a new file. There will be a run option on the top navigation bar (usually F5), and from there you can run the program, all within IDLE. – Jerrybibo Jul 27 '17 at 04:30
  • If you know Java and C++, then you likely are comfortable in at least Eclipse. If so, download the Python plugin for it – OneCricketeer Jul 27 '17 at 04:33

2 Answers2

0

There are many different options for writing python scripts. The simplest to use is Idle, it come with the Python download. Within Idle, create a new document to write a script. Once finished, save it as a .py file, and you can run it within Idle. For my personal setup, I use the text editor Atom. I can create documents easily, and run them through the terminal on my computer. Hope this helps.

mjmccolgan
  • 27
  • 5
0

To exit out of the "interactive mode" that you mentioned (the included REPL shell in IDLE) and write a script, you will have to create a new file by either selecting the option from the top navigation bar or pressing Control-N. As for running the file, there's also that option on the navigation bar; alternatively, you can press F5 to run the program.

Jerrybibo
  • 1,315
  • 1
  • 21
  • 27