Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Need some very basic help creating DVD to watch in DVD player! Carl Abudephane Digital Video 4 Feb 20, 2012 10:23 AM
Very basic question about processor speed Typswif2fingers Mac Basics and Help 3 Jul 21, 2011 05:12 AM
Very basic question about ram surfer99 Mac Basics and Help 5 Nov 17, 2007 07:59 AM
Some very basic questions... jedirunner OS X 4 Oct 30, 2007 01:17 PM
Two very basic questions about Safari... furthur Mac Help/Tips 4 Apr 15, 2003 08:25 PM


All times are GMT -5. The time now is 08:57 AM.

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

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