Re: [Tutor] trivial simple program..can it be made more concise?

2015-02-14 Thread Steven D'Aprano
On Sat, Feb 14, 2015 at 03:17:28AM +, steve10br...@comcast.net wrote: > Hi all, > > I was playing with Python tonight and created a simple program that > outputs numbers counting up then counting down all on the same > terminal line. The code is as follows: > > #---

[Tutor] sql-like join on two lists or dictionaries

2015-02-14 Thread street . sweeper
Hello all, Basically what I have here is header and line data for sales or purchase orders, and I'm trying to do a sql-like join to bring them together (which ultimately I did because I couldn't figure this out :)). I've managed to get the files into python using string slicing, that's not a prob

Re: [Tutor] sql-like join on two lists or dictionaries

2015-02-14 Thread Peter Otten
street.swee...@mailworks.org wrote: > Hello all, > > Basically what I have here is header and line data for sales or purchase > orders, and I'm trying to do a sql-like join to bring them together > (which ultimately I did because I couldn't figure this out :)). I've > managed to get the files in

Re: [Tutor] trivial simple program..can it be made more concise?

2015-02-14 Thread Dave Angel
On 02/14/2015 04:07 AM, Steven D'Aprano wrote: On Sat, Feb 14, 2015 at 03:17:28AM +, steve10br...@comcast.net wrote: Hi all, I was playing with Python tonight and created a simple program that outputs numbers counting up then counting down all on the same terminal line. The code is as follo

Re: [Tutor] trivial simple program..can it be made more concise?

2015-02-14 Thread Steven D'Aprano
On Sat, Feb 14, 2015 at 06:40:56AM -0500, Dave Angel wrote: > On 02/14/2015 04:07 AM, Steven D'Aprano wrote: > >On Sat, Feb 14, 2015 at 03:17:28AM +, steve10br...@comcast.net wrote: [...] > >>for i in range (a): > >> print i, '\r', [...] > >BUT I'm not sure why you are worried about makin

Re: [Tutor] sql-like join on two lists or dictionaries

2015-02-14 Thread Alan Gauld
On 14/02/15 09:55, Peter Otten wrote: with open(headerfile) as f: lookup_header = { headerdata[:6]: headerdata.rstrip("\n") for headerdata in f} Then you can iterate over the lines in linefile, extract the key from that and look it up in the dict: with open(linefile) as lines, op

Re: [Tutor] sql-like join on two lists or dictionaries

2015-02-14 Thread Joel Goldstick
On Sat, Feb 14, 2015 at 8:03 AM, Alan Gauld wrote: > On 14/02/15 09:55, Peter Otten wrote: > > with open(headerfile) as f: >> lookup_header = { >> headerdata[:6]: headerdata.rstrip("\n") for headerdata in f} >> >> Then you can iterate over the lines in linefile, extract the key fro

Re: [Tutor] trivial simple program..can it be made more concise?

2015-02-14 Thread Dave Angel
On 02/14/2015 07:51 AM, Steven D'Aprano wrote: On Sat, Feb 14, 2015 at 06:40:56AM -0500, Dave Angel wrote: On 02/14/2015 04:07 AM, Steven D'Aprano wrote: On Sat, Feb 14, 2015 at 03:17:28AM +, steve10br...@comcast.net wrote: [...] for i in range (a): print i, '\r', [...] BUT I'm n

[Tutor] Mobile apps in Python

2015-02-14 Thread Unee0x
I am a fairly new student of Python, and so far I've been impressed with the speed,ease and comfort of it. In the near future, I would like to build 3d graphical mobile games. Is there any platform out there that would allow me to build 3d mobile apps using the Python language exclusively? Than

Re: [Tutor] Mobile apps in Python

2015-02-14 Thread Steven D'Aprano
On Sat, Feb 14, 2015 at 05:12:59PM -0500, Unee0x wrote: > I am a fairly new student of Python, and so far I've been impressed > with the speed,ease and comfort of it. In the near future, I would > like to build 3d graphical mobile games. Is there any platform out > there that would allow me to

Re: [Tutor] Mobile apps in Python

2015-02-14 Thread wolfrage8...@gmail.com
I definitely recommend Kivy. I have enjoyed great success with it, and it was very easy to port my code to work on Android. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tut