Re: How to convert float to sortable integer in Python

2007-01-16 Thread Carl Banks
shellon wrote: > I'm sorry I mistake the function name, the function is > floatToRawIntBits(), it convert ieee 754 floating point number to > integer, e.g. if f1>f2 then floatToRawBits(f1) > floatToRawBits(f1) You can get the raw bits of a floating point number by packing into a string then unpac

Re: How to convert float to sortable integer in Python

2007-01-16 Thread shellon
I'm sorry I mistake the function name, the function is floatToRawIntBits(), it convert ieee 754 floating point number to integer, e.g. if f1>f2 then floatToRawBits(f1) > floatToRawBits(f1) I want convert floating point number to sortable string to index in Lucene, so I want first to conver the flo

Re: PyQt: QListviewItemIterator

2007-01-16 Thread Tina I
David Boddie wrote: > > When it.current() returns None. You can rewrite what you already > have like this: > > it = QListViewItemIterator(self.authListView) > while it.current(): > item = it.current() > if item.text(0).contains(filterString) or \ > item.text(1).contains(filter

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-16 Thread st911
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > Below is a post repeated with interesting information. But the main > > purpose of this post is to find out how many sheeple still believe in > > the 911 fairy tale of 19 hijackers that was to be USED BY THE EVIL > > CRIMINALS TO "change the

Re: Learning Python book, new edition?

2007-01-16 Thread Aahz
In article <[EMAIL PROTECTED]>, wesley chun <[EMAIL PROTECTED]> wrote: > >more on topic, here's a summary of Python books which are rev'd up to >2.5, categorized but not in any particular order: > >Python learning: >- Python for Dummies, Maruch, Sep 2006 That should be "Maruch & Maruch" -- my prim

Re: How can I create a linked list in Python?

2007-01-16 Thread sturlamolden
Bruno Desthuilliers wrote: > Implementing linked lists in Python is not a great deal - it just > doesn't make much sens. It does make sence, as there are memory constraints related to it. Python lists are arrays under the hood. This is deliberately. Dynamic arrays grows faster than lists for the

Re: urllib2 and HTTPBasicAuthHandler

2007-01-16 Thread Max Erickson
"m.banaouas" <[EMAIL PROTECTED]> wrote: ... >passman.add_password(None, auth_url, data['user'] , ... The only thing I can come up with is that auth_url can't begin with a protocol, like http:// or whatever. max -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I write code using FP

2007-01-16 Thread kernel1983
yeah! that's easy! althought no so clear a = lambda x,y:(x,y) b = lambda y:a(1,y) a(1,2) (1,2) b(2) (1,2) On 1月17日, 下午12时10分, Alejandro Dubrovsky <[EMAIL PROTECTED]> wrote: > kernel1983 wrote: > > In Function Program?Language can use like this: > > > define a function: > > f = lambda x,y:x,y >

Re: Does class patching actually work

2007-01-16 Thread John Nagle
James Stroud wrote: > John Nagle wrote: >> The intent of this is to replace method open_https of class URLopener >> with a local, patched version. >> >> Does that actually work? When I've tried to do that in other code, it >> seems to have no effect. In fact, I can write >> >> URLopener.open

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-16 Thread schoenfeld . one
[EMAIL PROTECTED] wrote: > Below is a post repeated with interesting information. But the main > purpose of this post is to find out how many sheeple still believe in > the 911 fairy tale of 19 hijackers that was to be USED BY THE EVIL > CRIMINALS TO "change the world forever" BUT IT WONT. Are we

Re: How can I write code using FP

2007-01-16 Thread Alejandro Dubrovsky
kernel1983 wrote: > In Function Program?Language can use like this: > > define a function: > f = lambda x,y:x,y > > then we use f to define another function: > f2 = f(1) > the f2 should equal to: > f2=lambda y:1,y > > we should be able call f2 with one parameter:f2(2) > just return 1,2 > > but

OSCON 2007: Call for Proposals

2007-01-16 Thread Kevin Altis
OSCON 2007 http://conferences.oreillynet.com/os2007/ Save the date for the 9th annual O'Reilly Open Source Convention, happening July 23-27, 2007 at the Oregon Convention Center in beautiful Portland, Oregon. Call For Participation -- Submit a proposal-fill out the form at:

Re: How can I write code using FP

2007-01-16 Thread Dan Bishop
On Jan 16, 9:18 pm, "kernel1983" <[EMAIL PROTECTED]> wrote: > In Function Program,Language can use like this: > > define a function: > f = lambda x,y:x,y > > then we use f to define another function: > f2 = f(1) > the f2 should equal to: > f2=lambda y:1,y > > we should be able call f2 with one para

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-16 Thread kilian heckrodt
[EMAIL PROTECTED] wrote: > Below is a post repeated with interesting information. But the main > purpose of this post is to find out how many sheeple still believe in > the 911 fairy tale of 19 hijackers that was to be USED BY THE EVIL > CRIMINALS TO "change the world forever" BUT IT WONT. Are we g

Re: How can I write code using FP

2007-01-16 Thread Leo Jay
On 16 Jan 2007 19:18:19 -0800, kernel1983 <[EMAIL PROTECTED]> wrote: In Function Program,Language can use like this: define a function: f = lambda x,y:x,y then we use f to define another function: f2 = f(1) the f2 should equal to: f2=lambda y:1,y we should be able call f2 with one parameter:f

Acc#2049850557 Activation Code Please

2007-01-16 Thread Kelvin
Amazing Hot Sexy! Free Videos! http://ghetonews.com Free Images! These videos are hotter than a 3 week crash course in MK-Ultra 90! Al-Zulu   -- http://mail.python.org/mailman/listinfo/python-list

How can I write code using FP

2007-01-16 Thread kernel1983
In Function Program,Language can use like this: define a function: f = lambda x,y:x,y then we use f to define another function: f2 = f(1) the f2 should equal to: f2=lambda y:1,y we should be able call f2 with one parameter:f2(2) just return 1,2 but how can I implement the characteristic in Pyth

Re: I wrote a C++ code generator in Python, would anyone please help me to review the code? :)

2007-01-16 Thread Kevin Wan
Sorry, I didn't write that much document. But you can use fgen --help to get the usage. I'm writing document now. :) Thanks, Kevin [EMAIL PROTECTED] wrote: > Kevin Wan wrote: > > fgen is a free command line tool that facilitates cross platform c++ > > development, including header generation, cp

