Re: Sending a file to a remote server.

2006-04-03 Thread Fredrik Lundh
Jose Carlos Balderas Alberico wrote: > Hi. I posted a message in the list a couple of days ago about sending a file > to a remote SimpleXMLRPCServer. Well. my doubt still remains, so I come to > you again in search of a clearer answer. > > The thing is I want to send a ZIP file to a server, and wh

Get the input from user

2006-04-03 Thread sushant . sirsikar
hi, I am doing example of address book.when user enter stop and presses enter my loop should stop.But there is some prob in my loop.It is accepting \r after pressing Enter key.How do i check end of input : addressbook={} name = raw_input("Enter Name (stop to Finish)") name = EnterAddress

Re: Getting a list of all classes derived from a base class

2006-04-03 Thread Vijairaj
Thanks Dylan and Alex, that was a new learning for me. but both the solutions don't work in jython 2.1 is there an alternative that will work with jython2.1 -- Thanks, Vijairaj -- http://mail.python.org/mailman/listinfo/python-list

Problem with wrapping GNU Units

2006-04-03 Thread TheSeeker
Hi, As part of a larger project, I am trying to use the GNU Units program to provide unit conversions between quantities. My first iteration, which worked OK, was to simply use units as a command-line app, and capture its output. The larger program however, calls the conversion routine many times,

Re: print() in Python 3000 return value?

2006-04-03 Thread Georg Brandl
Gary Herron wrote: >>for i in sequence: >> mylist.append(print(i)) >> >> >> > No no, please NO! You *know* that someday you'll want the return value > without actually printing the text. > > So let's don't overload a single function with two operations. Let > "print" print, and propo

Re: very very basic question

2006-04-03 Thread aghazalp
WO Larry that was very very smart...it works perfectly =) -- http://mail.python.org/mailman/listinfo/python-list

Re: print() in Python 3000 return value?

2006-04-03 Thread bayerj
> Sorry? 2+2 here returns 4, and certainly should with your Python. Err. Never mind. I was thinking about assignments, like >>> x += 2 which returns None. -- http://mail.python.org/mailman/listinfo/python-list

Re: Assignment in a while?

2006-04-03 Thread Alex Martelli
none <""thulben\"@(none)"> wrote: ... > can't do an assignment in the while loop. I found a way around this > (see the commented out while loop), but it seems hackish. Assignment > within a while loop seems like a pretty standard thing, so I'm just > curious what I'm missing. I see you've

Re: Getting a list of all classes derived from a base class

2006-04-03 Thread Dylan Moreland
Alex Martelli wrote: > Vijairaj R <[EMAIL PROTECTED]> wrote: >... > > class Test: > > do not use old-style classes: they exist ONLY for backwards > compatibility. > > Make you class Test new-style: > > class Test(object): >... > > > and you can call Test.__subclasses__() to get a list of a

Re: update or refresh a Listbox widget

2006-04-03 Thread Recoruds
it might be very slow when the data is big... -- http://mail.python.org/mailman/listinfo/python-list

Re: Assignment in a while?

2006-04-03 Thread Ben Thul
The inline iterator version fits very well with my sensibilities. The problem that I have with fetchall is that sometimes you need to deal with a very large dataset. Calling fetchall() on it will put the whole thing in memory, which is no good. Better to iterate over it one row at a time, IM

Re: Python 2.5 licensing: stop this change

2006-04-03 Thread Tim Roberts
Steve Holden <[EMAIL PROTECTED]> wrote: >As the only director of the Python Software Foundation to vote against a >recent Board motion to implement the change in licensing terms described in > > http://pyfound.blogspot.com/2006/04/python-25-licensing-change.html > >I would like to place on reco

Re: wxpython in action book

2006-04-03 Thread Tim Roberts
Butternut squash <[EMAIL PROTECTED]> wrote: > >any recommendations? any opinions? > >I want to learn to program in python and need a gui reference. I'll be >updating various mysql tables. I have most of the code ready to roll by >using a command line. I need put some lipstick on my project. > >pyQT

Re: "definitive" source on advanced python?

