[Tutor] (no subject)

Alan Gauld alan.gauld at btinternet.com
Wed Sep 15 01:48:05 CEST 2010

"Sukhpal Saini" <sunny_ashi1 at hotmail.com> wrote
> Hi! I have a problem. I just started python. when I
> use (open) function, is the file supposed to open?
> Because it doesn't.

How do you know? Are you also new to programming?
Or do you know another programming language?

Assuming that you are new to programming....
Are you expecting a window to appear with the file displayed?
If so you will be disappointed, open() simply makes the file available
to your program to manipulate. Any display of the file is down
to you as the programmer.

See the Handling Files topic of my tutorial for more information.

OTOH If you realized that but genuinely believe that open()
is not returning an open file object then you will need to give
us some more context - ideally some sample code and
any error messages. Please tell us which OS you are
using too.


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list