Hmm, I submitted an earlier message, but something seems to have gone
wrong.
Try this:
import sys
usingIdle = 0
for eachPath in sys.path:
if eachPath.find("idlelib"):
usingIdle = 1
break
if usingIdle:
host="localhost"
port="2000"
msg="Hello world"
else:
host, port,
I might be missing it, but I do not see anyway to set command line params in
IDLE.
You might hage to set the values in your code:
host, port, message = 'localhost', 9000, .;
crypto wrote:
> Hi,
>
> I am trying to use IDLE in order to test my program. My program is the
> following:
>
>
Hi,
I apologize not to have answered to your question in a coherent way. I
can take as excuses that I don't know English very well or that I was
mistaken by the fact that you refer a piece of code with the error
traceback (instead of simply asking for how entering command
parameters in IDLE).
But
Hi,
also if you print only 'host', running the script, you have to pass
all the 3 parameters, like:
python socket_script.py myserver 567 'All is OK!'
The parameter sys.argv[0] is of course the script 's name (in this
example: socket_script.py)
Bye.
--
http://mail.python.org/mailman/listinfo/py
Hi,
I am trying to use IDLE in order to test my program. My program is the
following:
import sys, socket
size = 1024
host, port, message = sys.argv[1], int(sys.argv[2]), sys.argv[3]
print host
How do I run this program on IDLE? I trying Run->Run Module but it
gives me:
Traceback (most recent ca