Re: How do I dynamically create functions without lambda?

2006-02-02 Thread Terry Hancock
On Thu, 2 Feb 2006 20:05:14 -0800 [EMAIL PROTECTED] (Alex Martelli) wrote: > Benji York <[EMAIL PROTECTED]> wrote: > > Alex Martelli wrote: > > > Disagree -- far more people THINK they're clever, than > > > really ARE clever. According to a recent article in > > > the Financial Times, over 40% of

Re: Calling a string as a function.

2006-02-02 Thread Terry Hancock
On Thu, 2 Feb 2006 22:10:22 -0700 <[EMAIL PROTECTED]> wrote: > I'm completely new to python, so sorry for my ignorence. > How does one go about converting a string, for instants > one received through tcp, into something that can be > called as a function? I'm trying to have what the user > sends t

Re: would it be feasable to write python DJing software

2006-02-02 Thread Terry Hancock
On Fri, 03 Feb 2006 02:35:56 +0100 Ivan Voras <[EMAIL PROTECTED]> wrote: > Levi Campbell wrote: > > Hi, I'm thinking about writing a system for DJing in > > python, but I'm not sure if Python is fast enough to > > handle the realtime audio needed for DJing > > Any and all mixing would probably hap

Re: Another try at Python's selfishness

2006-02-02 Thread Terry Hancock
On Thu, 02 Feb 2006 19:27:55 -0600 DH <[EMAIL PROTECTED]> wrote: > But I think most people who don't like the extraneous > 'self' in python just consider it a minor inconvenience > and don't even notice it after using python for a while. After messing around with Javascript (many magical variab

Re: Calling a string as a function.

2006-02-02 Thread Raymond Hettinger
[EMAIL PROTECTED] wrote: > I'm completely new to python, so sorry for my ignorence. > How does one go about converting a string, for instants one received through > tcp, into something that can be called as a function? > I'm trying to have what the user sends to the computer through the network, >

Re: Calling a string as a function.

2006-02-02 Thread Grant Edwards
On 2006-02-03, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: > How does one go about converting a string, for instants one received through > tcp, into something that can be called as a function? http://groups.google.com/group/comp.lang.python/browse_thread/thread/6735f7e30fffb077 -- http://ma

Calling a string as a function.

2006-02-02 Thread brandon.mcginty
I'm completely new to python, so sorry for my ignorence. How does one go about converting a string, for instants one received through tcp, into something that can be called as a function? I'm trying to have what the user sends to the computer through the network, run as a function. If the user send

Re: How do I dynamically create functions without lambda?

2006-02-02 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > Now Lisp (or Haskell, etc) I could easily see. But why should Python > tend to correlate with "high skill", when, as you point out, it's in > fact _simpler_?! My current working hypothesis: Python has never been > marketed and hyped the way Java and C#

Re: VB to Python migration

2006-02-02 Thread drewdr
On Fri, 27 Jan 2006 23:48:51 GMT, Josh <[EMAIL PROTECTED]> wrote: >We have a program written in VB6 (over 100,000 lines of code and 230 UI >screens) that we want to get out of VB and into a better language. The >program is over 10 years old and has already been ported from VB3 to >VB6, a job wh

Re: Another try at Python's selfishness

2006-02-02 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Definitely looks interesting. I'd like it more if it was more explicit, > but still, it does look nice. > > I guess you could make it recursion-safe if you saved/restored the > global "__" variable before/after calling the actual functio

Re: How do I dynamically create functions without lambda?

2006-02-02 Thread Alex Martelli
Benji York <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > Disagree -- far more people THINK they're clever, than really ARE > > clever. According to a recent article in the Financial Times, over 40% > > of a typical financial firm's employees firmly believe they are among > > the 5% best e

Re: How do I dynamically create functions without lambda?

2006-02-02 Thread Alex Martelli
Alan Morgan <[EMAIL PROTECTED]> wrote: ... > >> Since there are a lot more stupid people than clever people out there I > >> think the more likely scenario is having to maintain unmaintainable code > >> written by a complete idiot whose programming knowledge comes solely from > >> books whose ti

Re: learning python, using string help

2006-02-02 Thread [EMAIL PROTECTED]
silly newbie mistake your code runs fine on my openbsd box. ( I didnt uncomment the return map(...) line thanks for the awesome example! --mike -- http://mail.python.org/mailman/listinfo/python-list

Re: OS.MKDIR( ) Overwriting previous folder created...

2006-02-02 Thread Jeffrey Schwab
Ernesto wrote: > I couldn't find this with a search, but isn't there a way to overwrite > a previous folder (or at least not perform osmkdir( ) if your program > detects it already exists). Thanks ! Would something like this help? import os def failsafe_mkdir(dirname): try: os.mkdir

Re: would it be feasable to write python DJing software

2006-02-02 Thread Ivan Voras
Levi Campbell wrote: > Hi, I'm thinking about writing a system for DJing in python, but I'm > not sure if Python is fast enough to handle the realtime audio needed > for DJing, could a guru shed some light on this subject and tell me if > this is doable or if I'm out of my fscking mind? Any and al

Re: learning python, using string help

2006-02-02 Thread [EMAIL PROTECTED]
Tom, the script you referenced me errored ... But I will see if I can get it working. -- http://mail.python.org/mailman/listinfo/python-list

HTMLDocument and Xpath

2006-02-02 Thread swilson
Hi, I want to use xpath to scrape info from a website using pyXML but I keep getting no results. For example, in the following, I want to return the text "Element1" I can't get xpath to return anything at all. What's wrong with this code? from xml.dom.ext.reader import HtmlL

Re: Another try at Python's selfishness

2006-02-02 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > >write(sys.stdin, split(read(open(file, 'r')))[0]) > > So, if I got you right, the interpreter would have to interpret this > line like this: > 1. Evaluate the first parameter of the first function (sys.stdin) > 2. Look up the attribu

Re: Another try at Python's selfishness

2006-02-02 Thread DH
[EMAIL PROTECTED] wrote: > Having read previous discussions on python-dev I think I'm not the only > Python programmer who doesn't particularly like python's "self" > parameter: > > class Foo: > def bar(self, a,b): > return a+b > Foo().bar(1,2) => 3 > > The main reason

Re: OO conventions

2006-02-02 Thread Blair P. Houghton
Image would be a superclass to JPGImage, BMPImage, PNGImage, etc... But which to use could only be determined AFTER opening the file, because "file.jpg" doesn't have type JPG, it has type string and semantic value "maybe a jpeg file or maybe something misnamed as a jpeg file". So Image.open(filen

Re: Another try at Python's selfishness

2006-02-02 Thread n . estner
Definitely looks interesting. I'd like it more if it was more explicit, but still, it does look nice. I guess you could make it recursion-safe if you saved/restored the global "__" variable before/after calling the actual function, and probably there's a way to make it thread-safe, too. But how wo

Re: Another try at Python's selfishness

2006-02-02 Thread n . estner
>write(sys.stdin, split(read(open(file, 'r')))[0]) So, if I got you right, the interpreter would have to interpret this line like this: 1. Evaluate the first parameter of the first function (sys.stdin) 2. Look up the attribute "write" in this object 3. evaluate the first parameter of the split

Re: would it be feasable to write python DJing software

2006-02-02 Thread Farshid Lashkari
Levi Campbell wrote: > Hi, I'm thinking about writing a system for DJing in python, but I'm > not sure if Python is fast enough to handle the realtime audio needed > for DJing, could a guru shed some light on this subject and tell me if > this is doable or if I'm out of my fscking mind? > What do

would it be feasable to write python DJing software

2006-02-02 Thread Levi Campbell
Hi, I'm thinking about writing a system for DJing in python, but I'm not sure if Python is fast enough to handle the realtime audio needed for DJing, could a guru shed some light on this subject and tell me if this is doable or if I'm out of my fscking mind? -- http://mail.python.org/mailman/list

Re: learning python, using string help

2006-02-02 Thread [EMAIL PROTECTED]
thanks tom, I am running OpenBSD, NetBSD as well as OS X (FreeBSD) My first python script #!/usr/local/bin/python print "Content-type:text/html\n\n"; import os, string getrup = os.popen('ruptime').read() show = getrup.splitlines() for line in show: if line.find("up" or "down"):

Re: learning python, using string help

2006-02-02 Thread Tom Anderson
On Thu, 2 Feb 2006, [EMAIL PROTECTED] wrote: > Well, I did want to add some formatting for example I getcha. This is really an HTML problem rather than a python problem, isn't it? What you need to do is output a table. FWIW, here's how i'd do it (assuming you've got HP-UX ruptime, since that's

Re: Another try at Python's selfishness

2006-02-02 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Having read previous discussions on python-dev I think I'm not the only > Python programmer who doesn't particularly like python's "self" > parameter: > How about this decorator-based approach (still need to pick *some* name for self, I

Re: beta.python.org content

2006-02-02 Thread Aahz
In article <[EMAIL PROTECTED]>, A.M. Kuchling <[EMAIL PROTECTED]> wrote: >On 27 Jan 2006 08:08:58 -0800, > Michael Tobis <[EMAIL PROTECTED]> wrote: >> >> What about some permutation of the PyCon logo? It is really quite >> brilliant. >> >> http://www.python.org/pycon/2006/logo.png >> >> Kud

Re: Control if a input text is IP

2006-02-02 Thread Sbaush
thanks!! your ipcheck is perfect fo me!!2006/2/3, Fredrik Lundh <[EMAIL PROTECTED]>: Sbaush wrote:> My app has in input an ip address in IPv4 notation.> is there a function that control if input is a string in IPv4 notation?here's one way to do it:def ipcheck(s):try: a, b, c, d = [chr(i

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Diez B. Roggisch
Flavio schrieb: >> Who has created these items? Obviously you, so you _can_ store the list >> of selected items. > > well yeah, but the Idea was to let the user select(through the widget) > a subset of the original list and then access that subset... > >> Or you use the equally well documented QL

Control if a input text is IP

2006-02-02 Thread Sbaush
Hi all.My app has in input an ip address in IPv4 notation. is there a function that control if input is a string in IPv4 notation?Thanks all.bye-- Sbaush -- http://mail.python.org/mailman/listinfo/python-list

Re: Another try at Python's selfishness

2006-02-02 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Having read previous discussions on python-dev I think I'm not the only > Python programmer who doesn't particularly like python's "self" > parameter: > > class Foo: > def bar(self, a,b): > return a+b > Foo().

Re: locals() and dictionaries

2006-02-02 Thread Kent Johnson
JerryB wrote: > Rocco: > thanks for your response. The examples were just made up. I don't > normally use 'dict' and 'str'. > I know I can create a dictionary with the variables I want, etc. My > question is not how to solve the problem, or how to come up with a > work-around (I'm getting pretty go

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Flavio
> Who has created these items? Obviously you, so you _can_ store the list > of selected items. well yeah, but the Idea was to let the user select(through the widget) a subset of the original list and then access that subset... > Or you use the equally well documented QListViewItemIterator to trav

Re: beta.python.org content

2006-02-02 Thread Ph.T
On 2/2/06, Michael Sparks <[EMAIL PROTECTED]> wrote:    [1] NB: I **really** wouldn't go to python.com, I REALLY wasn'texpecting that (REALLY) . I wouldn't even p y t h o n . c o m -- gmail keeps throwing these into the spam bucket .-- American Dream Documentshttp://www.geocities.com/a

Re: Windows - create text file - (newb)

2006-02-02 Thread Ernesto
got it . thanks tons. i'm doing the tutorial now. -- http://mail.python.org/mailman/listinfo/python-list

Another try at Python's selfishness

2006-02-02 Thread n . estner
Having read previous discussions on python-dev I think I'm not the only Python programmer who doesn't particularly like python's "self" parameter: class Foo: def bar(self, a,b): return a+b Foo().bar(1,2) => 3 The main reason (at least for me) is that there's simply too

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Phil Thompson
On Thursday 02 February 2006 9:25 pm, Fabian Steiner wrote: > Hi! > > Sorry for adopting your post for my own question, but since it is > related to PyQT I think it's ok: Does anybody of you know where the > openbook »GUI Programming with Python: QT Edition« has gone? It's not > available any more:

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Diez B. Roggisch
Flavio schrieb: > Iterating over the items and checking if it is selected, sounds like a > good idea, but there no obvious way to get a hold of the list of > items!! The only way you can get an item is if you are in single > selection mode and you call selectedItem(). But I have to use multiple >

Re: OS.MKDIR( ) Overwriting previous folder created...

2006-02-02 Thread Larry Bates
try os.path.exists(path) -Larry Bates Ernesto wrote: > Ernesto wrote: >> I couldn't find this with a search, but isn't there a way to overwrite >> a previous folder (or at least not perform osmkdir( ) if your program >> detects it already exists). Thanks ! > > I suppose this also leads to the q

Re: OS.MKDIR( ) Overwriting previous folder created...

2006-02-02 Thread Ernesto
NEVERMIND ! Here is the solution... # if (os.path.isdir("C:\\MyNewFolder") == 0): os.mkdir("C:\\MyNewFolder") # - thanks -- http://mail.python.org/mailman/li

Re: Windows - create text file - (newb)

2006-02-02 Thread epost2
Yes. You could do: Python 2.4.2 (#2, Sep 30 2005, 21:19:01) [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> fileobj=open('~\myfile.txt','w') >>> fileobj.write("test") >>> fileobj.close() On Windows, for

Re: Windows - create text file - (newb)

2006-02-02 Thread Larry Bates
Yes. To open file: fp=open(r'C:\directory\filename.txt','r') To open file to write to: fp=open(r'C:\directory\filename.txt','w') You probably need to go through the Python tutorial as these items are covered. -Larry Bates Ernesto wrote: > Can Python be used to create (and/or open, read, a

Re: Windows - create text file - (newb)

2006-02-02 Thread Jorge Godoy
"Ernesto" <[EMAIL PROTECTED]> writes: > Can Python be used to create (and/or open, read, and write) a text file > in Windows (if the path is known) ? Yes. -- Jorge Godoy <[EMAIL PROTECTED]> "Quidquid latine dictum sit, altum sonatur." - Qualquer coisa dita em latim soa profundo. - Anythin

Re: OS.MKDIR( ) Overwriting previous folder created...

2006-02-02 Thread Ernesto
Ernesto wrote: > I couldn't find this with a search, but isn't there a way to overwrite > a previous folder (or at least not perform osmkdir( ) if your program > detects it already exists). Thanks ! I suppose this also leads to the question of: "Is there a way to determine if a path exists or n

Windows - create text file - (newb)

2006-02-02 Thread Ernesto
Can Python be used to create (and/or open, read, and write) a text file in Windows (if the path is known) ? -- http://mail.python.org/mailman/listinfo/python-list

Collecting snmp data - threads, processes, twisted?

2006-02-02 Thread Antal Rutz
Hi all, I'd like to collect snmp data from varoius network devices parallel. First I tried with my own threadpool class then I gave a try to Christopher Arndt's threadpool.py (http://chrisarndt.de/en/software/python/threadpool.html). I got the same result: with one thread it finished about 2 min

Collecting snmp data - threads, processes, twisted?

2006-02-02 Thread Antal Rutz
Hi all, I'd like to collect snmp data from varoius network devices parallel. First I tried with my own threadpool class then I gave a try to Christopher Arndt's threadpool.py (http://chrisarndt.de/en/software/python/threadpool.html). I got the same result: with one thread it finished about 2 mi

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Flavio
Iterating over the items and checking if it is selected, sounds like a good idea, but there no obvious way to get a hold of the list of items!! The only way you can get an item is if you are in single selection mode and you call selectedItem(). But I have to use multiple selection mode, for which

OS.MKDIR( ) Overwriting previous folder created...

2006-02-02 Thread Ernesto
I couldn't find this with a search, but isn't there a way to overwrite a previous folder (or at least not perform osmkdir( ) if your program detects it already exists). Thanks ! -- http://mail.python.org/mailman/listinfo/python-list

Re: classmethod and instance method

2006-02-02 Thread andychambers2002
Yes that's better. Didn't know about the __class__ attribute. I thought there must be a way to access this but couldn't find it in the docs. Thanks, Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Fabian Steiner
Hi! Sorry for adopting your post for my own question, but since it is related to PyQT I think it's ok: Does anybody of you know where the openbook »GUI Programming with Python: QT Edition« has gone? It's not available any more: http://www.opendocs.org/pyqt/ points now to a non-existing site.

Re: classmethod and instance method

2006-02-02 Thread Jean-Paul Calderone
On 2 Feb 2006 12:08:43 -0800, [EMAIL PROTECTED] wrote: >Hi, > >I'm trying to write a method that needs to know both the class name and >the instance details > >class A: > >@classmethod >def meth(cls, self): >print cls >print self > >a = A() >a.meth(a) > >The above code seem

Re: classmethod and instance method

2006-02-02 Thread Xavier Morel
[EMAIL PROTECTED] wrote: > Hi, > > I'm trying to write a method that needs to know both the class name and > the instance details > > Any suggestions? > What's the point of using a classmethod and an explicit cls argument when you can get the class object from the instance itself? >>> class

Re: Thread imbalance

2006-02-02 Thread Carl J. Van Arsdall
Tuvas wrote: > I have a program running several threads. One of them must be done > every (Specified time, usually 1 second). The whole point to having a > thread is do this. However, I've noticed the following. When there is > another part of the program that is active, this thread slips into > di

Thread imbalance

2006-02-02 Thread Tuvas
I have a program running several threads. One of them must be done every (Specified time, usually 1 second). The whole point to having a thread is do this. However, I've noticed the following. When there is another part of the program that is active, this thread slips into disuse, ei, it's only ran

Re: A class with built-in doctest feature ?

2006-02-02 Thread bearophileHUGS
The idea looks interesting, but you can also design a couple of functions that scan the docstrings of a given class and its methods to produce what you need: doctestAll(C) toHtml(C) This is probably simpler and gives similar results. Bye, bearophile -- http://mail.python.org/mailman/listinfo/p

Re: Detecting filename-encoding (on WinXP)?

2006-02-02 Thread Tim N. van der Leeuw
Hi Magnus, I get the filename from a URL, which probably is not in any kind of unicode-string but just a plain ASCII string. It should be possible to cast this to an ASCII string -- I'll try it right away to see if this works. Thanks! --Tim -- http://mail.python.org/mailman/listinfo/python-lis

classmethod and instance method

2006-02-02 Thread andychambers2002
Hi, I'm trying to write a method that needs to know both the class name and the instance details class A: @classmethod def meth(cls, self): print cls print self a = A() a.meth(a) The above code seems to work as intended. Could the same effect be achieved using a secon

Re: learning python, using string help

2006-02-02 Thread [EMAIL PROTECTED]
Well, I did want to add some formatting for example STATUS = "up" getrup = os.popen('ruptime').read() show = getrup.splitlines() gethost = show[0] hostname = gethost.split() print hostname[0] getstatus = hostname[1] if getstatus.find("STATUS"): print STATUS else: print "HOST DOWN

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Diez B. Roggisch
Flavio schrieb: > Hi, > > I have a QListview widget that allows me to store a bunch of strings in > it. This strings can be visualized, sorted, selected, etc. > > My Problem is that I cant find a way to get the user selected items > back from it! I looked over the Qt documentation many times over

[ANNOUNCE] Twenty-eighth release of PythonCAD now available

2006-02-02 Thread Art Haas
Hi. I'm pleased to announce the twenty-eighth development release of PythonCAD, a CAD package for open-source software users. As the name implies, PythonCAD is written entirely in Python. The goal of this project is to create a fully scriptable drafting program that will match and eventually excee

PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Flavio
Hi, I have a QListview widget that allows me to store a bunch of strings in it. This strings can be visualized, sorted, selected, etc. My Problem is that I cant find a way to get the user selected items back from it! I looked over the Qt documentation many times over but there is no method to tha

Re: How do I dynamically create functions without lambda?

2006-02-02 Thread Benji York
Alex Martelli wrote: > Disagree -- far more people THINK they're clever, than really ARE > clever. According to a recent article in the Financial Times, over 40% > of a typical financial firm's employees firmly believe they are among > the 5% best employees of the firm -- and the situation, believ

Re: learning python, using string help

2006-02-02 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi all, > > I have a simple snippet I am trying to keep the format the same as > plain text, though I want to embed it in html ... > > basically, > > print "Content-type:text/plain\n\n"; > getrup = os.popen('ruptime').read() > print get

learning python, using string help

2006-02-02 Thread [EMAIL PROTECTED]
hi all, I have a simple snippet I am trying to keep the format the same as plain text, though I want to embed it in html ... basically, print "Content-type:text/plain\n\n"; getrup = os.popen('ruptime').read() print getrup is the same format as if I ran 'ruptime' from the command line. If I use

Re: dynamic class instantiation

2006-02-02 Thread Ognen Duzlevski
Kent Johnson <[EMAIL PROTECTED]> wrote: > Ognen Duzlevski wrote: > > Can you suggest a better approach or did you already do that and I just > > missed > > it? :) > With the above definitions, an equivalent class is created by calling > page = classFactory( 'page', { 'name' : None, 'caption': No

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Laurent
Youpe! That work as I want Thx everybody ;) The problem was that I launched the glut main loop into a thread, and then it was separated from his initialisations functions I put it into another method and launch that method into a thread...! That work! -- http

Re: HTML parsing bug?

2006-02-02 Thread Istvan Albert
>> this is a comment in JavaScript, which is itself inside an HTML comment > Did you read the post? misread it rather ... -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic class instantiation

2006-02-02 Thread Kent Johnson
Ognen Duzlevski wrote: > Volker Grabsch <[EMAIL PROTECTED]> wrote: >>I'm sure you could replace 2/3 of your code with something much simpler >>(and shorter!) just by not inventing a new language and using the power >>of Python instead. > > > Hi Volker, > > I appreciate your comments. Basically,

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Laurent
threading.Thread(target = Scene.run).start() WORKS !!! great thx ;) now this should be better if the thread can ben declared inside the class! -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: OSCON 2006 (Python 14 Conference) Proposals due Feb. 13th

2006-02-02 Thread Kevin Altis
OSCON 2006: Opening Innovation http://conferences.oreillynet.com/os2006/ Save the date for the 8th annual O'Reilly Open Source Convention, happening July 24-28, 2006 at the Oregon Convention Center in beautiful Portland, Oregon. Call For Participation -- Submit a proposal-f

Re: Test driven programming, was Re: VB to Python migration

2006-02-02 Thread Grig Gheorghiu
Thanks for the insightful answer, Magnus. I have a lot of stuff to digest from your message :-) Maybe I'll continue the discussion on the mailing list you mentioned. Grig -- http://mail.python.org/mailman/listinfo/python-list

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Laurent
This is not a fantasm... Why this can not work?? in a thread a loop (the glut main loop) called by Scene.run() and in a second something else, e.g. function A A want to add an object in the Scene, the it call Scene.append(anObject) and in his next step, the glutmainloop will see that there is a

Re: How do I dynamically create functions without lambda?

2006-02-02 Thread Alan Morgan
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: >Alan Morgan <[EMAIL PROTECTED]> wrote: > ... >> Excessive cleverness can lead to unmaintainable code. So can excessive >> stupidity. > >+1 QOTW. import blush >> Since there are a lot more stupid people than clever people

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Diez B. Roggisch
Laurent wrote: > That is exactly what I do not want!! > > this is not transparent, I'm sure it is possible to make what I want: > Scene = ooglScene() > Scene.run() > scene.append(ooglPoint()) Well, if you know so well what you want, why don't you know how to do it? Besides: just using threads m

Re: Starting terminal applications from within python

2006-02-02 Thread sleepylight
Ah! I see now. That makes prefect sense. I guess I was thinking that python was simply going to pass a whole command string to the program rather than give each argument as individual strings. Seeing this makes the documentation seem much more sensible. Thank you! -- http://mail.python.org/m

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Jean-Paul Calderone
On 2 Feb 2006 09:29:45 -0800, Laurent <[EMAIL PROTECTED]> wrote: >That is exactly what I do not want!! > >this is not transparent, I'm sure it is possible to make what I want: >Scene = ooglScene() >Scene.run() >scene.append(ooglPoint()) Most concurrency is never even remotely transparent. Stop ch

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Laurent
That is exactly what I do not want!! this is not transparent, I'm sure it is possible to make what I want: Scene = ooglScene() Scene.run() scene.append(ooglPoint()) -- http://mail.python.org/mailman/listinfo/python-list

Re: Starting terminal applications from within python

2006-02-02 Thread Jean-Paul Calderone
On 2 Feb 2006 09:01:11 -0800, sleepylight <[EMAIL PROTECTED]> wrote: >Hi > >I'm staring to learn python for some systems administration projects >and so far this looks like a really great alternative to using shell >for everything. The python docs on the web site are really great, but >I could use

Re: VB to Python migration

2006-02-02 Thread Michael Tobis
An incremental approach and a redesign are not the same thing. It might be insurmountably difficult to acheeve both in a move to another platform. mt -- http://mail.python.org/mailman/listinfo/python-list

Starting terminal applications from within python

2006-02-02 Thread sleepylight
Hi I'm staring to learn python for some systems administration projects and so far this looks like a really great alternative to using shell for everything. The python docs on the web site are really great, but I could use come clarification on passing arguments using the os.spawnlp() function.

Re: Detecting filename-encoding (on WinXP)?

2006-02-02 Thread Magnus Lycka
Tim N. van der Leeuw wrote: > Hi, > > I have a need to store directory and filenames in a database. For the > database I chose to use UTF-8 encoding; but the actual encoding used is > probably immaterial: whichever coding I take, I'll run into this issue > eventually. > > At first my code worked

Re: OO conventions

2006-02-02 Thread Daniel Nogradi
> > > In this case, Image seems to be a python module, with the open function > > > defined, PIL's Image is not a class. > > > > > > > Thanks for the enlightening remarks, especially this last one, indeed, > > it's not a class. > > Actually, this way of creating a class instance is good OO practice

perform dynamic tasks for C/C++/ObjC programs

2006-02-02 Thread YL
I'm working on an expert system that allows dynamic updating of expert's knowledge and logics. I use database to store the info about how to evaluate user's responses to questionnaires. The core table called EvaluationPoint whose records have attributes(evaluation_point_id,questionnaire_id,pattern_

Re: webbrowser module + urls ending in .py = a security hole?

2006-02-02 Thread Blair P. Houghton
Blair P. Houghton wrote: > Which makes it no security hole at > all, it would seem... Well, no, that's a little strong. No *new* security hole, maybe. It would be on the order of having ./ in the PATH for root, and getting trapped by a hacker who named his rootkit "ls" or "pwd". I.e., it puts

Re: webbrowser module + urls ending in .py = a security hole?

2006-02-02 Thread Blair P. Houghton
Peter Hansen wrote: > It appears the correct approach might be something along the lines of > reading the registry to find what application is configured for the > "HTTP" protocol (HKCR->HTTP->shell->open->command) and run that, passing > it the URL. I think that would do what most people expect,

Re: [wxPython-users] Problem in threading

2006-02-02 Thread Josiah Carlson
My response is at the end. Sbaush <[EMAIL PROTECTED]> wrote: > Hi all. > I've a problem with thread in python. > My applications has a GUI that has some button. > I've a MVC-like architecture. > If i click on a button there is this effect: > > view.button_1_delete.Bind(EVT_BUTTON,self.OnDelete)

Re: OO conventions

2006-02-02 Thread Alex Martelli
Magnus Lycka <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >>And now, at long last, the image object actually is an image. So why make > >>this a two step process? Whatever the Image() initialization does, why > >>can't it be done automatically

Detecting filename-encoding (on WinXP)?

2006-02-02 Thread Tim N. van der Leeuw
Hi, I have a need to store directory and filenames in a database. For the database I chose to use UTF-8 encoding; but the actual encoding used is probably immaterial: whichever coding I take, I'll run into this issue eventually. At first my code worked until I ran into a directory full of Cyrilli

Re: OO conventions

2006-02-02 Thread Magnus Lycka
Alex Martelli wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >>And now, at long last, the image object actually is an image. So why make >>this a two step process? Whatever the Image() initialization does, why >>can't it be done automatically when you read the file? > > "Two-step construct" (

Re: Python vs C for a mail server

2006-02-02 Thread Randall Parker
Magnus Lycka wrote: > Or...don't you have automated tests? Ouch. If you (like me) feel a > little lazy to write a lot of test scripts, you can use a test tool > such as TextTest, that compares output between test runs, rather than > forcing you to write lots of scripts with plenty of assertions.

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Diez B. Roggisch
Laurent wrote: > Hi, > > here is the context: > > I'm coding a openGL API I will need for a project for my school. > This API is quite simple: > > an ooglScene describe all needed to make an openGL, and inherits from a > list. So an ooglScene is fundamentaly a list of ooglObjects (which is > or

Re: OO conventions

2006-02-02 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > image = Image( ) > > Now you have an "image" object. What is it? > > Answer: it isn't an image at all, not in the plain English sense. (Or if > it is, it is an arbitrary "default image" picked by the class designer.) No doubt (presumably some kind o

Problem in threading

2006-02-02 Thread Sbaush
Hi all.I've a problem with thread in python.My applications has a GUI that has some button. I've a MVC-like architecture.If i click on a button there is this effect:view.button_1_delete.Bind(EVT_BUTTON, self.OnDelete)view.button_1_list.Bind(EVT_BUTTON,self.OnList)def OnDelete(self, evt):        sel

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Laurent
Here are my codes: it doesn't use threading...! # # test_pyoogl.py # #!/usr/bin/env python from pyoogl import * import unittest class test(unittest.TestCase): def testWind

Re: cgi - secure sessions

2006-02-02 Thread Fuzzyman
GazaM wrote: > Ok, thanks for all the help guys. It seems that running this type of > script from inside of the html just isn't going to work as needed. > Seems like I'll just have to ditch the .shtml and point directly to a > cgi. This is how the other Python frameworks and sites work, such as >

Re: psycopg2

2006-02-02 Thread Matt Goodall
Jane Goldman wrote: > Hello, > > I bigginer Python programmer. I am working on web application that > access PostgreSQL on backend. After I imported PSYCOPG2 module in my > program I started to get unwanded debug output into my web bowser. It is > something like that: > > initpsycopg: initializin

Re: webbrowser module + urls ending in .py = a security hole?

2006-02-02 Thread Fuzzyman
Peter Hansen wrote: > Fuzzyman wrote: > > Blair P. Houghton wrote: > >>webbrowser.py module's handling of http:// accesses > >>is definitely different from its handling of file:// accesses. > > > > It's worth working out if this is down to webbrowser.py *or* Firefox. > > Try launching firefox wi

Re: Python vs C for a mail server

2006-02-02 Thread Magnus Lycka
Randall Parker wrote: > Magnus Lycka wrote: > >>Randall Parker wrote: >> >>>Also, compile time errors get caught sooner. They get caught before >>>tests even get written. >> >>Not if you do Test Driven Tevelopment. Then you write >>the tests before you compile your target code! It's >>also my expe

  1   2   >