2006-04-03 Thread Michele Simionato
I gave a course on advanced Python last year at the ACCU conference. See http://www.reportlab.org/~andy/accu2005/pyuk2005_simionato_wondersofpython.zip Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Can't detect EOF from stdin on windows console

2006-04-03 Thread Dmitry Anikin
I want to read stdin in chunks of fixed size until EOF I want to be able (also) to supply data interactively in console window and then to hit Ctrl+Z when finished So what I do is: while True: s = sys.stdin.read(chunk_size) if not s: break # do something with s if stdin is standar

How can i design a band-pass filter with scipy?

2006-04-03 Thread LabWINC
Hi all, i would like to design a high pass filter with scipy.signal module. This is the code i'm using to: import scipy.signal as signal import scipy #first of all i design the lowpass fir filter. This is a 10 taps filter with cutoff frequency =1 (as help tell me to do) lpwindow=signal.firwin(1

Re: wx.checklistbox

2006-04-03 Thread luca72
Hello Frefrik It works but sometimes it insert a blank row so the file is like: item1 item2 item3 item4 etc.. I don't inderstand why. But supposing that we can't solve this, is it possible to delete blanlk items in the checkListBox? -- http://mail.python.org/mailman/listinfo/python-list

Re: print() in Python 3000 return value?

2006-04-03 Thread Felipe Almeida Lessa
Em Dom, 2006-04-02 às 10:41 -0700, James Thiele escreveu: > Martin chimedin: > > James Thiele wrote: > > > I noticed in PEP 3000 that print will become a function. The PEP > > > references a thread where Guido explains this decision. The thread does > > > not specify what the function will return.

Re: ANN: uuid-0.1 Released

2006-04-03 Thread Lawrence D'Oliveiro
UUID = file("/proc/sys/kernel/random/uuid").readline().rstrip("\n") -- http://mail.python.org/mailman/listinfo/python-list

Re: datetime, tzinfo ... strange conversion?

2006-04-03 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Tino Lange <[EMAIL PROTECTED]> wrote: >--> Why is GMT (3) wrong? At a guess, it's because there's nothing in the parameters passed to indicate that daylight saving is currently in effect. Tip: always do your date/time calculations as far as possible in UTC. Onl

Re: Obtaining the Python Control Flow Graph

2006-04-03 Thread Carl Friedrich Bolz
Hi! [EMAIL PROTECTED] wrote: > I have been looking for a good way to convert python code into a > control flow graph. > > I know of Python functions that will convert an expression into an > abstract syntax tree (i.e. ast = parser.expr('(x+5)*5') then t = > ast.totuple() then t), but I am not sur

"definitive" source on advanced python?

2006-04-03 Thread vdrab
Hi all, Is there some sort of coherent source (dead tree format, maybe?) on some of the more advanced features of python (decorators, metaclasses, etc)? I'm sort of looking for a python book that actually gets to the good stuff at some point, without first spending 6 chapters on how to append ints

Py+SQLite or other (big output) ?

2006-04-03 Thread DurumDara
Hi ! I want to process many data with python, and want to store in database. In the prior version of my code I create a simple thing that delete the old results, recreate the database and fill up it. But that is not too flexible, because when an power supply or hardware problem occured, all o

beautiful GUI

2006-04-03 Thread Daily Lama
Hello, is there a way to create nice good-looking Form for Windows; I mean not the windows-style form, but something cute, like mac os forms with their coloured red-yellow-green buttons -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining the Python Control Flow Graph

2006-04-03 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > > I was wondering if anyone had any advice on the best way to obtain a > control flow graph. I need the control flow graph because I am trying > figure out if there is a way to bound the integer ranges and list > lengths at compile time. Although I haven't actually been

Subtle architecture-dependent bug in Numeric.RandomArray

2006-04-03 Thread Johannes Nix
There is a subtle bug in the RandomArray module, which is part of the Numeric package. It causes the random number generator RandomArray.normal() to return incorrect values when invoked on Linux compiled with gcc on a AMD Opteron machine, that is, a system with 64-Bit CPU and ILP64 data model.

[CONSTRUCT] - Removing Need For Repeated Definition of __str__

