Re: [Tutor] Student Class

2012-09-05 Thread eryksun
On Wed, Sep 5, 2012 at 7:43 PM, Ashley Fowler wrote: > > class Student: Are you using Python 3? If not, Student should explicitly inherit from object. > def __init__(self, first_name, last_name, numCredits, gpa): > self.first_name = first_name > self.last_name = last_name >

[Tutor] Formatting questions regarding datetime.isoformat()

2012-09-05 Thread staticsafe
Hello, I am running Python 2.6.6 on a Debian Squeeze system. I am using two modules in this bit of code - datetime and python-tvrage (available on pypy here: http://pypi.python.org/pypi/python-tvrage/). My goal is to find the time remaining until a certain show airs. Here is some code I have writ

Re: [Tutor] Student Class

2012-09-05 Thread Ashley Fowler
so far i have: class Student: def __init__(self, first_name, last_name, numCredits, gpa): self.first_name = first_name self.last_name = last_name self.numCredits = numCredits self.gpa = gpa def getFirstname(self): return self.first_name

Re: [Tutor] Student Class

2012-09-05 Thread Alan Gauld
On 05/09/12 23:10, Ashley Fowler wrote: I need help creating a student class. We don't do your homework for you we will only offer hints. So you need to show us what you are trying and we will try to steer you to something better. class with there first name, last name, credits and gpa. Ca

Re: [Tutor] Student Class

2012-09-05 Thread Dwight Hutto
On Wed, Sep 5, 2012 at 6:10 PM, Ashley Fowler wrote: > I need help creating a student class. I am suppose to create a student > class with there first name, last name, credits > and gpa. Can anybody help me get started? Below is what needs to be > included. For number one, is the variables > sup

[Tutor] Student Class

2012-09-05 Thread Ashley Fowler
I need help creating a student class. I am suppose to create a student class with there first name, last name, credits and gpa. Can anybody help me get started? Below is what needs to be included. For number one, is the variables suppose to be parameters? for instance, class Student: def __i

Re: [Tutor] help me decide

2012-09-05 Thread Wayne Werner
On Tue, 4 Sep 2012, Matthew Ngaha wrote: a) IF you happen to have used both, which one fills you with joy and is more fun for you to program with, GUI programming, or web related / Framework programming? Honestly - both. It's really a highly subjective question and depends what you want to do

Re: [Tutor] help me decide

2012-09-05 Thread Dwight Hutto
No matter what the kit used for GUI, make sure it's well documented, and has plenty of tuts/docs. I used tkinter, and wxpython, and like the widget set/cross OS usages in wxpython better. However, with more experience, now I'm moving toward the Blender Game Engine to give more feel, and a 3-d pop

Re: [Tutor] help me decide

2012-09-05 Thread Steve Willoughby
On 05-Sep-12 10:40, Alan Gauld wrote: On 05/09/12 11:04, Matthew Ngaha wrote: also please could you tell me why you suggest wxPython over GTK? Support, there are probably more beginner friendly resources for wxPython than for GTk, although that is changing. Yeah, and wxPython is a large, co

Re: [Tutor] help me decide

2012-09-05 Thread Alan Gauld
On 05/09/12 11:04, Matthew Ngaha wrote: also please could you tell me why you suggest wxPython over GTK? Support, there are probably more beginner friendly resources for wxPython than for GTk, although that is changing. that wxPython is the easiet to pick up yet a lot more complete than Tk

Re: [Tutor] help me decide

