[Tutor] help with random.randint

2010-02-02 Thread David
(the last one generated in the loop?) So I tried to change line 4 to the following: terms += random.randint(1, 99) hoping that it would add a second integer to my terms list. But I get an error: /home/david/Documents/Python-Projekt/multiplier.py in () 2 terms = [] 3 for i

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-02 Thread David
etting the global variables correct and incorrect to 0 from _within_ askFaultyAnswers; then I would run showStats() also from _within_ askFaultyAnswers. Good idea? Many thanks for your guidance and input! David On 03/02/10 12:25, Benno Lang wrote: On Wed, Feb 3, 2010 at 12:21 PM, David

Re: [Tutor] help with random.randint

2010-02-02 Thread David
Hello Bob, thanks for your comments! On 03/02/10 14:51, bob gailer wrote: or if you seek terseness: terms = [random.randint(1, 99) for i in 'ab'] Do I understand correctly that 'ab' here merely serves to produce a 'dummy sequence' over which I

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-03 Thread David
t as a variable, and when I google it, nothing much comes of if... David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] help with random.randint

2010-02-03 Thread David
integers here, but not of x,y pairs, right? (I can see that this was a problem of my code right from the start, btw.) David On 03/02/10 19:08, Eike Welk wrote: Hello David! On Wednesday February 3 2010 04:21:56 David wrote: import random terms = [] for i in range(2): terms

[Tutor] how to graph percentile -- matplotlib, Inkscape, or what?

2010-02-06 Thread David
hanks for your ideas! David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to graph percentile -- matplotlib, Inkscape, or what?

2010-02-06 Thread David
Hello Alan, thanks for the guidance, I will then dig a little deeper into matplotlib. I guess the reason why I discarded it before is that I understood matplotlib to be a curve plotting tool, and not so much a tool to draw graphics. I will investigate! David On 06/02/10 17:15, Alan Gauld

[Tutor] if item.find(extension)!= -1: -- what's the -1?

2010-02-06 Thread David
a reply? Thank you! David Example Code: for item in filelist: if item.find(extension)!= -1: snaplist.append(item) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] if item.find(extension)!= -1: -- what's the -1?

2010-02-06 Thread David
Thank you Wayne, Kent, it's easy to see clearly once told what to focus on ;-) David On 07/02/10 00:35, David wrote: Hello again, in Knowlton's 2008 book "Python: Create, Modify, Reuse" the author makes frequent use of the term -1 in his code, but doesn't tell

Re: [Tutor] how to graph percentile -- matplotlib, Inkscape, or what?

2010-02-07 Thread David
it, PyX might be a good choice for this sort of thing. But again, I have not practical experience with that tool. David On 07/02/10 02:29, Alan Gauld wrote: "David" wrote in message news:4b6d37e4.9050...@gmx.net... matplotlib. I guess the reason why I discarded it before is tha

[Tutor] NameError: global name 'celsius' is not defined (actually, solved)

2010-02-09 Thread David
ipython at all!? Many thanks, David Dear List, this should be so basic that I feel bad asking this question here, but I don't get it. I am having a look at Sande's book "Hello World". The topic is 'Modules', and the code comes directly from the book. I h

Re: [Tutor] NameError: global name 'celsius' is not defined (actually, solved)

2010-02-09 Thread David
Hello Wesley, thanks for your reply. I was surprised about the limited information too. Sadly (?), I can't reproduce the error any more... David On 10/02/10 11:13, wesley chun wrote: I just wrote this message, but after restarting ipython all worked fine. How is it to be explained t

Re: [Tutor] Coin flip game

2010-02-11 Thread David
is, if you chose randrange(1) you will get only one answer, namely 0. If you type randrange(0) then you will get an error message (ValueError: empty range for randrange). Which makes sense. Remember, randrange() goes up to, but not including the integer supplied. HTH, David Tha

Re: [Tutor] New Python testing book