2006-04-03 Thread Ilias Lazaridis
I have some python code which looks similar to this: class Car(BaseClass) : manufacturer = factory.string() model = factory.string() modelYear = factory.integer() def __str__(self): return '%s %s %s' % (self.modelYear, self.manufacturer, self.model) def fac

Oserror: [Errno 20]

2006-04-03 Thread k r fry
Hi, I am new to this list and also programming with python. I have an error: oserror [errno 20] not a directory "katiescint.py" The piece of code causing the problem is: [code] for subdir in os.listdir(DATADIR): #loop through list of strings file=FITS.Read(DATADIR+'/'+subdir+

Re: how to comment lot of lines in python

2006-04-03 Thread Sion Arrowsmith
Eric Deveaud <[EMAIL PROTECTED]> wrote: >some moderns editors allow you to comment/uncomment a selected Bunch >of lines of code Out of curiousity, is there a modern editor which *doesn't* allow you to comment/uncomment a selected bunch of lines of code? -- \S -- [EMAIL PROTECTED] -- http://ww

Re: Py+SQLite or other (big output) ?

2006-04-03 Thread Gerhard Häring
Anonymous Coward DurumDara wrote: > [...] > So I want to use one database file - but I want to protect it. > How to do it with SQLite ? > I see that solutions: > - 1. I use transactions. > - 2. I create full copy of database after every bigger transation. > - 3. Shadow file ??? > - 4. Mirror databa

Re: Oserror: [Errno 20]

2006-04-03 Thread Peter Hansen
k r fry wrote: > Hi, I am new to this list and also programming with python. > > I have an error: oserror [errno 20] not a directory "katiescint.py" Please always post complete tracebacks, and without manually reentering the data. In most cases you'll save us and you lots of time and guessing.

Re: how to comment lot of lines in python

2006-04-03 Thread Kent Johnson
Sion Arrowsmith wrote: > Eric Deveaud <[EMAIL PROTECTED]> wrote: >> some moderns editors allow you to comment/uncomment a selected Bunch >> of lines of code > > Out of curiousity, is there a modern editor which *doesn't* allow you > to comment/uncomment a selected bunch of lines of code? > Tex

Re: Oserror: [Errno 20]

2006-04-03 Thread k r fry
Sorry for not copying the whole traceback before, I hop I have done it right this time. I am now getting: Traceback (most recent call last): File "katiescint.py", line 153, in ? for subdir in os.path.istdir(DATADIR): #loop through list of strings AttributeError: 'module' ob

Re: wx.checklistbox

2006-04-03 Thread luca72
I have solve in this way i'm sure it's not the best, but it works: lista1leggi = open('/lista1.txt', 'r') mt = lista1leggi.readlines() lunghezzamt = len(mt) lucianino = 0 while lucianino < (lunghezzamt - 1): if mt[lucianino] == '\n': del

GIS

2006-04-03 Thread Albert Leibbrandt
Hi I need to get myself familiarised with GIS, specifically postgis for postgres. Can anyone give some advice, or some docs that start at the beginning. I've tried the postgis mailing list but it does not seem as if that list is very active. Perhaps you guys know of gis packages for python? T

Re: how to comment lot of lines in python

2006-04-03 Thread Rick Zantow
Kent Johnson <[EMAIL PROTECTED]> wrote in news:44310867$1_1 @newspeer2.tds.net: > Sion Arrowsmith wrote: >> Eric Deveaud <[EMAIL PROTECTED]> wrote: >>> some moderns editors allow you to comment/uncomment a selected Bunch >>> of lines of code >> >> Out of curiousity, is there a modern editor wh

Re: Problem with wrapping GNU Units

2006-04-03 Thread Kent Johnson
TheSeeker wrote: > Hi, > As part of a larger project, I am trying to use the GNU Units program > to provide unit conversions between quantities. Maybe Unum would be a useful alternate: http://home.tiscali.be/be052320/Unum.html Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python Logo Revealed

2006-04-03 Thread robin
"Giovanni Bajo" <[EMAIL PROTECTED]> wrote: >robin wrote: > >> I have an entry on my blog discussing the new Python logo, which is >> apparently due to replace the current one within the month. I'd be >> interested in what people think of it. >> >> Surf: >> http://diagrammes-modernes.blogspot.com >

