Re: "0 in [True,False]" returns True

2005-12-12 Thread bonono
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > > but seriously, unless you're writing an introspection tool, testing for > > > bool is pretty silly. just use "if v" or "if not v", and leave the rest > > > to > > > Python. > > > > > The OP's code(and his work around) doesn't look like he i

Re: "0 in [True,False]" returns True

2005-12-12 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > > but seriously, unless you're writing an introspection tool, testing for > > bool is pretty silly. just use "if v" or "if not v", and leave the rest to > > Python. > > > The OP's code(and his work around) doesn't look like he is testing for > boolean which of course e

Re: ActivePython and Amara

2005-12-12 Thread alex23
Jay wrote: > Woah woah woah, calm your ass down a little. > > I didn't say that the "hijacker" made it go off topic. Did I? I just > said that the thread was going off topic from the dam title. We > weren't talking about XML no more now were we. They were discussing _why_ the XML module you were t

Re: newbie: generate a function based on an expression

2005-12-12 Thread Mike Meyer
"Jacob Rael" <[EMAIL PROTECTED]> writes: > Hello, > I would like write a function that I can pass an expression and a > dictionary with values. The function would return a function that > evaluates the expression on an input. For example: > > fun = genFun("A*x+off", {'A': 3.0, 'off': -0.5, 'Max': 2

Re: newbie: generate a function based on an expression

2005-12-12 Thread Michael Spencer
Jacob Rael wrote: > Hello, > > I would like write a function that I can pass an expression and a > dictionary with values. The function would return a function that > evaluates the expression on an input. For example: > > fun = genFun("A*x+off", {'A': 3.0, 'off': -0.5, 'Max': 2.0, 'Min': > -2.0}

newbie: generate a function based on an expression

2005-12-12 Thread Ezequiel, Justin
>>> def genFun(expr, locs): ... return lambda x: eval('min(Max,max(Min,%s))' % expr, locs, {'x': x}) ... >>> fun = genFun("A*x+off", {'A': 3.0, 'off': -0.5, 'Max': 2.0, 'Min': -2.0} ) >>> fun at 0x011B1470> >>> fun(0) -0.5 >>> fun(-10) -2.0 >>> fun(10) 2.0 >>> -- http://mail.python.org/mai

Re: OO in Python? ^^

2005-12-12 Thread Donn Cave
Quoth Tom Anderson <[EMAIL PROTECTED]>: ... | While we're on the subject of Haskell - if you think python's | syntactically significant whitespace is icky, have a look at Haskell's | 'layout' - i almost wet myself in terror when i saw that! That's funny. I don't think I ever bothered to acquain

Re: ActivePython and Amara

2005-12-12 Thread Jay
On that note... I would like to open up the floor again.. lol -- http://mail.python.org/mailman/listinfo/python-list

newbie: generate a function based on an expression

2005-12-12 Thread Jacob Rael
Hello, I would like write a function that I can pass an expression and a dictionary with values. The function would return a function that evaluates the expression on an input. For example: fun = genFun("A*x+off", {'A': 3.0, 'off': -0.5, 'Max': 2.0, 'Min': -2.0} ) >>> fun(0) -0.5 >>> fun(-10) -

Re: how does exception mechanism work?

2005-12-12 Thread Ben Hutchings
Tom Anderson <[EMAIL PROTECTED]> wrote: > On Mon, 12 Dec 2005, it was written: > >> [EMAIL PROTECTED] writes: >> >>> Is this model correct or wrong? Where can I read about the mechanism >>> behind exceptions? >> >> Usually you push exception handlers and "finally" clauses onto the >> activation s

Re: Using XML w/ Python...

2005-12-12 Thread Jay
ok, thx -- http://mail.python.org/mailman/listinfo/python-list

Re: ActivePython and Amara

2005-12-12 Thread Jay
Woah woah woah, calm your ass down a little. I didn't say that the "hijacker" made it go off topic. Did I? I just said that the thread was going off topic from the dam title. We weren't talking about XML no more now were we. And who the hell are you talking to thinking that I haven't researched my

Re: Using XML w/ Python...

2005-12-12 Thread uche . ogbuji
Rick, thanks. Based on your clue I checked, and it seems those Amara packages are not being built rightly. I'll look to get those packages fixed and updated tomorrow. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.nethttp://fourthought.com h

Python Graph API

2005-12-12 Thread Nathan Gilbert
Has there been any work done lately on the Python Graph API? Thanks in advance, NG -- "The life of a repoman is always intense." -- http://mail.python.org/mailman/listinfo/python-list

Re: ActivePython and Amara

2005-12-12 Thread alex23
The thread didn't go "off topic", the "hijacker" was reporting on errors with Amara's Windows installer that COULD BE RESPONSIBLE FOR THE PROBLEMS YOU ARE EXPERIENCING. If you had ANY understanding of Python, you would have realised this. Sometimes you really need to slow down and learn something

ActivePython and Amara

2005-12-12 Thread Jay
Ok, i had this posted on the other thread "XML w/ Python" but it kinda got off topic from the title to ill start a new thread. My question is this... the import of amara works in ActivePython... PythonWin 2.3.5 (#62, Feb 9 2005, 16:17:08) [MSC v.1200 32 bit (Intel)] on win32. Portions Copyright

Re: "0 in [True,False]" returns True

2005-12-12 Thread bonono
Fredrik Lundh wrote: > Pierre Quentel wrote: > > > In some program I was testing if a variable was a boolean, with this > > test : if v in [True,False] > > > > My script didn't work in some cases and I eventually found that for v = > > 0 the test returned True > > > > So I changed my test for the

Re: PythonWin troubleshooting

2005-12-12 Thread chuck
Build 205 for the win32 ext. -- http://mail.python.org/mailman/listinfo/python-list

PythonWin troubleshooting

2005-12-12 Thread chuck
Having problems with PythonWin on Windows XP SP1. Shortly after startup and trying to debug I see: LoadBarState failed - LoadBarState failed (with win32 exception!) Things go down hill quickly from there. From there I see stuff like: [Dbg]>>> Traceback (most recent call last): File "C:\Pytho

Re: Executing a python script with arguments from a python script

2005-12-12 Thread James Stroud
Larry Bates wrote: > You can pass arguments into a python script, see getopt module. > Then to call an external script you would use subsystem module > (or os.system if you are on earlier version of python). I think getopt is a little dated. Try optparse. To quote the python documentation, it is

Re: "0 in [True,False]" returns True

2005-12-12 Thread David Wahler
Pierre Quentel wrote: > Hi all, > > In some program I was testing if a variable was a boolean, with this > test : if v in [True,False] > > My script didn't work in some cases and I eventually found that for v = > 0 the test returned True > > So I changed my test for the obvious "if type(v) is bool"

Re: How to Refresh the Desktop window with python script

2005-12-12 Thread Gary Herron
[EMAIL PROTECTED] wrote: >Hi everybody > >I have couple of questions, > >1) How can i refresh my desktop window(wallpaper), using the python >script, after pasting some data on the desktop. > > The is *way* too operating system and window system dependent to answer without more knowledge. >2)

Re: Using XML w/ Python...

2005-12-12 Thread Jay
come on guys, the post isnt dead yet -- http://mail.python.org/mailman/listinfo/python-list

Re: debug 'continue' does not appear to work right

2005-12-12 Thread David Wahler
[EMAIL PROTECTED] wrote: > When I enter 'c' at the (Pdb) prompt it just goes to the next line, and > doesn't "continue" as it should. [...] > > Here's the sample output: > > S:\tmp>python epdb1.py > --Return-- > > c:\python21\lib\pdb.py(895)set_trace()->None > -> Pdb().set_trace() [...] Works for

How to Refresh the Desktop window with python script

2005-12-12 Thread muttu2244
Hi everybody I have couple of questions, 1) How can i refresh my desktop window(wallpaper), using the python script, after pasting some data on the desktop. 2) How can i run an exe file from the python 3) How can i get the information of a machine like "computer name", "mac address", "ip addres

Re: instance + classmethod question

2005-12-12 Thread Mike Meyer
Laszlo Zsolt Nagy <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>Laszlo Zsolt Nagy <[EMAIL PROTECTED]> writes: >>>Is it possible to tell, which instance was used to call the >>>classmethod that is currently running? >>Ok, I read through what got to my nntp server, and I'm still >>completely conf

Re: OO in Python? ^^

2005-12-12 Thread bonono
Tom Anderson wrote: > While we're on the subject of Haskell - if you think python's > syntactically significant whitespace is icky, have a look at Haskell's > 'layout' - i almost wet myself in terror when i saw that! > Though one doesn't need to use indentation and write everything using {} in Has

Re: OO in Python? ^^

2005-12-12 Thread Tom Anderson
On Mon, 12 Dec 2005, Donn Cave wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Alex Martelli) wrote: > >> Tom Anderson <[EMAIL PROTECTED]> wrote: >>... >> >> >>> For example, if i wrote code like this (using python syntax): >>> >>> def f(x): >>> return 1 + x >>> >>> The com

Syntax and speed

2005-12-12 Thread bearophileHUGS
ShedSkin (http://shed-skin.blogspot.com) has taught me something: simple syntax and high speed can often go together, in a computer language. This means two things: 1) A "fast language" can have a simple (python-like) syntax. For example a language fast as C++ can allow: d = {"hello":1} as a synt

Re: OO in Python? ^^

2005-12-12 Thread Tom Anderson
On Mon, 12 Dec 2005, Bengt Richter wrote: On Mon, 12 Dec 2005 01:12:26 +, Tom Anderson <[EMAIL PROTECTED]> wrote: -- ø¤º°`°º¤øø¤º°`°º¤øø¤º°`°º¤øø¤º°`°º¤ø [OT} (just taking liberties with your sig ;-) ,<@><

Re: Developing a network protocol with Python

2005-12-12 Thread Tom Anderson
On Mon, 12 Dec 2005, Laszlo Zsolt Nagy wrote: > I think to be effective, I need to use TCP_NODELAY, and manually > buffered transfers. Why? > I would like to create a general messaging object that has methods like > > sendinteger > recvinteger > sendstring > recvstring Okay. So you're really d

Re: Using XML w/ Python...

2005-12-12 Thread Jay
Suggestions maybe? -- http://mail.python.org/mailman/listinfo/python-list

Re: I want a Python Puppy !

2005-12-12 Thread Claudio Grondi
Paul Boddie wrote: > Claudio Grondi wrote: > >>I have just discovered the existance of Puppy Linux which is a complete >>operating system with a suite of GUI apps, only about 50 - 60M booting >>directly off the CDROM ( http://www.puppylinux.org ). > > > This isn't really Python-related, but I

Re: IsString

2005-12-12 Thread Larry Bates
Steven D'Aprano wrote: > On Mon, 12 Dec 2005 14:24:48 -0700, Steven Bethard wrote: > > >>Tuvas wrote: >> >>>I need a function that will tell if a given variable is a character or >>>a number. Is there a way to do this? Thanks! >> >>What's your use case? This need is incommon in Python... > > >

Re: Python is incredible!

2005-12-12 Thread Tom Anderson
On Mon, 12 Dec 2005, Tolga wrote: > I am using Common Lisp for a while and nowadays I've heard so much about > Python that finally I've decided to give it a try becuase You read reddit.com, and you want to know why they switched? > Python is not very far away from Lisp family. That's an intere

Re: Python is incredible!

2005-12-12 Thread Tom Anderson
On Mon, 12 Dec 2005, Cameron Laird wrote: > While there is indeed much to love about Lisp, please be aware > that meaningful AI work has already been done in Python Wait - meaningful AI work has been done? ;) tom -- limited to concepts that are meta, generic, abstract and philosophical -- IEE

Re: Pattern matching with string and list

2005-12-12 Thread Tom Anderson
On Mon, 12 Dec 2005 [EMAIL PROTECTED] wrote: > I'd need to perform simple pattern matching within a string using a list > of possible patterns. For example, I want to know if the substring > starting at position n matches any of the string I have a list, as > below: > > sentence = "the color is

Re: Executing a python script with arguments from a python script

2005-12-12 Thread Larry Bates
You can pass arguments into a python script, see getopt module. Then to call an external script you would use subsystem module (or os.system if you are on earlier version of python). If you can, just make the other python program into a function and import it as James Stroud suggests in a separate

Re: "0 in [True,False]" returns True

2005-12-12 Thread Steven Bethard
Pierre Quentel wrote: > In some program I was testing if a variable was a boolean, with this > test : if v in [True,False] > > My script didn't work in some cases and I eventually found that for v = > 0 the test returned True This seems like a strange test. What is this code trying to do? If

Re: IsString

2005-12-12 Thread Steven Bethard
Steven D'Aprano wrote: > Judging by the tone of the original poster's question, I'd say for sure he > is an utter Python newbie, probably a newbie in programming in general, > so I bet that what (s)he really wants is something like this: > > somefunction("6") > -> It is a number. > > somefunction

Re: I want a Python Puppy !

2005-12-12 Thread Claudio Grondi
Diez B. Roggisch wrote: > Claudio Grondi schrieb: > >> I have just discovered the existance of Puppy Linux which is a >> complete operating system with a suite of GUI apps, only about 50 - >> 60M booting directly off the CDROM ( http://www.puppylinux.org ). >> >> This approach appears to me ve

Re: how does exception mechanism work?

2005-12-12 Thread Tom Anderson
On Mon, 12 Dec 2005, it was written: > [EMAIL PROTECTED] writes: > >> Is this model correct or wrong? Where can I read about the mechanism >> behind exceptions? > > Usually you push exception handlers and "finally" clauses onto the > activation stack like you push return addresses for function c

Re: Python is incredible!

2005-12-12 Thread Xavier Morel
Luis M. Gonzalez wrote: > You are not the first lisper who fell inlove with Python... > Check this out: > http://www.paulgraham.com/articles.html > Paul Graham is not in love with Python though, he's still very much in love with Lisp. He merely admits being unfaithful to Lisp from time to time (

Re: Pattern matching with string and list

2005-12-12 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > Hi, > > I'd need to perform simple pattern matching within a string using a > list of possible patterns. For example, I want to know if the substring > starting at position n matches any of the string I have a list, as > below: > > sentence = "the color is $red" > patte

Re: Executing a python script with arguments from a python script

2005-12-12 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hi, > > I need to call a python script, with command line arguments (it is an > autonomous script with a __main__), from within another python script. > Can I use exec() or execfile() for this? How to pass the arguments? > > Thanks, > > Olivier. > Obligatory "ugh."

Executing a python script with arguments from a python script

2005-12-12 Thread olaufr
Hi, I need to call a python script, with command line arguments (it is an autonomous script with a __main__), from within another python script. Can I use exec() or execfile() for this? How to pass the arguments? Thanks, Olivier. -- http://mail.python.org/mailman/listinfo/python-list

Pattern matching with string and list

2005-12-12 Thread olaufr
Hi, I'd need to perform simple pattern matching within a string using a list of possible patterns. For example, I want to know if the substring starting at position n matches any of the string I have a list, as below: sentence = "the color is $red" patterns = ["blue","red","yellow"] pos = sentenc

Re: Using XML w/ Python...

2005-12-12 Thread Jay
you might be on to something >>> from amara import domtools >>> print domtools.__file__ C:\Python23\lib\site-packages\amara\domtools.pyc >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: executing a system command from my Python app

2005-12-12 Thread James Stroud
Dan M wrote: > I'm writing a Python replacement for a particularly ugly shell script. we > are running mimedefang on our mail server, moving spam and virus messages > to a quarantine directory. This little python script successfully chdir's > to the quarantine directory, identifies all of the quara

Re: Newbie: executing a system command from my Python app

2005-12-12 Thread Dan M
On Mon, 12 Dec 2005 13:25:14 -0800, Dan M wrote: > I'm writing a Python replacement for a particularly ugly shell script. we > are running mimedefang on our mail server, moving spam and virus messages > to a quarantine directory. This little python script successfully chdir's > to the quarantine d

Re: I want a Python Puppy !

2005-12-12 Thread Paul Boddie
Claudio Grondi wrote: > I have just discovered the existance of Puppy Linux which is a complete > operating system with a suite of GUI apps, only about 50 - 60M booting > directly off the CDROM ( http://www.puppylinux.org ). This isn't really Python-related, but I thought that Puppy Linux would

Re: IsString

2005-12-12 Thread Steven D'Aprano
On Mon, 12 Dec 2005 14:24:48 -0700, Steven Bethard wrote: > Tuvas wrote: >> I need a function that will tell if a given variable is a character or >> a number. Is there a way to do this? Thanks! > > What's your use case? This need is incommon in Python... No offense to the four or five helpful

Re: I want a Python Puppy !

2005-12-12 Thread Diez B. Roggisch
Claudio Grondi schrieb: > I have just discovered the existance of Puppy Linux which is a complete > operating system with a suite of GUI apps, only about 50 - 60M booting > directly off the CDROM ( http://www.puppylinux.org ). > > This approach appears to me very Pythonic, so it were a nice th

Re: Using XML w/ Python...

2005-12-12 Thread uche . ogbuji
""" But anyway, i get this... >>> import amara >>>from amara import domtools >>> print domtools.py Traceback (most recent call last): File "", line 1, in ? NameError: name 'domtools' is not defined """ Sheesh! That right after waking up. And it shows :-) Should have been "print domtools.__fi

Re: Another newbie question

2005-12-12 Thread John J. Lee
Steve Holden <[EMAIL PROTECTED]> writes: [...] > The "Law" of Demeter isn't about *how* you access objects, it's about > what interfaces to objects you can "legally" manipulate without undue > instability across refactoring. In other words, it's about semantics, > not syntax. And it's led a lot

Re: Using XML w/ Python...

2005-12-12 Thread Jay
Umm, yea, u definatly hijacked my thread. If you didnt mean to then dont But anyway, i get this... >>> import amara >>>from amara import domtools >>> print domtools.py Traceback (most recent call last): File "", line 1, in ? NameError: name 'domtools' is not defined >>> suggestions? -- h

Re: debug 'continue' does not appear to work right

2005-12-12 Thread newsposter
I was running the above from the command-line, but when I run the program within IDLE, 'c', continue, works as it should. -Chris -- http://mail.python.org/mailman/listinfo/python-list

I want a Python Puppy !

2005-12-12 Thread Claudio Grondi
I have just discovered the existance of Puppy Linux which is a complete operating system with a suite of GUI apps, only about 50 - 60M booting directly off the CDROM ( http://www.puppylinux.org ). This approach appears to me very Pythonic, so it were a nice thing to have a full featured Puppy

debug 'continue' does not appear to work right

2005-12-12 Thread newsposter
When I enter 'c' at the (Pdb) prompt it just goes to the next line, and doesn't "continue" as it should. Here's the sample program: # epdb1.py -- experiment with the Python debugger, pdb import pdb a = "aaa" pdb.set_trace() b = "bbb" c = "ccc" final = a + b + c print final Here's the sample outp

Re: Python is incredible!

2005-12-12 Thread Tolga
I cannot remember where was it, but I saw a sentence in the Internet: "When programming, programmers spend more time for reading than writing". This is definitely true. We don't only read others' code but we also read our code again and again and again. Thus, a language which is easier to read can

Re: "0 in [True,False]" returns True

2005-12-12 Thread Carsten Haese
On Mon, 2005-12-12 at 16:26, Pierre Quentel wrote: > Hi all, > > In some program I was testing if a variable was a boolean, with this > test : if v in [True,False] > > My script didn't work in some cases and I eventually found that for v = > 0 the test returned True > > So I changed my test fo

Re: "0 in [True,False]" returns True

2005-12-12 Thread Fredrik Lundh
Pierre Quentel wrote: > In some program I was testing if a variable was a boolean, with this > test : if v in [True,False] > > My script didn't work in some cases and I eventually found that for v = > 0 the test returned True > > So I changed my test for the obvious "if type(v) is bool", but I sti

"0 in [True,False]" returns True

2005-12-12 Thread Pierre Quentel
Hi all, In some program I was testing if a variable was a boolean, with this test : if v in [True,False] My script didn't work in some cases and I eventually found that for v = 0 the test returned True So I changed my test for the obvious "if type(v) is bool", but I still find it confusing th

Re: IsString

2005-12-12 Thread Steven Bethard
Tuvas wrote: > I need a function that will tell if a given variable is a character or > a number. Is there a way to do this? Thanks! What's your use case? This need is incommon in Python... STeVe -- http://mail.python.org/mailman/listinfo/python-list

Newbie: executing a system command from my Python app

2005-12-12 Thread Dan M
I'm writing a Python replacement for a particularly ugly shell script. we are running mimedefang on our mail server, moving spam and virus messages to a quarantine directory. This little python script successfully chdir's to the quarantine directory, identifies all of the quarantine subdirectories

Problem with auto-selection in wx masked control

2005-12-12 Thread jean-michel bain-cornu
Hi all, I'm trying to get the whole field selected when the caret arrives into a wx masked control. This is perfectly done with the program below. But if I comment out the line "r= dlg.ShowModal()", I get something different : the data within the field is no more correctly selected. Why ? And is

ASD Project and python integration

2005-12-12 Thread GRios
Hey folks, some time ago i started searching the web for some tools i would like to have at my disposal. I found some high quality examples, but there was always something i disliked, for instance licensing terms. Then i started my own one. I would like to share them with the comunity. It is comp

Rpy: displaying multivariate data with pairs() and coplot()

2005-12-12 Thread malv
Did anybody manage to use pairs() or coplot() from python using the rpy module? In fact any information going a bit beyond Tim Churches' very useful examples on plot() usage in rpy would be highly welcome. Thx. malv -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is incredible!

2005-12-12 Thread Fredrik Lundh
"Tolga" wrote: > Let's suppose that I actually want to leave Lisp totally but what about > AI sources? Most of them are based on Lisp. Oh yes, yes, I know, one > may study AI with any language, even with BASIC, but nearly all > important AI books start with a short Lisp intro. They say that "you d

Re: Developing a network protocol with Python

2005-12-12 Thread Diez B. Roggisch
> Am I on the right way to develop a new protocol? > Are there any common mistakes that programmers do? > Is there a howto where I can read more about this? If you _must_ develop your own protocol, use at least twisted. But I'd go for an existing solutions out there - namely pyro. No need to inve

Re: sql using characters like é and ã

2005-12-12 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hello, I am switching from VB to python. > I managed to crank my files into a sqlite > dbase, converting the original names to > unicode with s=unicode(s,"latin-1"). > Everything is working fine, but when > I query the dbase with dbapi2 and want > to retrieve names this

Rpy: displaying multivariate data with pairs() and coplot()

2005-12-12 Thread malv
Did anybody manage to use pairs() or coplot() from python using the rpy module? In fact any information going a bit beyond Tim Churches' very useful examples on plot() usage in rpy would be highly welcome. Thx. malv -- http://mail.python.org/mailman/listinfo/python-list

sql using characters like é and ã

2005-12-12 Thread tjerk
Hello, I am switching from VB to python. I managed to crank my files into a sqlite dbase, converting the original names to unicode with s=unicode(s,"latin-1"). Everything is working fine, but when I query the dbase with dbapi2 and want to retrieve names this way: 'Select * from table where name lik

Re: Proposal: Inline Import

2005-12-12 Thread adam
When I'm feeling too lazy to do imports while moving large blocks of code, I use this little hack. It lets me proceed with checking whether the move does what I wanted and at the end I fix the imports and remove the try/except wrapper. I think it would achieve your desired result and not have an im

Re: Problem with Lexical Scope

2005-12-12 Thread Bengt Richter
On 12 Dec 2005 01:23:48 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >Thanks for the example code. Definately provided a few different ways >of doing the construction. > >Actually, the status variable was the only thing that mattered for the >inner function. The first code post had a bug

Re: How does Scons compare to distutils?

2005-12-12 Thread Robert Kern
John J. Lee wrote: > I imagine scons has some support for > distutils. Not really, no. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: no arguments expected

2005-12-12 Thread shawn a
thanks for all your input. Ive gotten it to work thanks! --shawn On 12/12/05, Steve Holden <[EMAIL PROTECTED]> wrote: > Dennis Lee Bieber wrote: > > On Sun, 11 Dec 2005 22:00:55 -0500, shawn a <[EMAIL PROTECTED]> > > declaimed the following in comp.lang.python: > > > > > >>I havet these 2 files i

Re: IsString

2005-12-12 Thread Larry Bates
Tuvas wrote: > I need a function that will tell if a given variable is a character or > a number. Is there a way to do this? Thanks! > You can test the type of the object as follows: >>> a='abc' >>> isinstance(a, str) True >>> isinstance(a, (list, tuple)) False >>> The old way was to use type(a),

Re: mxODBC argv sql query

2005-12-12 Thread Steve Holden
BartlebyScrivener wrote: > This can't be the most elegant way to get a command line parameter into > an sql query. It works but I can't explain why. Is there another, more > correct way? Here sys.argv[1] is a topic like "laugher" or "technology" > > import mx.ODBC.Windows as odbc > import sys > >

Re: IsString

2005-12-12 Thread Peter Decker
On 12 Dec 2005 08:26:06 -0800, Tuvas <[EMAIL PROTECTED]> wrote: > I need a function that will tell if a given variable is a character or > a number. Is there a way to do this? Thanks! Use isinstance(). e.g.: x = 7 isinstance(x, int) -> True isinstance(x, basestring) -> False x = "Hello" isinstan

Re: Newbie - BigInt

2005-12-12 Thread Jim Steil
Found my answer. x = 1L sets x to 1 and makes it a type of Long.  I tested with my web service and it works.     -Jim Jim Steil VP of Application Development CustomCall Data Systems (608) 274-3009 x286 Fredrik Lundh wrote: Jim Steil wrote I am trying to call a SOAP web

Re: Help: how to run python applications as NT service?

2005-12-12 Thread Larry Bates
zxo102 wrote: > Hi there, > I have a python application (many python scripts) and I start the > application like this > > python myServer.py start > > in window. It is running in dos window. Now I would like to put it in > background as NT service. I got a example code: SmallestService.py fro

Re: How does Scons compare to distutils?

2005-12-12 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > How does Scons compare to distutils? Should I ignore > it or move to it? [...] Yes. Seriously, what are you doing? distutils seems pretty ubiquitous when building Python extensions, since it has special knowledge of the Python with which it is

Developing a network protocol with Python

2005-12-12 Thread Laszlo Zsolt Nagy
Hello, I would like to develop a new network protocol, where the server and the clients are Python programs. I think to be effective, I need to use TCP_NODELAY, and manually buffered transfers. I would like to create a general messaging object that has methods like sendinteger recvinteger se

Re: Documentation suggestions

2005-12-12 Thread A.M. Kuchling
On Sat, 10 Dec 2005 11:45:12 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> to make it better. Maybe it could be "'', from '' >> by ". Then the text for your file would be "'The zlib module', >> from '(the eff-bot guide to) The Standard Python Library' by Fredrik Lundh." > > that sh

Re: making fractals in python

2005-12-12 Thread Ernst Noch
evil_daffid wrote: > hi, > Im reseaching fractals, and how to make them in python using recursion. > I've written a bit of code to make the koch isalnd but something isn't > right, I have the basic shape but there's something wrong with the > recursion i've used, could someone help me. > > Her

allow_none=True in SimpleXMLRPCServer

2005-12-12 Thread Daniel Crespo
Hello, Does anyone know which methods do I have to override for allowing Nones to be accepted and sended from SimpleXMLRPCServer to the client? Thanks Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie - BigInt

2005-12-12 Thread Jim Steil
SOAPpy     -Jim Jim Steil VP of Application Development CustomCall Data Systems (608) 274-3009 x286 Fredrik Lundh wrote: Jim Steil wrote I am trying to call a SOAP web service with python and I having success unless I need to pass a BigInteger parameter. Since python is dyn

Re: namespace in Python?

2005-12-12 Thread Heiko Wundram
Carl wrote: > What is the equivalent of a C++ (or C#) namespace in Python? Your best bet will be modules: --- a.py def test(): print "I am test() from a.py" b.py import a a.test() --- They are no direct match to C++-namespaces though, as the namespace doesn't show up in the s

Re: namespace in Python?

2005-12-12 Thread Fredrik Lundh
"Carl" <[EMAIL PROTECTED]> wrote: > What is the equivalent of a C++ (or C#) namespace in Python? modules and packages: http://docs.python.org/tut/node8.html -- http://mail.python.org/mailman/listinfo/python-list

Re: simple question on optional parameters

2005-12-12 Thread D H
[EMAIL PROTECTED] wrote: > I am using a toolkit that has a SetFaveNumbers() method. the method > accepts any number > of comma-separated numbers. > > the following are all valid examples: > > FooToolkit.SetFaveNumbers(1,3,5) > FooToolkit.SetFaveNumbers(2,4,6,8,10) > FooToolkit.SetFaveNumbers(1) >

Re: simple question on optional parameters

2005-12-12 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am using a toolkit that has a SetFaveNumbers() method. the method > accepts any number of comma-separated numbers. any number of arguments, that is. > the following are all valid examples: > > FooToolkit.SetFaveNumbers(1,3,5) > FooToolkit.SetFaveNumbers(2,4,6,8,10) >

Re: Python is incredible!

2005-12-12 Thread Tolga
Oh, Mr(s) Laird, you've indicated to a very important thing for me: Let's suppose that I actually want to leave Lisp totally but what about AI sources? Most of them are based on Lisp. Oh yes, yes, I know, one may study AI with any language, even with BASIC, but nearly all important AI books start

Re: Another newbie question

2005-12-12 Thread james . moughan
Mike Meyer wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > Mike Meyer <[EMAIL PROTECTED]> wrote: > >> > "In addition to the full set of methods which operate on the coordinate > >> > as > >> > a whole, you can operate on the individual ordinates via instance.x and > >> > instance.y which a

namespace in Python?

2005-12-12 Thread Carl
What is the equivalent of a C++ (or C#) namespace in Python? Yours /Carl -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is incredible!

2005-12-12 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Tolga <[EMAIL PROTECTED]> wrote: . . . >Actually I loved Lisp and still don't want to throw it away beacuse of >my interest of artificial intelligence, but using Python is not >programming, it IS

mxODBC argv sql query

2005-12-12 Thread BartlebyScrivener
This can't be the most elegant way to get a command line parameter into an sql query. It works but I can't explain why. Is there another, more correct way? Here sys.argv[1] is a topic like "laugher" or "technology" import mx.ODBC.Windows as odbc import sys driv='DRIVER={Microsoft Access Driver (*

simple question on optional parameters

2005-12-12 Thread scooterm
I am using a toolkit that has a SetFaveNumbers() method. the method accepts any number of comma-separated numbers. the following are all valid examples: FooToolkit.SetFaveNumbers(1,3,5) FooToolkit.SetFaveNumbers(2,4,6,8,10) FooToolkit.SetFaveNumbers(1) I do not know how this method is implemente

Re: Newbie - BigInt

2005-12-12 Thread Fredrik Lundh
Jim Steil wrote > I am trying to call a SOAP web service with python and I having success > unless I need to pass a BigInteger parameter. Since python is > dynamically typed it seems to be sending a regular int instead of > BigInteger and my web service doesn't like that. Is there a way for me >

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-12 Thread gene tani
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, JohnBMudd > wrote: > > > Python could take over the programming world except one of it's best > > features (scope by indent) is a primary reason why it never will. It's > > not flexible enough. A large percentage of programmers won't even

  1   2   >