Re: [Tutor] Need help with python keyboard press/navigation commands

2013-03-12 Thread Alan Gauld
On 12/03/13 03:59, akuma ukpo wrote: I have tried def get_direction(self): """ whenever a key is pressed the character moves to the direction corresponding to the key """ 'North':w 'South': s 'East' : d 'West' : a What d

Re: [Tutor] Need help with python keyboard press/navigation commands

2013-03-11 Thread Danny Yoo
On Mon, Mar 11, 2013 at 8:59 PM, akuma ukpo wrote: > This is the problem > > Implement a function called get_direction which, on a particular character > , gives the > direction corresponding to that character. Do you know how to write a test case for this function? You had test cases for one o

[Tutor] Need help with python keyboard press/navigation commands

2013-03-11 Thread akuma ukpo
This is the problem Implement a function called get_direction which, on a particular character , gives the direction corresponding to that character. The correspondences are as follows:  The character ’w’ corresponds to the direction ’North’  The character ’a’ corresponds to the direction ’West’

Re: [Tutor] Need help with function coding.

2013-03-10 Thread Steven D'Aprano
On 11/03/13 03:09, Joel Goldstick wrote: On Sun, Mar 10, 2013 at 11:35 AM, Steven D'Aprano wrote: On 10/03/13 05:23, Jason Friedman wrote: You might look at this: https://chrome.google.com/**webstore/[...] Why would I do that? If you have a question,

Re: [Tutor] Need help with function coding.

2013-03-10 Thread Joel Goldstick
On Sun, Mar 10, 2013 at 11:35 AM, Steven D'Aprano wrote: > On 10/03/13 05:23, Jason Friedman wrote: > >> You might look at this: >> >> https://chrome.google.com/**webstore/[...] >> > > > Why would I do that? > > If you have a question, please ask it. Don't post

Re: [Tutor] Need help with function coding.

2013-03-10 Thread Steven D'Aprano
On 10/03/13 05:23, Jason Friedman wrote: You might look at this: https://chrome.google.com/webstore/ [...] Why would I do that? If you have a question, please ask it. Don't post a link to something that looks like spam with no explanation at all. Oh, and if you think I'm being rude, consid

Re: [Tutor] Need help with function coding.

2013-03-07 Thread Peter Otten
akuma ukpo wrote: > I am defining the function in one .py file and testing the function in > another .py file. > > this is my code for the test: > > def test_quantity_convert(self): > self.assertEqual(gallons_to_cups(0), 16) > self.assertEqual(gallons_to_cups(100), 1600) > >

Re: [Tutor] Need help with function coding.

2013-03-07 Thread Danny Yoo
On Thu, Mar 7, 2013 at 2:36 PM, akuma ukpo wrote: > I am defining the function in one .py file and testing the function in > another .py file. > > this is my code for the test: > > def test_quantity_convert(self): > self.assertEqual(gallons_to_cups(0), 16) Good, thanks for showing us

Re: [Tutor] Need help with function coding.