Re: I wrote a C++ code generator in Python, would anyone please help me to review the code? :)

2007-01-16 Thread Kevin Wan
I'm writing the document for fgen. You can use SVN to access the most updated files. Basically you can use fgen --help to get the usage. It's my c++ development tool, and I didn't spend that much time on writing document. Sorry. But I'm writing now. Thanks and waiting to work with you guys, Kevi

how to use xmlrpc properly in windows xp

2007-01-16 Thread Leo Jay
i just wrote a server and client for xmlrpc test. if server and client run in the same machine, everything is fine. but if server and client run in different machine, the speed is unbearably slow. i tried several times, and the approx time is about 18.5 sec to invoke server.test() 5 times. i had

*POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-16 Thread st911
Below is a post repeated with interesting information. But the main purpose of this post is to find out how many sheeple still believe in the 911 fairy tale of 19 hijackers that was to be USED BY THE EVIL CRIMINALS TO "change the world forever" BUT IT WONT. Are we going to PERMIT some evil criminal

Re: How can I create a linked list in Python?

2007-01-16 Thread kernel1983
Every language has its own way to do the business! Python has a more abstract data type as the common tools. Just do things in pythonic way! On 1月17日, 上午9时55分, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Tuesday 16/1/2007 17:07, Dongsheng Ruan wrote: > > >Thanks for your kindly help. > >I am

[ANN] argparse 0.5 - Command-line parsing library

2007-01-16 Thread Steven Bethard
Announcing argparse 0.5 --- argparse home: http://argparse.python-hosting.com/ argparse single module download: http://argparse.python-hosting.com/file/trunk/argparse.py?format=raw argparse bundled downloads at PyPI: http://www.python.org/pypi/argparse/ About this r

Re: Newbie: Capture traceback message to string?

2007-01-16 Thread Gary Herron
Sean Schertell wrote: > Hello! > > I'm new to Python and this is my first post to the list. > > I'm trying to simply capture exception text to a few strings which > can be passed to a PSP page to display a pretty error message. The > problem is that I just can't seem to figure out how to get th

Re: Queue and signals

2007-01-16 Thread hg
[EMAIL PROTECTED] wrote: > > >> Is it legal to use Queue.put in a signal handle and Queue.get in > >> the main process (no thread) > > hg> PS: and if not is there a way to share data between a "main" and > its hg> signal in a safe way (write in signal and read in main) > > The Q

Re: How can I create a linked list in Python?

2007-01-16 Thread Gabriel Genellina
At Tuesday 16/1/2007 17:07, Dongsheng Ruan wrote: Thanks for your kindly help. I am new CS student taking datat structure and algorithms with AHO's book with the same title. The book is done in Pascal, which might be an outdated language. However, my instructor probably wants us to understand

Newbie: Capture traceback message to string?

2007-01-16 Thread Sean Schertell
Hello! I'm new to Python and this is my first post to the list. I'm trying to simply capture exception text to a few strings which can be passed to a PSP page to display a pretty error message. The problem is that I just can't seem to figure out how to get the basic components of the traceb

Re: Newbie - converting csv files to arrays in NumPy - Matlab vs. Numpy comparison

2007-01-16 Thread oyekomova
Travis- Yes, I tried your suggestion, but found that it took longer to read a large file. Thanks for your help. Travis E. Oliphant wrote: > oyekomova wrote: > > Thanks to everyone for their excellent suggestions. I was able to > > acheive the following results with all your suggestions. However,

Re: Check a windows service

2007-01-16 Thread Gabriel Genellina
At Tuesday 16/1/2007 19:19, awel wrote: Sorry, but could you give me an example with a real service 'cause I've tried this script but nothings happened, no error, nothings ; even if I launch it in cmd prompt. You have to call the EnumServices function if you want some useful output. Copy&paste

Re: Search Queue

2007-01-16 Thread Gabriel Genellina
At Tuesday 16/1/2007 15:01, Dennis Lee Bieber wrote: If "Queue like functionality" means inserting at the end, and removing from the front... Just use a list Someone said that time complexity should be part of an object public interfase. Implementing a queue using Python lists is triv

Re: Queue and signals

2007-01-16 Thread skip
>> Is it legal to use Queue.put in a signal handle and Queue.get in the >> main process (no thread) hg> PS: and if not is there a way to share data between a "main" and its hg> signal in a safe way (write in signal and read in main) The Queue module was designed to work in multit

Re: urrlib2 multithreading error

2007-01-16 Thread Gabriel Genellina
At Tuesday 16/1/2007 11:41, [EMAIL PROTECTED] wrote: When I use it on a single thread everything goes ok, when I create multiple threads the execution halts and the program terminates, just before the last line (when I execute the request.read(.) ). Obviously I tried to catch the exception but i

Re: Making a simple script standalone

2007-01-16 Thread Larry Bates
Rikishi 42 wrote: > Hi, > I'm new to this group. I've tried finding my answer in existing messages, > but no such luck. > > What I want to do is to compile/bundle/prepare/whatever_term a simple > Python script for deployment on a Windows machine. Installing Python > itself on that machine, is not

Re: I wrote a C++ code generator in Python, would anyone please help me to review the code? :)

2007-01-16 Thread [EMAIL PROTECTED]
Kevin Wan wrote: > fgen is a free command line tool that facilitates cross platform c++ > development, including header generation, cpp file generation, makefile > generation, unit test framework generation, etc. > > http://sf.net/projects/fgen > > I'm not very familiar with Python. Any feedback a

Re: urllib2 and HTTPBasicAuthHandler

2007-01-16 Thread m.banaouas
Max, I verified and determined that Zope realm is "Zope", by tcp spy tool witch shows me the server headers. Actually, I tried differents ways without success. It seems like it's not so easy to negociate a basic authentication process with urllib2, while it's based on very simple specifications,

Re: PyQt: QListviewItemIterator

2007-01-16 Thread David Boddie
On Tuesday 16 January 2007 18:57, Tina I wrote: > I have a QListView with a number of columns. In order to filter the > output I iterate using QListViewItemIterator looking for the string > entered by the user (filterString). Currently I do it this way: [Reformatted code for quoting purposes] >

Re: Class data members in C

2007-01-16 Thread Ziga Seilnacht
Nick Maclaren wrote: > Hmm. The extensions documentation describes how to add instance > members to a class (PyMemberDef), but I want to add a class member. > Yes, this is constant for all instances of the class. > > Any pointers? Add something like this to your PyMODINIT_FUNC after you have init

Re: How can i eval subindex on list[ ][ ] ?

2007-01-16 Thread James Stroud
jairodsl wrote: > Excuse me, i was trying in too many ways but i couldnt access subindex > on a list , the problem is the next: > > I have > > indif=[[0,'A'],[1,'B'],[2,'C'],[3,'D']] > > and > > indic=[[0,'B'],[1,'C'],[2,'D'],[3,'E']] > > i need to eval if indic[i][j] is equal to indif[i][j] >

POSH Query

2007-01-16 Thread S.Mohideen
Hi Folks, I am implementing a multithreaded Network application in Python. As most of you know that the GIL hinders the performance scalablity in SMP machines. I came across POSH. Here they talk about multiple instances of Python Interpreter sticking around a Shared memory , byp

Re: Making a simple script standalone

2007-01-16 Thread James Stroud
Rikishi 42 wrote: > Hi, > I'm new to this group. I've tried finding my answer in existing messages, > but no such luck. > > What I want to do is to compile/bundle/prepare/whatever_term a simple > Python script for deployment on a Windows machine. Installing Python > itself on that machine, is not

Help: asyncore/asynchat and terminator string

2007-01-16 Thread David Hirschfield
I'm implementing a relatively simple inter-application communication system that uses asyncore/asynchat to send messages back and forth. The messages are prefixed by a length value and terminator string, to signal that a message is incoming, and an integer value specifying the size of the messa

Re: Anyone has a nice "view_var" procedure ?

2007-01-16 Thread Stef Mientki
Adam wrote: > Stef Mientki wrote: > >> hello, >> >> Is there some handy/ nice manner to view the properties of some variable ? >> As a newbie, I often want to see want all the properties of a var, >> and also some corner values (large arrays) etc. >> >> Probably it's not so difficult, >> but I don

How can i eval subindex on list[ ][ ] ?

2007-01-16 Thread jairodsl
Excuse me, i was trying in too many ways but i couldnt access subindex on a list , the problem is the next: I have indif=[[0,'A'],[1,'B'],[2,'C'],[3,'D']] and indic=[[0,'B'],[1,'C'],[2,'D'],[3,'E']] i need to eval if indic[i][j] is equal to indif[i][j] I used a double for but i had got "list

Making a simple script standalone

2007-01-16 Thread Rikishi 42
Hi, I'm new to this group. I've tried finding my answer in existing messages, but no such luck. What I want to do is to compile/bundle/prepare/whatever_term a simple Python script for deployment on a Windows machine. Installing Python itself on that machine, is not an option. Ideally I would like

POSH

2007-01-16 Thread S.Mohideen
Hi Folks, I am implementing a multithreaded Network application in Python. As most of you know that the GIL hinders the performance scalablity in SMP machines. I came across POSH. Here they talk about multiple instances of Python Interpreter sticking around a Shared memory , bypa

Re: arguments of a function/metaclass

2007-01-16 Thread goodwolf
[EMAIL PROTECTED] je napisao/la: > Hello, > > > I have a member function with many (20) named arguments > > def __init__(self,a=1,b=2): > self.a=a > self.b=b > > I would like to get rid of the many redundant lines like self.a=a and > set the members automatically. > The list of default arg

Re: Queue and signals

2007-01-16 Thread hg
hg wrote: > Hi, > > Is it legal to use Queue.put in a signal handle and Queue.get in the main > process (no thread) > > Thanks, > > hg PS: and if not is there a way to share data between a "main" and its signal in a safe way (write in signal and read in main) Thanks, hg -- http://mail.pyt

mod_python example code

2007-01-16 Thread EricClack
I've been using Python, MySQL, Apache and mod_python for some time now and think that it is a great combination for many projects. However I have been constantly surprised by the lack of any visible mod_python examples on the web. So, I've released my framework in the hope that it will be useful t

Re: How can I create a linked list in Python?

