newbie running IDLE with command line arguments

Philippe C. Martin philippe at philippecmartin.com
Wed May 18 08:46:48 EDT 2005


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:
> 
> 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 call last):
>   File "C:\Python24\userprograms\simpleclient.py", line 5, in
> -toplevel-
>     host, port, message = sys.argv[1], int(sys.argv[2]), sys.argv[3]
> IndexError: list index out of range
> 
> How do I enter the command arguments?
> 
> Thanks,
> C29




More information about the Python-list mailing list