2013-03-07 Thread Joel Goldstick
On Thu, Mar 7, 2013 at 4:36 PM, akuma ukpo wrote: > I am defining the function in one .py file and testing the function in > another .py file. > > this is my code for the test: > > def test_quantity_convert(self): > self.assertEqual(gallons_to_cups(0), 16) > self.assertEqual(g

Re: [Tutor] Need help with function coding.

2013-03-07 Thread akuma ukpo
I am defining the function in one .py file and testing the function in another .py file. this is my code for the test: def test_quantity_convert(self): self.assertEqual(gallons_to_cups(0), 16) self.assertEqual(gallons_to_cups(100), 1600) this is my code for the defined functi

Re: [Tutor] Need help with function coding.

2013-03-07 Thread akuma ukpo
i now know how to define functions. My problem is i don't know what particular function that converts gallons directly to cups. However, i derived a function that converts celsius to fahrenheit (9/5 * temperature + 32) tested it using python and it passed the test. I need a function for gallons

Re: [Tutor] Need help with function coding.

2013-03-07 Thread Danny Yoo
On Thu, Mar 7, 2013 at 1:55 PM, akuma ukpo wrote: > i don't know how to write functions. so i guess that is where i'm stuck. i > was following a tutorial on my lab document but i still did not understand > what to do. i will attach the pdf and python files as well. I am CCing the rest of the Pyth

Re: [Tutor] Need help with function coding.

2013-03-07 Thread Mark Lawrence
On 07/03/2013 20:23, akuma ukpo wrote: I have a python lab to do but for some reason i can't understand. (a) Write a function which converts from gallons to cups2 (b) Now we’d like to be able to convert from cups to milliliters, since metric measurements are easier to convert between. Implement

Re: [Tutor] Need help with function coding.

2013-03-07 Thread Danny Yoo
> (a) Write a function which converts from gallons to cups2 Do you know how to write functions? Can you write a function that takes a number and returns twice that number, for example? Show us what you have seen already, and we may be able to start from there. The question you are asking does

Re: [Tutor] Need help with function coding.

2013-03-07 Thread Joel Goldstick
On Thu, Mar 7, 2013 at 3:23 PM, akuma ukpo wrote: > I have a python lab to do but for some reason i can't understand. > > > (a) Write a function which converts from gallons to cups2 > (b) Now we’d like to be able to convert from cups to milliliters, since > metric measurements > are easier to con

[Tutor] Need help with function coding.

2013-03-07 Thread akuma ukpo
I have a python lab to do but for some reason i can't understand. (a) Write a function which converts from gallons to cups2 (b) Now we’d like to be able to convert from cups to milliliters, since metric measurements are easier to convert between. Implement a function which does this. (c) We’d als

Re: [Tutor] Need help with sqlite3 in python

2013-02-17 Thread Jim Byrnes
On 02/17/2013 12:31 PM, Alan Gauld wrote: On 17/02/13 16:50, Jim Byrnes wrote: cur.execute("INSERT INTO pwds VALUES ('WebSites', 'xMe', 'me', 'you', 'here', 'there')") When this code is run, done prints in the terminal, there is no error Can you do selects properly? Can you extract data

Re: [Tutor] Need help with sqlite3 in python

2013-02-17 Thread Alan Gauld
On 17/02/13 16:50, Jim Byrnes wrote: cur.execute("INSERT INTO pwds VALUES ('WebSites', 'xMe', 'me', 'you', 'here', 'there')") When this code is run, done prints in the terminal, there is no error Can you do selects properly? Can you extract data put in manually? That would prove the conn

[Tutor] Need help with sqlite3 in python

2013-02-17 Thread Jim Byrnes
I am writing a small database CRUD app using python 2.7, pythoncard, sqlite3 on Ubuntu 12.04. So far I can retrieve data fine but I cannot do inserts. In my first attempt I used parameter substitution. When that did not work I thought I didn't understand it and decided to try a simple insert.

Re: [Tutor] need help with python for counter

2012-12-19 Thread bob gailer
On 12/19/2012 12:40 AM, Brandon Merritt wrote: I feel silly, but I'm having the darndest time trying to figure out why this for counter won't work. I know that there is the count method for the string class, but I was just trying to do it the syntactical way to prove myself that I know the very

Re: [Tutor] need help with python for counter

2012-12-19 Thread Alan Gauld
On 19/12/12 05:40, Brandon Merritt wrote: the string class, but I was just trying to do it the syntactical way to prove myself that I know the very basics. Which is not a bad thing. just returning 1 or 0, even if I very clearly make sure that I specify at least 4 instances of the digit in my

Re: [Tutor] need help with python for counter

2012-12-19 Thread Dave Angel
On 12/19/2012 12:40 AM, Brandon Merritt wrote: > I feel silly, but I'm having the darndest time trying to figure out why > this for counter won't work. I know that there is the count method for the > string class, but I was just trying to do it the syntactical way to prove > myself that I know the

Re: [Tutor] need help with python for counter

2012-12-18 Thread शंतनू
On 19/12/12 5:12 PM, Mitya Sirenef wrote: > You can also do: > > count = sum(i==digit for i in number) > > I think this is very clear and short.. Another... import re count = len(re.findall(digit, number)) -- shantanoo ___ Tutor maillist - Tutor@py

Re: [Tutor] need help with python for counter

2012-12-18 Thread DoanVietTrungAtGmail
After incrementing for a little while, if the condition i == digit is not met for the current character, count is reset by the else: branch. Your count variable must feel frustrated like a dog which keeps being yanked back by a cord of length 0 when it tries to get free. Trung Doan == On

Re: [Tutor] need help with python for counter

2012-12-18 Thread Mitya Sirenef
On 12/19/2012 12:40 AM, Brandon Merritt wrote: I feel silly, but I'm having the darndest time trying to figure out why this for counter won't work. I know that there is the count method for the string class, but I was just trying to do it the syntactical way to prove myself that I know the very

[Tutor] need help with python for counter

2012-12-18 Thread Brandon Merritt
I feel silly, but I'm having the darndest time trying to figure out why this for counter won't work. I know that there is the count method for the string class, but I was just trying to do it the syntactical way to prove myself that I know the very basics. As of right now, my script is just returni

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] need help

2012-11-01 Thread eryksun
On Thu, Nov 1, 2012 at 7:12 PM, Matthew Ngaha wrote: >> 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 "vi

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 eryksun
On Thu, Nov 1, 2012 at 6:37 PM, Matthew Ngaha wrote: > import sys sys.executable > 'D:\\Data\\Program Files Data\\Py\\pythonw.exe' > > i dont see Python31 .. is this Py that is supposed to be Python31?.. and do > i type this exactly like you did in cmd? > > set PATH=%PATH%;C:\Python31 ?

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 eryksun
On Thu, Nov 1, 2012 at 5:55 PM, Matthew Ngaha wrote: > > i type it in both IDLE and CMD. in the directory where i made those .html > files, i held shift and right clicked to get the command line open. im on > windows vista. the i type that line in there. i use Python 3.1 The interpreter executabl

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 Dave Angel
On 11/01/2012 05:55 PM, Matthew Ngaha wrote: >> 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 versio

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 Dave Angel
On 11/01/2012 05:47 PM, Matthew Ngaha wrote: >> >> >> 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 install

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
> > > > 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 Dave Angel
On 11/01/2012 05:24 PM, Matthew Ngaha wrote: > 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: If you got an error, quote it in full in your message (usi

Re: [Tutor] need help

2012-11-01 Thread Alex Clark
On 2012-11-01 21:24:52 +, Matthew Ngaha said: 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 wron

[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 new to python

2012-10-04 Thread Joel Goldstick
On Wed, Oct 3, 2012 at 11:38 AM, wrote: > Hi im new to python and im stuck on my homework. I have to define the > functions appropriately in the python file so they all test and work but im > not even sure where to begin or what to I could really use some help. Ive > attached the file. > > Thank

Re: [Tutor] need help with a script..

2012-04-11 Thread Mark Lawrence
On 11/04/2012 14:50, Khalid Al-Ghamdi wrote: Hi All, I'm using python 3.2 on a windows xp. I wrote the below script and ran it with the hope of returning a list of proctors (list_proc), but when it runs it doesn't call the function convert_proctors() as intended. On the other hand, when i impo

Re: [Tutor] need help with a script..

2012-04-11 Thread Khalid Al-Ghamdi
got it thanks a lot On Wed, Apr 11, 2012 at 4:59 PM, Jerry Hill wrote: > On Wed, Apr 11, 2012 at 9:50 AM, Khalid Al-Ghamdi > wrote: > > Hi All, > > > > I'm using python 3.2 on a windows xp. > > > > I wrote the below script and ran it with the hope of returning a list of > > proctors (list_p

Re: [Tutor] need help with a script..

2012-04-11 Thread Christian Witts
On 2012/04/11 03:50 PM, Khalid Al-Ghamdi wrote: Hi All, I'm using python 3.2 on a windows xp. I wrote the below script and ran it with the hope of returning a list of proctors (list_proc), but when it runs it doesn't call the function convert_proctors() as intended. On the other hand, when i

Re: [Tutor] need help with a script..

2012-04-11 Thread Jerry Hill
On Wed, Apr 11, 2012 at 9:50 AM, Khalid Al-Ghamdi wrote: > Hi All, > > I'm using python 3.2 on a windows xp. > > I wrote the below script and ran it with the hope of returning a list of > proctors (list_proc), but when it runs it  doesn't call the function > convert_proctors() as intended. On the

[Tutor] need help with a script..

2012-04-11 Thread Khalid Al-Ghamdi
Hi All, I'm using python 3.2 on a windows xp. I wrote the below script and ran it with the hope of returning a list of proctors (list_proc), but when it runs it doesn't call the function convert_proctors() as intended. On the other hand, when i import the module from the IDLE prompt and call the

Re: [Tutor] Need help adding a funcation

2011-12-02 Thread Andreas Perstinger
On 2011-12-02 08:22, Michael Hall wrote: I am still not understanding what it is I am being asked to do. Ok, forget about your working program and just concentrate on question 1a): > # a) write a function, getDivisors(), that returns a list of all > # of the positive divisors of a given number

Re: [Tutor] Need help adding a funcation

2011-12-02 Thread Steven D'Aprano
Michael Hall wrote: I am still not understanding what it is I am being asked to do. What is the differance between my_list = [] an my_list[ ] because when I use my_list[] I get an error. Not sure what I am doing wrong. In Python, square brackets [ ] are used for two related but different purpo

Re: [Tutor] Need help adding a funcation

2011-12-01 Thread Michael Hall
I am still not understanding what it is I am being asked to do. What is the differance between my_list = [] an my_list[ ] because when I use my_list[] I get an error. Not sure what I am doing wrong. I am asking if you are given the following question how would you write the program. I have most of

Re: [Tutor] Need help adding a funcation

2011-12-01 Thread Alan Gauld
On 01/12/11 21:17, Michael Hall wrote: Can anyone else help with this question? Sure lots of us could help. But Dave's doing a good job leading you in the right direction. Is there something that you don't understand? If you ask about specific points we can give specific answers. Meantime I'l

Re: [Tutor] Need help adding a funcation

2011-12-01 Thread Michael Hall
Can anyone else help with this question? On Thu, Dec 1, 2011 at 12:17 PM, Dave Angel wrote: > (You top-posted, so I'm deleting all the out-of-order stuff. in these > forums, you should put your response after whatever you quote.) > > > On 12/01/2011 02:55 PM, Michael Hall wrote: > >> The OP has

Re: [Tutor] Need help adding a funcation

2011-12-01 Thread Dave Angel
(You top-posted, so I'm deleting all the out-of-order stuff. in these forums, you should put your response after whatever you quote.) On 12/01/2011 02:55 PM, Michael Hall wrote: The OP has been taught but is still having an issue and all I am doing is asking for help. Here is what I have so fa

Re: [Tutor] Need help adding a funcation

2011-12-01 Thread Michael Hall
The OP has been taught but is still having an issue and all I am doing is asking for help. Here is what I have so far # 1) a perfect number is a positive integer that is equal to the # sum of its proper positive divisors,excluding the number itself. # for example, 6 is a perfect number because it

Re: [Tutor] Need help adding a funcation

2011-12-01 Thread Dave Angel
(You forgot to post your response on the list, instead posting it privately to me. Please use Reply-All, or whatever the equivalent is on your email app) On 12/01/2011 11:49 AM, Michael Hall wrote: On Thu, Dec 1, 2011 at 7:51 AM, Dave Angel wrote: On 12/01/2011 10:33 AM, Michael Hall wro

Re: [Tutor] Need help adding a funcation

2011-12-01 Thread Dave Angel
On 12/01/2011 10:33 AM, Michael Hall wrote: Here is the code I have written. # Create main function. def main(): a = input('Please Enter a Number: ') # Ask user for input. number = int(a) x = 1 sum_of = 0 while number> x: if number % x == 0: sum_of

[Tutor] Need help adding a funcation

2011-12-01 Thread Michael Hall
Here is the code I have written. # Create main function. def main(): a = input('Please Enter a Number: ') # Ask user for input. number = int(a) x = 1 sum_of = 0 while number > x: if number % x == 0: sum_of = sum_of + x x += 1 if sum_of == number:

Re: [Tutor] need help to learn threading

2011-08-28 Thread Nitin Pawar
this one at tutorial point explains multi threading with examples .. http://www.tutorialspoint.com/python/python_multithreading.htm On Sun, Aug 28, 2011 at 9:50 PM, Payal wrote: > Hi all, > Can someone suggest a resource for me to learn threading in python? I > don't know threading in any other

[Tutor] need help to learn threading

2011-08-28 Thread Payal
Hi all, Can someone suggest a resource for me to learn threading in python? I don't know threading in any other language. I tried a few online tutorials but got lost soon. How do I start? With warm regards, -Payal -- ___ Tutor maillist - Tutor@pytho

Re: [Tutor] Need help wrapping my head around duck typing

2011-05-24 Thread Cory Teshera-Sterne
Hmm ... I thought I was going to try to keep this as general as possible, but it may be more helpful if I gave a more concrete example. The code below is the existing function; I'd be ok with throwing it out & starting over, but originally thought I could modify it fairly easily. The directory str

Re: [Tutor] Need help wrapping my head around duck typing

2011-05-24 Thread Wayne Werner
On Tue, May 24, 2011 at 9:17 PM, Cory Teshera-Sterne wrote: > Hello, > > Thanks for the input. I guess you're right, this is more of a case of > argument assertion - but then I'm not sure how to do error handling here, > because, for example, multiple issues that should be dealt with in very > dif

Re: [Tutor] Need help wrapping my head around duck typing

2011-05-24 Thread Cory Teshera-Sterne
Hello, Thanks for the input. I guess you're right, this is more of a case of argument assertion - but then I'm not sure how to do error handling here, because, for example, multiple issues that should be dealt with in very different ways could raise the same error (as in the original example). I'

Re: [Tutor] Need help wrapping my head around duck typing

2011-05-24 Thread Izz ad-Din Ruhulessin
I forgot to mention strptime 2011/5/25 Izz ad-Din Ruhulessin > Hi Cory, > > From your description it seems to me that your case is more one of > asserting that your function received valid arguments, than a matter of > stat

Re: [Tutor] Need help wrapping my head around duck typing

2011-05-24 Thread Izz ad-Din Ruhulessin
Hi Cory, >From your description it seems to me that your case is more one of asserting that your function received valid arguments, than a matter of static-vs-ducktyping. Even with type checking, they can still generate errors (out of bounds, incorrect formatting). Now i've seen some discussions

[Tutor] Need help wrapping my head around duck typing

2011-05-24 Thread Cory Teshera-Sterne
Hi folks, Coming from a language background that has a different approach to variables (*cough* Java *cough*), I'm trying to understand Python's typing conventions and how to deal with unknown variable types in my code. And as a newbie, I'm really concerned with not writing code that will make the

Re: [Tutor] need help with lxml errors

2011-05-22 Thread Rayon
n.org Subject: Re: [Tutor] need help with lxml errors On Sun, 22 May 2011 09:51:44 pm Rayon wrote: > I am trying to import lxml > > from lxml import etree And that succeeds fine. Your problem lies elsewhere. > bb = etree.Element(self.get_time) > return str(bb) In future, pleas

Re: [Tutor] need help with lxml errors

2011-05-22 Thread Steven D'Aprano
On Sun, 22 May 2011 09:51:44 pm Rayon wrote: > I am trying to import lxml > > from lxml import etree And that succeeds fine. Your problem lies elsewhere. > bb = etree.Element(self.get_time) > return str(bb) In future, please copy and paste (do NOT retype, simplify or summarize) the full tr

[Tutor] need help with lxml errors

2011-05-22 Thread Rayon
I am trying to import lxml from lxml import etree bb = etree.Element(self.get_time) return str(bb) and I get this error: File "C:\Python26\lib\site-packages\lxml\apihelpers.pxi", line 1480, in lxml.etree.__getNsTag (src/lxml/lxml.etree.c:23373) File "C:\Python26\lib\site

Re: [Tutor] Need help with arrays

2011-05-05 Thread Matt Gregory
On 5/4/2011 10:30 AM, Patrick P. wrote: Hello, I hope this is the right way to ask my question, if not, sorry to bother you. Maybe you can tell me who to ask. Ok so here is my code [snip] A = np.array([[m111,m121], [m211,m221]]) B = np.array([[m112,m122], [m212,m222]]) print(np.dot(A,B)) Trac

Re: [Tutor] Need help with arrays

2011-05-04 Thread Alan Gauld
"Patrick P." wrote I hope this is the right way to ask my question, if not, sorry to bother you. Maybe you can tell me who to ask. The way you ask the question is fine but the place is maybe not so good. This is a list for people learning Python but you are really asking about numpy so you

[Tutor] Need help with arrays

2011-05-04 Thread Patrick P .
Hello, I hope this is the right way to ask my question, if not, sorry to bother you. Maybe you can tell me who to ask. Ok so here is my code import numpy as np nH = 2.2 nL = 1.7 welle = 0.5 wurzel = (8.85*10**(-12) *

Re: [Tutor] Need help with the property function

2011-04-14 Thread Jim Byrnes
Dave Angel wrote: On 01/-10/-28163 02:59 PM, Jim Byrnes wrote: I'm trying to teach myself OOP in python (again). The following code from Dawson's book runs fine, unaltered [1]. class Critter(object): """ A virtual pet """ def __init__(self, name): print "A new critter is born" self.name = name

Re: [Tutor] Need help with the property function

2011-04-14 Thread Jim Byrnes
Steven D'Aprano wrote: Jim Byrnes wrote: I'm trying to teach myself OOP in python (again). The following code from Dawson's book runs fine, unaltered [1]. What's Dawson's book? Python Programming for the absolute beginner, by Michael Dawson Thanks for the explanation. It was exactly wit

Re: [Tutor] Need help with the property function

2011-04-13 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Jim Byrnes wrote: I'm trying to teach myself OOP in python (again). The following code from Dawson's book runs fine, unaltered [1]. class Critter(object): """ A virtual pet """ def __init__(self, name): print "A new critter is born" self.name = name def get_name(self)

Re: [Tutor] Need help with the property function

2011-04-13 Thread Steven D'Aprano
Jim Byrnes wrote: I'm trying to teach myself OOP in python (again). The following code from Dawson's book runs fine, unaltered [1]. What's Dawson's book? class Critter(object): """ A virtual pet """ def __init__(self, name): print "A new critter is born" self.name = n

Re: [Tutor] Need help with the property function

2011-04-13 Thread Prasad, Ramit
+ramit.prasad=jpmchase@python.org] On Behalf Of Jim Byrnes Sent: Wednesday, April 13, 2011 3:34 PM To: tutor@python.org Subject: [Tutor] Need help with the property function I'm trying to teach myself OOP in python (again). The following code from Dawson's book runs fine, unaltered [

[Tutor] Need help with the property function

2011-04-13 Thread Jim Byrnes
I'm trying to teach myself OOP in python (again). The following code from Dawson's book runs fine, unaltered [1]. class Critter(object): """ A virtual pet """ def __init__(self, name): print "A new critter is born" self.name = name

Re: [Tutor] Need help with dates in Python

2011-03-11 Thread nookasree ponamala
Thanks for your help Francesco. This works. Sree. --- On Fri, 3/11/11, Francesco Loffredo wrote: > From: Francesco Loffredo > Subject: Re: [Tutor] Need help with dates in Python > To: tutor@python.org > Date: Friday, March 11, 2011, 1:05 AM > On 09/03/2011 9.21, nookasree &

Re: [Tutor] Need help with dates in Python

2011-03-10 Thread nookasree ponamala
3/10/11, James Reynolds wrote: From: James Reynolds Subject: Re: [Tutor] Need help with dates in Python To: "nookasree ponamala" Cc: "Andre Engels" , tutor@python.org Date: Thursday, March 10, 2011, 2:26 AM On Wed, Mar 9, 2011 at 1:34 PM, nookasree ponamala wrote: Hi,

Re: [Tutor] Need help with dates in Python

2011-03-10 Thread Francesco Loffredo
On 09/03/2011 9.21, nookasree ponamala wrote: Hi, I need help in finding the minimum date and maximum date in a file. Here is my test file: s.no: dt1 amt id1 id2 452 2010-02-20 $23.26 05954206107 452 2010-02-05 $20.78 05954206107 451

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread Prasad, Ramit
Street | Houston, TX 77002 work phone: 713 - 216 - 5423 From: tutor-bounces+ramit.prasad=jpmchase@python.org [mailto:tutor-bounces+ramit.prasad=jpmchase@python.org] On Behalf Of James Reynolds Sent: Wednesday, March 09, 2011 2:57 PM To: nookasree ponamala Cc: tutor@python.org Subject: Re: [Tuto

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread James Reynolds
d(t) > print t > > Thanks > Sree. > > --- On Wed, 3/9/11, Andre Engels wrote: > > > From: Andre Engels > > Subject: Re: [Tutor] Need help with dates in Python > > To: "nookasree ponamala" > > Cc: tutor@python.org > > Date:

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread Steven D'Aprano
nookasree ponamala wrote: Hi, I'm new to Python programming. I've changed the code to below, but still it is not working, Could you pls. make the corrections in my code. If you are to be a programmer, you need to learn how to read the error messages you get. You probably would have seen an er

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread ian douglas
I'm new to the language as well, but I think you're missing your indentation after each of your 'if' conditions? On 03/09/2011 10:34 AM, nookasree ponamala wrote: if t< max: maxyr = max< should be indented if t> min:

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread nookasree ponamala
maxyr = max if t > min: minyr = min t = (a,b,maxyr,minyr) tot.append(t) print t Thanks Sree. --- On Wed, 3/9/11, Andre Engels wrote: > From: Andre Engels > Subject: Re: [Tutor] Need help with dates in Python >

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread Andre Engels
On Wed, Mar 9, 2011 at 9:21 AM, nookasree ponamala wrote: > Hi, > > I need help in finding the minimum date and maximum date in a file. > Here is my test file: > s.no:   dt1     amt     id1     id2 > 452     2010-02-20      $23.26      059542        06107 > 452     2010-02-05      $20.78      0595

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread C.Y. Ruhulessin
import datetime min = datetime.date(2008, 1, 1) max = datetime.date(2012, 12, 31) file = open ('test2.txt','r') line = file.readline()[-1] while line: # your code 2011/3/9 nookasree ponamala > Hi, > > I need help in finding the minimum date and maximum date in a file. > Here is my test fil

[Tutor] Need help with dates in Python

2011-03-09 Thread nookasree ponamala
Hi, I need help in finding the minimum date and maximum date in a file. Here is my test file: s.no: dt1 amt id1 id2 452 2010-02-20 $23.26 05954206107 452 2010-02-05 $20.78 05954206107 451 2010-02-24 $5.99 05954220151

[Tutor] Need help on OCR.

2011-02-06 Thread Sriram Jaju
Hi all, I'm new to python. I'm doing a project on OCR (Optical Character Recognition), I've heard a lot about Python so i want to know whether i can use python for OCR. If yes what are the tool require for that?. My another doubt is that, can i use python for programming microcontrollers ? -- Xc

Re: [Tutor] Need help on Setup.py

2011-02-02 Thread Alan Gauld
"Sriram Jaju" wrote What is pywin32 ? I mean what is its use ? It is a set of Python modules that gives access to the Windows API, including COM functions. Using it you can create native Windows GUIs from Python or, more usefully, integrate with Windows Operating System features and other

Re: [Tutor] Need help on Setup.py

2011-02-02 Thread Sriram Jaju
What is pywin32 ? I mean what is its use ? -- Xcited 2 be AliveSriram ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need help on Setup.py

2011-02-01 Thread Walter Prins
Hi Victor, On 1 February 2011 07:38, Victor Binns wrote: > I have been trying to add some of the extras with python such as pywin32 > and others. > > when i click on setup.py it does not work. > > I need help on the problem. > > This is because setup.py is not intended to just be run without pa

Re: [Tutor] Need Help in installing MySQLdb-Python

2011-02-01 Thread Tommy Kaas
Fra: tutor-bounces+tommy.kaas=kaasogmulvad...@python.org [mailto:tutor-bounces+tommy.kaas=kaasogmulvad...@python.org] På vegne af Victor Binns Sendt: 1. februar 2011 01:19 Til: Tutor python Emne: [Tutor] Need Help in installing MySQLdb-Python I have Python 2.6.3 I went to the following

Re: [Tutor] Need help on Setup.py

2011-02-01 Thread Alan Gauld
"Victor Binns" wrote I have been trying to add some of the extras with python such as pywin32 and others. when i click on setup.py it does not work. I need help on the problem. "It does not work" is pretty vague, can you give more specifics? How are you running it? What error messages do you

[Tutor] Need help on Setup.py

2011-01-31 Thread Victor Binns
I have been trying to add some of the extras with python such as pywin32 and others. when i click on setup.py it does not work. I need help on the problem. Victor___ Tutor maillist - Tutor@python.org To unsubscribe

Re: [Tutor] Need Help in installing MySQLdb-Python

2011-01-31 Thread Alan Gauld
"Victor Binns" wrote I have Python 2.6.3 Congratulatons SqlLite should already be installed as part of the standard library. Try: import sqlite3 as sql clicked on the file called setup.py I usually run setup manually rarther than double click... serverKey = _winreg.OpenKey(_winr

[Tutor] Need Help in installing MySQLdb-Python

2011-01-31 Thread Victor Binns
I have Python 2.6.3 I went to the following link http://pypi.python.org/pypi/ Found - file (MySQL-python 1.2.3) clicked on file - clicked on (MySQL-python-1.2.3.tar.gz) unzipped the file in a created folder clicked on the file called setup.py following ERROR: Traceback (most recent cal

Re: [Tutor] Need Help!

2010-12-03 Thread Steven D'Aprano
tgreen...@aol.com wrote: Hello I am totally new to python and our last assignment is that we have to create a Gui Application game similar to Hangman. The game allows the user to guess a movie title from hints and allows the player to also guess a letter in the title. Right now I just have

Re: [Tutor] Need Help!

2010-12-03 Thread Hugo Arts
On Sat, Dec 4, 2010 at 7:08 AM, wrote: > > Hello I am totally new to python and our last assignment is that we have to > create a Gui Application game similar to Hangman. The game allows the user > to guess a movie title from hints and allows the player to also guess a > letter in the title. Righ

[Tutor] Need Help!

2010-12-03 Thread tgreen673
Hello I am totally new to python and our last assignment is that we have to create a Gui Application game similar to Hangman. The game allows the user to guess a movie title from hints and allows the player to also guess a letter in the title. Right now I just have the GUI set up. Whatever

<    1   2   3   4   5   6   >