Re: DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE

2006-04-03 Thread [EMAIL PROTECTED]
I love messages like this! Just when I think I'm about the dumbest person in the World, someone comes in and sets a brand new all-time low. Good Job, Dude. But call your kickin' ~ditrabation~, "Cooty Tar", or something. That will insulate all newbies to this list from a lifetime of idiocy. You

Re: "definitive" source on advanced python?

2006-04-03 Thread Gabriel de Dietrich
Maybe you're looking for something like this? http://jamesthornton.com/eckel/TIPython/html/Index.htm Haven't read it yet, but seems to be about design patterns. Not the "definitive" stuff, though... -- http://mail.python.org/mailman/listinfo/python-list

Re: how to comment lot of lines in python

2006-04-03 Thread Frank Millman
Kent Johnson wrote: > Sion Arrowsmith wrote: > > Eric Deveaud <[EMAIL PROTECTED]> wrote: > >> some moderns editors allow you to comment/uncomment a selected Bunch > >> of lines of code > > > > Out of curiousity, is there a modern editor which *doesn't* allow you > > to comment/uncomment a select

Re: GIS

2006-04-03 Thread Cyril Bazin
Postgis is only an extension of Postgres which add new classes and new operations specialised for GIS. All you should know, is how to build SQL requests for postgres... If you want to be familiarised with the GIS, you should try to make your own little project. So you will be able to ask more pre

Re: Oserror: [Errno 20]

2006-04-03 Thread Sybren Stuvel
k r fry enlightened us with: > I did think maybe it was meant to be "listdir" instead of "istdir", > but that doesn't work either. And again you don't tell us in what way it doesn't work. Think about what you post from our point of view. Then re-read it, and think about it again. Only if you're s

Re: Oserror: [Errno 20]

2006-04-03 Thread k r fry
Again, I apologise. Not knowing much about Python means that I don't know what needs to be provided. I meant it doesn't work in the same way that "istdir" didn't work. Here is what I have coded: for subdir in os.path.istdir(DATADIR): #loop through list of strings file=FITS

Re: GIS

2006-04-03 Thread Albert Leibbrandt
Cyril Bazin wrote: > Postgis is only an extension of Postgres which add new classes and new > operations specialised for GIS. > All you should know, is how to build SQL requests for postgres... > > If you want to be familiarised with the GIS, you should try to make > your own little project. > S

Re: Oserror: [Errno 20]

2006-04-03 Thread Sybren Stuvel
k r fry enlightened us with: > Traceback (most recent call last): >File "katiescint.py", line 153, in ? > for subdir in os.path.listdir(DATADIR): #loop through > list of strings > AttributeError: 'module' object has no attribute 'listdir' But why do you use that function the

Re: DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE

2006-04-03 Thread alainpoint
Bravo, yoo r write, a propriatary languish is an oxy-moron. I have a rekwest zou: witch languish do yoo rekomend, bikoos yoo seem so a grate programor, at list zis is wat eye beleve, judging by yoo spelling. Alain -- http://mail.python.org/mailman/listinfo/python-list

Re: - Removing Need For Repeated Definition of __str__

2006-04-03 Thread Dylan Moreland
Ilias Lazaridis wrote: > I have some python code which looks similar to this: > > class Car(BaseClass) : >manufacturer = factory.string() >model = factory.string() >modelYear = factory.integer() > >def __str__(self): >return '%s %s %s' % (self.modelYear,

Re: Oserror: [Errno 20]

2006-04-03 Thread k r fry
Thank you very much! *embarassed*. :-) Ben Thul wrote: > I think that if you go back and look at the original reply, he spelled > it "isdir"...;) > > --Ben > k r fry wrote: > >> Again, I apologise. Not knowing much about Python means that I don't >> know what needs to be provided. I meant

Re: Oserror: [Errno 20]

2006-04-03 Thread Peter Hansen
k r fry wrote: > Sorry for not copying the whole traceback before, I hop I have done it > right this time. > > I am now getting: > > Traceback (most recent call last): >File "katiescint.py", line 153, in ? > for subdir in os.path.istdir(DATADIR): #loop through > list of st

