[Tutor] wxPython parent classes

2011-04-19 Thread Eric Stevens
I've been noticing that in all the example codes I have seen, when someone
creates container, x,  inside of a frame or other container class, y, they
always seem to create an instance of wx.Panel first and then use that
instance as the parent class of container x. I have been just placing 'self'
in there, however, letting the class I am creating (whether it be a wx.Frame
subclass, wx.ScrolledWindow subclass, etc) be the parent class of any other
wx.Window class I instantiate inside that class. Is one way better than the
other, and if so, why? Thanks.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] wxPython issues

2011-04-18 Thread Eric Stevens
I am trying to create an addressbook program and am currently  working on
prototype pages. Right now, I am trying to create a wx.ScrolledWindow class
with a wx.ListCtrl to display the names of all contacts. I keep running into
an error with my current configuration that is stating I have not specified
the 'parent' position when instantiating my class, but from my best
understanding, I have. (The full Exception Error is below). I have attatched
a text file with a copy of my program. I am new at this, so I am sure my
program is not optimal, so I would also appreciate any further advice or
comments if you have the time. Thank you.

Traceback (most recent call last):
  File "C:\Python27\programming\wxPython practice", line 34, in 
frame= RandomFrame(None, -1, 'Random')
  File "C:\Python27\programming\wxPython practice", line 29, in __init__
listpage = ScrolledWindow(panel, -1)
  File "C:\Python27\programming\wxPython practice", line 9, in __init__
wx.ScrolledWindow.__init__(self)
  File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py",
line 145, in __init__

 _windows_.ScrolledWindow_swiginit(self,_windows_.new_ScrolledWindow(*args,
**kwargs))
TypeError: Required argument 'parent' (pos 1) not found


contacts program.rtf
Description: RTF file
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] List sorting issues

2011-03-28 Thread Eric Stevens
I am currently designing an address book program, and am trying to design a
method for organizing the keys (which are the names of the entries) for
displaying purposes. I have created a list by doing sortedKeys =
self.addbook.keys() {the self.addbook refers to a dictionary in a custom
class}, and then i try to do a sortedKeys.sort() but never get an
alphabetical list of the keys. All i get is 'None'. I know that a
'list.sort()' returns a None value but all of the tutorials I see show this
giving an alphabetized list.

 I have also tried doing a 'sorted(self.addbook)' which gives me a list but
not alphabetized. The dictionary keys I am using are 'Eric', 'Kyle', and
'dfd' and they always appear in that order when i use the sorted() feature
(obviously not alphabetized).

 Could you please let me know what I am doing wrong or let me know of
another way to alphabetize an iterable object. Thank you.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] zipfile error message

2011-02-07 Thread Eric Stevens
Hi:

I am relatively new to Python and have been recently trying to experiment
with its zipfile capabilities. However, everytime I try to open a zip (
using method zipfile.ZipFile(open('zipfile.zip','r')) ) I continue to get an
error message that states:error: unpack requires a string argument of length
46. Would anyone be able to help me figure out what is wrong? I am currently
running Python 2.7 on Windows (not sure if that matters). Thank you.

Eric
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor