[Tutor] newbie Questions

2012-07-16 Thread Matthew Ngaha
Hi all. I'm new to Python and Programming in general. I've started out with Python for beginners, and so far so good. My friend who i might add, is not a programmer but has had experience in the world of programming (i dont know how much but he claims a lot), has told me to forget about Python and

Re: [Tutor] newbie Questions

2012-07-16 Thread Matthew Ngaha
6 PM, Alexandre Zani wrote: > On Mon, Jul 16, 2012 at 5:09 AM, Matthew Ngaha > wrote: > > Hi all. I'm new to Python and Programming in general. I've started out > with > > Python for beginners, and so far so good. My friend who i might add, is > not > &

Re: [Tutor] Error message...

2012-08-25 Thread Matthew Ngaha
>Hi Victoria. im a total beginner aswell but i noticed something. shouldnt this >line: else: return s(0) == s(-1) and isPalindrome (s[1:-1]) be else: return s[0] == s[-1] and isPalindrome (s[1:-1]) it looks like you have the string s as a function which you are trying to call. what you wante

[Tutor] calculation issue.

2012-08-26 Thread Matthew Ngaha
Hi guys ive been reading a beginners book on python and the author created a simple game with the liewires package. I understand the explaination but there is just 1 part that i don't quite get. I'm not great at maths but this isn't complex at all. i don't know if i should post the whole code, cos'

Re: [Tutor] calculation issue.

2012-08-26 Thread Matthew Ngaha
thanks guys. Eryksun your explaination was brilliant and clear. i understood what you explained but got a bit confused with this line: The bottom of the next pizza is at y = 100 + 100 = 200 if this Pizza (pizza.b) was on hold at position y = 100 and the previous pizza(pizza.a) had fallen an addi

[Tutor] help me decide

2012-09-04 Thread Matthew Ngaha
hey guys as i program more, i think of silly questions i would like answers to. if anyone doesnt mind entertaining my question, please do answer:) I have just about finished my beginner tutorial, just a few exercises left. i feel confident using Python now but im still not sure which direction i wa

Re: [Tutor] help me decide

2012-09-04 Thread Matthew Ngaha
sorry wrong i didnt send mail right. hey i didnt explain it properly, i wasn't asking what language to use or learn. I am only going to be using Python. I meant whic area to study on 1st, GUI programing e.g Tkinter or Programming with a web framwork e.g Django. _

Re: [Tutor] help me decide