Re: how to comment lot of lines in python

2006-04-03 Thread Kent Johnson
Rick Zantow wrote: > Kent Johnson <[EMAIL PROTECTED]> wrote in news:44310867$1_1 > @newspeer2.tds.net: > >> Sion Arrowsmith wrote: >>> Out of curiousity, is there a modern editor which *doesn't* allow you >>> to comment/uncomment a selected bunch of lines of code? >>> >> TextPad is my editor of ch

Re: Oserror: [Errno 20]

2006-04-03 Thread Ben Thul
I think that if you go back and look at the original reply, he spelled it "isdir"...;) --Ben k r fry wrote: > Again, I apologise. Not knowing much about Python means that I don't > know what needs to be provided. I meant it doesn't work in the same way > that "istdir" didn't work. > > Here i

Pydev and Pydev Extensions 1.0.4 release

2006-04-03 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.0.4 have been released Check http://www.fabioz.com/pydev for details on Pydev Extensions and http://pydev.sf.net for details on Pydev Release Highlights in Pydev Extensions: - - Interactive Con

Re: Oserror: [Errno 20]

2006-04-03 Thread k r fry
Thank you very much! I really appreciate the help. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: "definitive" source on advanced python?

2006-04-03 Thread bruno at modulix
Gabriel de Dietrich wrote: > Maybe you're looking for something like this? > http://jamesthornton.com/eckel/TIPython/html/Index.htm > > Haven't read it yet, but seems to be about design patterns. Not the > "definitive" stuff, though... While TIP is an interesting book, it is more about implementa

Re: GIS

2006-04-03 Thread Diez B. Roggisch
I need to create a sphere with a certain size. I have x and y > coordinates which I then need to calculated the distances between. > I use postgresql, that is why I am looking at postgis. > > If anybody knows of any documentation (except for what is on the postgis > homepage) please let me know a

Re: "definitive" source on advanced python?

2006-04-03 Thread Kent Johnson
vdrab wrote: > Hi all, > > Is there some sort of coherent source (dead tree format, maybe?) on > some of the more advanced features > of python (decorators, metaclasses, etc)? I'm sort of looking for a > python book that actually gets to the good stuff at some point, without > first spending 6 cha

Re: Difference between 'is' and '=='

2006-04-03 Thread Adam DePrince
On Mon, 2006-03-27 at 17:17 -0500, Terry Reedy wrote: > "Clemens Hepper" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > It's strange: python seem to cache constants from 0 to 99: > > The Python specification allows but does not require such behind-the-scenes > implementatio

string building

2006-04-03 Thread John Salerno
Out of curiosity, is there any kind of equivalent in Python to the StringBuilder class in C#? Here's a quick description from the .NET documentation: "This class represents a string-like object whose value is a mutable sequence of characters. The value is said to be mutable because it can be m

Re: New Python Logo Revealed

2006-04-03 Thread Alec Jang
robin 写道: > "Giovanni Bajo" <[EMAIL PROTECTED]> wrote: > >> robin wrote: >> >>> I have an entry on my blog discussing the new Python logo, which is >>> apparently due to replace the current one within the month. I'd be >>> interested in what people think of it. >>> >>> Surf: >>> http://diagrammes-

Re: string building

2006-04-03 Thread Chris Mellon
On 4/3/06, John Salerno <[EMAIL PROTECTED]> wrote: > Out of curiosity, is there any kind of equivalent in Python to the > StringBuilder class in C#? Here's a quick description from the .NET > documentation: > > "This class represents a string-like object whose value is a mutable > sequence of chara

Re: New Python Logo Revealed

2006-04-03 Thread Alec Jang
Alec Jang 写道: > robin 写道: >> "Giovanni Bajo" <[EMAIL PROTECTED]> wrote: >> >>> robin wrote: >>> I have an entry on my blog discussing the new Python logo, which is apparently due to replace the current one within the month. I'd be interested in what people think of it. Surf

Re: Getting a list of all classes derived from a base class

