Can I load a python program at the interactive >>> prompt?

W

walterbyrd

I am running cygwin on xp.

Much to my annoyance, I can not cut-and-paste from a windows app to
the python prompt. I think I could do this with putty, but I do not
have the permissions to install putty on my xp box.

Can I load a file into the python interactive environment? For
example I have a file called test.py that consists of the following:

print "hello"
print "hello again"

Can I load that file into python at the >>> prompt?

or something like that?
 
T

Tim Golden

walterbyrd said:
I am running cygwin on xp.

Much to my annoyance, I can not cut-and-paste from a windows app to
the python prompt. I think I could do this with putty, but I do not
have the permissions to install putty on my xp box.

I do this all the time. The key (altho' not strictly essential)
is to access the console window Properties from the top-left drop-down
menu and then on the first tab, select Quick Edit. With this, you
can just right-click with the mouse and whatever you had in the
clipboard (as long as it's text) will drop into your Python
session. Whenever I'm posting code snippets here, I always
copy them from the email and do what I've described to run
them in a fresh interpreter session to make sure they work.
Can I load a file into the python interactive environment? For
example I have a file called test.py that consists of the following:

print "hello"
print "hello again"

Can I load that file into python at the >>> prompt?


or something like that?


Well, you can use execfile if you want.

TJG
 
T

Tim Golden

walterbyrd said:
I am running cygwin on xp.

..... and I just noticed this vital bit. So not sure
how much of my other post applies. Sorry. Maybe it'll
help anyway. :)

TJG
 
D

Diez B. Roggisch

Tim said:
.... and I just noticed this vital bit. So not sure
how much of my other post applies. Sorry. Maybe it'll
help anyway. :)


Everything. The atrocity that the windows terminal window is isn't
mitigated by an out-of-the-box cygwin. Did anybody *ever* need a
rectangular marking mode?

You could use rxvt. But that's also far from perfect.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top