Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70813

Re: Running scripts from shell / IDLE in windows

From Mark H Harris <harrismh777@gmail.com>
Newsgroups comp.lang.python
Subject Re: Running scripts from shell / IDLE in windows
Date 2014-05-01 11:02 -0500
Organization Aioe.org NNTP Server
Message-ID <53627022.9020504@gmail.com> (permalink)
References <9fa954ea-e341-42ac-a91d-fb25598ccba7@googlegroups.com>

Show all headers | View raw


On 5/1/14 10:34 AM, s71murfy wrote:

>
> I am trying to run the simple helloworld script from the IDLE shell. I want to pass it arguments. Please can you give me the syntax to do it?
>

There are several ways to do this, depending on your preferences and 
goals.  Is the helloworld script the tk version?  In which case have the 
script put up input dialog boxes...

The python docs pages are very clear about input parameter i/o and may 
give you some help, if you're building a script that you want to launch 
from a terminal, or startup...

What I do with my IDLE scripts is embed to embed a Main function (or 
call it Hello().  So, I import hello, then call hello.Main(parms).  or, 
  hello.Hello(parms)

example

====file hello.py===

def Hello(parms list):
     whatever
     whatever

====================


 From IDLE:

import hello

hello.Hello([1, 2, 3, 4])




marcus

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Running scripts from shell / IDLE in windows s71murfy <sam.murthy@gmail.com> - 2014-05-01 08:34 -0700
  Re: Running scripts from shell / IDLE in windows Mark H Harris <harrismh777@gmail.com> - 2014-05-01 11:02 -0500
    Re: Running scripts from shell / IDLE in windows Mark H Harris <harrismh777@gmail.com> - 2014-05-01 11:18 -0500

csiph-web