2006-04-03 Thread Alex Martelli
Dylan Moreland <[EMAIL PROTECTED]> wrote: ... > > do not use old-style classes: they exist ONLY for backwards > > compatibility. ... > > and you can call Test.__subclasses__() to get a list of all extant > > subclassed of Test at any time. ... > Thanks Alex. That's a new one to me -- new-s

Re: Getting a list of all classes derived from a base class

2006-04-03 Thread Alex Martelli
Vijairaj <[EMAIL PROTECTED]> wrote: > Thanks Dylan and Alex, that was a new learning for me. > > but both the solutions don't work in jython 2.1 is there an alternative > that will work with jython2.1 Alas, no: your simple idea is essentially the best you can do in any implementation of Pyhon at

Re: "definitive" source on advanced python?

2006-04-03 Thread Alex Martelli
vdrab <[EMAIL PROTECTED]> wrote: > Thank you. > > The original question was not meant to sound particularly arrogant, and > as you point out > a book covering ONLY things like metaprogramming would probably be > pretty useless in its own way. There's a niche market for such books -- "Putting Me

Re: How to debug python code?

2006-04-03 Thread Johannes Nix
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > My typical debugging technique is the infamous "wolf fence" (there's > one wolf in Alaska, how do you find it? First build a fence down the > middle of the state, wait for the wolf to howl, determine which side of > the fence it is on. Repeat p

Re: Newbie: splitting dictionary definition across two .py files

2006-04-03 Thread Adam DePrince
On Fri, 2006-03-31 at 12:46 -0800, Karthik Gurusamy wrote: > Ben Finney wrote: > > [EMAIL PROTECTED] writes: > > > > > I'm fairly new to python. I like to define a big dictionary in two > > > files and use it my main file, build.py > > > > > > I want the definition to go into build_cfg.py and build

Re: Difference between 'is' and '=='

2006-04-03 Thread Roy Smith
Adam DePrince <[EMAIL PROTECTED]> wrote: > It just happens that the >logical operation > > (a is b ) -> (a == b ) > >is always True. Only for small values of "always". You can always do pathological things with operators: class Foo: def __eq__ (self, other): return False f = Foo

Re: Best IDE for Python?

2006-04-03 Thread Adam DePrince
On Fri, 2006-03-31 at 09:30 +0200, Fredrik Lundh wrote: > Dennis Lee Bieber wrote: > > > > I want to know which is the best IDE for python.Please if > > > possible mention the features of the IDE. > > > > The best IDE is the one that YOU can be most productive in. What /I/ > > find useful ma

Re: beautiful GUI

2006-04-03 Thread M�ta-MCI
Hi! Two ideas : - WindowsBlind - Internet-Explorer + DHTML - Flash, like GUI Oups, there are three ideas Sorry @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between 'is' and '=='

2006-04-03 Thread Dave Hansen
On 3 Apr 2006 10:37:11 -0400 in comp.lang.python, [EMAIL PROTECTED] (Roy Smith) wrote: >Adam DePrince <[EMAIL PROTECTED]> wrote: >> It just happens that the >>logical operation >> >> (a is b ) -> (a == b ) >> >>is always True. > >Only for small values of "always". You can always do pathologic

Re: Get the input from user

2006-04-03 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > hi, > I am doing example of address book.when user enter stop and presses > enter my loop should stop.But there is some prob in my loop.It is > accepting \r after pressing Enter key.How do i check end of input : > addressbook={} > name = raw_input("Enter Name

Re: string building

2006-04-03 Thread Duncan Booth
John Salerno wrote: > Out of curiosity, is there any kind of equivalent in Python to the > StringBuilder class in C#? Yes, usually you use StringIO/cStringIO for this. It works for those situations where you just want to append to a string as you build it. The alternative is just to build up

Re: Python 2.5 licensing: stop this change

2006-04-03 Thread Philippe Martin
That was nasty Steve - at least I'm ready for any kind of bad new today ;-) Regards, Philippe Steve Holden wrote: > As the only director of the Python Software Foundation to vote against a > recent Board motion to implement the change in licensing terms described > in > >http://pyfound.b

Re: Difference between 'is' and '=='

2006-04-03 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Roy Smith wrote: > This may even be useful. What if you were trying to emulate SQL's > NULL? NULL compares false to anything, even itself. Strictly speaking, comparing NULL to anything gives NULL, not False. -- http://mail.python.org/mailman/listinfo/python-list

mod_python and PHP sharing same session

2006-04-03 Thread Scott
I am trying to get a mod_python application to read an existing PHP session. I need some data that was set in the session by the PHP application. I am using the mod_python Session class but even when I specify the session id that PHP uses the Sesssion(req, sid) call returns a new session id. The

Re: Difference between 'is' and '=='

2006-04-03 Thread Duncan Booth
Adam DePrince wrote: > It just happens that the > logical operation > > (a is b ) -> (a == b ) > > is always True. That is incorrect: >>> inf = 1e300*1e300 >>> nan = inf-inf >>> nan is nan, nan==nan (True, False) -- http://mail.python.org/mailman/listinfo/python-list

Re: How can i design a band-pass filter with scipy?

2006-04-03 Thread Serge Orlov
LabWINC wrote: > Hi all, > i would like to design a high pass filter with scipy.signal module. > ... I think you'd better ask scipy people at . Your question requires a lot of field specific knowledge. -- http://mail.python.org/mailman/listinfo/python-list

Re: String pattern matching

2006-04-03 Thread Eddie Corns
"Jim Lewis" <[EMAIL PROTECTED]> writes: >Anyone have experience with string pattern matching? >I need a fast way to match variables to strings. Example: >string - variables > >abcaaab - xyz >abca - xy >eeabcac - vxw >x matches abc >y matches a >z matches aab >w maches ac >v maches ee

Re: Can't detect EOF from stdin on windows console

2006-04-03 Thread Serge Orlov
Dmitry Anikin wrote: > I want to read stdin in chunks of fixed size until EOF > I want to be able (also) to supply data interactively in console > window and then to hit Ctrl+Z when finished [snip fighting with windows] > Read at most size bytes from the file (less if the read hits EOF before >

Re: string building

2006-04-03 Thread Sion Arrowsmith
John Salerno <[EMAIL PROTECTED]> wrote: >Out of curiosity, is there any kind of equivalent in Python to the >StringBuilder class in C#? Here's a quick description from the .NET >documentation: > >"This class represents a string-like object whose value is a mutable >sequence of characters. The v

can I get the index number in for x in y loop?

2006-04-03 Thread JuHui
>>> a='String' >>> for x in a: ... print x ... S t r i n g >>> can I get the index number of a in the upon loop within for x in a loop? -- http://mail.python.org/mailman/listinfo/python-list

Capturing stdout without waiting for the process end

2006-04-03 Thread Luigi
Hi to all! I'd like to execute an external program capturing the stdout/stderr messages at "real-time". I mean that I don't want to wait for the end of the process. If I write a code like this: import os import sys class Runner: def run(self, arg): try: fin, fout = os.po

Re: mod_python and PHP sharing same session

2006-04-03 Thread Diez B. Roggisch
Scott wrote: > I am trying to get a mod_python application to read an existing PHP > session. I need some data that was set in the session by the PHP > application. I am using the mod_python Session class but even when I > specify the session id that PHP uses the Sesssion(req, sid) call > return

Re: can I get the index number in for x in y loop?

2006-04-03 Thread Luigi
Try this: >>> a='String' >>> i=0 >>> for x in a: ... print i, x ... i+=1 ... 0 S 1 t 2 r 3 i 4 n 5 g -- http://mail.python.org/mailman/listinfo/python-list

Re: can I get the index number in for x in y loop?

2006-04-03 Thread Paul McGuire
"JuHui" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >>> a='String' > >>> for x in a: > ... print x > ... > S > t > r > i > n > g > >>> > > can I get the index number of a in the upon loop within for x in a > loop? > Use enumerate. See example below. -- Paul >>> a = "Strin

Re: can I get the index number in for x in y loop?

2006-04-03 Thread Rune Strand
JuHui wrote: > >>> a='String' > >>> for x in a: > ... print x > ... > S > t > r > i > n > g > >>> > > can I get the index number of a in the upon loop within for x in a > loop? for x, y in enumerate(a) print x, y -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't detect EOF from stdin on windows console

2006-04-03 Thread Peter Hansen
Serge Orlov wrote: > Dmitry Anikin wrote: >>I want to read stdin in chunks of fixed size until EOF >>I want to be able (also) to supply data interactively in console >>window and then to hit Ctrl+Z when finished > > [snip fighting with windows] > >>Read at most size bytes from the file (less if t

Re: can I get the index number in for x in y loop?

2006-04-03 Thread JuHui
which one has best performance? a:for i in range(0,len(a)) b:for x in a c:for x,y in enumerate(a) but, it seems I cann't get index number with b format..:( -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python and PHP sharing same session

2006-04-03 Thread Jim Gallacher
Scott wrote: > I am trying to get a mod_python application to read an existing PHP > session. I need some data that was set in the session by the PHP > application. I am using the mod_python Session class but even when I > specify the session id that PHP uses the Sesssion(req, sid) call > returns

Convertion of Unicode to ASCII NIGHTMARE

2006-04-03 Thread ChaosKCW
Hi I am reading from an oracle database using cx_Oracle. I am writing to a SQLite database using apsw. The oracle database is returning utf-8 characters for euopean item names, ie special charcaters from an ASCII perspective. I get the following error: >SQLiteCur.execute(sql, row) >UnicodeDe

question about nasty regex

2006-04-03 Thread Peter
I'm wondering if someone can tell me whether the following set of regex substitutions is possible. I want to convert parallel legal citations into single citations. What I mean is, I want to change, e.g.: "Doremus v. Board of Education of Hawthorne, 342 U.S. 429, 434, 72 S. Ct. 394, 397, 96 L.E

Re: can I get the index number in for x in y loop?

2006-04-03 Thread Felipe Almeida Lessa
Em Seg, 2006-04-03 às 08:47 -0700, JuHui escreveu: > which one has best performance? Let's see... > a:for i in range(0,len(a)) $ python2.4 -mtimeit -s 'a=[None]*100' 'for i in range(len(a)): j = a[i] ' 10 loops, best of 3: 17.7 usec per loop $ python2.4 -mtimeit -s 'a=[None]*100' 'for i

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-03 Thread Paul Boddie
ChaosKCW wrote: > Hi > > I am reading from an oracle database using cx_Oracle. I am writing to a > SQLite database using apsw. > > The oracle database is returning utf-8 characters for euopean item > names, ie special charcaters from an ASCII perspective. And does cx_Oracle return those as Unicode

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-03 Thread Robert Kern
ChaosKCW wrote: > Hi > > I am reading from an oracle database using cx_Oracle. I am writing to a > SQLite database using apsw. > > The oracle database is returning utf-8 characters for euopean item > names, ie special charcaters from an ASCII perspective. I'm not sure that you are using those te

Re: binascii.a2b_binary

2006-04-03 Thread Scott David Daniels
Ed Swarthout wrote: > Why is there no binascii.a2b_binary(bitstr) which returns the binary data > represented by the bit string? Like: > binascii.a2b_binary('0011001100110101') > '35' > perl has pack("B*", "0011001100110101"); What, you mean like: int('0011001100110101', 2) Which you

Re: Capturing stdout without waiting for the process end

2006-04-03 Thread [EMAIL PROTECTED]
What OS are you doing this on? I had an issue similar to this and it was due to default buffering behavior of my tty's. If I recall correctly I executed a bunch of settty to eliminate the buffering behavior of stdout. The set the terminal back to it's original setting when my program was done.

Re: can I get the index number in for x in y loop?

2006-04-03 Thread JuHui
thanks a lot! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-03 Thread Diez B. Roggisch
> Don't. You can't. Those characters don't exist in the ASCII character set. > SQLite 3.0 deals with UTF-8 encoded SQL statements, though. That is not entirely correct - one can, if losing information is ok. The OPs code that normalized UTF-8 to NFKD, an umlaut like ä is transformed to a two-chara

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-03 Thread Paul Boddie
Oh, and it occurs to me, as I seem to have mentioned a document about PgSQL rather than pysqlite (although they both have the same principal developer), that you might need to investigate the client_encoding parameter when setting up your connection. The following message gives some information (bu

  1   2   >