Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 26, 2012, 01:13 PM   #1
unbelly
macrumors newbie
 
Join Date: Mar 2012
Some very basic qs about IDLE

I've downloaded IDLE as my interpreter for Python and at first thought I had the hang of it but totally confused now.

I have the IDLE shell open for Python which is what I get when I open IDLE but I have noticed that I can open a new window from the shell and that this brings up a notepad type page, without the prompts. Is this the main text editor page where I have to write the code and where I save it from? What's confusing me is that I also seem to be able to save files from the Shell and I am just wondering why i would want to save in both?

I realise this is a very basic question but I am new to programming and ignorant about a lot of the basic stuff comp sci people would take for granted!

The extra problem I'm having is that I have another thing installed - when I open it's a black window with prompts, similar to IDLE shell, and is called python.exe at the top.

I downloaded these via the MIT site and didn't fully understand the difference of each when I downloaded...

Would really appreciate any help with which ones I need to use. I'm thinking two would be enough- text editor and shell in IDLE? And that I don't need the python.exe (the black screen window).
unbelly is offline   0 Reply With Quote
Old Mar 26, 2012, 05:27 PM   #2
thundersteele
macrumors 68030
 
Join Date: Oct 2011
Python can be used interactively, or in a more conventional way of "write code, then execute code."

IDLE gives you both options, i.e. a python shell with a prompt for interactive work, and a text editor (with highlighting and code completion).

When you save a file from the shell, this saves the shell history, which does not give a working piece of python code, but can still be useful. I don't know what your python.exe is, but probably you don't need it
thundersteele is offline   0 Reply With Quote
Old Mar 26, 2012, 06:54 PM   #3
unbelly
Thread Starter
macrumors newbie
 
Join Date: Mar 2012
You are right, I don't need that extra python window. I typed some code into the IDLE text editor, had to save it, then pressed run, and it then brought up the shell which showed the results. Perfect.

Thanks for your help thundersteele!

I see I can do it all in the shell also and take your point about how the editor is good for saving the code itself.
unbelly is offline   0 Reply With Quote
Old Mar 27, 2012, 09:32 PM   #4
Bradf0rd91
macrumors newbie
 
Join Date: Mar 2012
I'm also in a basic (and I mean BASIC) CompSci class at the moment, and I had very similar questions to these that no one ever thinks to answer in class. From what I understand, that black window is (or is a form of) a "terminal"? Someone correct me if I'm wrong here, but that '.exe' extension at the end means it is meant for 'executing' the code you write, and only that. The shell allows you to interactively write and run code (but not save it). The edit window allows you to write and save code (but not run it). The black window is what pops up if you ever select a file you've saved and double-click it (to run it) without telling the computer you want it opened in a shell.
Bradf0rd91 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Anyone having trouble with IMAP Idle? pmontanarella iCloud and Apple Services 2 Jan 1, 2014 07:39 AM
Restarting when idle! please help beerunner MacBook Pro 0 Nov 8, 2013 10:08 PM
IDLE hangs on raw_input() turboLT Mac Programming 10 Oct 9, 2013 08:42 AM
Free note app with basic formatting basic HTML Subu iPhone and iPod touch Apps 0 Mar 1, 2013 03:44 AM

Forum Jump

All times are GMT -5. The time now is 11:25 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC