Re: [Tutor] associating two objects without ORM and processing a text file

2013-02-15 Thread Steven D'Aprano
On 15/02/13 16:38, eryksun wrote: On Thu, Feb 14, 2013 at 4:33 PM, Prasad, Ramit wrote: My knee jerk response is a try/finally block, but I am sure there are better ways. The atexit.register decorator hooks sys.exitfunc: http://docs.python.org/2/library/atexit I find a try...finally bloc

Re: [Tutor] Tutor Digest, Vol 108, Issue 58

2013-02-15 Thread Claira
Hi, I signed up a while ago, but I didn't really understand anything. I have a basic question that maybe someone can help with. I'll like to integrate yelp data -- http://www.programmableweb.com/api/yelp -- onto google maps -- http://www.programmableweb.com/api/google-maps -- like how http://www.tr

Re: [Tutor] New User-Need-Help

2013-02-15 Thread Dave Angel
On 02/15/2013 06:28 PM, Mark Lawrence wrote: On 15/02/2013 22:31, Joel Goldstick wrote: Sorry, you said above python 3. In python 3 raw_input was changed to input. so change that and it will work for you. There are some differences between 2 and 3 that you will need to look out for. Go to th

Re: [Tutor] New User-Need-Help

2013-02-15 Thread Jos Kerc
On Sat, Feb 16, 2013 at 12:20 AM, Deborah Piotrowski wrote: > It works, but it doesn't open a window. It just says that stuff under the > code. How do you open a window? Depends... How do you run the script? From Idle, command prompt? > > > On Fri, Feb 15, 2013 at 4:14 PM, Jos Kerc wrote:

Re: [Tutor] New User-Need-Help

2013-02-15 Thread Mark Lawrence
On 15/02/2013 22:31, Joel Goldstick wrote: Sorry, you said above python 3. In python 3 raw_input was changed to input. so change that and it will work for you. There are some differences between 2 and 3 that you will need to look out for. Go to the python.org site to learn

Re: [Tutor] New User-Need-Help

2013-02-15 Thread Jos Kerc
No, not same. At lea On Fri, Feb 15, 2013 at 11:44 PM, Joel Goldstick wrote: > so copy the code and the error message here > > > On Fri, Feb 15, 2013 at 5:42 PM, Deborah Piotrowski < > spiceninj...@gmail.com> wrote: > >> I did what you said, nothing changed. >> same errors, same syntax message.

Re: [Tutor] New User-Need-Help

2013-02-15 Thread Jos Kerc
Sorry, sent before finishing... If you changed raw_input, as asked. Now, it complains about print 'Game Over' Should become print('Game Over') On Sat, Feb 16, 2013 at 12:10 AM, Jos Kerc wrote: > No, not same. At lea > > > On Fri, Feb 15, 2013 at 11:44 PM, Joel Goldstick > wrote: > >> so copy

Re: [Tutor] New User-Need-Help

2013-02-15 Thread Joel Goldstick
so copy the code and the error message here On Fri, Feb 15, 2013 at 5:42 PM, Deborah Piotrowski wrote: > I did what you said, nothing changed. > same errors, same syntax message. > I suggest you run it on your IDLE to see if it works. > > > On Fri, Feb 15, 2013 at 3:31 PM, Joel Goldstick > wrot

Re: [Tutor] New User-Need-Help

2013-02-15 Thread Joel Goldstick
On Fri, Feb 15, 2013 at 5:29 PM, Joel Goldstick wrote: > Are you using python 2 or python 3? > > > On Fri, Feb 15, 2013 at 5:28 PM, Deborah Piotrowski < > spiceninj...@gmail.com> wrote: > >> Ok, so I made a shortcut to IDLE(GUI) and I open it up. click "New >> Window" and type in the code: >> prin

Re: [Tutor] New User-Need-Help

2013-02-15 Thread Joel Goldstick
Are you using python 2 or python 3? On Fri, Feb 15, 2013 at 5:28 PM, Deborah Piotrowski wrote: > Ok, so I made a shortcut to IDLE(GUI) and I open it up. click "New Window" > and type in the code: > print "Game Over" > raw_input("\n\nPress Enter Key to exit") > and save the file on my desktop. >

Re: [Tutor] New User-Need-Help

2013-02-15 Thread Joel Goldstick
On Fri, Feb 15, 2013 at 5:09 PM, Deborah Piotrowski wrote: > It Didn't work. First of all, reply to all. You are sending messages to me only, not to the group. Other's may be able to help you better than I can. Second. "It didn't work" is not a useful answer. So you have a file with two lin

Re: [Tutor] New User-Need-Help

2013-02-15 Thread Joel Goldstick
On Fri, Feb 15, 2013 at 5:03 PM, Deborah Piotrowski wrote: > > > On Fri, Feb 15, 2013 at 2:58 PM, Joel Goldstick > wrote: > >> >> >> >> On Fri, Feb 15, 2013 at 4:45 PM, Deborah Piotrowski < >> spiceninj...@gmail.com> wrote: >> >>> Hi, >>> >>> >>> I am very new to Python, I am using the e-book "Py

Re: [Tutor] Newbie Here -- Averaging & Adding Madness Over a Given (x) Range?!?!

2013-02-15 Thread Michael J. McConachie
On 02/15/2013 04:03 PM, Albert-Jan Roskam wrote: > >> Eventually what I'll need to do is: >> 1. Index the file and/or count the lines, as to identify each line's >> positional relevance so that it can average any range of numbers that are >> sequential; one to one another. > In other words: you

Re: [Tutor] Newbie Here -- Averaging & Adding Madness Over a Given (x) Range?!?!

2013-02-15 Thread Albert-Jan Roskam
> Eventually what I'll need to do is: > > 1.  Index the file and/or count the lines, as to identify each line's > positional relevance so that it can average any range of numbers that are > sequential; one to one another. In other words: you would like to down-sample your data? For example, r

Re: [Tutor] Newbie Here -- Averaging & Adding Madness Over a Given (x) Range?!?!

2013-02-15 Thread Michael J. McConachie
@ Stephen, Thank you for the answers. I appreciate your understanding, and patience; I understand that it was confusing (unintentionally) and probably irritating to any of the seasoned tutor list members. Your examples helped greatly, and was the push I needed. Happy Friday, and thanks again,

Re: [Tutor] Newbie Here -- Averaging & Adding Madness Over a Given (x) Range?!?!

2013-02-15 Thread Michael J. McConachie
@Bob @David -- I gave you all the other parts to give you a background, and context as it relates to my 'problem'. My apologies if it seems obfuscated. I took an hour to write that email, and revised it several times in an attempt to provide good information. Please disregard my OP. On 02/14/

Re: [Tutor] associating two objects without ORM and processing a text file

2013-02-15 Thread Alan Gauld
On 15/02/13 03:09, neubyr wrote: I do have a doubt regarding this - e.g. how would I implement this if my program/application is web based. For example, loading the text file during web server start and stop. For a long running process like a web server this is probably the wrong approach. Yo