Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-12-03 Thread James Harris
On 3 Dec, 20:56, Michael Torrie wrote: > Steve Ferg wrote: > > Is there any particular reason why this might be a *bad* language- > > design idea? > > Syntactically, using braces, begin/end blocks, python white space, and > your if/elif/then/endif structures, amounts to the same thing; they are >

Re: Feature request: String-inferred names

2009-12-03 Thread Ben Finney
Brad Harms writes: > Anyway, it looks like the docs agree with you > (http://docs.python.org/glossary.html#term-attribute), so I'm not > going to argue. That's good, because the terms are quite well established in Python terminology. > However, for the purpose of clean communication, I'd still

Re: Feature request: String-inferred names

2009-12-03 Thread Bradley K. Harms
On Tue, 2009-12-01 at 14:38 +, Steven D'Aprano wrote: > On Mon, 30 Nov 2009 18:55:46 -0800, The Music Guy wrote: > > > Lie Ryan, I think I see what you're saying about using __dict__ to add > > members to a class, but it's not quite the same. __dict__ is only for > > attributes, NOT properties

Formatting logically nested actions -- Pythonic way?

2009-12-03 Thread Alf P. Steinbach
Hi. I discovered with tkinter the registration of widgets with layout managers (tkinter "geometry" managers, e.g. calls to pack()) needs to be done very hierarchically. And this leads to hierarchical code, which would be nice to indicate by indenting, but oops, indenting in Python is syntact

Re: Feature request: String-inferred names

2009-12-03 Thread Brad Harms
On Tue, 2009-12-01 at 16:58 +0100, Bruno Desthuilliers wrote: > The Music Guy a écrit : > (snip) > > Lie Ryan, I think I see what you're saying about using __dict__ to add > > members > > No "members" in Python - only attributes. > > to a class, but it's not quite the same. __dict__ is only for >

editor with autocompletion

2009-12-03 Thread Siva B
Hi friends, I am writing a new language. So I want an editor with auto complete. I there any such tool in Python ?(not only in python any other) I want it for my new lang help me Thanks siva -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature request: String-inferred names

2009-12-03 Thread Brad Harms
On Tue, 2009-12-01 at 14:38 +, Steven D'Aprano wrote: > On Mon, 30 Nov 2009 18:55:46 -0800, The Music Guy wrote: > > > Lie Ryan, I think I see what you're saying about using __dict__ to add > > members to a class, but it's not quite the same. __dict__ is only for > > attributes, NOT properties

Re: Question on Python as career

2009-12-03 Thread John Bokma
TimmyGee writes: > On Dec 4, 1:08 pm, r0g wrote: >> TimmyGee wrote: >> > On Dec 4, 2:48 am, Grant Edwards wrote: [..] >> >www.rentacoder.com? >> >> Euwww, that's not an experience I'd recommend! >> >> Roger. > > Really? I was considering giving it a go one of these days. Not a good > idea? I

Re: memory error

2009-12-03 Thread Stephen Hansen
On Thu, Dec 3, 2009 at 5:51 AM, Ahmed, Shakir wrote: > I am getting a memory error while executing a script. Any idea is highly > appreciated. > > Error message: " The instruction at "0x1b009032" referenced memory at > "0x0804:, The memory could not be "written" > > This error is appearing an

Re: Which is more pythonic?

2009-12-03 Thread Edward A. Falk
In article , Filip GruszczyÅ ski wrote: > >for choice in self.__choices: > choicesBox.addItem(choice) This is the easiest to read. I'm guessing that this is not inner-loop stuff that needs to be optimized, so you should favor readability over performance. -- -Ed Falk, f...@despam

Re: Question on Python as career

2009-12-03 Thread TimmyGee
On Dec 4, 1:08 pm, r0g wrote: > TimmyGee wrote: > > On Dec 4, 2:48 am, Grant Edwards wrote: > >> On 2009-12-03, r0g wrote: > > > I have done one MA in Linguistics, did a PhD in Natural > > Language Processing and doing a Post Doctoral now. ... > > After I complete my Post Doctoral wh

Re: can python do this?

2009-12-03 Thread Lie Ryan
On 12/3/2009 4:55 AM, Anssi Saari wrote: Rounak writes: I am a complete newbie. I want to know if the following can be done using python or should I learn some other language: (Basically, these are applescripts that I wrote while I used Mac OS) 1.Web Page Image to Wallpaper: A script that take

Re: memory error

2009-12-03 Thread Lie Ryan
On 12/4/2009 12:51 AM, Ahmed, Shakir wrote: I am getting a memory error while executing a script. Any idea is highly appreciated. Error message: " The instruction at "0x1b009032" referenced memory at "0x0804:, The memory could not be "written" This error is appearing and I have to exit from

Re: Which is more pythonic?

2009-12-03 Thread Lie Ryan
On 12/4/2009 11:44 AM, Rhodri James wrote: map(self.__choices, choicesBox.addItem) or [choicesBox.addItem(choice) for choice in self.__choices] Aside from being pythonic or non-pythonic, using map or list comprehension with a method with side-effect is not the intention of functional progra

Re: memory error

2009-12-03 Thread Rami Chowdhury
On Thursday 03 December 2009 05:51:05 Ahmed, Shakir wrote: > I am getting a memory error while executing a script. Any idea is > highly appreciated. > > Error message: " The instruction at "0x1b009032" referenced memory at > "0x0804:, The memory could not be "written" > > This error is appea

Re: Organization of GUIs

2009-12-03 Thread Lie Ryan
On 12/4/2009 10:40 AM, Michael Torrie wrote: Lie Ryan wrote: On 12/4/2009 12:44 AM, Michael Mossey wrote: I have a question about typical organization of GUIs. I will be using PyQt. Model-View-Controller (MVC) pattern. Model - all the business logic lives in the model. View - your GUI Contr

Re: More elegant solution for diffing two sequences

2009-12-03 Thread r0g
Lie Ryan wrote: > On 12/4/2009 8:28 AM, Ulrich Eckhardt wrote: >> I'm trying to write some code to diff two fonts. What I have is every >> character (glyph) of the two fonts in a list. I know that the list is >> sorted >> by the codepoints of the characters. What I'd like to ask is whether >> there

Re: Directly converting Python to C using the C API

2009-12-03 Thread Philip Semanchuk
On Dec 3, 2009, at 9:09 PM, Emmanuel Bengio wrote: I'm fairly new to the python world, and I often heard critics about it's speed, and also about it's "non-compilability". Then I thought, there is a complete C API that manages Python itself. Would it be feasible to transform pure Python code

Re: Directly converting Python to C using the C API

2009-12-03 Thread Chris Rebert
On Thu, Dec 3, 2009 at 6:09 PM, Emmanuel Bengio wrote: > I'm fairly new to the python world, and I often heard critics about it's > speed, and also about it's "non-compilability". > Then I thought, there is a complete C API that manages Python itself. > Would it be feasible to transform pure Pytho

Re: Organization of GUIs

2009-12-03 Thread Benjamin Kaplan
On Thu, Dec 3, 2009 at 9:59 AM, Michael Mossey wrote: > On Dec 3, 6:38 am, Lie Ryan wrote: >> On 12/4/2009 12:44 AM, Michael Mossey wrote: >> >> > I have a question about typical organization of GUIs. I will be using >> > PyQt. >> >> Model-View-Controller (MVC) pattern. >> >> Model - all the busi

Re: slightly OT: Python BootCamp

2009-12-03 Thread J
On Fri, Dec 4, 2009 at 09:21, Steven D'Aprano wrote: > On Thu, 03 Dec 2009 16:20:24 -0500, J wrote: > >> The difference between me (learning a new language) and the guy teaching >> (who knows it inside and out) > > I don't know about that. He's teaching some pretty atrocious habits. See > below.

Directly converting Python to C using the C API

2009-12-03 Thread Emmanuel Bengio
I'm fairly new to the python world, and I often heard critics about it's speed, and also about it's "non-compilability". Then I thought, there is a complete C API that manages Python itself. Would it be feasible to transform pure Python code into pure Python "C API" code? It would spare the parsing

Re: Question on Python as career

2009-12-03 Thread r0g
TimmyGee wrote: > On Dec 4, 2:48 am, Grant Edwards wrote: >> On 2009-12-03, r0g wrote: >> > I have done one MA in Linguistics, did a PhD in Natural > Language Processing and doing a Post Doctoral now. ... > After I complete my Post Doctoral which may be only 2-3 months > away, wit

Re: UnicodeDecodeError? Argh! Nothing works! I'm tired and hurting and...

2009-12-03 Thread Chris Jones
On Thu, Dec 03, 2009 at 07:59:30PM EST, David Robinow wrote: > On Thu, Dec 3, 2009 at 7:33 PM, Steven D'Aprano > wrote: > > On Fri, 04 Dec 2009 00:52:35 +0100, Michael Ströder wrote: > > > >> Aahz wrote: > >>> Just to be contrary, I *like* mbox. > >> > >> Me too. :-) > > > > > > Why? What features

Re: slightly OT: Python BootCamp

2009-12-03 Thread Steven D'Aprano
On Thu, 03 Dec 2009 16:20:24 -0500, J wrote: > The difference between me (learning a new language) and the guy teaching > (who knows it inside and out) I don't know about that. He's teaching some pretty atrocious habits. See below. > His code: [...] > for (exten, list) in files.iteritems(): >

Re: UnicodeDecodeError? Argh! Nothing works! I'm tired and hurting and...

2009-12-03 Thread David Robinow
On Thu, Dec 3, 2009 at 7:33 PM, Steven D'Aprano wrote: > On Fri, 04 Dec 2009 00:52:35 +0100, Michael Ströder wrote: > >> Aahz wrote: >>> Just to be contrary, I *like* mbox. >> >> Me too. :-) > > > Why? What features or benefits of mbox do you see that make up for it's > disadvantages? I've never

Re: Which is more pythonic?

2009-12-03 Thread MRAB
Filip Gruszczyński wrote: I have just written a very small snippet of code and started thinking, which version would be more pythonic. Basically, I am adding a list of string to combo box in qt. So, the most obvious way is: for choice in self.__choices: choicesBox.addItem(choice) But I

Re: Which is more pythonic?

2009-12-03 Thread Rhodri James
On Thu, 03 Dec 2009 15:41:56 -, Filip Gruszczyński wrote: I have just written a very small snippet of code and started thinking, which version would be more pythonic. Basically, I am adding a list of string to combo box in qt. So, the most obvious way is: for choice in self.__choices:

Re: UnicodeDecodeError? Argh! Nothing works! I'm tired and hurting and...

2009-12-03 Thread Steven D'Aprano
On Fri, 04 Dec 2009 00:52:35 +0100, Michael Ströder wrote: > Aahz wrote: >> In article <[email protected]>, Steven D'Aprano >> wrote: >>> Good grief, it's about six weeks away from 2010 and Thunderbird still >>> uses mbox as it's default mail box format. Hello, the nineti

Re: Declaring a class level nested class?

2009-12-03 Thread Steven D'Aprano
On Thu, 03 Dec 2009 06:59:43 -0800, cmckenzie wrote: > It was late when I posted my example, so I don't think I made my > question clear enough. I want to be able to construct a class level > class variable, so its global to the class, then reference it from a > class method. My brain is spinnin

Re: Question on Python as career

2009-12-03 Thread TimmyGee
On Dec 4, 2:48 am, Grant Edwards wrote: > On 2009-12-03, r0g wrote: > > >>> I have done one MA in Linguistics, did a PhD in Natural > >>> Language Processing and doing a Post Doctoral now. ... > > >>> After I complete my Post Doctoral which may be only 2-3 months > >>> away, with this knowledge c

testing command line scripts that use optparse

2009-12-03 Thread Peter
Hi I have a script like this: def doit(input, output): parser = OptionParser() parser.add_option("-a", "--accounts", dest="accounts", default="all", help="list available accounts") ... (options, args) = parser.parse_args() # main driver if __name__ == "__main__": import

Re: Insane Problem

2009-12-03 Thread Steven D'Aprano
On Thu, 03 Dec 2009 10:13:14 -0500, Carsten Haese wrote: > Victor Subervi wrote: >> I believe I mentioned in my first post that the "print test" does print >> the exact fields being called from the referring page. > > Was any part of "What do the print statements actually print? Please > copy and

Re: Organization of GUIs

2009-12-03 Thread Michael Mossey
On Dec 3, 6:38 am, Lie Ryan wrote: > On 12/4/2009 12:44 AM, Michael Mossey wrote: > > > I have a question about typical organization of GUIs. I will be using > > PyQt. > > Model-View-Controller (MVC) pattern. > > Model - all the business logic lives in the model. > View - your GUI > Controller - T

Which is more pythonic?

2009-12-03 Thread Filip Gruszczyński
I have just written a very small snippet of code and started thinking, which version would be more pythonic. Basically, I am adding a list of string to combo box in qt. So, the most obvious way is: for choice in self.__choices: choicesBox.addItem(choice) But I could also do: map(self.__c

Re: UnicodeDecodeError? Argh! Nothing works! I'm tired and hurting and...

2009-12-03 Thread Michael Ströder
Aahz wrote: > In article <[email protected]>, > Steven D'Aprano wrote: >> Good grief, it's about six weeks away from 2010 and Thunderbird still >> uses mbox as it's default mail box format. Hello, the nineties called, >> they want their mail formats back! Are the tbird d

Re: python bijection

2009-12-03 Thread geremy condra
On Thu, Dec 3, 2009 at 12:57 PM, M.-A. Lemburg wrote: > geremy condra wrote: >> On Thu, Dec 3, 2009 at 7:04 AM, M.-A. Lemburg wrote: >>> I think the only major CS data type missing from Python is some >>> form of (fast) directed graph implementation à la kjGraph: >>> >>>    http://gadfly.sourcefo

Re: Help in wxpython

2009-12-03 Thread Kevin Walzer
Madhura, Sorry to be a bit off-topic, but, I would really recommend you to use pygtk instead of wx. For one thing, the developers at pygtk are very active (they have their mailing list as well ) and it comes by default with python on almost all linux distros. You can also easily install it on w

Re: Organization of GUIs

2009-12-03 Thread Michael Torrie
Lie Ryan wrote: > On 12/4/2009 12:44 AM, Michael Mossey wrote: >> I have a question about typical organization of GUIs. I will be using >> PyQt. >> > > Model-View-Controller (MVC) pattern. > > Model - all the business logic lives in the model. > View - your GUI > Controller - Takes input No, you

Re: Overriding module's class

2009-12-03 Thread Bruno Desthuilliers
Pavel Skvazh a écrit : > Is it possible to override a class in the module or the module itself > that is imported across the project to add new methods to it? > > For example I've got > > module 'a' with class A > > from a import A > > but I don't want to add a method to that A class not just i

Re: Bored.

2009-12-03 Thread Ognjen Bezanov
Anssi Saari wrote: Necronymouse writes: Hello, I am learning python for about 2 years and I am bored. Not with python but I have a little problem, when i want to write something I realise that somebody had alredy written it! So i don´t want to make a copy of something but i wanna get better in

Overriding module's class

2009-12-03 Thread Pavel Skvazh
Is it possible to override a class in the module or the module itself that is imported across the project to add new methods to it? For example I've got module 'a' with class A from a import A but I don't want to add a method to that A class not just in this unit, but across the project, so eve

Re: confusing thread behavior

2009-12-03 Thread paul
On Dec 3, 2:03 pm, Mike Driscoll wrote: > On Dec 3, 3:42 pm, paul wrote: > > > > > > > I have been experiencing strange thread behavior when I pass a message > > received via a Queue to a wx.PostEvent method (from wxPython). The > > relevant code in the thread is: > > > def run(self): > >     whi

Re: Help in wxpython

2009-12-03 Thread Mike Driscoll
On Dec 3, 3:22 pm, Nobody wrote: > On Thu, 03 Dec 2009 07:55:19 +, r0g wrote: > > I have to recommend to opposite, stick with wx. What's the point of > > tying yourself into GTK when wx works on Mac, PC and Linux? > > The main drawbacks are that wxWidgets sucks compared to GTK or Qt (mostly >

Re: Help in wxpython

2009-12-03 Thread Mike Driscoll
On Dec 2, 10:05 pm, Krishnakant wrote: > On Wed, 2009-12-02 at 00:20 -0800, madhura vadvalkar wrote: > > Hi > > > I am trying to write an  PAINT like application where on the mouse > > click a circle is drawn on canvas. I am new to python and using > > wxpython to create this. > > > here is the co

Re: Strange unicode / no unicode phenomen with mysql

2009-12-03 Thread Hans Müller
I found the bug, it's in the mysql module. When a column has COLLATE=utf8_bin set, the column is NOT returned as unicode. It's a known bug #541198 Thanks all for reading. Greetings Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: confusing thread behavior

2009-12-03 Thread Mike Driscoll
On Dec 3, 3:42 pm, paul wrote: > I have been experiencing strange thread behavior when I pass a message > received via a Queue to a wx.PostEvent method (from wxPython). The > relevant code in the thread is: > > def run(self): >     while self.is_running: >         task = self.queue.get() >        

Re: confused with os.fork()

2009-12-03 Thread Aahz
In article , Dennis Lee Bieber wrote: >On Wed, 25 Nov 2009 13:52:09 -0800 (PST), Sandy >declaimed the following in gmane.comp.python.general: >> >> Sometimes (very rare) it prints something like this: >> ab >> c >> d >> e > > Not > >ab > >c >d >e > >? That's what I would guess, too. >

Re: More elegant solution for diffing two sequences

2009-12-03 Thread Lie Ryan
On 12/4/2009 8:28 AM, Ulrich Eckhardt wrote: I'm trying to write some code to diff two fonts. What I have is every character (glyph) of the two fonts in a list. I know that the list is sorted by the codepoints of the characters. What I'd like to ask is whether there is a more elegant solution to

confusing thread behavior

2009-12-03 Thread paul
I have been experiencing strange thread behavior when I pass a message received via a Queue to a wx.PostEvent method (from wxPython). The relevant code in the thread is: def run(self): while self.is_running: task = self.queue.get() wx.PostEvent(self.app.handle_task, task) sel

Re: Ignoring XML Namespaces with ElementTree

2009-12-03 Thread Pete
On Dec 3, 2:55 pm, Stefan Behnel wrote: > Pete, 03.12.2009 19:21: > > > Is there anyway to configure ElementTree to ignore the XML namespace? > > For the past couple months, I've been using minidom to parse an XML > > file that is generated by a unit within my organization that can't > > stick wit

Re: Incorrect number of bytes returned by getsockopt(socket.SOL_SOCKET, socket.TCP_INFO, buflen)

2009-12-03 Thread Martien Verbruggen
On Thu, 3 Dec 2009 10:29:13 -0800 (PST), Ashwin Rao wrote: > tcp_info = sock.getsockopt(socket.SOL_SOCKET, socket.TCP_INFO, 104) In C, to get tcp_info, SOL_SOCKET should be IPPROTO_TCP. I'm assuming it's the same in Python, although I've never tried it. Martien --

More elegant solution for diffing two sequences

2009-12-03 Thread Ulrich Eckhardt
Hi! I'm trying to write some code to diff two fonts. What I have is every character (glyph) of the two fonts in a list. I know that the list is sorted by the codepoints of the characters. What I'd like to ask is whether there is a more elegant solution to the loop below or whether there are any

Re: Help in wxpython

2009-12-03 Thread Nobody
On Thu, 03 Dec 2009 07:55:19 +, r0g wrote: > I have to recommend to opposite, stick with wx. What's the point of > tying yourself into GTK when wx works on Mac, PC and Linux? The main drawbacks are that wxWidgets sucks compared to GTK or Qt (mostly due to being modelled on the Win32 API, whic

Re: slightly OT: Python BootCamp

2009-12-03 Thread J
On Sun, Nov 29, 2009 at 20:14, Terry Reedy wrote: > J wrote: >> >> Ok... so I've been re-teaching myself python, as it's been several >> years since I last really used it.  And in the midst of this, my >> contracting company came up to me on Friday and asked if I'd be >> interested in filling a la

Re: python bijection

2009-12-03 Thread Francis Carr
[In re R. Hettinger's critiques] > * it extends the language with arcane syntax tricks... I think most of these in the current version of J. Bronson's "bidict" can be left unused, or removed altogether. In almost all cases, a bidict should be accessed as an ordinary python dict. > * we've alrea

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-12-03 Thread Robert Kern
On 2009-12-03 14:56 PM, Michael Torrie wrote: I'm not sure, but Python's grammar is LL(1) I think, and probably darn close to context-free. It is LL(1) after some non-formal postprocessing of the tokens to properly handle the indentation. -- Robert Kern "I have come to believe that the who

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-12-03 Thread Michael Torrie
Steve Ferg wrote: > Is there any particular reason why this might be a *bad* language- > design idea? Syntactically, using braces, begin/end blocks, python white space, and your if/elif/then/endif structures, amounts to the same thing; they are all equivalent. Thus from a language pov, there's no

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-12-03 Thread Michael Torrie
Steven D'Aprano wrote: > But you're right, the convention of using verbs for functions isn't as > strong as the convention of using nouns for classes and types. The idea that functions should be verbs is plain wrong, coming from the traditional world of functional programming. Since functions s

Re: Help with function prototype

2009-12-03 Thread Chris Rebert
On Thu, Dec 3, 2009 at 3:02 AM, Nadav Chernin wrote: > Hi, all > > In past I asked about module – inspect, that can’t to get me prototype of > C-implemented functions ( usually all built-in functions ). > > But, still I see that all Python Editors ( IDLE for example ) can to show > prototype of bu

Re: Bored.

2009-12-03 Thread Anssi Saari
Necronymouse writes: > Hello, I am learning python for about 2 years and I am bored. Not with > python but I have a little problem, when i want to write something I > realise that somebody had alredy written it! So i don´t want to make a > copy of something but i wanna get better in python skills

Re: Question about file objects...

2009-12-03 Thread nn
On Dec 2, 6:56 pm, Terry Reedy wrote: > J wrote: > > On Wed, Dec 2, 2009 at 09:27, nn wrote: > >>> Is there a way to read the file, one item at a time, delimited by > >>> commas WITHOUT having to read all 16,000 items from that one line, > >>> then split them out into a list or dictionary?? > > >

Re: Ignoring XML Namespaces with ElementTree

2009-12-03 Thread Stefan Behnel
Pete, 03.12.2009 19:21: > Is there anyway to configure ElementTree to ignore the XML namespace? > For the past couple months, I've been using minidom to parse an XML > file that is generated by a unit within my organization that can't > stick with a standard. This hasnt been a problem until recentl

Re: Incorrect number of bytes returned by getsockopt(socket.SOL_SOCKET, socket.TCP_INFO, buflen)

2009-12-03 Thread Roy Smith
In article <5c2800de-a6d2-4863-b423-87ef80d95...@k17g2000yqh.googlegroups.com>, Ashwin Rao wrote: > I computed the size of the tcp_info using the > following program, which returned 104. > --- > #include > #include > > int main() > { > printf("%d", sizeof(struct tcp_info)); > } In general

Does Python mess with the (unicode) code page?

2009-12-03 Thread Roy Smith
We've got a windows executable which used to get run out of a shell script (Cygwin bash) and is now being run with subprocess.Popen(). The windows app is misbehaving. To make a long story short, the guy who wrote the code in question says, > it's all based on the return values of the WinAPI c

Incorrect number of bytes returned by getsockopt(socket.SOL_SOCKET, socket.TCP_INFO, buflen)

2009-12-03 Thread Ashwin Rao
Hi, I need to retrieve the tcp_info from a socket using getsockopt. The details of structure tcp_info are available at [http://src.gnu- darwin.org/src/sys/netinet/tcp.h.html]. The getsockopt method for a socket whose documentation is available at [http://docs.python.org/ library/socket.html#socke

Ignoring XML Namespaces with ElementTree

2009-12-03 Thread Pete
Is there anyway to configure ElementTree to ignore the XML namespace? For the past couple months, I've been using minidom to parse an XML file that is generated by a unit within my organization that can't stick with a standard. This hasnt been a problem until recently when the script was provided a

Re: Organization of GUIs

2009-12-03 Thread Dietmar Schwertberger
Michael Mossey schrieb: View can be fine-grained. Often the View consists of a number of GUI objects. Some people write this in a democratic arrangement---they all talk to each other. This can make analyzing system behavior complicated. Hence my proposal for a hierarchy. Yes, the democratic arra

Re: python bijection

2009-12-03 Thread M.-A. Lemburg
geremy condra wrote: > On Thu, Dec 3, 2009 at 7:04 AM, M.-A. Lemburg wrote: >> I think the only major CS data type missing from Python is some >> form of (fast) directed graph implementation à la kjGraph: >> >>http://gadfly.sourceforge.net/kjbuckets.html >> >> With these, you can easily build

Re: python bijection

2009-12-03 Thread geremy condra
On Thu, Dec 3, 2009 at 7:04 AM, M.-A. Lemburg wrote: > Raymond Hettinger wrote: >> [Joshua Bronson] >>> Raymond, do you think there might be any future in including a built- >>> in bidict data structure in Python? >> >> I don't think so.  There are several forces working against it: >> >> * the re

Re: Insane Problem

2009-12-03 Thread Victor Subervi
On Thu, Dec 3, 2009 at 12:38 PM, Carsten Haese wrote: > Victor Subervi wrote: > > No, it doesn't, because you've only provided one third of what I > asked > > for. I also asked for the code and the inputs that go into it. > > > > > > I provided those earlier. > > No, you didn't provide the

Re: Insane Problem

2009-12-03 Thread Carsten Haese
Victor Subervi wrote: > No, it doesn't, because you've only provided one third of what I asked > for. I also asked for the code and the inputs that go into it. > > > I provided those earlier. No, you didn't provide the exact code you're running. You provided a selected snippet you deemed

Re: Socket question

2009-12-03 Thread Lie Ryan
On 12/4/2009 1:52 AM, perlsyntax wrote: Is there away in python i can connect to a server in socket to two servers at the same time or can't it be done? use threading or non-blocking read. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to set object parameters nicely?

2009-12-03 Thread Bruno Desthuilliers
allen.fowler a écrit : (snip) In this case, and I am trying to create a number of ORM-like objects. (Though, there is no database involved.) So, instances of these classes are acting as records that are shuttled around in the system, and the object's properties are acting as values. The paramet

Re: Socket question

2009-12-03 Thread cassiope
On Dec 3, 7:45 am, perlsyntax wrote: > On 12/03/2009 09:28 AM, [email protected] wrote:> On 02:52 pm, > [email protected] wrote: > >> Is there away in python i can connect to a server in socket to two > >> servers at the same time or can't it be done? > > > I'm not sure what y

Re: Socket question

2009-12-03 Thread D'Arcy J.M. Cain
On Thu, 03 Dec 2009 09:45:19 -0600 perlsyntax wrote: > On 12/03/2009 09:28 AM, [email protected] wrote: > > On 02:52 pm, [email protected] wrote: > >> Is there away in python i can connect to a server in socket to two > >> servers at the same time or can't it be done? > > > >

Re: Insane Problem

2009-12-03 Thread Victor Subervi
On Thu, Dec 3, 2009 at 10:53 AM, Carsten Haese wrote: > Victor Subervi wrote: > > In order to help you diagnose the problem, we need to see the *exact* > > code you're running, we need to see the *exact* inputs going into it, > > and we need to see the *exact* output coming out of it.

Re: Socket question

2009-12-03 Thread Grant Edwards
On 2009-12-03, perlsyntax wrote: > On 12/03/2009 09:28 AM, [email protected] wrote: >> On 02:52 pm, [email protected] wrote: >> >>> Is there away in python i can connect to a server in socket to >>> two servers at the same time or can't it be done? >> >> I'm not sure what you'r

Re: Call C program

2009-12-03 Thread Grant Edwards
On 2009-12-03, Patrick Sabin wrote: >> I am developing a Python application and I need to call a C program >> which needs one parameter and it returns another one. > Have a look at the ctypes module > http://python.net/crew/theller/ctypes/tutorial.html Ctypes is great, except it's for calling

Re: Insane Problem

2009-12-03 Thread Carsten Haese
Victor Subervi wrote: > In order to help you diagnose the problem, we need to see the *exact* > code you're running, we need to see the *exact* inputs going into it, > and we need to see the *exact* output coming out of it. > > > Let's see your answers and see if you're right that the

Re: Question on Python as career

2009-12-03 Thread Grant Edwards
On 2009-12-03, r0g wrote: >>> I have done one MA in Linguistics, did a PhD in Natural >>> Language Processing and doing a Post Doctoral now. ... >>> >>> After I complete my Post Doctoral which may be only 2-3 months >>> away, with this knowledge can I join IT? > Getting involved in an open sourc

Re: Declaring a class level nested class?

2009-12-03 Thread Lie Ryan
On 12/4/2009 1:59 AM, cmckenzie wrote: Sigh, I'm using Google Groups and it seems I can't see my original post and everyone's replies. I'm really keen to reply back, so I'll just re-post my follow up for now and make sure I don't make a habit of this. (I'll get a news reader) Here goes: I agree,

Re: Socket question

2009-12-03 Thread perlsyntax
On 12/03/2009 09:28 AM, [email protected] wrote: On 02:52 pm, [email protected] wrote: Is there away in python i can connect to a server in socket to two servers at the same time or can't it be done? I'm not sure what you're asking. Can you clarify? Jean-Paul I just want

Re: Insane Problem

2009-12-03 Thread Victor Subervi
On Thu, Dec 3, 2009 at 10:13 AM, Carsten Haese wrote: > Victor Subervi wrote: > > I believe I mentioned in my first post that the "print test" does print > > the exact fields being called from the referring page. > > Was any part of "What do the print statements actually print? Please > copy and p

Re: Socket question

2009-12-03 Thread exarkun
On 02:52 pm, [email protected] wrote: Is there away in python i can connect to a server in socket to two servers at the same time or can't it be done? I'm not sure what you're asking. Can you clarify? Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Strange unicode / no unicode phenomen with mysql

2009-12-03 Thread Hans Müller
I have a strange unicode problem with mySQL and sqlite. In my application I get a table as a sqlite table which is being compared to an existing mySQL Table. The sqlite drive returns all strings from the table as a unicode string which is Ok. The mysql drive returns all strings as utf-8 coded

Re: Help in wxpython

2009-12-03 Thread Lie Ryan
On 12/3/2009 6:55 PM, r0g wrote: Krishnakant wrote: Madhura, Sorry to be a bit off-topic, but, I would really recommend you to use pygtk instead of wx. For one thing, the developers at pygtk are very active (they have their mailing list as well ) and it comes by default with python on almost all

Re: Python without wrapper script

2009-12-03 Thread Jonathan Hartley
On Dec 3, 3:13 pm, Jonathan Hartley wrote: > On Dec 2, 4:12 pm, Ulrich Eckhardt wrote: > > > > > eric.frederich wrote: > > > Is there a way to set up environment variables in python itself > > > without having a wrapper script. > > > Yes, sure, you can set environment variables... > > > > The wra

Re: Python without wrapper script

2009-12-03 Thread Jonathan Hartley
On Dec 2, 4:12 pm, Ulrich Eckhardt wrote: > eric.frederich wrote: > > Is there a way to set up environment variables in python itself > > without having a wrapper script. > > Yes, sure, you can set environment variables... > > > The wrapper script is now something like > > > #!/bin/bash > > >

Re: Insane Problem

2009-12-03 Thread Carsten Haese
Victor Subervi wrote: > I believe I mentioned in my first post that the "print test" does print > the exact fields being called from the referring page. Was any part of "What do the print statements actually print? Please copy and paste their output." unclear to you in any way? > Perhaps this > i

Re: Insane Problem

2009-12-03 Thread Victor Subervi
On Thu, Dec 3, 2009 at 8:02 AM, Victor Subervi wrote: > On Thu, Dec 3, 2009 at 6:07 AM, Victor Subervi wrote: > >> On Wed, Dec 2, 2009 at 4:08 PM, MRAB wrote: >> >>> Victor Subervi wrote: >>> Hi; I have spent 2-3 hours trying to track this bug. Here's the code snippet: f

Re: Declaring a class level nested class?

2009-12-03 Thread Lie Ryan
On 12/3/2009 3:55 PM, cmckenzie wrote: I can't figure out what the correct way to construct the "nested" class so it can belong to "module". which one you want? 1. The Outside's class contains a nested class class Outside(object): class Inside(object): ... 2. The Outside's class

Re: Declaring a class level nested class?

2009-12-03 Thread cmckenzie
On Dec 3, 9:59 am, cmckenzie wrote: > Sigh, I'm using Google Groups and it seems I can't see my original > post and everyone's replies. I'm really keen to reply back, so I'll > just re-post my follow up for now and make sure I don't make a habit > of this. (I'll get a news reader) Here goes: > > I

Declaring a class level nested class?

2009-12-03 Thread cmckenzie
Sigh, I'm using Google Groups and it seems I can't see my original post and everyone's replies. I'm really keen to reply back, so I'll just re-post my follow up for now and make sure I don't make a habit of this. (I'll get a news reader) Here goes: I agree, I'm C# and Java influenced, but I've got

Re: Noob thread lock question

2009-12-03 Thread Lie Ryan
On 12/4/2009 1:20 AM, Astley Le Jasper wrote: When you say don't forget about the GIL, what should I not be forgetting? I'm using sqlite and the following: I mean don't forget that when the GIL is locked, all threads (except the current one, and threads waiting on I/O) will not be able to run.

Socket question

2009-12-03 Thread perlsyntax
Is there away in python i can connect to a server in socket to two servers at the same time or can't it be done? -- http://mail.python.org/mailman/listinfo/python-list

Strange MySQL / sqlite3 Problem with unicode

2009-12-03 Thread Hans Müller
I have a strange unicode problem with mySQL and sqlite. In my application I get a table as a sqlite table which is being compared to an existing mySQL Table. The sqlite drive returns all strings from the table as a unicode string which is Ok. The mysql drive returns all strings as utf-8 coded

Re: Organization of GUIs

2009-12-03 Thread Lie Ryan
On 12/4/2009 12:44 AM, Michael Mossey wrote: I have a question about typical organization of GUIs. I will be using PyQt. Model-View-Controller (MVC) pattern. Model - all the business logic lives in the model. View - your GUI Controller - Takes input Controller notifies Model if there is user

Re: Call C program

2009-12-03 Thread Dave Angel
Patxi Bocos wrote: Hi!, I am developing a Python application and I need to call a C program which needs one parameter and it returns another one. How could I do it? Thanks :) You don't specify your python version, nor your OS. And you don't really say what state that C program is in. S

Re: How to set object parameters nicely?

2009-12-03 Thread inhahe
On Thu, Dec 3, 2009 at 9:32 AM, inhahe wrote: > On Thu, Dec 3, 2009 at 9:16 AM, Lie Ryan wrote: >> On 12/2/2009 10:26 AM, allen.fowler wrote: >>> >>> I've tried this, but have found two issues: >>> >>> 1) I can't set default values. >>> 2) I can't set required values. >>> >>> In both of the above

  1   2   >