Python 2.7 or 3.1
Which is better for a beginner to get started in Python with? Thanks! -- http://mail.python.org/mailman/listinfo/python-list
Re: Python 2.7 or 3.1
Would it be safe to say that 2.6 would be even better for beginners than? -- http://mail.python.org/mailman/listinfo/python-list
Create a GUI and EXE for a python app?
Having trouble with my mail client, so sorry if this goes through more than once. I'm worknig on a simple math program as my first application. I would like to make a cross-platform pretty GUI for it and also package it up in a EXE for distribution on Windows. What are the best and easiest ways I can do this?Thanks! -- http://mail.python.org/mailman/listinfo/python-list
RE: Python 2.7 or 3.1
I personally would take only one bite at a time. Meaning only do one then do the other later. But to each it own :) > Date: Fri, 29 Oct 2010 17:48:11 -0500 > To: python-list@python.org > From: jbiq...@icsmx.com > Subject: Re: Python 2.7 or 3.1 > > Hello all > > Would you consider a "not so intelligent move" for a newsbie to > Python to have maybe version 2.7 and 3.x (if that's possible to be > running together on the same machine) to have them run and be > learning mainly in 2.7 and see differences in 3.x? In my case I am > interested mainly in web applications with a database and if possible > being accesing dbase since a projects still runs a big system under > dbase format, or definitely stay with 2.7 for a while until most in > migrate it t o 3.x? > > Thanks in advance > Jorge Biquez > > At 05:21 p.m. 29/10/2010, geremy condra wrote: > >On Wed, Oct 27, 2010 at 7:18 PM, Braden Faulkner wrote: > > > Would it be safe to say that 2.6 would be even better for beginners than? > > > >Let me just come out with a contrary point of view before you go down > >that path. If you're seriously considering using sqlite, then you may > >be just as well off using Python3 as 2.7 or 2.6- it's in all of the > >above, and Python3 is a big cleanup over previous versions of the > >language. > > > >Geremy Condra > >-- > >http://mail.python.org/mailman/listinfo/python-list > > > -- > http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
RE: text file reformatting
I also am having issues with this. > Date: Sun, 31 Oct 2010 14:48:09 -0500 > From: python.l...@tim.thechases.com > To: iwawi...@gmail.com > Subject: Re: text file reformatting > CC: python-list@python.org > > > PRJ01001 4 00100END > > PRJ01002 3 00110END > > > > I would like to pick only some columns to a new file and put them to a > > certain places (to match previous data) - definition file (def.csv) > > could be something like this: > > > > VARIABLEFIELDSTARTS FIELD SIZE NEW PLACE IN NEW DATA FILE > > ProjID ; 1 ; 5 ; 1 > > CaseID ; 6 ; 3 ; 10 > > UselessV ; 10 ; 1 ; > > Zipcode ; 12 ; 5 ; 15 > > > > So the new datafile should look like this: > > > > PRJ01001 00100END > > PRJ01002 00110END > > > How flexible is the def.csv format? The difficulty I see with > your def.csv format is that it leaves undefined gaps (presumably > to be filled in with spaces) and that you also have a blank "new > place in new file" value. If instead, you could specify the > width to which you want to pad it and omit variables you don't > want in the output, ordering the variables in the same order you > want them in the output: > > Variable; Start; Size; Width > ProjID; 1; 5; 10 > CaseID; 6; 3; 10 > Zipcode; 12; 5; 5 > End; 16; 3; 3 > > (note that I lazily use the same method to copy the END from the > source to the destination, rather than coding specially for it) > you could do something like this (untested) > >import csv >f = file('def.csv', 'rb') >f.next() # discard the header row >r = csv.reader(f, delimiter=';') >fields = [ > (varname, slice(int(start), int(start)+int(size)), width) > for varname, start, size, width > in r > ] >f.close() >out = file('out.txt', 'w') >try: > for row in file('data.txt'): >for varname, slc, width in fields: > out.write(row[slc].ljust(width)) >out.write('\n') >finally: > out.close() > > Hope that's fairly easy to follow and makes sense. There might > be some fence-posting errors (particularly your use of "1" as the > initial offset, while python uses "0" as the initial offset for > strings) > > If you can't modify the def.csv format, then things are a bit > more complex and I'd almost be tempted to write a script to try > and convert your existing def.csv format into something simpler > to process like what I describe. > > -tkc > > > -- > http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
RE: text file reformatting
Sorry to clarify, I was having issues getting this to work. I'm relatively new to Python. Sorry for the miscommunication. > Date: Sun, 31 Oct 2010 16:13:42 -0500 > From: python.l...@tim.thechases.com > To: brad...@hotmail.com > CC: python-list@python.org > Subject: Re: text file reformatting > > On 10/31/10 14:52, Braden Faulkner wrote: > >> import csv > >> f = file('def.csv', 'rb') > >> f.next() # discard the header row > >> r = csv.reader(f, delimiter=';') > >> fields = [ > >> (varname, slice(int(start), int(start)+int(size)), width) > >> for varname, start, size, width > >> in r > >> ] > >> f.close() > >> out = file('out.txt', 'w') > >> try: > >> for row in file('data.txt'): > >> for varname, slc, width in fields: > >> out.write(row[slc].ljust(width)) > >> out.write('\n') > >> finally: > >> out.close() > > > > I also am having issues with this. > > [top-posting fixed -- it's generally frowned upon in this > newsgroup/mailing-list and adherence to the preferences will tend > to get you a wider audience] > > Are your issues with my code, or with the topic at hand? If it's > my code, note my comment about it being untested. If it's the > topic at hand, I recommend trying my code (or a variation > there-of after you've tested it). > > -tkc > > -- http://mail.python.org/mailman/listinfo/python-list
[Beginer Question] I heard about python needing some sort of _VariableName_ boiler plate?
Can anyone explain to me how this works, I don't seem to have to do it in IDLE? Thanks! -- http://mail.python.org/mailman/listinfo/python-list
Best method for a menu in a command line program?
I'm using a menu for my command line app using this method. choice = "foobar" while choice != "q": if choice == "c": temp = input("Celsius temperature:") print "Fahrenheit:",celsius_to_fahrenheit(temp) elif choice == "f": temp = input("Fahrenheit temperature:") print "Celsius:",fahrenheit_to_celsius(temp) elif choice != "q": print_options() choice = raw_input("option:") Just wondering if there is another or more efficient way I should be doing it? Thanks -- Braden Faulkner -- http://mail.python.org/mailman/listinfo/python-list
Re: Best method for a menu in a command line program?
Sorry, I wasn't aware it was doing that but... I've removed it :-) Sorry about that, Braden Faulkner -- http://mail.python.org/mailman/listinfo/python-list