Re: [Tutor] cross platform gui

2005-02-12 Thread Liam Clarke
I would recommend wxPython, it seems to be cross platform. Pythoncard is an easy to use wrapper around wxPython, and for some stuff you have to revert back to wxPython code. I can't on QT, and Tkinter is getting a bit old these days (imao.) AFAIK they should all be cross-platform (query QT), so it

Re: [Tutor] what is wrong with this?

2005-02-12 Thread Liam Clarke
Yup, that's what I was after, the full error message. >self.grid1.CreateGrid(100,6) > val = gridc.wxGrid_CreateGrid(self, *_args, **_kwargs) try this self.grid1.CreateGrid(self, 100, 6) I'm pretty sure you have to explicitly pass self. Let me know how ya go. Regards, Liam Clarke On Sun,

Re: [Tutor] what is wrong with this?

2005-02-12 Thread jrlen balane
how would i find the stack trace? by the way, this is what the log says: 11:53:16: TypeError: wxGrid_CreateGrid() takes at least 3 arguments (2 given)Traceback(most recent call last): 11:53:16: TypeError: wxGrid_CreateGrid() takes at least 3 arguments (2 given) File "C:\PYTHON23\Lib\site-

[Tutor] cross platform gui

2005-02-12 Thread Kim Branson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, i'm interested in building a gui for some code we have. I'm after pointers on gui programming, and a recommendation on a cross platform gui library, wxpython? pythoncard, qt? What do people use. Ideally i'd like something that can work on win

Re: [Tutor] Downloading from http

2005-02-12 Thread Kent Johnson
Mark Kels wrote: On Sat, 12 Feb 2005 09:25:10 -0500, Jacob S. <[EMAIL PROTECTED]> wrote: urllib or urllib2 or maybe httplib maybe? urlopen( url[, data]) I'm sorry, but I didn't understood a thing (maybe its because of my bad english, and mybe its because I'm just dumb :). Anyway, can you giv

Re: ****SPAM(11.2)**** [Tutor] Larger program organization

2005-02-12 Thread Brian van den Broek
Bob Gailer said unto the world upon 2005-02-11 15:34: At 10:39 AM 2/11/2005, Ryan Davis wrote: I'm starting to make a code-generation suite in python, customized to the way we ASP.NET at my company, and I'm having some trouble finding a good way to organize all the code. My take on doing that in

Re: [Tutor] default argument frustration

2005-02-12 Thread Brian van den Broek
I've combined a few email's worth of quoting as no previous post had all the elements I wanted to refer to. Alan Gauld said unto the world upon 2005-02-11 13:30: >> >>FOR THE LOVE OF MIKE can someone tell me even one reason why this >>isn't a misfeature?!?! >> > > Its the only sane way to impleme

Re: [Tutor] help with refactoring needed -- which approach is morePythonic?

2005-02-12 Thread Brian van den Broek
Alan Gauld said unto the world upon 2005-02-12 07:51: Thanks Alan and Kent for the replies. I'm responding to a couple of questions Alan asked me about my problem. I don't think I have any further questions of my own (yet), though. :-) Call it node_linkify. The new thought is to create two new

[Tutor] Idle needles

2005-02-12 Thread Lobster
[EMAIL PROTECTED] wrote: Brian van den Broek wrote: But the multiple copies of pythonw seems key, and also the sort of thing that better Python minds than most seem to accept they have to live with too: Make sure you read

Re: [Tutor] Downloading from http

2005-02-12 Thread Mark Kels
On Sat, 12 Feb 2005 09:25:10 -0500, Jacob S. <[EMAIL PROTECTED]> wrote: > urllib or urllib2 or maybe httplib maybe? > > urlopen( url[, data]) > > Open the URL url, which can be either a string or a Request object. > data should be a string, which specifies additional data to send to t

Re: [Tutor] Larger program organization

2005-02-12 Thread Kent Johnson
Ryan Davis wrote: I'm starting to make a code-generation suite in python, customized to the way we ASP.NET at my company, and I'm having some trouble finding a good way to organize all the code. I keep writing it, but it feels more and more spaghetti-ish every day. Organize your code into packa

Re: [Tutor] Downloading from http

2005-02-12 Thread Jacob S.
urllib or urllib2 or maybe httplib maybe? urlopen( url[, data]) Open the URL url, which can be either a string or a Request object. data should be a string, which specifies additional data to send to the server. In HTTP requests, which are the only ones that support data, it should be a

[Tutor] Downloading from http