2010-02-12 Thread David
Hi Alan, On 12/02/10 17:34, Alan Gauld wrote: Amazon are remarkably reticent about the actual contents. See here: http://tinyurl.com/y9dy62p I am, btw, always happy to see 'book announcements' on this list -- keep them coming! David ___

Re: [Tutor] Bowing out

2010-03-03 Thread David
you find the time and motivation, thanks again; David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Passing arguments to CGI script

2010-06-15 Thread David
Hi, I'm trying to pass arguments to a python script running on my webserver. Here is the script: import cgi import cgitb import sys cgitb.enable() form = cgi.FieldStorage() title = form.getvalue("title") print """Content-type: text/html """ print form.keys() print """ """ When I run it on the

Re: [Tutor] test

2010-11-05 Thread David
On 6 November 2010 16:20, Steven D'Aprano wrote: > Luke Paireepinart wrote: >> >> You don't get your own e-mails back. > > I do. > > Perhaps it's an option when you sign up? For any list (like this one) hosted by mailman, the default is set by list administrator, but every user can customise this

[Tutor] help with loop that is to be fed out of a word list

2009-02-09 Thread David
d' command: da...@ubuntu:~/Documents/Tools/Python/Code$ python downey_9.5.py what letters have to be used? zhg zhg aa z da...@ubuntu:~/Documents/Tools/Python/Code$ I realise that my loop fails to execute beyond the first word in the list (&qu

[Tutor] Program to report if file was modified today

2009-02-11 Thread David
st[-1] == now: print "This file has changed today." print "*"*30 else: print "This file did not change" results; ./py_lastmod_date.py /home/david/ py_pyparse_end.py Thi

Re: [Tutor] Program to report if file was modified today

2009-02-11 Thread David
nt fname, "has changed today. " else: pass mod() results; david [09:25 PM] opteron ~ $ ./py_lastmod_date.py /home/david/ py_compare_time.py has changed today. py_lastmod_date.py has changed today. -david -- Powered by Gentoo GNU/LINUX http://www.li

Re: [Tutor] Program to report if file was modified today

2009-02-12 Thread David
time(modtime)) if out == now: print fname, "has changed today. " mod() -david -- powered by Gentoo/GNU Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Program to report if file was modified today

2009-02-12 Thread David
David wrote: > Kent Johnson wrote: > >> On Wed, Feb 11, 2009 at 11:21 PM, bob gailer wrote: >> >> >> > Thanks Alan and Kent, > This works as expected; > > #!/usr/bin/python > import sys > import os > import time > > def mod

[Tutor] *nix tail -f multiple log files with Thread

2009-02-13 Thread David
b 13 08:58:48 2009] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/moodle/favicon.ico [Fri Feb 13 08:58:51 2009] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/moodle/favicon.ico Feb 13 09:02:26 opteron sudo:david : TTY=pts/4 ; PWD=/hom

Re: [Tutor] *nix tail -f multiple log files with Thread

2009-02-15 Thread David
David wrote: bob gailer wrote: Did the C program accomplish that? If so, it might help to see that code. If not why mention it? It is here if you want to check it out; http://dwabbott.com/downloads/logtailer.c.txt Your example output falls short of your stated goal as I understand it! My

Re: [Tutor] *nix tail -f multiple log files with Thread

2009-02-16 Thread David
when they work as expected. I have been avoiding this phase of learning. -david -- powered by Gentoo/GNU Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] *nix tail -f multiple log files with Thread

2009-02-16 Thread David
Bill Campbell wrote: > On Mon, Feb 16, 2009, David wrote: > >> Bill Campbell wrote: >> >>> The ``swatch'' program, written in perl, does this by using the >>> gnu-tail program via a pipe using. >>> >>> gtail --f

[Tutor] Class instance understanding = None

2009-02-26 Thread David
.00') add = a.deposit(add_data) print "deposit = ", add results; The current date is: 02/27/09 balance = 100.0 withdraw = None deposit = None expected results; The current date is: 02/27/09 balance = 100.0 withdraw = 50.0 deposit = 100.0 thanks, -david

Re: [Tutor] Class instance understanding = None

2009-02-27 Thread David
Thank you spir and Andre for the explanation. You are very good teachers. I can now continue. I am sure I will be back. Next I am going to set up a menu to enter amounts and also a way to store the resulting balance. Is cPickle a good way to do this? -david -- Powered by Gentoo GNU/LINUX

Re: [Tutor] Class instance understanding = None

2009-02-27 Thread David
Thank you spir and Andre for the explanation. You are very good teachers. I can now continue. I am sure I will be back. Next I am going to set up a menu to enter amounts and also a way to store the resulting balance. Is cPickle a good way to do this? -david -- Powered by Gentoo GNU/LINUX http

Re: [Tutor] Class instance understanding = None

2009-02-27 Thread David
Amount: 100 Traceback (most recent call last): File "./py_pettycash.py", line 77, in menu() File "./py_pettycash.py", line 53, in menu a.deposit(cash) File "./py_pettycash.py", line 15, in deposit self.balance = sel

Re: [Tutor] Class instance understanding = None

2009-02-27 Thread David
David wrote: but when I change it to; start_total() start = start_total() a = Account(start) here is the error; Enter Amount: 100 Traceback (most recent call last): File "./py_pettycash.py", line 77, in menu() File "./py_pettycash.py", line 53, in menu a.

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread David
bob gailer wrote: Kapsicum wrote: On Mon, Mar 9, 2009 at 1:18 AM, WM. > wrote: Traceback (most recent call last): File "C:\Python26\TicTacToeD.py", line 165, in main() File "C:\Python26\TicTacToeD.py", line 150, in main DisplayBoar

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread David
WM. wrote: I am using Python 26 on a Windows XP OK, here are the three lines mentioned following the error message. Traceback (most recent call last): File "C:\Python26\TicTacToeD.py", line 165, in main() File "C:\Python26\TicTacToeD.py", line 150, in main DisplayBoard(board) Fil

Re: [Tutor] i can only write one line of code on python shell help please ?

2009-03-09 Thread David
mustafa akkoc wrote: > Hello , > > - In python shell , i can only write one line of code when I go to > next line this sign appears >>> how can write the code like in > script mode and run > > thanks > -- > Mustafa Akkoc >

[Tutor] Newby Linux Program review + help with regular expressions

2009-03-09 Thread David
. Here is my code; http://asterisklinks.com/wiki/doku.php?id=wiki:gentoo_report The report it generates is at the bottom. I didn't want to post it all here. Thanks, -david -- Powered by Gentoo GNU/LINUX http://www.linuxcrazy.com pgp.mit.edu ___ Tutor mai

Re: [Tutor] (no subject)

2009-03-17 Thread David
Alan Gauld wrote: Combine the two hints so far to improve it, then look even more closely at range() to see how to do the decreasing lengths. Thanks for the tips, I have been trying to figure it out also. I did get it after about 3 hours :) -david -- Powered by Gentoo GNU/LINUX

Re: [Tutor] Distributing MySQL with my application

2009-03-23 Thread David
Lauren Snyder wrote: 2. I also like the idea of writing a script to check to see if MySQL is installed. However, I need pointers on writing this script and also the script to auto install MySQL on another user's computer. Thank you again for your help and brilliant ideas! Lauren Are these

Re: [Tutor] (no subject)

2009-03-23 Thread David
Jared White wrote: ** * I cant get a code to work for this bottom half, Can anyone help me *** ** * *** ** * See if this helps; http://www.network-theory.co.uk/docs/pytut/rangeFunction.html -- Powered

Re: [Tutor] (no subject)

2009-03-24 Thread David
Padmanaban Ganesan wrote: > Hello David, > > Please try this . I hope this answered your question now. > > SAM PRG: > > def main(): > i=1 > while i <=10: > j=1 > while j<=i: > print &#x

[Tutor] Adding key, value to Dictionary

2009-03-27 Thread David
I am trying to make a simple Todo program and I can not get the dictionary to update. This works; #!/usr/bin/python key = 'Clean house' value = (1,2,3,4) todo = {key:value} value = (5,6,7,8) todo['Walk Dog'] = value print todo results {'Walk Dog': (5, 6, 7, 8), 'Clean house': (1, 2, 3, 4)} OK g

Re: [Tutor] Adding key, value to Dictionary

2009-03-27 Thread David
David wrote: I am trying to make a simple Todo program and I can not get the dictionary to update. This works; #!/usr/bin/python key = 'Clean house' value = (1,2,3,4) todo = {key:value} value = (5,6,7,8) todo['Walk Dog'] = value print todo results {'Walk Dog': (

Re: [Tutor] Adding key, value to Dictionary

2009-03-27 Thread David
greg whittier wrote: On Fri, Mar 27, 2009 at 1:31 PM, David wrote: But I can not get this to update after the first time it is ran. def get_todo(): todo = {} moved todo{} outside of the function This set todo to an empty dictionary each time you execute get_todo. Ok I see it now

Re: [Tutor] Operational Error. --HELP

2009-03-31 Thread David
bijoy franco wrote: I tried following query as well. code: infunction_curs.execute('SELECT * FROM table_book') This also throws the same error Bijoy Why did you try that? -- Powered by Gentoo GNU/LINUX http://www.linuxcrazy.com pgp.mit.edu ___ Tu

[Tutor] Append a dictionary value

2009-04-04 Thread David
direction my head has started to hurt :) thanks -david #!/usr/bin/python import time import datetime todo = {'Study Python': (datetime.date(2009, 4, 1), datetime.time(12, 15)), 'Clean House': (datetime.date(2009, 4, 4), datetime.time(15, 15)),

Re: [Tutor] Append a dictionary value

2009-04-04 Thread David
David wrote: I put together a todo program here; http://linuxcrazy.pastebin.com/f74beaf78 And I am trying to add an option to edit the values which are date and time. Below I have gotten this far but now I need some help. looks like my attempt to use setdefault will not work. Please point me

Re: [Tutor] Append a dictionary value

2009-04-04 Thread David
Sander Sweers wrote: I do not understand what it is you want to do. Do you want to replace the old date and time with the new? If so you already do this with todo[answer] = datevalue, time. Why do you want to use setdefault? I was confused, I thought it would add another value to the key not

Re: [Tutor] (no subject)

2009-04-06 Thread David
Sifis Sifakis wrote: Hi, I'm a student in Applied Informatics and i need to make a project in Python. More specificaly,i have to create a simple online bookstore using Python. I would use Google App Engine; http://code.google.com/appengine/docs/python/gettingstarted/ -- Powered by Gentoo

[Tutor] Consolidate reused code blocks

2009-04-08 Thread David
for k, v in todo.iteritems(): print k, v[0],v[1] load_todo(todo) except KeyError, e: print '\nError! Please enter the Todo to be removed.\n' print 'Case and spaces are important.' H

[Tutor] [Fwd: Re: Consolidate reused code blocks]

2009-04-08 Thread David
-- Powered by Gentoo GNU/Linux http://linuxcrazy.com --- Begin Message --- Kent Johnson wrote: On Wed, Apr 8, 2009 at 8:38 PM, David wrote: Hi Everyone, I have a simple todo list program with functions to add, delete, edit and print out a list of todo's. I need to understand how to r

Re: [Tutor] Consolidate reused code blocks

2009-04-08 Thread David
Kent Johnson wrote: On Wed, Apr 8, 2009 at 8:38 PM, David wrote: Hi Everyone, I have a simple todo list program with functions to add, delete, edit and print out a list of todo's. I need to understand how to remove the same blocks of code I use in each function. Should I create a clas

Re: [Tutor] Help

2009-04-11 Thread David
krayzie...@yahoo.com wrote: Sent from my BlackBerry® device from Digicel Don't have a BlackBerry, sorry can not help. -david -- Powered by Gentoo GNU/Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/ma

Re: [Tutor] sender name in smtplib

2009-04-13 Thread David
George Wahid wrote: I want to send an email from a google mail account so that the sender name will be 'User Name' instead of 'usern...@gmail.com' in the inbox. this is the code I use: (I'm using python 2.5) import smtplib g=smtplib.SMTP('smtp.googlemail.com') g.ehlo();g.starttls();g.ehl

Re: [Tutor] beginners resources list, Python education events

2009-04-16 Thread David
wesley chun wrote: hey all, i'm trying to collate a complete newbie-to-programming list of resources and was wondering if you could help me fill in the holes... thx in advance! Hi wesley, A couple I liked; One Day of IDLE Toying http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html

Re: [Tutor] PDF to text conversion

2009-04-21 Thread David
program for Windows but this application is being developed on Linux and should also run on Windows; so I do not want to incorporate a Windows only application. How about pyPdf; http://pybrary.net/pyPdf/ And an example; http://code.activestate.com/recipes/511465/ -david -- Powered by Gentoo GNU

Re: [Tutor] PDF to text conversion

2009-04-22 Thread David
ython from subprocess import call call(['pdftotext', 'test.pdf']) -david -- Powered by Gentoo GNU/Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Number cruncher

2009-04-22 Thread David
here; http://pytut.infogami.com/beginners When you get to 9 you will be able to do your lesson. -david -- Powered by Gentoo GNU/Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to run a .py file or load a module?

2009-04-26 Thread David
Norman Khine wrote: On Mon, Apr 27, 2009 at 12:07 AM, Sander Sweers wrote: Here is another one for fun, you run it like python countdown.py 10 #!/usr/bin/env python import sys from time import sleep times = int(sys.argv[1]) # The argument given on the command line def countdown(n): try:

[Tutor] Add newline's, wrap, a long string

2009-04-28 Thread David
L returns 1337 Here is what USE returns; http://linuxcrazy.pastebin.com/m2239816f thanks -david -- Powered by Gentoo GNU/Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Add newline's, wrap, a long string

2009-04-28 Thread David
st so in short: import commands, textwrap data = textwrap.wrap(commands.getoutput('my command'), 80) Vince On Tue, Apr 28, 2009 at 3:43 PM, David <mailto:da...@abbottdavid.com>> wrote: I am getting information from .txt files and posting them in fields on a w

Re: [Tutor] Add newline's, wrap, a long string

2009-04-29 Thread David
ing.join is deprecated, yet join is a method of str objects. So ... Lines = '\n'.join(L) ... or use textwrap.fill which returns a string with the newlines already in place ... Lines = textwrap.fill(USE, 80) HTH, Marty Again t

Re: [Tutor] Add newline's, wrap, a long string

2009-04-29 Thread David
David wrote: Martin Walsh wrote: Just one more comment, string.join is deprecated, yet join is a method of str objects. So ... Lines = '\n'.join(L) ... or use textwrap.fill which returns a string with the newlines already in place ... Lines = textwrap.fill(USE, 80)

Re: [Tutor] Add newline's, wrap, a long string

2009-04-29 Thread David
Alan Gauld wrote: "Sander Sweers" wrote What you can do is define all the variables upfront. This way you can get rid of the else. Below is an example how you can do this with only looping once over the fle. And you can put the variables as keys of a dictionary and avoid all the if tests:

Re: [Tutor] Code Dosent work.

2009-05-03 Thread David
record. 3. Exit. Please make a selection. 2 First name. David Second name. William Done. Welcome to databox V2.0. 1. Searth the database. 2. Add a record. 3. Exit. Please make a selection. 1 David William Why were you using pygame? -- Powered by Gentoo GNU/Linux http:/

[Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-04 Thread David
for a quick shot of enlightenment ;-) David ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Reset while loop

2009-05-05 Thread David
5 22:41:26 opteron ntpd[3571]: kernel time sync status change 4001', ''] [/output] That was with sec_to_wait set at 30 The problem I am having is it will print something whatever sec_to_wait is set to even if the file's st_mtime is the same. I want it to only

Re: [Tutor] Reset while loop

2009-05-06 Thread David
Alan Gauld wrote: "David" wrote I was playing around with trying to create a python program like tail -f as discussed on the list. i came up with this; Alan, thanks for your time and great tips :) import os def get_tail(fname, bufsize, linesep): f = open(

Re: [Tutor] Reset while loop

2009-05-06 Thread David
en and is there any way to fix it? The program is just for me to learn Python, if I wanted to tail a log file I would just use tail, but an understanding may help in the future. thanks, -david -- Powered by Gentoo GNU/Linux http://linuxcrazy.com ___

Re: [Tutor] Reset while loop

2009-05-06 Thread David
bob gailer wrote: You call sleep only when the file is updated. As long as the file is not updated the loop runs continuously and therefore 100%. and is there any way to fix it? move the sleep call out of the if, and put the update of old_time in the if while True: new_time = o

Re: [Tutor] Code Dosent work.

2009-05-09 Thread David
can help point you in the right direction. -david -- Powered by Gentoo GNU/Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] paramiko again

2009-05-09 Thread David
Matt Herzog wrote: Hello again. This code comes straight from the http://oreilly.com/catalog/9780596515829/ book. The only actual code I changed was s/get/put on the second to last line. The author says I ought to be able to do this and have it Just Work. There are several things I don't und

[Tutor] Suggestions for while loop

2009-05-10 Thread David
And This; try: total_names = int(raw_input('Enter Total Number of Names: ')) except ValueError: print 'You must enter a number!' total_names = int(raw_input('Enter Total Number of Names: ')) Does not handle the second input for exceptions. thanks, -david

Re: [Tutor] Suggestions for while loop

2009-05-11 Thread David
Dave Angel wrote: def getTotalNumber(prompt): while True: try: numstr = raw_input(prompt) n = int(numstr) if 0 < n < 50:#some validation return n print "Number is not reasonable, try again" except ValueErro

Re: [Tutor] simply moving files]

2009-05-12 Thread David
David wrote: Subject: [Tutor] simply moving files From: Matt Herzog Date: Tue, 12 May 2009 13:51:36 -0400 To: Python List To: Python List On monday I posted the below code: def schmove(src,dst): ... src

[Tutor] [Fwd: Re: simply moving files]]

2009-05-12 Thread David
Forwarded to the list, I would also like to understand the forward slash; os.system("mv %s/%s %s" % (src, fnames, dst)) -- Powered by Gentoo GNU/Linux http://linuxcrazy.com --- Begin Message --- On Tue, May 12, 2009 at 03:50:00PM -0400, David wrote: >

Re: [Tutor] simply moving files]]

2009-05-13 Thread David
Alan Gauld wrote: "David" wrote Forwarded to the list, I would also like to understand the forward slash; os.system("mv %s/%s %s" % (src, fnames, dst)) The slash separates the file path, src, from the filename. Thus if src is /foo/bar/baz and fnames is spam then %s/

[Tutor] Find files without __doc__ strings

2009-05-16 Thread David
I am doing an exercise in Wesley Chun's book. Find files in the standard library modules that have doc strings. Then find the ones that don't, "the shame list". I came up with this to find the ones with; #!/usr/bin/python import os import glob import fileinput import re pypath = "/usr/lib/pyth

Re: [Tutor] Find files without __doc__ strings

2009-05-17 Thread David
spir wrote: Le Sat, 16 May 2009 21:46:02 -0400, David s'exprima ainsi: I am doing an exercise in Wesley Chun's book. Find files in the standard library modules that have doc strings. Then find the ones that don't, "the shame list". I came up with this to find t

[Tutor] [Fwd: Re: Find files without __doc__ strings]

2009-05-18 Thread David
-- powered by Gentoo/GNU Linux http://linuxcrazy.com --- Begin Message --- Lie Ryan wrote: > David wrote: >> spir wrote: >>> Le Sat, 16 May 2009 21:46:02 -0400, >>> David s'exprima ainsi: >>> >>>> I am doing an exercise in Wesley Chun'

Re: [Tutor] Find files without __doc__ strings

2009-05-18 Thread David
Lie Ryan wrote: > David wrote: >> spir wrote: >>> Le Sat, 16 May 2009 21:46:02 -0400, >>> David s'exprima ainsi: >>> >>>> I am doing an exercise in Wesley Chun's book. Find files in the >>>> standard library modules that hav

Re: [Tutor] web cam

2009-05-20 Thread David
Ricardo Aráoz wrote: Hi, a friend of mine has asked me how difficult would it be to send web cam images through python program as a hobby project. Honestly, at this point I have no idea where does he want to put python in the equation nor what does the project entail. So I'm asking for pointers t

[Tutor] sqlite3 format data from tables

2009-05-23 Thread David
: return self.database.get_transactions() def display_transactions(self): print "Your transaction History is:",self.bl.report_transactions() self.menu[5]=("Transaction History",self.display_transactions) Can I use the numbers 1,2,3,4 as a way to return the history? Thanks, I hope

Re: [Tutor] sqlite3 format data from tables

2009-05-23 Thread David
David wrote: I have a budget program I am using to learn from. http://linuxcrazy.pastebin.com/f3b301daf I can not figure out how to get the transaction details to return so that it looks nice. It returns like this now. Your transaction History is: [(1, u'Food', -100), (2, u'

Re: [Tutor] Post to wordpress

2009-05-23 Thread David
Jan Erik Moström wrote: Hi, I'm looking for a module or an example for how to post to a wordpress blog. I want to create a post and set: + title + content + category + tags + publish date I've looked around and found (settin

Re: [Tutor] sqlite3 format data from tables

2009-05-23 Thread David
Martin Walsh wrote: David wrote: David wrote: I have a budget program I am using to learn from. http://linuxcrazy.pastebin.com/f3b301daf I can not figure out how to get the transaction details to return so that it looks nice. It returns like this now. Your transaction History is: [(1, u'

Re: [Tutor] Using a list

2009-05-30 Thread David
Alan Gauld wrote: "Doug Reid" wrote The tutorial I'm using is discussing list, tuples, and dictionaries. ... four attributes: Strength,Stamina, Wisdom, and Dexterity. The player should be able to spend points from the pool on any attribute and should also be able to take points from an attribu

Re: [Tutor] Using a list

2009-05-30 Thread David
David wrote: Alan Gauld wrote: "Doug Reid" wrote The tutorial I'm using is discussing list, tuples, and dictionaries. ... four attributes: Strength,Stamina, Wisdom, and Dexterity. The player should be able to spend points from the pool on any attribute and should also be able

[Tutor] Class Tips

2009-05-30 Thread David
acre = int(raw_input("Enter Total Acre's To Be Treated: ")) bag = int(raw_input('Enter Bag Weight: ')) return rate, nitrogen, acre, bag main() thanks, -david -- Powered by Gentoo GNU/Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Class Tips

2009-05-30 Thread David
Alan Gauld wrote: "David" wrote I took this program that determines a fertilizer application rate; ... And converted it to class/object to learn how they work. Just looking for some pointers, if I did it correctly etc. For such a small program its hard to see what else you could

Re: [Tutor] Class Tips

2009-05-31 Thread David
ALAN GAULD wrote: but I get an error here; def main(): frate = FertRate(get_inputs()) File "./fert_class.py", line 15, in main frate = FertRate(get_inputs()) TypeError: __init__() takes exactly 5 arguments (2 given) Sorry my mistake. Because get_inputs() returns a tuple you h

Re: [Tutor] Class Tips

2009-05-31 Thread David
W W wrote: One thing that's probably not in the scope of the program but really usually a good idea is error checking. i.e. this line: rate = float(raw_input("Enter rate i.e. (0.5) : ")) could be converted to something like: try: rate = float(raw_input("Enter rate...")) except ValueErr

Re: [Tutor] Spell checking source code?

2009-06-02 Thread David
ALAN GAULD wrote: But that will check the whole file. The OP only wanted to spell check the comments. Unless I'm missing something? "Allen Fowler" wrote Are there any utilities to help "spell check" source code? (Docstrings, etc) I came up with this; [sample file] #!/usr/bin/python

Re: [Tutor] my first gui]

2009-06-03 Thread David
-- powered by Gentoo/GNU Linux http://linuxcrazy.com --- Begin Message --- prasad rao wrote: > Hello. > I made my first mager gui program.I need your openions suggestions and > improvements. > Hi Prasad, I get this error, I am using 2.5 on Linux; Exception in Tkinter callback Traceback (most

Re: [Tutor] my first gui]

2009-06-03 Thread David
David wrote: > > prasad rao wrote: > >> Hello. >> I made my first mager gui program.I need your openions suggestions and >> improvements. >> >> > Hi Prasad, > I get this error, I am using 2.5 on Linux; > > Exception in Tkinter callback

[Tutor] What is this kind of loop called

2009-06-07 Thread David
49355543, 9549355560): numbers = i get(numbers) call_numbers() Is there a technical name for a loop like this? thanks -david -- Powered by Gentoo GNU/Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] [Fwd: Re: What is this kind of loop called]

2009-06-07 Thread David
Forwarding to the list, forgot again :( -- Powered by Gentoo GNU/Linux http://linuxcrazy.com --- Begin Message --- bob gailer wrote: David wrote: In one of my questions to this list, Kent explained to me how to use a loop like this; #!/usr/bin/python from time import sleep def get(numbers

Re: [Tutor] smptlib question

2009-06-08 Thread David
Albert-jan Roskam wrote: (sorry for posting this again, but something might have gone wrong) Hi, I made a very simple program to send everybody I know a change of address I am parsing the .msg files with another function, which returns a set called 'recipients'. The code below works, but it

Re: [Tutor] gui further explained (The error in unreadable form)

2009-06-09 Thread David
Essah Mitges wrote: What I am trying to do is start my pygame game from my pygame menuI do not think I am using the right code to do this I am trying to use the subprocess module to open a child window with the game inside of it but python doesn't like thatThe second thing that i'd like to know

Re: [Tutor] Need help solving this problem

2009-06-10 Thread David
Raj Medhekar wrote: I have been teaching myself Python using a book. The chapter I am on currently, covers branching, while loops and program planning. I am stuck on on of the challenges at the end of this chapter, and I was hoping to get some help with this. Here it is: Write a program that

Re: [Tutor] Need a solution.

2009-06-11 Thread David
"And it only took you", tries, "tries!\n" raw_input("\n\nPress the enter key to exit") Hi Raj, I am also learning Python and never did any real programming before, I have been attempting to learn about classes, this is my version, comments, suggesti

Re: [Tutor] Need a solution.

2009-06-11 Thread David
is that under #guessing Loop you do not have () around the code; ie. while (guess != the_number): if (guess > the_number): print "Lower.." On Fri, Jun 12, 2009 at 12:02 AM, David <mailto:da...@abbottdavid.com>> wrote: Raj Medhekar wrote:

  1   2   3   4   5   6   7   8   9   10   >