2012-09-05 Thread Prasad, Ramit
From: Matthew Ngaha [snip] > i feel confident using Python now but im still not > sure which direction i want to go in. I would at some point like to > learn how to use GUIs and a web Framework(Django). But i don't know > which of the 2 to start out with. > > a) IF you happen to have used both, wh

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Mark Lawrence
On 05/09/2012 16:18, eryksun wrote: On Wed, Sep 5, 2012 at 10:51 AM, Ray Jones wrote: subprocess.call(['dolphin', '/my_home/testdir/\u044c\u043e\u0432']) Dolphin's error message: 'The file or folder /my_home/testdir/\u044c\u043e\u0432 does not exist' "\u" only codes a BMP character in unico

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 08:18 AM, eryksun wrote: > On Wed, Sep 5, 2012 at 10:51 AM, Ray Jones wrote: >> subprocess.call(['dolphin', '/my_home/testdir/\u044c\u043e\u0432']) >> >> Dolphin's error message: 'The file or folder >> /my_home/testdir/\u044c\u043e\u0432 does not exist' > "\u" only codes a BMP charac

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Steven D'Aprano
On 06/09/12 00:51, Ray Jones wrote: subprocess.call(['dolphin', '/my_home/testdir/\u044c\u043e\u0432']) Dolphin's error message: 'The file or folder /my_home/testdir/\u044c\u043e\u0432 does not exist' That's because you're telling Dolphin to look for a file literally called: BACKSLASH u ZERO

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Steven D'Aprano
On 06/09/12 00:04, Ray Jones wrote: On 09/05/2012 04:52 AM, Peter Otten wrote: Ray Jones wrote: But doesn't that entail knowing in advance which encoding you will be working with? How would you automate the process while reading existing files? If you don't *know* the encoding you *have* to

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread eryksun
On Wed, Sep 5, 2012 at 10:51 AM, Ray Jones wrote: > > subprocess.call(['dolphin', '/my_home/testdir/\u044c\u043e\u0432']) > > Dolphin's error message: 'The file or folder > /my_home/testdir/\u044c\u043e\u0432 does not exist' "\u" only codes a BMP character in unicode literals, i.e. u"unicode lite

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Peter Otten
Ray Jones wrote: > On 09/05/2012 04:52 AM, Peter Otten wrote: >> Ray Jones wrote: >> >>> >>> But doesn't that entail knowing in advance which encoding you will be >>> working with? How would you automate the process while reading existing >>> files? >> If you don't *know* the encoding you *have* t

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 07:51 AM, Ray Jones wrote: > subprocess.call(['dolphin', '/my_home/testdir/\u044c\u043e\u0432']) > > Dolphin's error message: 'The file or folder > /my_home/testdir/\u044c\u043e\u0432 does not exist' > > But if I copy the characters as seen by Bash's shell and paste them into > my sub

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 07:31 AM, eryksun wrote: > On Wed, Sep 5, 2012 at 5:42 AM, Ray Jones wrote: >> I have directory names that contain Russian characters, Romanian >> characters, French characters, et al. When I search for a file using >> glob.glob(), I end up with stuff like \x93\x8c\xd1 in place of th

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread eryksun
On Wed, Sep 5, 2012 at 5:42 AM, Ray Jones wrote: > I have directory names that contain Russian characters, Romanian > characters, French characters, et al. When I search for a file using > glob.glob(), I end up with stuff like \x93\x8c\xd1 in place of the > directory names. I thought simply identi

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 04:52 AM, Peter Otten wrote: > Ray Jones wrote: > >> >> But doesn't that entail knowing in advance which encoding you will be >> working with? How would you automate the process while reading existing >> files? > If you don't *know* the encoding you *have* to guess. For instance you c

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Peter Otten
Ray Jones wrote: >> You can work around that by specifying the appropriate encoding >> explicitly: >> >> $ python tmp2.py iso-8859-5 | cat >> � >> $ python tmp2.py latin1 | cat >> Traceback (most recent call last): >>File "tmp2.py", line 4, in >>print u"Я".encode(encoding) >> UnicodeEncodeError:

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 03:33 AM, Peter Otten wrote: > Ray Jones wrote: > >> I have directory names that contain Russian characters, Romanian >> characters, French characters, et al. When I search for a file using >> glob.glob(), I end up with stuff like \x93\x8c\xd1 in place of the >> directory names. I tho

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Peter Otten
Ray Jones wrote: > I have directory names that contain Russian characters, Romanian > characters, French characters, et al. When I search for a file using > glob.glob(), I end up with stuff like \x93\x8c\xd1 in place of the > directory names. I thought simply identifying them as Unicode would > cl

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 02:57 AM, Walter Prins wrote: > Hi Ray, > > On 5 September 2012 10:42, Ray Jones wrote: >> Can someone point me to a page that will clarify the concepts, not just >> try to show me the Python implementation of what I already don't >> understand? ;) > Try the following 2 links which s

Re: [Tutor] help me decide

2012-09-05 Thread Matthew Ngaha
Hi Alan thanks so much for your helpful answers. > probably wxPython or GTk > But if you want to get serious about GUIs I'd probably suggest wxPython > instead - it ultimately is more powerful and complete and if you are only > just starting will be easy to learn whereas learning Tkinter and conv

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Walter Prins
Hi Ray, On 5 September 2012 10:42, Ray Jones wrote: > Can someone point me to a page that will clarify the concepts, not just > try to show me the Python implementation of what I already don't > understand? ;) Try the following 2 links which should hopefully help: http://www.joelonsoftware.com/

[Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
I have directory names that contain Russian characters, Romanian characters, French characters, et al. When I search for a file using glob.glob(), I end up with stuff like \x93\x8c\xd1 in place of the directory names. I thought simply identifying them as Unicode would clear that up. Nope. Now I hav