2005-02-12 Thread Mark Kels
Hi list. How can I download a file from an HTTP server ? I checked the documentation but couldn't find what I need. Thanks! -- 1. The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners. 2. Unix is user friendly - it's just picky about it's frien

[Tutor] Re: References in loops

2005-02-12 Thread Brian Beck
Andrei wrote: Numbers are immutable, so the element 1 can't change into a 2 inside the list. If 1 was not immutable, e.g. a list you could modify it and then it would be "updated" in the original list too. It doesn't have anything to do with mutability, only the scope of i. Consider a list of li

Re: [Tutor] Idle needles

2005-02-12 Thread Kent Johnson
Brian van den Broek wrote: But the multiple copies of pythonw seems key, and also the sort of thing that better Python minds than most seem to accept they have to live with too: Make sure you read the next message in the thread w

Re: [Tutor] help with refactoring needed -- which approach is morePythonic?

2005-02-12 Thread Alan Gauld
> It still seems to me that the actual updating of the article should be > a Node method (it is the Node object's article that is being updated, > after all). Yes, the owner of the data should update it. > Call it node_linkify. The new thought is to create two new > methods for the TP_file class:

Re: [Tutor] help with refactoring needed -- which approach is more Pythonic?

2005-02-12 Thread Kent Johnson
Brian van den Broek wrote: Kent Johnson said unto the world upon 2005-02-11 11:34: In general I think this is a bad design. I try to avoid telling components about their parents in any kind of containment hierarchy. If the component knows about its parent, then the component can't be reused in a

[Tutor] Idle + Firefox solution - hopefully

2005-02-12 Thread Lobster
- closing down IDLE and pressing ctrl alt and del I notice that 3 copies of pythonw are in memory I closed these down and IDLE is working again Hi, for what it's worth, I've never had issues with Firefox and IDLE when running Zone Alarm. (Currently running ZoneAlarm version:5.5.062.004) But the

Re: [Tutor] what is wrong with this?

2005-02-12 Thread Liam Clarke
Can you post the whole stack trace? On Sat, 12 Feb 2005 13:36:18 +0800, jrlen balane <[EMAIL PROTECTED]> wrote: > this code is for a MDIChildFrame, It has a MDIParentFrame and when I > run the MDIPrentFrame, there seems to be no problem, but when I > attempt to edit the MDIChildFrame using the de

Re: [Tutor] help with refactoring needed -- which approach is more Pythonic?

2005-02-12 Thread Brian van den Broek
Kent Johnson said unto the world upon 2005-02-11 11:34: Brian van den Broek wrote: Alan Gauld said unto the world upon 2005-02-10 02:58: Pseudo code: class Body: def __init__(self,content): self.contents = contents self.nodes = [] def parse(self):

Re: [Tutor] Idle needles

2005-02-12 Thread Brian van den Broek
Lobster said unto the world upon 2005-02-12 10:34: Danny Yoo wrote: On Sat, 12 Feb 2005, Lobster wrote: Just to nail this issue down: try turning ZoneAlarm off, just for a moment, and then start up IDLE. (You can always turn ZoneAlarm back on after this experiment.) If you don't see any proble

[Tutor] Re: Data storage, SQL?

2005-02-12 Thread Sandip Bhattacharya
On Fri, 11 Feb 2005 20:09:10 +1300, Liam Clarke wrote: > Hi, > > I'm looking to create a prog that will store disparate bits of info > all linked together, i.e. address details for a person, transaction > records, specific themes, and the ability to search by certain > criteria, so I'm pretty su

[Tutor] what is wrong with this?

2005-02-12 Thread jrlen balane
this code is for a MDIChildFrame, It has a MDIParentFrame and when I run the MDIPrentFrame, there seems to be no problem, but when I attempt to edit the MDIChildFrame using the designer mode in BOA (i'm using BOA by the way), an error occurs that says: TypeError: wxGrid_CreateGrid() takes at least

Re: [Tutor] Idle needles

2005-02-12 Thread Danny Yoo
On Sat, 12 Feb 2005, Lobster wrote: > Idols subprocess didn't make connection Either Idle can't start or > personal firewall is blocking the connection = > > Now I am getting the added message that the "socket connection is > refused" (recently updated to the latest Zone Alarm) Hi Ed,

Re: [Tutor] Idle needles

2005-02-12 Thread Lobster
Danny Yoo wrote: More Info = Idols subprocess didn't make connection Either Idle can't start or personal firewall is blocking the connection = Now I am getting the added message that the "socket connection is refused" (recently updated to the latest Zone Alarm) Ed Jason

[Tutor] Re: References in loops

2005-02-12 Thread Andrei
Matt Dimmic wrote: In Python, one bug that often bites me is this: (example A) aList = [1,2,3] for i in aList: i += 1 print aList --> [1,2,3] Numbers are immutable, so the element 1 can't change into a 2 inside the list. If 1 was not immutable, e.g. a list you could modify it and then it woul

[Tutor] What does this mean

2005-02-12 Thread jrlen balane
what does (*args, **kwargs) mean??? i'm sort of a bit confused... thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Idle needles

2005-02-12 Thread Lobster
Danny Yoo wrote: On Sat, 12 Feb 2005, Lobster wrote: Idols subprocess didn't make connection Either Idle can't start or personal firewall is blocking the connection = Now I am getting the added message that the "socket connection is refused" (recently updated to the latest Zone Alarm)

Re: [Tutor] Larger program organization

2005-02-12 Thread EJP
 "Ryan Davis" [EMAIL PROTECTED] wrote My background is mostly C#, so I'm used to the ridiculous rigidity of strongly-typed languages. I have been using python for helper apps for a few months now, so am pretty familiar with the syntax now, but I don't know any of the patterns y

[Tutor] Re: Larger program organization

2005-02-12 Thread Javier Ruere
Ryan Davis wrote: > I'm starting to make a code-generation suite in python, customized to > the way we ASP.NET at my company, and I'm having some trouble finding a > good way to organize all the code. I keep writing it, but it feels more > and more spaghetti-ish every day. > > I'm going to look a

Re: [Tutor] elementtree, lists, and dictionaries

2005-02-12 Thread Kent Johnson
If you iterate over the author nodes you can check the user name and password of each in turn. Not tested code! def authenticateAuthor(author, password): authorxml = 'author.xml' path = os.path.join(xml, authorxml) if not os.path.exists(path): return False, False else:

Re: [Tutor] References in loops

2005-02-12 Thread Jacob S.
Of all the odd quirks of python, this is the only thing that has bitten be in the butt. And several, several times. List comprehensions have similar limitations as python lambdas, however, so I guess the only way to execute several expressions on the item in the list would be to pass the item to

Re: [Tutor] Idle needles

2005-02-12 Thread Lobster
Danny Yoo wrote: >>More seriously I can not run Idle and Firefox together Not quite sure >>what to do other than download the whole web sites? thanks for the info Danny :-) >What happens if you try running both of them together? Do either of them >fail to start up? > >Firefox and IDLE should not c

Re: [Tutor] default argument frustration

2005-02-12 Thread Alan Gauld
> > interface. The function should return the same result each time > > you call it with the same input. The only way to achieve that > > is to have the default calculated once. > > IBTD. > With full lexical scope you only need to calculate the default argument > in the lexical scope it was defined

Re: [Tutor] Re: Might be a silly question!

2005-02-12 Thread Liam Clarke
I suppose, you could do it like this - gamma = 5, and access with gamma[0]. But, there'd be nothing to stop you reassigning gamma. On Fri, 11 Feb 2005 18:44:18 -, Alan Gauld <[EMAIL PROTECTED]> wrote: > > I have been reading code written before me (mind you it's C++) and > the > > authors

Re: [Tutor] Larger program organization

2005-02-12 Thread Alan Gauld
> without trying to make this one of those classic threads of great, > do you feel you could develop fairly complex applications faster > in Python than in C#/ASP.NET? It's a rhetorical question > (but I'm interested in your answer as a single data point) To be honest it wouldn't make a great

Re: [Tutor] References in loops

2005-02-12 Thread Danny Yoo
On Fri, 11 Feb 2005, Matt Dimmic wrote: > In Python, one bug that often bites me is this: > > (example A) > aList = [1,2,3] > for i in aList: > i += 1 > print aList > --> [1,2,3] > > This goes against my intuition, which is that aList == [2,3,4], probably > because so much in Python is passe

Re: [Tutor] What does this mean

2005-02-12 Thread Jeremy Jones
jrlen balane wrote: what does (*args, **kwargs) mean??? i'm sort of a bit confused... thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor *args is notation for list of arguments. **kwargs is notation for key

Re: [Tutor] help with refactoring needed -- whichapproach ismorePythonic?

2005-02-12 Thread Alan Gauld
> > - otherwise you get circular references which can cause memory > > leaks by confusing the garbage collector! > > CPython has been able to GC cycles since version 2.0. Yep but it takes a lot longer. The cycle detection sweep only occurs periodically if I remember rightly, and if you are doin