Re: [Tutor] need an explanation

2012-10-12 Thread Matthew Ngaha
Thanks for everyone that replied. I really gained a lot from all the input. Also thanks to Dave and Prasad for explaining why i had errors trying to run the program. I fully understand the code now and im able to run it without errors. ___ Tutor maillist

Re: [Tutor] need an explanation

2012-10-11 Thread Prasad, Ramit
Matthew Ngaha wrote: [snip] > @ DAVE.. you said > sys is a module (presumably you have an import > somewhere above this line). In the module, there's a list argv. > > the import statements are: > > import sys > import os > import shutil > import zipfile > > so im guessing [sys, os, shutil, zipf

Re: [Tutor] need an explanation

2012-10-11 Thread Dave Angel
On 10/11/2012 04:48 PM, Matthew Ngaha wrote: >> >> Obviously a Monty Python fan as I see 3 methods :) >> > lol i dont know what i was looking at.. yes its 3 methods sorry:( > > >>> def __init__(self): >>> self.zipping_directory = "unzipped-{}".format(filename) >>> >> Where did filename appear

Re: [Tutor] need an explanation

2012-10-11 Thread Matthew Ngaha
> > > Obviously a Monty Python fan as I see 3 methods :) > lol i dont know what i was looking at.. yes its 3 methods sorry:( > >> def __init__(self): >> self.zipping_directory = "unzipped-{}".format(filename) >> > > Where did filename appear from above? > > > sorry i didnt write everything.

Re: [Tutor] need an explanation

2012-10-11 Thread Emile van Sebille
Matthew Ngaha wrote: i need help on 2 topics. 1) can someone please tell me what sys is doing, and why its using weird indexing? if __name__ == "__main__": A_Class(*sys.argv[1:4]).A_Class_Method() sys is doing nothing -- argv in sys holds the command line arguments passed into python

Re: [Tutor] need an explanation

2012-10-11 Thread Mark Lawrence
On 11/10/2012 20:24, Matthew Ngaha wrote: i need help on 2 topics. 1) can someone please tell me what sys is doing, and why its using weird indexing? sys isn't doing anything and the weird indexing is called slicing. if __name__ == "__main__": A_Class(*sys.argv[1:4]).A_Class_Method()

Re: [Tutor] need an explanation

2012-10-11 Thread Dave Angel
On 10/11/2012 03:24 PM, Matthew Ngaha wrote: > i need help on 2 topics. > > 1) can someone please tell me what sys is doing, and why its using weird > indexing? > > if __name__ == "__main__": > A_Class(*sys.argv[1:4]).A_Class_Method() sys isn't being indexed. sys is a module (presumably you h

Re: [Tutor] need an explanation

2012-10-11 Thread Prasad, Ramit
Matthew Ngaha wrote: > i need help on 2 topics. > > 1) can someone please tell me what sys is doing, and why its using weird > indexing? > > if __name__ == "__main__": >     A_Class(*sys.argv[1:4]).A_Class_Method() > > is sys able to call methods? if so why does it need indexing if it uses * .

[Tutor] need an explanation

2012-10-11 Thread Matthew Ngaha
i need help on 2 topics. 1) can someone please tell me what sys is doing, and why its using weird indexing? if __name__ == "__main__": A_Class(*sys.argv[1:4]).A_Class_Method() is sys able to call methods? if so why does it need indexing if it uses * . --