Re: [Tutor] Running python from windows command prompt

2013-04-11 Thread Prasad, Ramit
On 11/04/13 07:08, Arijit Ukil wrote: > Thanks for the help. Now I have modifed the code as: > > import sys > > def main(argv): > data = int(sys.argv[1]) > avg = average (data) > print "Average:", avg > > def average(num_list): > return sum(num_list)/len(num_list) Note that in

Re: [Tutor] Running python from windows command prompt

2013-04-10 Thread Alan Gauld
On 11/04/13 07:08, Arijit Ukil wrote: Thanks for the help. Now I have modifed the code as: import sys def main(argv): data = int(sys.argv[1]) avg = average (data) print "Average:", avg def average(num_list): return sum(num_list)/len(num_list) if __name__ == "__main__":

Re: [Tutor] Running python from windows command prompt

2013-04-10 Thread Asokan Pichai
On Thu, Apr 11, 2013 at 11:38 AM, Arijit Ukil wrote: > Thanks for the help. Now I have modifed the code as: > > import sys > > def main(argv): > > data = int(sys.argv[1]) > > avg = average (data) > > print "Average:", avg > > def average(num_list): > return sum(num_list)/len(num_l

Re: [Tutor] Running python from windows command prompt

2013-04-10 Thread Arijit Ukil
: http://www.tcs.com Experience certainty. IT Services Business Solutions Outsourcing From: Alan Gauld To: tutor@python.org Date: 04/10/2013 10:58 PM Subject: Re: [Tutor] Running python from windows co

Re: [Tutor] Running python from windows command prompt

2013-04-10 Thread Alan Gauld
On 10/04/13 13:32, Arijit Ukil wrote: I like to run a python program "my_python.py" from windows command prompt. This program ( a function called testing) takes input as block data (say data = [1,2,3,4] and outputs processed single data. Hopefully the code below is not your entire program. If

Re: [Tutor] Running python from windows command prompt

2013-04-10 Thread eryksun
On Wed, Apr 10, 2013 at 8:32 AM, Arijit Ukil wrote: > > python my_python.py 1 3 2 Adding Python's installation directory to PATH is for starting the interpreter with specific options (-O, -vv, etc), running a module on Python's sys.path (-m), running a command (-c), or starting an interactive sh

Re: [Tutor] Running python from windows command prompt

2013-04-10 Thread Dave Angel
On 04/10/2013 08:32 AM, Arijit Ukil wrote: I like to run a python program "my_python.py" from windows command prompt. This program ( a function called testing) takes input as block data (say data = [1,2,3,4] and outputs processed single data. import math def avrg(data): return sum(data)/len

Re: [Tutor] Running python from windows command prompt

2013-04-10 Thread Amit Saha
On Wed, Apr 10, 2013 at 10:32 PM, Arijit Ukil wrote: > I like to run a python program "my_python.py" from windows command prompt. > This program ( a function called testing) takes input as block data (say > data = [1,2,3,4] and outputs processed single data. > > import math > > def avrg(data): >

Re: [Tutor] Running python from windows command prompt

2013-04-10 Thread Amit Saha
On Wed, Apr 10, 2013 at 10:32 PM, Arijit Ukil wrote: > I like to run a python program "my_python.py" from windows command prompt. > This program ( a function called testing) takes input as block data (say > data = [1,2,3,4] and outputs processed single data. > > import math > > def avrg(data): >

[Tutor] Running python from windows command prompt

2013-04-10 Thread Arijit Ukil
I like to run a python program "my_python.py" from windows command prompt. This program ( a function called testing) takes input as block data (say data = [1,2,3,4] and outputs processed single data. import math def avrg(data): return sum(data)/len(data) def testing (data): val =

Re: [Tutor] running python from windows command prompt

2013-04-10 Thread Dave Angel
(Please don't hijack a thread with an unrelated question. You're no doing yourself any favors, as any decent thread-viewer will hide your new subject line, and group the whole thread with its original title. That can cause your query to be ignored by many of the readers.) To start a new threa

[Tutor] running python from windows command prompt

2013-04-10 Thread Arijit Ukil
I like to run a python program "my_python.py" from windows command prompt. This program ( a function called testing) takes input as block data (say data = [1,2,3,4] and outputs processed single data. import math def avrg(data): return sum(data)/len(data) def testing (data): val = avrg(