[Tutor] Help Noob Question

Ben Finney ben+python at benfinney.id.au
Thu Mar 27 10:11:12 CET 2014


Leo Nardo <waterfallroad at gmail.com> writes:

> Im on windows 8 and i need to open a file called string1.py that is on
> my desktop, in both the interpreter and notepad++, so that i can work
> on it.

It's not clear what you want. What does it mean to you for a Python
program to be “open in the interpreter”?

You have opened the file in a text editor, which is fine; the editor
presents the file contents for you to edit and save.

There isn't really an equivalent with the Python interactive
interpreter. It takes its input from you typing at the console.

Do you mean “import the module”? That executes the module and makes it
available in a distinct namespace. But it doesn't seem to be quite what
you're asking.

Do you mean “run the module as a program”? That is done
*non*-interactively, so you don't do it at the interactive Python
interpreter. Instead, you do it by issuing a command at your operating
system's command prompt.

> I already have it open in notepad, but for the life of me cannot
> figure out how to open it in the interpreter.

Welcome to the forum :-) Hopefully you can make clearer what it is you
want to do.

-- 
 \        “Intellectual property is to the 21st century what the slave |
  `\                              trade was to the 16th.” —David Mertz |
_o__)                                                                  |
Ben Finney



More information about the Tutor mailing list