2012-09-04 Thread Matthew Ngaha
hey you didnt read my question:( i dont enjoy either because i have no experience with them. so im asking questions about peoples personal experiences with the 2 areas which can give me further information to research on. ___ Tutor maillist - Tutor@pyth

Re: [Tutor] help me decide

2012-09-05 Thread Matthew Ngaha
Hi Alan thanks so much for your helpful answers. > probably wxPython or GTk > But if you want to get serious about GUIs I'd probably suggest wxPython > instead - it ultimately is more powerful and complete and if you are only > just starting will be easy to learn whereas learning Tkinter and conv

Re: [Tutor] help me decide

2012-09-06 Thread Matthew Ngaha
hey guys i just like to thank everyone for their input. Its really helped me in deciding a lot of things. also @ Alan i think? as ive started writing this mail it won;t let me look up previous senders but thanks for your input. Also your field of work sounds very interesting indeed. I can't dare to

Re: [Tutor] I need Help

2012-09-08 Thread Matthew Ngaha
this is the same book i bought a few months ago to get me started. the instructions i remember where clear for windows. if there is a problem with the download files on the site, the author has the files on his own site also: http://www.programgames.com/page4.html save or run the file, once insta

Re: [Tutor] I Need Help - further details now provided.

2012-09-09 Thread Matthew Ngaha
SORRY i wrote to you not the mailing list:( im a beginner myself, and those instructions seem very complicated for me. But i did install Python and everything included with no problem. You need at least Python 3.1 for this book we have. its what the author recommended. version 2.7 as you have s

[Tutor] web frameworks

2012-09-09 Thread Matthew Ngaha
Hi all, i had a recent post about learning about guis and web applications. i decided to try guis 1st, but i also decided that maybe a very very very simple web framework would not be too much work for me to study once in while. I decided on Flask because i read it's the simpliest framework out of

Re: [Tutor] web frameworks

2012-09-09 Thread Matthew Ngaha
sorry steven i keep replying to sender and not tutor:( ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] I Need Help - further details now provided.

2012-09-09 Thread Matthew Ngaha
> What instructions are you talking about? > > I'm sure that was very clear in your head when you wrote that, but think > about how it looks to us. We could be reading your email hours, days, > even months later. We see your comment about complicated instructions, > but all context is lost and we h

Re: [Tutor] web frameworks

2012-09-09 Thread Matthew Ngaha
thanks for all the help guys. Cherrypy it is. i will take a look at some cgi tutorials first, as Alan suggested, to get a good understanding of how things work. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://

[Tutor] simon says

2012-09-10 Thread Matthew Ngaha
hi guy my book has set me an assignment of a simon says game but i don't really understand what it's asking me to do. here's the text: write a version of the simon says game where a player has to repeat an ever-growing, random sequence of colours and sounds using the keyboard. Anyone understand t

Re: [Tutor] simon says

2012-09-10 Thread Matthew Ngaha
> You should read up on the Simon Says rules and such. It's an > established, old game. Once you get that, then work on replicating it > through software. > thanks for your input. i understand Simon Says. I'm just struggling to see the connection with the assignment. a sequence of colours and soun

Re: [Tutor] simon says

2012-09-10 Thread Matthew Ngaha
>> hi guy my book has set me an assignment of a simon says game but i >> don't really understand what it's asking me to do. here's the text: It's the last chapter of Python Prgogramming for the absolute beginner. they have covered all the basics. Even simple tkinter apps and Pygame games. If i und

Re: [Tutor] simon says

2012-09-10 Thread Matthew Ngaha
> This seems less about "simon says" the social game, and more about > "simon", the 1980s electronic toy. > > That toy had four colored buttons that would light up in a sequence, > playing a tone for each color. The player would then have to press > the buttons in the same sequence. The game woul

Re: [Tutor] simon says

2012-09-11 Thread Matthew Ngaha
> Sounds as though what is wanted in a Pythonic version of an early electronic > game "Simon" that was marketed back in the late 70's. It was roughly Frisbee > shaped although slightly larger. The top was divided into four > quadrant-shaped paddles each of a different color. The game consiste

[Tutor] setting a timer

2012-09-12 Thread Matthew Ngaha
i have a way to set a timer for creating new objects copied from a book but as i have started my next exercise in a very different way, i want to avoid that math method/formula as it will cause me to rearrange some classes totally... i tried a simple method but its not working. any ideas? heres my

Re: [Tutor] setting a timer

2012-09-12 Thread Matthew Ngaha
> Get a slower computer. > > I expect that if you find an old Commodore 64 from 1982, or perhaps > an 1984 Apple Macintosh, it might be slow enough for your count down > idea to work. But with modern computers, counting up to, or down from, > 5 is more or less instantaneous in human terms. > >

[Tutor] simon game issues

2012-09-13 Thread Matthew Ngaha
Hi guys. my Python tutorial set me a task to recreate a simon game using livewires. http://www.youtube.com/watch?v=agUABjGAJww this is quite long, i understand if you can't help right away summary: i create 4 squared shaped objects(red, blue, green, yellow) as instances for a class derived from th

Re: [Tutor] simon game issues

2012-09-14 Thread Matthew Ngaha
> It would appear you're running some form of event loop, such as > wxpython, tkinter, pygame, or whatever. If so, you have to do your > delays using the mechanism that system defines, not using sleep(). As > you've discovered, sleep() stops the whole thread, and that's not what > you want. What

[Tutor] Relative import help

2012-09-22 Thread Matthew Ngaha
i have an assignment from a book to practice implementing relative imports. it gave a very clear and easy to follow explanation, but my results are proving the instructions are wrong. here's what i have tried. my folder structure: Project / __init__.py main.py Domestic / __init__

Re: [Tutor] Relative import help

2012-09-22 Thread Matthew Ngaha
> Not impossible, but I doubt that. > > Have you followed the instructions *exactly*? If not, you have > probably missed something. What book is it? > > Otherwise, the book and you are probably using different versions of > Python. What version of Python are you using, and what is the book > using?

Re: [Tutor] Relative import help

2012-09-22 Thread Matthew Ngaha
> You probably have a path that reaches into Domestic or Europe sub-package. > That can happen if e. g. Project/Domestic/Europe is your current working > directory. > > Try to cd into the Project folder's parent directory and see if > > $ python -c 'import Project.Domestic.Europe.winners' > > works

Re: [Tutor] Relative import help

2012-09-22 Thread Matthew Ngaha
> try > import ../my_module > instead of > import ..my_module > and see what happens. > Your problem may be just that you haven't included the separator. > > .. means one directory higher but you must separate it from the file name. > > Two directories higher would be > ../../my_module sadly this

Re: [Tutor] Relative import help

2012-09-22 Thread Matthew Ngaha
> cd is a shell command; you do it before starting Python. You didn't > mention what OS you're running, but cd should be about the same for > Linux, Windows, or Mac. im on windows. i always start Python via IDLE. ive never started it for editing though the shell, run > cmd etc? ill type that int

Re: [Tutor] Relative import help

2012-09-22 Thread Matthew Ngaha
> You probably have a path that reaches into Domestic or Europe sub-package. > That can happen if e. g. Project/Domestic/Europe is your current working > directory. > > Try to cd into the Project folder's parent directory and see if > > $ python -c 'import Project.Domestic.Europe.winners' > > works

Re: [Tutor] Relative import help

2012-09-22 Thread Matthew Ngaha
> You had forward slashes in your description of the folder layout, so I > assumed you were on a linux box or a mac. I think I have now learned the > lesson and will make fewer assumptions in the future. > > First, in idle's "shell" window type > import sys print(sys.executable) > > (dont

Re: [Tutor] [Tkinter-discuss] displaying an image

2012-10-04 Thread Matthew Ngaha
> You need to install PIL to use the tutorial you are doing. > > http://www.pythonware.com/products/pil/ the site says " The current free version is PIL 1.1.7. This release supports Python 1.5.2 and newer, including 2.5 and 2.6. A version for 3.X will be released later. " i have python 3. all the

Re: [Tutor] [Tkinter-discuss] whats Style()

2012-10-07 Thread Matthew Ngaha
sorry i sent the email directly by mistake. Just like to say thanks once again for all the help ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] [Tkinter-discuss] whats Style()

2012-10-07 Thread Matthew Ngaha
> > sorry i sent the email directly by mistake. Just like to say thanks once > again for all the help > this email was a mistake, meant for anything mailing section.. please ignore it ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscr

[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 * . --

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-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

[Tutor] hasattr()

2012-10-13 Thread Matthew Ngaha
im trying to understand this hasattr function. i am supposed to pass in an object and an attribute name into its parametres... so im trying to get it to return True. Here's a quick test class Test: def __init__(self): self.att = "testing" >>> e = Test() >>> hasattr(e, e.att) False >>

Re: [Tutor] hasattr()

2012-10-14 Thread Matthew Ngaha
Thank you xDog and Steven. The whole assignment makes a lot of sense now after your explanations of what hasattr is doing. Thanks ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinf

[Tutor] Which is better Practice and why

2012-10-22 Thread Matthew Ngaha
In many of the tutorial examples ive come across, the main code's program is never at the top level, but always in a function of some sort. i understand why but, there is always a different way used to access the main code, i want to know which is the best. main() main's code #top level mai

Re: [Tutor] Which is better Practice and why

2012-10-22 Thread Matthew Ngaha
oh ok i understand it.. Thanks for the help guys ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] help with homework

2012-10-28 Thread Matthew Ngaha
> > In your original getNames do something like this. >> Initialise a counter to zero. >> Every time you get a valid name increment the count. >> If the count is three you're finished. >> > hey i was looking at the question as im learning also. With the counter, would you use a while loop instead o

[Tutor] need help

2012-11-01 Thread Matthew Ngaha
working through my tutorial ive been told to set up a simple webserver. i can't even get started because the 1st line of code its asked me to do fails with a syntax error. here's the code: python3 -m http.server any ideas what is going wrong? it asked me to make some simple .html files, then in t

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > > > Always, *always* include the *full* error message, otherwise we have to > guess. Not fun. Some other questions: What operating system are you using? > What version of Python does your tutorial assume? Do you in fact have > Python 3 installed on your system? > > > maybe im running it from

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > > > Works for me with 3.3: > > > aclark@Alexs-MacBook-Pro:~/ > python3.3 -m http.server > Serving HTTP on 0.0.0.0 port 8000 ... > > > hey how do you start it or where do you run it from. did you type that in the command line? ___ Tutor maillist - Tu

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > If you got an error, quote it in full in your message (using copy/paste, > not by retyping or paraphrasing. As it stands, we don't know if the > error was in bash, in csh, in cmd, or in Python, and if it was in > python, we don''t know what version. > > > python3 -m http.server > > Where did y

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > Don't run it from inside IDLE. You were right to run it from cmd. > > Pasting the error message you showed elsewhere: > > 'python3' is not recognized as an internal or external > command, operable program or batch file. > > That simply says that the PATH does not point to your PYTHON3.bat or >

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > The interpreter executable in Windows is always called "python" > (console) or "pythonw" (no console). The 3.1 installer doesn't put the > executable's directory on the system PATH. The option to add this was > added to the 3.3 installer. Otherwise you'll have to add the directory > manually. I

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > No, in your case it's > > set PATH=%PATH%;D:\Data\Program Files Data\Py > > That's just a temporary modification for the current cmd process. It's > easiest to show how to change it permanently with screen captures; > search for "vista set path". > i followed the instructions at http://ban

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > "Py" is a directory. > > Once you've added the Python executable's directory to the path, you > can start the http.server module as a script by running the following: > > python -m http.server > > Don't use "pythonw" in this case. The latter is associated with the > .pyw file extension, use

Re: [Tutor] help

2012-11-19 Thread Matthew Ngaha
It's asking a lot if you want people to read your whole code to try and spot the errors. Try to run it from the console and paste what the errors are here. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mai

Re: [Tutor] help

2012-11-20 Thread Matthew Ngaha
> Traceback (most recent call last): > File "Match finder GUI.py", line 87, in ? > app = Application(root) > File "\Match finder GUI.py", line 23, in __init__ > self.create_widgets() > File "Match finder GUI.py", line 61, in create_widgets > self.submit_bttn = Button(self, text =

Re: [Tutor] Proper useage of "open"

2012-12-12 Thread Matthew Ngaha
> I typed in to my script: > a = open (dupli, r) > and got an error stating that "dupli" is not deffined. it needs the quotes around it. so try: a = open ("dupli", "r") ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription option

Re: [Tutor] exercise

2012-12-14 Thread Matthew Ngaha
> return {e for (e, g) in self.sort_email.items() > if g & groups_list} > guys i think ive got it. The & in that comprehension was really confusing me, but i found out it means intersection, so i took the sets manually and saw the results i got using intersection and it became more

Re: [Tutor] Python Programming for Absolute Beginners, 3rd Edition

2013-01-02 Thread Matthew Ngaha
> With the code not being on the page, I went to the directed website and got > the downloads, yet I couldn't find the source code > anywhere to be found. Am I missing something plainly obvious? what exactly did you download? all the source code for every chapter is included in the download __

[Tutor] unclear topic

2013-01-14 Thread Matthew Ngaha
hey guys, this is not really a Python question. When ever im doing a tutorial, it could be pygame or some gui application, i usually find everything straight forward until the demonstration involves drawing. Then maths is applied and i can't follow along as easily. In the end by commenting out cert

Re: [Tutor] Traffic Light

2013-01-19 Thread Matthew Ngaha
On Sat, Jan 19, 2013 at 10:56 PM, anthonym wrote: > Thanks again for the info Alan. I am still passing the button process > until I can get my rectangle and ovals on the canvass. The program runs > and produces a window with the radio buttons on top. I would like them on > the bottom but change

Re: [Tutor] Traffic Light

2013-01-19 Thread Matthew Ngaha
On Sun, Jan 20, 2013 at 12:05 AM, Matthew Ngaha wrote: > On Sat, Jan 19, 2013 at 11:29 PM, anthonym wrote: >> Sure thing. Here is the code. And after that is the box I get with the >> radio buttons but no shapes. > i might be way off as im struggling to understand how tki

[Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
hi guys i am a python 3.1.1. user but really need to use python 2 to be able to use certain libraries and frameworks. i have installed python 2.7 but they cant run together as all .py and .pyw files are opened with python 3. i can open simple python 2 files by right clicking and finding pythons 2's

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> > Python 3.3 for Windows comes with a "launcher", which will approximate (for > Python only) what Unix and Linux users have had for years for any scripting > language. You can get it separately, as Mark Lawrence has said, but maybe > it's time to bring your 3.x current. > there was a lot of read

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> > You don't have to uninstall 3.1 but you would have to install all the > downloaded modules or packages that you have in your 3.1 site packages > folder to the 3.3 site packages folder. Maybe it's easier to simply grab > the standalone pylauncher as I suggested earlier. Only you know what is t

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> yes the 2nd option (standalone pylauncher) sounds more convienient for > me. i just have to try and comprehend all the instructions given.. > hopefully ill get there in the end i managed to install the laucher. on the site when i click the correct launcher 32bit, i chose "run" and it automatical

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> > Have you added shebang lines to those scripts yet? > yes i added them. i think the problem is at the start where it asks me to: You should ensure the launcher is on your PATH - depending on how it was installed it may already be there, but check just in case it is not. >From a command-prompt,

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> I'm not using it, since I'm not using Windows. So these are guesses based > on years stuck\b\b\b\b\b spent in the Windows environment. > > Clearly, the name of the program is py.exe, so that's what you should try > searching for. From the cmd prompt, try dir /s py.exe > > Or, you could just

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> Did you find the "control-panel-way" to modify the PATH (assuming py.exe > wasn't already in there) ? Without it, I'd be surprised if right-click > would work correctly. > > And as for IDLE, there are two different IDLEs, one in each directory. So > run the one that corresponds to the python you

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
On Thu, Jan 24, 2013 at 9:35 PM, eryksun wrote: > On Thu, Jan 24, 2013 at 1:56 PM, Matthew Ngaha wrote: >> >> py is not recognized and and it said "depending on how it was >> installed". the problem is it didnt allow me to select a path when >> ins

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> In a cmd shell, check that 'assoc .py' is "Python.File" and that > 'ftype Python.File' points to py.exe in your Windows directory, e.g. > "C:\Windows\py.exe "%1" %*'. If it's wrong, re-install. Or fix it > manually using assoc and ftype in an elevated cmd shell, which updates > the local machine

Re: [Tutor] following on

2013-02-18 Thread Matthew Ngaha
>> understanding of how everything works. > > Use it., Experiment with it. Break it. > Thats the best way. Read the source code its all available in > Python or C. > Hey can you please tell me which source code youre referring too? The initial files that come with Python? also the C code, where ca

Re: [Tutor] following on

2013-02-18 Thread Matthew Ngaha
Hey, a Big thanks to everyone that has offered their input. I really appreciate it. Also thanks for all the additional links, i will definately start to read up on data structures , source code and everything else that was suggested ___ Tutor maillist -

[Tutor] break

2013-03-14 Thread Matthew Ngaha
i cant seem to break out of this loop. let me explain the variables you see: Enemy.ships = [] #an Enemy class variable that contains enemy ships self.missiles = [] an instance variable that appends how many Visible missiles my ship has fired Enemy.rects = [] an Enemy class variable that represents

Re: [Tutor] break

2013-03-14 Thread Matthew Ngaha
>> if Enemy.ships: >> for missile in self.missiles: > >flag = False >> >> for rect in Enemy.rects: > >assert(!flag) > >> if QPoint(missile.x + 5, missile.y) in rect: >>

Re: [Tutor] break

2013-03-14 Thread Matthew Ngaha
> One good approach is to have a separate function or method with > both loops: > > def attack(self, Enemy): > > for missile in self.missiles: > for rect in Enemy.rects: > if QPoint(missile.x + 5, missile.y) in rect: > explosion = Explosion(rect.x(), rect.y()

Re: [Tutor] break

2013-03-14 Thread Matthew Ngaha
thanks guys ive finally got it working. even though i didnt use the flag due to invalid syntax i realized since i was getting no errors i wasnt actually doing anything wrong. My mistake was i removed the ememy ship but for some reason forgot to remove the missile so it was still active on the next

[Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
Im following a tutorial on what i believe is using Python 2 and i'm a bit confused. I use Python 3 on windows vista. I believe urlretrieve() is a python 2 function that isnt in 3, but why is the tutorial using urllib instead of urllib2? Also when i run the program on Python 3, it says: AttributeEr

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
the whole program depends on the urlretrieve 3rd argument, the function to be called.. is there no options to include a callback? def _download(self): def reporthook(pos, block, total): if self.size != total: self._size = total self.on_size.emit

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
> Look in the module docs for urlib.request. > Hi. Ive never used the urllib before unless it was typing in something from an unrelated tutorial. I've also never done anything related to web programming. I'm looking at the urllib.request page and i really don't understand what i'm looking at. I'm

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
> > You might want to look at requests module: > http://docs.python-requests.org/en/latest/ > Many people think it is easier to use than the native python support. > are all of these modules related to web programming like clients and (HTTP)servers? I've come across urllib a lot of times but only

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
Gauld wrote: > On 07/04/13 17:20, Matthew Ngaha wrote: >>> >>> Look in the module docs for urlib.request. >>> >> >> Hi. Ive never used the urllib before > > > In Python 3 urllib combines (the best) features of > urllib and urllib2 fro

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
>org/2/library/urllib.html#urllib.urlretrieve > or > http://docs.python.org/3/library/urllib.request.html#urllib.request.urlretrieve sorry about the top posting gmail has changed the way their messages are done, it gave me a blank field i didnt realize i was writing above the message. i must have

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
> Unless you're looking for something specific from the URL that the > tutorial uses, then you could use any address > > Bodsda thanks i did that and to my suprise an extra file showed up in my folder, of the page i just visited:) thanks ___ Tutor mailli

Re: [Tutor] help regarding game code

2013-05-12 Thread Matthew Ngaha
>> bWater.clicked.connect( water_clicked ) AttributeError: 'int use a paste site like http://bpaste.net/+python to show us the code. i am no expert @ programming myself but that error is telling you you used an int and tried to access an int method called connect somewhere in your code. ints do n

[Tutor] env var packages

2013-05-14 Thread Matthew Ngaha
i have to install django and ive come across some weird instructions. it says to set Django's django-admin.py file to my environment variable. I was instructed to get django via easy installer that was located in my Python/Scripts folder. it installed django to a different place in site-packages,

Re: [Tutor] env var packages

2013-05-15 Thread Matthew Ngaha
Thank you Vasya and Eryksun. Sorry i didn't mention my OS i am on windows. Thanks for the links and detailed explanations which after following, i now have django up and running! thanks again ___ Tutor maillist - Tutor@python.org To unsubscribe or chang

Re: [Tutor] Python Programming for the Absolute Beginner

2013-05-15 Thread Matthew Ngaha
i completed this book and i did every exercise. are you asking for help with the challenges, or have you completed them and want code to compare yours too? im relunctant to share challenge code, incase you havent done them. They are really good exercises to try doing. __

Re: [Tutor] Interested in learning Python

2013-05-15 Thread Matthew Ngaha
i recommend getting a copy of Python Programming for the absolute beginner. It offers end of chapter exercises to make sure you understand everything you are reading. It was a great read for me and made my learning experience really fun. I garantee by the end you would have gained a lot of confiden

[Tutor] model methods in Django

2013-05-18 Thread Matthew Ngaha
im following the official docs and after learning Python im sure of how methods work, but the model example on the beginners guide has me really confused. The model definition is omitted but can anyone explain how this methed (was_published_recently) is given these attributes: class Poll(models.

Re: [Tutor] model methods in Django

2013-05-19 Thread Matthew Ngaha
Thanks guys i had no idea about these method attributes and also these underlying oop __objects__ @ eryksun i understand your explanation, im still having trouble figuring out how django is being used in the tutorial. class Poll(models.Model): # ... def was_published_recently(self):

Re: [Tutor] model methods in Django

2013-05-19 Thread Matthew Ngaha
> The default description is the name with underscores removed, unless > you set a custom description in the function's "short_description" > attribute. I'm not experienced with Django, so I can't ramble off lots > of examples, but hopefully you get the gist. Thanks that does clear it up. Also tha

Re: [Tutor] model methods in Django

2013-05-19 Thread Matthew Ngaha
> class Poll(models.Model): > > question = models.CharField(max_length=200) > pub_date = models.DateTimeField('date published') > > > > def was_published_recently(self): > return self.pub_date >= timezone.now() - datetime.timedelta(days=1) > > # > > > was_published_recen

Re: [Tutor] model methods in Django

2013-05-19 Thread Matthew Ngaha
> options.py is the biggest module in the admin package. The link I > posted is to the get_actions method of ModelAdmin. In the tutorial, > PollAdmin extends this class. > oh ok thanks, yes i will definately look through it > I'm not coming from any framework. My knowledge of web development is >

Re: [Tutor] model methods in Django

2013-05-19 Thread Matthew Ngaha
o you are > quoting. > > On 20/05/13 00:23, Matthew Ngaha wrote: ok thanks i didnt think about that. I was quoting eryksun. I'll includethat line from now on ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription option

Re: [Tutor] challenge-chapter 2

2013-05-22 Thread Matthew Ngaha
On Wed, May 22, 2013 at 6:02 AM, Andrew Triplett wrote: > I am on chapter two for Python Programming working on the challenges and the > question is: > > 1. Create a list of legal and illegal variable names. Describe why each is > either legal or illegal. Next, create a list of "good" and "bad" le

Re: [Tutor] Difference between types

2013-05-23 Thread Matthew Ngaha
wait for someone more knowledgeable to answer, but from what i know, Yes it does have a profound meaning. Strings consist of character sets. Something that was here way before Python Like i said my experience is limited so i too would like to hear some reponses ___

[Tutor] Fwd: QT Python: How to re-use the return value of fileDialog.openFileName() ?

2013-05-27 Thread Matthew Ngaha
Sorry for the forward, i forgot to reply to tutor On Mon, May 27, 2013 at 3:53 AM, Sunitha Misra wrote: > self.fileDialog = QtGui.QFileDialog() > > QtCore.QObject.connect(self.toolButton, > QtCore.SIGNAL(_fromUtf8("clicked()")), self.fileDialog.getOpenFileName) > i think the way youre doing it

Re: [Tutor] Fwd: QT Python: How to re-use the return value of fileDialog.openFileName() ?

2013-05-27 Thread Matthew Ngaha
On Mon, May 27, 2013 at 2:14 PM, SM wrote: >But then I also had to use self.fileDialog from within the function. Not > sure how I could avoid using fileDialog. > > Thanks. No problem. to do it without the instance variable, you access its method directly. so replace: path = self.fileDialog.getO

[Tutor] global variables

2013-08-22 Thread Matthew Ngaha
I'm always told to avoid using them. I read discussions on the python irc channel about them but honestly i feel there are some times where i can't avoid using them. Like where i want to keep track of a state variable in many different functions that may or may not alter its value and also not want

Re: [Tutor] global variables

2013-08-22 Thread Matthew Ngaha
On Thu, Aug 22, 2013 at 1:40 PM, Chris Down wrote: > It sounds like you want to use a class. > Why would you not just use a class if you want to store state? I don't feel my program needs a class. Also i have been told to stop using classes by some very experienced Python programmers on irc even

Re: [Tutor] global variables

2013-08-22 Thread Matthew Ngaha
On Thu, Aug 22, 2013 at 2:52 PM, Chris Down wrote: >I would doubt that anyone has told you "don't ever use classes", because > that's nonsense; you've probably misread a dissuasion from that path in a > single instance as applying more broadly than was intended. I am being totally honest here. I

Re: [Tutor] global variables

2013-08-22 Thread Matthew Ngaha
On Thu, Aug 22, 2013 at 3:04 PM, Alan Gauld wrote: > On 22/08/13 13:36, Matthew Ngaha wrote: > Global variables in themselves are not the problem. > It's how they tend to get used that causes problems. > Globals that are only changed via a set of > dedicated functions ar

  1   2   >