2007-01-16 Thread Bruno Desthuilliers
Dongsheng Ruan a écrit : > Thanks for your kindly help. > I am new CS student taking datat structure and algorithms with AHO's book > with the same title. > > The book is done in Pascal, which might be an outdated language. Yes, somehow - but note, that linked lists are the central data structu

Re: How can I create a linked list in Python?

2007-01-16 Thread ray223
Dongsheng Ruan wrote: > with a cell class like this: > > #!/usr/bin/python > > import sys > > class Cell: > > def __init__( self, data, next=None ): > self.data = data > self.next = next > > def __str__( self ): > return str( self.data ) > > def echo( self ): > print self.__str__() Hi

Re: Check a windows service

2007-01-16 Thread awel
Sorry, but could you give me an example with a real service 'cause I've tried this script but nothings happened, no error, nothings ; even if I launch it in cmd prompt. Thanks Chris Mellon a écrit : > On 16 Jan 2007 09:09:34 -0800, Tim Golden <[EMAIL PROTECTED]> wrote: > > awel wrote: > > > > >

Re: Check a windows service

2007-01-16 Thread awel
Sorry, but could you give me an example with a real service 'cause I've tried this script but nothings happened, no error, nothings ; even if I launch it in cmd prompt. Thanks Tim Golden a écrit : > awel wrote: > > > I'm new in python and I would like to know if it's possible to check if > > a sp

Re: Check a windows service

2007-01-16 Thread awel
Sorry, but could you give me an example with a real service 'cause I've tried this script but nothings happened, no error, nothings ; even if I launch it in cmd prompt. Thanks Tim Golden a écrit : > awel wrote: > > > I'm new in python and I would like to know if it's possible to check if > > a sp

Re: Python Threads and C Semaphores

2007-01-16 Thread Andrew MacIntyre
Dejan Rodiger wrote: > Jeremy said the following on 16.1.2007 8:27: > >> I have a fat C++ extension to a Python 2.3.4 program. In all, I count >> five threads. Of these, two are started in Python using >> thread.start_new_thread(), and both of these wait on semaphores in the C++ >> extension using

Re: How to determine what exceptions a method might raise?

2007-01-16 Thread Ben Finney
Ed Jensen <[EMAIL PROTECTED]> writes: > it would be handy if there was something I could do in the > interactive interpreter to make it tell me what exceptions the file > method might raise (such as IOError). For what purpose would this be handy? Surely the benefit of the interactive interpreter

Re: Conflicting needs for __init__ method

2007-01-16 Thread Ben Finney
"BJörn Lindqvist" <[EMAIL PROTECTED]> writes: > import rational > rational.rational(45) > rational.rational(45.0) > rational.rational([45, 45.5]) > > def rational(obj): > initers = [(int, from_int), (basestring, from_str), (list, from_list)] > for obj_type, initer in initers: > if

Class data members in C

2007-01-16 Thread Nick Maclaren
Hmm. The extensions documentation describes how to add instance members to a class (PyMemberDef), but I want to add a class member. Yes, this is constant for all instances of the class. Any pointers? Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Projects anyone?

2007-01-16 Thread Ben Finney
"placid" <[EMAIL PROTECTED]> writes: > I'm looking for anyone who is working on a project at the moment that > needs help (volunteer). The Volunteer Opportunities page is a bit thin at the moment. I'd hope people can respond to this thread and update that page with other projects that need help.

Python and Soap protocol

2007-01-16 Thread Grzegorz Smith
Hi folks I must write webb application that will comunicate with delphi desktop application by SOAP protocol. Can you recommend any Python Soap Libary? I founded: SOAPpy and Zolera SOAP Infrastructure (ZSI). Any tip which is better to use? Thanks for any help Gregor -- http://mail.python.org/mailm

Re: How can I create a linked list in Python?

2007-01-16 Thread bearophileHUGS
Gary Herron: > If you really want a list (as Python defines a list - with all the methods) > then you should use Python's lists. They are quite efficient and convenient: In CPython they are dynamic arrays, they aren't lists. Try adding elements at the beginning of a list compared to adding eleme

Re: assert versus print [was Re: The curious behavior of integer objects]

2007-01-16 Thread Carl Banks
Neil Cerutti wrote: > On 2007-01-16, Ron Adam <[EMAIL PROTECTED]> wrote: > > I have to admit that part of why assert seems wrong to me is > > the meaning of the word implies something you shouldn't be able > > to ignore. While warnings seem like something that can be > > disregarded. > > Experien

Re: A note on heapq module

2007-01-16 Thread bearophileHUGS
Scott David Daniels: > I'd suggest some changes. It is nice to have Heaps with equal > contents equal no matter what order the inserts have been done. > Consider how you want Heap([1, 2, 3]) and Heap([3, 1, 2]) to behave. > Similarly, it is nice to have str and repr produce canonical > representat

Queue and signals

2007-01-16 Thread hg
Hi, Is it legal to use Queue.put in a signal handle and Queue.get in the main process (no thread) Thanks, hg -- http://mail.python.org/mailman/listinfo/python-list

Very beautiful

2007-01-16 Thread ahmad6132
1) If you are looking for the truth to soothe and please your self, just click on this link. 2) If you are looking for the secrt of the family happiness, just click on this link. 3) If you are looking for solving any social problem you face, just click on this link. http://www.sultan.org/artic

Re: Globbing files by their creation date

2007-01-16 Thread James Antill
On Tue, 16 Jan 2007 07:44:29 -0600, skip wrote: > Thomas> I've used glob.glob to create a list of all files whose name > Thomas> matches a substring, but I don't see how I can use it to > Thomas> identify files by their creation date. > > Sumthin' like: > > files = [f for f in glob.g

mysqldb, file _mysql.so needed

2007-01-16 Thread Snirp
Good day to you all! I am trying to get mysqldb working on an ISP webserver. They will not not help me, but I think it will be possible. The thing is that there is one binary file necessary for this to work (found in python site-packages): _mysql.so (on linux) I am a poor soul stuck with windows

Re: How can I create a linked list in Python?

2007-01-16 Thread Dongsheng Ruan
Thanks for your kindly help. I am new CS student taking datat structure and algorithms with AHO's book with the same title. The book is done in Pascal, which might be an outdated language. However, my instructor probably wants us to understand the list ADT better by not using the built in list

Re: How to determine what exceptions a method might raise?

2007-01-16 Thread Harlin Seritt
Hi Ed, Generally checking the sources give a very good clue as to what exceptions the interpreter can raise. Look around _builtins_ for this. Harlin Seritt Ed Jensen wrote: > I'm really enjoying using the Python interactive interpreter to learn > more about the language. It's fantastic you can

Re: Regex Question

2007-01-16 Thread Bill Mill
James Stroud wrote: > Bill Mill wrote: > > Hello all, > > > > I've got a test script: > > > > start python code = > > > > tests2 = ["item1: alpha; item2: beta. item3 - gamma--", > > "item1: alpha; item3 - gamma--"] > > > > def test_re(regex): > >r = re.compile(regex, re.MULTILINE) > >

OT: teleporters (Was: General Question About Python)

2007-01-16 Thread Carroll, Barry
> -Original Message- > From: Hendrik van Rooyen [mailto:[EMAIL PROTECTED] > Sent: Saturday, January 13, 2007 9:47 PM > To: Torabisu; python-list@python.org > Subject: Re: General Question About Python > > "Torabisu" <[EMAIL PROTECTED]> wrote: > > > > > > Hendrik van Rooyen wrote: > > >

Re: for v in l:

2007-01-16 Thread Gert Cuykens
ok thx this was just what i was looking for http://docs.python.org/tut/node7.html#SECTION00760 -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I create a linked list in Python?

2007-01-16 Thread azrael
How can I implement a linked list like the implementations in c with struct-s and arrays (or pointers). to simbolize the working principe Gary Herron je napisao/la: > Dongsheng Ruan wrote: > > with a cell class like this: > > > > #!/usr/bin/python > > > > import sys > > > > class Cell: > > > >

How to determine what exceptions a method might raise?

2007-01-16 Thread Ed Jensen
I'm really enjoying using the Python interactive interpreter to learn more about the language. It's fantastic you can get method help right in there as well. It saves a lot of time. With that in mind, is there an easy way in the interactive interpreter to determine which exceptions a method migh

Re: How can I create a linked list in Python?

2007-01-16 Thread Gary Herron
Dongsheng Ruan wrote: > with a cell class like this: > > #!/usr/bin/python > > import sys > > class Cell: > > def __init__( self, data, next=None ): > self.data = data > self.next = next > > def __str__( self ): > return str( self.data ) > > def echo( self ): > print self.__str__() >

Re: Segfault with tktreectrl on python-2.5 on linux

2007-01-16 Thread klappnase
Anton Hartl schrieb: > The bug report should go to both; I actually contacted Jeremy Hylton > as a main contributor of the new AST code two weeks ago but didn't > get any response. > Ok, I submitted bug reports on both the tktreectrl and the python sourceforge pages. Now I'll have a nice cup of

How can I create a linked list in Python?

2007-01-16 Thread Dongsheng Ruan
with a cell class like this: #!/usr/bin/python import sys class Cell: def __init__( self, data, next=None ): self.data = data self.next = next def __str__( self ): return str( self.data ) def echo( self ): print self.__str__() -- http://mail.python.org/mailman/listinfo/python-l

Re: A note on heapq module

2007-01-16 Thread Scott David Daniels
Scott David Daniels wrote: Sorry, I blew the __ne__: >> def __ne__(self, other): >> return not isinstance(other, Heap) or self.h != other.h > return not isinstance(other, self.__class__) and sorted( > self.h) != sorted(other.h) Should be:

Re: A note on heapq module

2007-01-16 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > In few minutes I have just written this quite raw class, I'd suggest some changes. It is nice to have Heaps with equal contents equal no matter what order the inserts have been done. Consider how you want Heap([1, 2, 3]) and Heap([3, 1, 2]) to behave. Similarly, it

Re: whats wrong with my reg expression ?

2007-01-16 Thread Gert Cuykens
thx it works now -- http://mail.python.org/mailman/listinfo/python-list

Re: help needed for pymorph

2007-01-16 Thread azrael
yes, in the PIL directory Dennis Lee Bieber je napisao/la: > On 16 Jan 2007 08:07:09 -0800, "azrael" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > > > does anyone have any idea how to fix it. > > > Well, the last line of your traceback indicates that the error

Re: A note on heapq module

2007-01-16 Thread Jussi Salmela
[EMAIL PROTECTED] kirjoitti: > I think the sort has to be simplified, otherwise it can't keep the heap > invariant... > > def sort(self): > self.h.sort() > > Bye, > bearophile > And __repr__ should be something like this: = def __repr__(self): if self.h: re

Re: urllib2 and HTTPBasicAuthHandler

2007-01-16 Thread Max Erickson
"m.banaouas" <[EMAIL PROTECTED]> wrote: > Hi all, > I started to use urllib2 library and HTTPBasicAuthHandler class > in order to authenticate with a http server (Zope in this case). > I don't know why but it doesn't work, while authenticating with > direct headers manipulation works fine! > ...

Re: Regular expressions question

2007-01-16 Thread Victor Polukcht
Great thnx. It works. On Jan 16, 6:02 pm, Wolfgang Grafen <[EMAIL PROTECTED]> wrote: > Victor Polukcht wrote: > > I have 2 strings: > > > "Global etsi3 *200 ok30 100% 100% > > Outgoing" > > and > > "Global etsi3 * 4 ok 30 100% 100% > >

Re: A note on heapq module

2007-01-16 Thread bearophileHUGS
I think the sort has to be simplified, otherwise it can't keep the heap invariant... def sort(self): self.h.sort() Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

PyQt: QListviewItemIterator

2007-01-16 Thread Tina I
Hi, I'm fairly new to both Python and Qt so please bare with me. I have a QListView with a number of columns. In order to filter the output I iterate using QListViewItemIterator looking for the string entered by the user (filterString). Currently I do it this way: it = QListViewItemIterator(se

Re: smtplib question

2007-01-16 Thread Tim Williams
On 16/01/07, gandalf gold <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > I was trying out smtplib and found out that I can email to anyone in my > domain but not to an email address not in the domain. From browsing on the > web, it seems that this has to do with the configuration of the mail serve

Python for Maemo -- new version released

2007-01-16 Thread Osvaldo Santana
We from INdT (Nokia Institute of Technology -- Brazil) have the pleasure to announce the new version of Python for Maemo, for Maemo SDK 2.1 ("Scirocco") and SDK 3.0 ("Bora"). Highlights of this version: * Support for Nokia N800[1] device/software (SDK 3.0) * Language updated to Python 2.5 * Update

Re: A note on heapq module

2007-01-16 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > some time ago I have written a bug > into small program that uses the functions of the heapq module, because > I have added an item to the head of the heap using a normal list > method, breaking the heap invariant. I know I've had similar bugs in my code before. > from

Re: arguments of a function/metaclass

2007-01-16 Thread goodwolf
Gabriel Genellina je napisao/la: > "goodwolf" <[EMAIL PROTECTED]> escribió en el mensaje > news:[EMAIL PROTECTED] > > A simply solution: > > > > def __init__(self, a=1, b=2, c=3, ..): > >for key, val in locals().items(): > >if key != 'self': > >setattr(self.__class__, k

Re: Check a windows service

2007-01-16 Thread Gabriel Genellina
"awel" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > I'm new in python and I would like to know if it's possible to check if > a specific windows service is present and if it's possible how can I > do? Yes, using the wmi module, but you'll have to search the Microsoft docume

Re: Check a windows service

2007-01-16 Thread Chris Mellon
On 16 Jan 2007 09:09:34 -0800, Tim Golden <[EMAIL PROTECTED]> wrote: > awel wrote: > > > I'm new in python and I would like to know if it's possible to check if > > a specific windows service is present and if it's possible how can I > > do? > > This is one way: > > http://tgolden.sc.sabren.com/pyt

A note on heapq module

2007-01-16 Thread bearophileHUGS
In few minutes I have just written this quite raw class, it lacks doctring (the same of the functions of the heapq module), it may contain bugs still, I haven't tested it much. It's just a simple wrapper around some of the functions of the heapq module (nsmallest and nlargest are missing). Usually

smtplib question

2007-01-16 Thread gandalf gold
Hi everyone, I was trying out smtplib and found out that I can email to anyone in my domain but not to an email address not in the domain. From browsing on the web, it seems that this has to do with the configuration of the mail server. The mail server in my organization is MS exchange. Obvious

Re: Search Queue

2007-01-16 Thread Gabriel Genellina
"abcd" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > Yea basically I need Queue like functionality with the ability to > search for a particular instance in it. I guess I could just use a > list and search it as needed. Perhaps the Queue class should be called ThreadQueue,

Re: Check a windows service

2007-01-16 Thread Tim Golden
awel wrote: > I'm new in python and I would like to know if it's possible to check if > a specific windows service is present and if it's possible how can I > do? This is one way: http://tgolden.sc.sabren.com/python/wmi_cookbook.html#automatic_services You'd have to change that example slightly

Re: help needed for pymorph

2007-01-16 Thread azrael
here is the traceback http://barok.foi.hr/~ikljaic/untitled.jpg -- http://mail.python.org/mailman/listinfo/python-list

Check a windows service

2007-01-16 Thread awel
Hi, I'm new in python and I would like to know if it's possible to check if a specific windows service is present and if it's possible how can I do? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: arguments of a function/metaclass

2007-01-16 Thread Gabriel Genellina
"goodwolf" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > A simply solution: > > def __init__(self, a=1, b=2, c=3, ..): >for key, val in locals().items(): >if key != 'self': >setattr(self.__class__, key, val) > > in addition: > > def set(self, **kwa

Re: Python web app. (advice sought)

2007-01-16 Thread Tim Williams
On 16/01/07, Ralf Schönian <[EMAIL PROTECTED]> wrote: > > I would also like to vote for Karrigell. > > BTW: Does anyone knows how to avoid stopping/starting of the webserver > after changing external libraries? I have some own modules under > /opt/local/python/lib and import them by extending the

Re: html + javascript automations = [mechanize + ?? ] or something else?

2007-01-16 Thread ina
John wrote: > I have to write a spyder for a webpage that uses html + javascript. I > had it written using mechanize > but the authors of the webpage now use a lot of javascript. Mechanize > can no longer do the job. > Does anyone know how I could automate my spyder to understand > javascript? Is

  1   2   >