Re: state of SOAP and python?

2006-08-16 Thread Andre Meyer
I had success with ZSI: http://pywebsvcs.sourceforge.net/It worked very nicely for publishing a SOAP we service and accessing it from a client writtenusing the same library. What I didn't manage to achieve was to write the client in AJAX (tried http://www-128.ibm.com/developerworks/webservices/lib

Very weird behavior that's driving me crazy

2006-08-16 Thread Pupeno
Hello, I am experiencing a weird behavior that is driving me crazy. I have module called Sensors containing, among other things: class Manager: def getStatus(self): print "getStatus(self=%s)" % self return {"a": "b", "c": "d"} and then I have another module called SensorSingle

Python form Unix to Windows

2006-08-16 Thread Pradeep
Hi friends, We are changing the python application from Unix to Windows. The source code of Python application should work well in windows. How to make changed to windows environment. In Python code we have login module, ftp, socket programming. Please help in changing the code from Unix envirnme

Weekly Python Patch/Bug Summary

2006-08-16 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 404 open ( +2) / 3376 closed (+16) / 3780 total (+18) Bugs: 860 open ( -1) / 6131 closed (+17) / 6991 total (+16) RFE : 229 open ( +1) / 235 closed ( +1) / 464 total ( +2) New / Reopened Patches __ option to

round not rounding to 0 places

2006-08-16 Thread Fuzzydave
I have been using a round command in a few places to round a value to zero decimal places using the following format, round('+value+', 0) but this consistantly returns the rounded result of the value to one decimal place with a zero EG: 4.97 is returned as 5.0 when i want it returned as 5, does

Re: what is the keyword "is" for?

2006-08-16 Thread Hendrik van Rooyen
"Dan Bishop" <[EMAIL PROTECTED]> wrote: | Sybren Stuvel wrote [on the difference between is and ==]: | > Obviously "a is b" implies "a == b", | | Not necessarily. | | >>> a = b = 1e1000 / 1e1000 | >>> a is b | True | >>> a == b | False Huh? - wtf is this - I find this deeply disturbing - Sybre

Re: Python form Unix to Windows

2006-08-16 Thread neokosmos
Pradeep wrote: > We are changing the python application from Unix to Windows. The source > code of Python application should work well in windows. How to make > changed to windows environment. > In Python code we have login module, ftp, socket programming. > > Please help in changing the code from

Re: round not rounding to 0 places

2006-08-16 Thread Simon Forman
Fuzzydave wrote: > I have been using a round command in a few places to round > a value to zero decimal places using the following format, > > round('+value+', 0) > > but this consistantly returns the rounded result of the value > to one decimal place with a zero > > EG: > > 4.97 is returned as 5.0

Re: how to deepcopy a slice object?

2006-08-16 Thread Alexandre Guimond
thx for all the help simon. good ideas i can work with. thx again. alex. Simon Forman wrote: > Alexandre Guimond wrote: > > Here is my reason: > > > > I have an object that contrains a 2D regular grid (matrix). In this > > regular grid, I place points at regular intervals. In essence, i have > >

Re: round not rounding to 0 places

2006-08-16 Thread Tim Leslie
On 16 Aug 2006 00:19:24 -0700, Fuzzydave <[EMAIL PROTECTED]> wrote: > I have been using a round command in a few places to round > a value to zero decimal places using the following format, > > round('+value+', 0) > > but this consistantly returns the rounded result of the value > to one decimal pl

Re: Python form Unix to Windows

2006-08-16 Thread Simon Forman
Pradeep wrote: > Hi friends, > > We are changing the python application from Unix to Windows. The source > code of Python application should work well in windows. How to make > changed to windows environment. > In Python code we have login module, ftp, socket programming. > > Please help in changin

Re: Very weird behavior that's driving me crazy

2006-08-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Pupeno wrote: > - Shouldn't the manager be the same in the first print and the second, that > is, the id is different, shouldn't it be the same ? > - What happened with all the output of SensorSingleton.getStatus() ? there's > no trace of it (but there's output of the metho

Re: round not rounding to 0 places

2006-08-16 Thread Fuzzydave
> Sybren Stuvel wrote: > round returns a float. Use > int(round('+value+', 0)) > to get an integer. > Sybren ahh of course it does, slaps own forehead sorted thanks :) David P -- http://mail.python.org/mailman/listinfo/python-list

Re: Very weird behavior that's driving me crazy

2006-08-16 Thread Simon Forman
Pupeno wrote: > Hello, > I am experiencing a weird behavior that is driving me crazy. I have module > called Sensors containing, among other things: > > class Manager: > def getStatus(self): > print "getStatus(self=%s)" % self > return {"a": "b", "c": "d"} > > and then I have an

Re: what is the keyword "is" for?

2006-08-16 Thread [EMAIL PROTECTED]
Sybren Stuvel wrote: > Dan Bishop enlightened us with: > a = b = 1e1000 / 1e1000 > a is b > > True > a == b > > False > > If "a is b" then they refer to the same object, hence a == b. It > cannot be otherwise, unless Python starts to defy logic. I copied your > code and got the expec

Re: Very weird behavior that's driving me crazy

2006-08-16 Thread Pupeno
Nevermind, it was fixed. Thanks. Pupeno wrote: > Hello, > I am experiencing a weird behavior that is driving me crazy. I have module > called Sensors containing, among other things: > > class Manager: > def getStatus(self): > print "getStatus(self=%s)" % self > return {"a": "

Re: what is the keyword "is" for?

2006-08-16 Thread Simon Forman
Sybren Stuvel wrote: > Dan Bishop enlightened us with: > a = b = 1e1000 / 1e1000 > a is b > > True > a == b > > False > > If "a is b" then they refer to the same object, hence a == b. It > cannot be otherwise, unless Python starts to defy logic. I copied your > code and got the expec

Re: what is the keyword "is" for?

2006-08-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Sybren Stuvel wrote: > Dan Bishop enlightened us with: > a = b = 1e1000 / 1e1000 > a is b >> True > a == b >> False > > If "a is b" then they refer to the same object, hence a == b. It > cannot be otherwise, unless Python starts to defy logic. I copied your > c

RE: What would be the best way to run python client in the background

2006-08-16 Thread Tim Golden
| Tim Golden wrote: | | > [gel] | > | > | I have written a python client server app [...] | > | I want to run the client end of the app more or less invisibly | > | (no console) on the XP clients when ever a users logs on. [Tim G] | > The normal way is to run a Win32 service. There are several |

Re: using python at the bash shell?

2006-08-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, cga2000 wrote: > and also some bash built-ins such as "cd" do not do anything .. maybe > ipython starts a subprocess that switches and then immediately exits .. > so when I get the prompt back I'm back where I started. If you put a ``!`` in front of ``cd`` this is what hap

Re: how to deepcopy a slice object?

2006-08-16 Thread Simon Forman
Alexandre Guimond wrote: > thx for all the help simon. good ideas i can work with. > > thx again. > > alex. > You're very welcome, a pleasure. ;-) ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory usage of an 'empty' python interpreter

2006-08-16 Thread Ant
[EMAIL PROTECTED] wrote: > I was wondering what the approximate amount of memory needed to load a > Python interpreter (only, no objects, no scripts, no nothing else) in a > Linux 2.6 environment. According to ps, it appears to be 3312 bytes, > which seems absurdly low to me. However, when I che

Re: Very weird behavior that's driving me crazy

2006-08-16 Thread John Machin
Pupeno wrote: > Hello, > I am experiencing a weird behavior that is driving me crazy. I have module > called Sensors containing, among other things: > > class Manager: > def getStatus(self): > print "getStatus(self=%s)" % self > return {"a": "b", "c": "d"} > > and then I have a

Re: Memory usage of an 'empty' python interpreter

2006-08-16 Thread Ganesan Rajagopal
> neokosmos <[EMAIL PROTECTED]> writes: > I was wondering what the approximate amount of memory needed to load a > Python interpreter (only, no objects, no scripts, no nothing else) in a > Linux 2.6 environment. According to ps, it appears to be 3312 bytes, > which seems absurdly low to me.

Re: Memory usage of an 'empty' python interpreter

2006-08-16 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > I was wondering what the approximate amount of memory needed to load a > Python interpreter (only, no objects, no scripts, no nothing else) in a > Linux 2.6 environment. According to ps, it appears to be 3312 bytes, > which seems absurdly low to me. Your spidey sense is

Re: Memory usage of an 'empty' python interpreter

2006-08-16 Thread John Machin
Ant wrote: > [EMAIL PROTECTED] wrote: > > I was wondering what the approximate amount of memory needed to load a > > Python interpreter (only, no objects, no scripts, no nothing else) in a > > Linux 2.6 environment. According to ps, it appears to be 3312 bytes, > > which seems absurdly low to me.

Re: Printing n elements per line in a list

2006-08-16 Thread Gerard Flanagan
unexpected wrote: > If have a list from 1 to 100, what's the easiest, most elegant way to > print them out, so that there are only n elements per line. > > So if n=5, the printed list would look like: > > 1 2 3 4 5 > 6 7 8 9 10 > 11 12 13 14 15 > etc. > > My search through the previous posts yield

Re: What would be the best way to run python client in the background

2006-08-16 Thread Roger Upole
You can use the Task Scheduler to run a script at login. It's not as robust as creating a service, but it's much less work. Roger "gel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > I have written a python client server app that keeps an eye on > processes starting and

Re: Printing n elements per line in a list

2006-08-16 Thread John Machin
Gerard Flanagan wrote: > > just variations on previous answers: > > rng = range(1,101) > > #ad hoc > for line in ( rng[i:i+5] for i in xrange(0,100,5) ): > print ' '.join(map(str,line)) > > #in general > def lines( seq, count=1 ): > n = len(seq) > for x in ( seq[i:i+count] for i in xr

Re: Reference Variables In Python Like Those In PHP

2006-08-16 Thread Laurent Pointal
Chaos a écrit : > Is It possible to have reference variables like in PHP > > ex. > > > $x = 1; > $y =& $x; > > $y += 1; > > echo $x; > echo "\n" > echo $y; > > ?> > > This would show > > 2 > 2 > > Is this available in python? See other replies (ie. in Python all variables are names refer

Re: Creating Charts in Excel with pyExcelerator.ExcelMagic

2006-08-16 Thread Chris
implicate_order wrote: > Greetings, > Here's an Excel class I use. I'm afraid I can't recall where I found the basic class. I have a vague recollection it is due to Mark Hammond, author of the win32com package. Might have been in win32com demos. (Whoever the original author is anyway, many thanks

Re: Global Objects...

2006-08-16 Thread Chaz Ginger
KraftDiner wrote: > I have a question.. > > myGlobalDictionary = dictionary() > > > class someClass: >def __init__(self): > self.x = 0; >def getValue(self, v) > myGlobalDictionary.getVal(v) > > > myGlobalDictionary doesn't seem to be visible to my someClass methods. > Why?

Re: what is the keyword "is" for?

2006-08-16 Thread Dan Sommers
On Wed, 16 Aug 2006 10:06:03 +0200, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In [14]: a is b > Out[14]: True > In [15]: a == b > Out[15]: False > In [16]: a > Out[16]: nan > On my platform the division results in "Not A Number". Two NaNs > compared are always `False`. You could a

Re: programming with Python 3000 in mind

2006-08-16 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > (1) How far away is Python 3000? > Years away, although not that many years. Three? Four? Try 1 1/2. Guido hopes to release 3.0a1 next January and 3.0 final a year after. > (2) Will there be automated tools for co

Re: programming with Python 3000 in mind

2006-08-16 Thread Steve Holden
Steven D'Aprano wrote: > On Tue, 15 Aug 2006 13:16:27 -0700, beliavsky wrote: > > >>The current beta version of Python is 2.5 . How can a Python programmer >>minimize the number of changes that will be needed to run his code in >>Python 3000? In general, he should know what is being removed from

wxPython Install

2006-08-16 Thread Dr. Philipp Walderdorff
Hallo James I had the same problems. But I could solve them. The problem which is left: I do not know exaktly how I solved it. I have tried a lots of times, two weeks or fight against dependency-problems. In FedoraCore5 I did: yum update yum yum install python python-2.4.2-3.2.1 yum install p

Re: Printing n elements per line in a list

2006-08-16 Thread Gerard Flanagan
John Machin wrote: > Gerard Flanagan wrote: > > > > > just variations on previous answers: > > > > rng = range(1,101) > > > > #ad hoc > > for line in ( rng[i:i+5] for i in xrange(0,100,5) ): > > print ' '.join(map(str,line)) > > > > #in general > > def lines( seq, count=1 ): > > n = len(se

Re: programming with Python 3000 in mind

2006-08-16 Thread Paul Boddie
Kay Schluehr wrote: > Fredrik Lundh wrote: > > [EMAIL PROTECTED] wrote: > > > > > The current beta version of Python is 2.5 . How can a Python programmer > > > minimize the number of changes that will be needed to run his code in > > > Python 3000? > > > > by ignoring it, until it exists. > > And w

Defining our own types?

2006-08-16 Thread Michael Yanowitz
Hello: I know this will probably turn about to be another dumb question and I know I have asked a few really dumb ones lately on this list, but I am hoping otherwise this time: suppose I type: ip = 123.45.67.89 (no quotes) - is it possible (maybe by catching an exception), to have this a

Re: Defining our own types?

2006-08-16 Thread Steve Holden
Michael Yanowitz wrote: > Hello: > >I know this will probably turn about to be another dumb question > and I know I have asked a few really dumb ones lately on this list, > but I am hoping otherwise this time: > > suppose I type: > ip = 123.45.67.89 > (no quotes) > - is it possible (may

Re: Printing n elements per line in a list

2006-08-16 Thread Sion Arrowsmith
In article <[EMAIL PROTECTED]>, Dan Sommers <[EMAIL PROTECTED]> wrote: >Perhaps not the prettiest, but I can't think of anything simpler to read >six months from now: > >counter = 0 >for an_element in the_list: >print an_element, >counter = counter + 1 >if counter =

Re: what is the keyword "is" for?

2006-08-16 Thread Sion Arrowsmith
Simon Forman <[EMAIL PROTECTED]> wrote: >Python 2.4.3 (#2, Apr 27 2006, 14:43:58) >[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 >Type "help", "copyright", "credits" or "license" for more information. > >|>> a = b = 1e1000 / 1e1000 >|>> a is b >True >|>> a == b >False I agree with you: $ python P

Re: Printing n elements per line in a list

2006-08-16 Thread John Machin
Yu-Xi Lim wrote: > John Machin wrote: > > > How did you avoid division when testing for leap year? > > > > Well, you're testing for a modulus, not really a division, so a nasty hack: > > def isleapyear(year): > return not year&3 > > works for 1901-2099. > > But programming like this causes a

classes on GladeGen

2006-08-16 Thread Rafal Janas
Hi. I create simple program using glade and GladeGen. In main.py is main class and in wind.py is wind class. In main class is entry1 and button1. When I click on button1 I open wind class wind.Wind() In wind class is entry1 field when I type some values and how can I send this value to main class.

Current module reference

2006-08-16 Thread Miguel Galves
HiHow do I get a reference for the current module I'm in ?I have a package called services with a __init__.pythat need to use getattr() to fill out a hash whithmy package attributes. But to use getattr, I need a object that references my package (kind of this this reference in Java).How can I do it

Optimization of __len__() in cgi.py

2006-08-16 Thread Bob Kline
I have a suggestion for speeding up the performance of code like this: fields = cgi.FieldStorage() if fields: ... which, as it turns out, invokes FieldStorage.__len__(), which in turn calls FieldStorage.keys(), which builds a list of keys by hand, taking several minutes for large forms. This imp

Re: Current module reference

2006-08-16 Thread Steve Holden
Miguel Galves wrote: > Hi > > How do I get a reference for the current module I'm in ? > I have a package called services with a __init__.py > that need to use getattr() to fill out a hash whith > my package attributes. But to use getattr, I need > a object that references my package (kind of this

Re: recommended general-purpose string template packages?

2006-08-16 Thread metaperl
vj wrote: > I use preppy from reportlab: > > http://www.reportlab.org/preppy.html wow. thanks for the link. I second you on pretty. It is ultra-simple and nothing but a gateway to python. also, reportlab makes a number of high-quality open source python wares. -- http://mail.python.org/mailman

RE: What would be the best way to run python client in the background

2006-08-16 Thread Tim Golden
| > [gel] | > | > | I have written a python client server app [...] | > | I want to run the client end of the app more or less invisibly | > | (no console) on the XP clients when ever a users logs on. While this isn't answering the question you first asked, might I suggest an alternative approach?

Re: idea on how to get/set nested python dictionary values

2006-08-16 Thread metaperl
[EMAIL PROTECTED] wrote: > | would use a recursive approach for this - given that you have a sort > of recursive datastructure: > > py> def SetNewDataParam2(Data, NewData): > ... if type(Data[Data.keys()[0]]) == type(dict()): > ... SetNewDataParam2(Data[Data.keys()[0]], NewData) > ...

Re: Optimization of __len__() in cgi.py

2006-08-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Bob Kline wrote: > I have a suggestion for speeding up the performance of code like this: > > fields = cgi.FieldStorage() > if fields: ... > > which, as it turns out, invokes FieldStorage.__len__(), which in turn > calls FieldStorage.keys(), which builds a list of keys by

Re: trying to reach kevin smith, author of plastex

2006-08-16 Thread Kevin Smith
On 2006-08-15 15:28:36 -0400, "metaperl" <[EMAIL PROTECTED]> said: > Email to Kevin Smith regarding his plastex package failed. I hope he > read this group. The tarball that he needs to reproduce the error is > here: > http://arc.livingcosmos.org/wolfram-fruit2/wolfram-fruit.tar.gz > > Hi, when a

Re: round not rounding to 0 places

2006-08-16 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Tim Leslie <[EMAIL PROTECTED]> wrote: >On 16 Aug 2006 00:19:24 -0700, Fuzzydave <[EMAIL PROTECTED]> wrote: >> I have been using a round command in a few places to round >> a value to zero decimal places using the following format, >> >> round('+value+', 0) >> >> but

Adding a char inside path string

2006-08-16 Thread Hitesh
Hi, I get path strings from a DB like: \\serverName\C:\FolderName1\FolderName2\example.exe I am writing a script that can give me access to that exe file. But problem is that string is not universal path, I need to add C$. Any idea how I can add $ char in that string. ServerName is not fixed len

Re: Adding a char inside path string

2006-08-16 Thread Fredrik Lundh
"Hitesh" wrote: > I get path strings from a DB like: > > \\serverName\C:\FolderName1\FolderName2\example.exe > > I am writing a script that can give me access to that exe file. > But problem is that string is not universal path, I need to add C$. > Any idea how I can add $ char in that string. > S

Re: Defining our own types?

2006-08-16 Thread Kay Schluehr
Michael Yanowitz wrote: > Hello: > >I know this will probably turn about to be another dumb question > and I know I have asked a few really dumb ones lately on this list, > but I am hoping otherwise this time: > > suppose I type: > ip = 123.45.67.89 > (no quotes) > - is it possible (maybe

Re: Memory usage of an 'empty' python interpreter

2006-08-16 Thread Ant
> > Are you sure ps is reporting in bytes not KB? The bare interpreter in > > Windows is 3368KB. > > Where did you get that from? With Python 2.4.3, on my machine (Win XP > SP2): > > C:\junk>dir \python24\python* > [snip] > 29/03/2006 05:35 PM 4,608 python.exe > 29/03/2006 05:35 PM

Re: programming with Python 3000 in mind

2006-08-16 Thread John Roth
[EMAIL PROTECTED] wrote: > >> The current beta version of Python is 2.5 . How can a Python > >> programmer minimize the number of changes that will be needed to run > >> his code in Python 3000? > > Since we don't know what Python 3000 will look like yet (it's still in very > early develop

Re: inheritance?

2006-08-16 Thread KraftDiner
Steven D'Aprano wrote: > On Tue, 15 Aug 2006 19:35:11 -0700, KraftDiner wrote: > > > I have two classes: > > > > class implicitClass: > >def __init__(self): > >def isIVR(self): #This is a class private method. > > The convention is to flag classes as "private" with a leading underscore: >

Re: classes on GladeGen

2006-08-16 Thread davelist
On Aug 16, 2006, at 8:05 AM, Rafal Janas wrote: > Hi. > > I create simple program using glade and GladeGen. > In main.py is main class and in wind.py is wind class. > In main class is entry1 and button1. When I click on button1 I open > wind > class wind.Wind() > In wind class is entry1 field w

Re: Error with: pickle.dumps(numpy.float32)

2006-08-16 Thread Iljya
I have reproduced the error with Numpy 1.0b1 The output with v.1.0b1 reads: PicklingError: Can't pickle : it's not found as __builtin__.float32scalar Has anyone else encountered this? Thanks, Iljya Iljya wrote: > Hello, > > I need to pickle the type numpy.float32 but encounter an error when I

Question on extracting doc strings from .py files

2006-08-16 Thread metaperl
If you type: >>> import os; help(os) Then you see the following (see below). But I don't understand where the line "MODULE DOCS http://www.python.org/doc/current/lib/module-os.html " is encoded in os.py anywhere. If you search for the words 'module-os.html' you find nothing. Ditto for 'MODULE

Re: what is the keyword "is" for?

2006-08-16 Thread Alex Martelli
Sybren Stuvel <[EMAIL PROTECTED]> wrote: > Dan Bishop enlightened us with: > a = b = 1e1000 / 1e1000 > a is b > > True > a == b > > False > > If "a is b" then they refer to the same object, hence a == b. It > cannot be otherwise, unless Python starts to defy logic. I copied your P

How to delete a directory tree in FTP

2006-08-16 Thread T
I connect to a FTP server which can be either unix or windows server. Once in the FTP session, I would like to delete a directory tree on the server. Is there a command that will do this? If not, can someone point me to a right direction? Thanks! -- http://mail.python.org/mailman/listinfo/pyth

Re: Question on extracting doc strings from .py files

2006-08-16 Thread Fredrik Lundh
metaperl wrote: import os; help(os) > > Then you see the following (see below). But I don't understand where > the line > "MODULE DOCS > http://www.python.org/doc/current/lib/module-os.html > " > > is encoded in os.py anywhere. If you search for the words > 'module-os.html' you find not

Re: Optimization of __len__() in cgi.py

2006-08-16 Thread Georg Brandl
Bob Kline wrote: > I have a suggestion for speeding up the performance of code like this: > > fields = cgi.FieldStorage() > if fields: ... > > which, as it turns out, invokes FieldStorage.__len__(), which in turn > calls FieldStorage.keys(), which builds a list of keys by hand, taking > several m

Re: idea on how to get/set nested python dictionary values

2006-08-16 Thread [EMAIL PROTECTED]
metaperl wrote: > [EMAIL PROTECTED] wrote: > > > | would use a recursive approach for this - given that you have a sort > > of recursive datastructure: > > > > py> def SetNewDataParam2(Data, NewData): > > ... if type(Data[Data.keys()[0]]) == type(dict()): > > ... SetNewDataParam2(Data[

QListView and text

2006-08-16 Thread Vojta Drbohlav
Hello, Can I get all text from first column in QListView? How? PS. Sorry for my bad English ;) Than you, Vojta -- http://mail.python.org/mailman/listinfo/python-list

Re: Optimization of __len__() in cgi.py

2006-08-16 Thread Bob Kline
Marc 'BlackJack' Rintsch wrote: >> def keys(self): >> return {}.fromkeys([i.name for i in self.list]).keys() > > This does not maintain the order of `self.list`. Don't know if there's > code relying on this. Such code would be flying in the face of an implication that the order of th

Re: Optimization of __len__() in cgi.py

2006-08-16 Thread Bob Kline
Sybren Stuvel wrote: > FieldStorage.__nonzero__ tried first if it exists. You might want to > use that for more optimization. Excellent suggestion! It would be nice if this were adopted to supplement the original optimization, rather than replace it. Bob -- http://mail.python.org/mailman/listin

Re: Adding a char inside path string

2006-08-16 Thread Hitesh
Thank you Fredrik. That works for a string. But I am getting list of tuples from DB. rows = [('\\serverName\C:\FolderName1\FolderName2\example.exe',), ('\\serverName\C:\FolderName1\FolderName2\example2.exe',), ('\\serverName\C:\FolderName1\FolderName2\example3.exe',), ('\\serverName\C:\FolderName

python-dev and setting up setting up f2py on Windows XP

2006-08-16 Thread Sile
Hi, I've been trying to get f2py working on Windows XP, I am using Python 2.3. I'm new to python so I'm not too sure what I'm doing yet. I need the python-dev package to run f2py. I have been told this is just the header files and .dll and I need to put them somewhere my C compiler can find them.

Re: inheritance?

2006-08-16 Thread infidel
> Yes I believe so but in fromfile I want to call the appropriate > method depending on the in a parameter in fromfile... > like: > class baseClass: >def fromfile(self, fileObj, byteOrder=None, explicit=False): > if explicit: > call fromfile of explicit class > else: >

Re: QListView and text

2006-08-16 Thread Phil Thompson
On Wednesday 16 August 2006 4:43 pm, Vojta Drbohlav wrote: > Hello, > Can I get all text from first column in QListView? How? > > PS. Sorry for my bad English ;) > > Than you, Vojta Assuming you are talking about PyQt v3 rather than v4 then use the columnText() method. Phil -- http://mail.pytho

QListView and text

2006-08-16 Thread Vojta Drbohlav
Oh, sorry. I explained it bad. I use PyQt3 and I need text from all rows. -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a char inside path string

2006-08-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Hitesh wrote: > That works for a string. > But I am getting list of tuples from DB. > > rows = [('\\serverName\C:\FolderName1\FolderName2\example.exe',), > ('\\serverName\C:\FolderName1\FolderName2\example2.exe',), > ('\\serverName\C:\FolderName1\FolderName2\example3.exe',

Re: QListView and text

2006-08-16 Thread Phil Thompson
On Wednesday 16 August 2006 5:29 pm, Vojta Drbohlav wrote: > Oh, sorry. I explained it bad. > > I use PyQt3 and I need text from all rows. row = listView.firstChild() while row: for col in range(listView.columns()): text = row.text(col) row = row.nextSibling() ..

Re: Adding a char inside path string

2006-08-16 Thread Tim Williams
On 16/08/06, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 16 Aug 2006 09:00:57 -0700, "Hitesh" <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > > > > Thank you Fredrik. That works for a string. > > But I am getting list of tuples from DB. > > > > rows = [('\\serverName\C:

ELAN IT - Python Developer - South East

2006-08-16 Thread Jan de Swart
A successful company with global ties is seeking a Software Developer to work at their site in Reading. As a company they are expanding fast and want good developers to join and progress with them, offering the opportunity for a successful career. My client is a market leading provider of B2B soft

Re: X windows and Python?

2006-08-16 Thread Paul Rubin
Grant Edwards <[EMAIL PROTECTED]> writes: > The way (well, _one_ way) it's supposed to work is you make an > Xlib call to claim ownership of "the selection". ... Thanks, this explanation was very interesting. It would be great if tkinter had some calls to do this stuff, which I guess means the un

profanity filter

2006-08-16 Thread Ronny Abraham
Hi guys, does anyone have any idea where I can find a profanity filter written in python? -ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Error with: pickle.dumps(numpy.float32)

2006-08-16 Thread Ziga Seilnacht
Iljya wrote: > I have reproduced the error with Numpy 1.0b1 > > The output with v.1.0b1 reads: > PicklingError: Can't pickle : it's not found as > __builtin__.float32scalar > > Has anyone else encountered this? > > Thanks, > > Iljya > > Iljya wrote: > > Hello, > > > > I need to pickle the type nump

Re: Adding a char inside path string

2006-08-16 Thread Hitesh
Thank you all it worked!. Tim, > modRows = ['\\'+itm[0].replace(":", "$") for itm in rows] What are those two forward slashes for? I had to remove them otherwise I was getting output like '\\' inside list or if I print I was getting like \\\ Thanks, hj Tim Williams wrote: > On 16/08/06,

Re: profanity filter

2006-08-16 Thread skip
Ronny> does anyone have any idea where I can find a profanity filter Ronny> written in python? No, but maybe SpamBayes (or a tiny little part of it) would suit your needs. Do you want to remove profanity and let the document (email, web page, etc) pass, just score if for profanity or blo

Re: inheritance?

2006-08-16 Thread John Henry
As others pointed out already, this kind of "if then else" determination of type is best avoided. If it looks like a duck, quakes like a duck, must be a duck. KraftDiner wrote: > Steven D'Aprano wrote: > > On Tue, 15 Aug 2006 19:35:11 -0700, KraftDiner wrote: > > > > > I have two classes: > > > >

Re: Open file handles?

2006-08-16 Thread Hari Sekhon
danielx wrote: Is there an equivalent in windows? Jon wrote: Perhaps using os you could work with lsof [http://www.linuxcommand.org/man_pages/lsof8.html] Jon Thomas Bartkus wrote: This may be more of a Linux question, but I'm doing this from Python. . How ca

Re: os.path.normpath

2006-08-16 Thread Hari Sekhon
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I am using a windows box and passing a string like "../foo/../foo2" to normpath which then returns "..\\foo2". But if this string is going into a webpage link it should really be "../foo". Is there any way to tell os.path.normpath

Re: Optimization of __len__() in cgi.py

2006-08-16 Thread Bob Kline
Georg Brandl wrote: > Post a RFE to the Python Tracker at > http://sourceforge.net/tracker/?group_id=5470&atid=355470 > > If you want, assign it to me (gbrandl). Done, thanks. Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: QListView and text

2006-08-16 Thread Vojta Drbohlav
Thank you very much. How can I move slected item up? This is no work: sel = list.currentItem() sel.moveItem(sel.itemAbove()) -- http://mail.python.org/mailman/listinfo/python-list

Re: inheritance?

2006-08-16 Thread KraftDiner
Steven D'Aprano wrote: > On Tue, 15 Aug 2006 19:35:11 -0700, KraftDiner wrote: > > > I have two classes: > > > > class implicitClass: > >def __init__(self): > >def isIVR(self): #This is a class private method. > > The convention is to flag classes as "private" with a leading underscore: >

Re: python-dev and setting up setting up f2py on Windows XP

2006-08-16 Thread [EMAIL PROTECTED]
I'm really not familiar with the package you are trying to use, nor that familiar with what you get on windows. I would guess you did a binary installation download, and you may need to get the python source tarball instead - in order to get the files you need. Barring that, I'm certain the heade

Re: profanity filter

2006-08-16 Thread skip
Ronny> replacement of profanity would be good, like * or so. It's Ronny> for a website as opposed to checking email. Can SpamBayes be Ronny> applied to comments or strings within a program? SpamBayes scores inputs which look like emails (header, blank line, body). All it does is

Segmentation Fault using MySQLdb and twisted

2006-08-16 Thread jgarber
Hello, I just upgraded MySQLdb to the 1.2.0 version provided by Redhat Enterprise Linux ES4. At that point I began to get segfaults when importing twisted after MySQLdb, but not before. -- RedHat Enterprise Linux ES 4 (fully updated) Python 2.3.4 mysql-python (MySQLdb) version 1.2.0 twisted vers

It is __del__ calling twice for some instances?

2006-08-16 Thread Max Yuzhakov
Hello! It is correct behaviour for python to call __del__ on some identity of a class object more than once? In brief I shall describe a situation. Sorry for my english. For debugin purposes I'm put in my module global counters for counting __init__ and __del__ calls. This is a sample code for

trouble understanding inheritance...

2006-08-16 Thread KraftDiner
This is not working the way I think it should it would appear that fromfile and getName are calling the baseClass methods which are simple passes What have I done wrong? class baseClass: def __init__(self, type): if type == 'A': self = typeA(

Re: It is __del__ calling twice for some instances?

2006-08-16 Thread Max Yuzhakov
Max Yuzhakov writes: MY> print "difference = %d" % init_cnt-del_cnt Little correction. print "difference = %d" % (init_cnt-del_cnt) -- GMT More Then ... -- http://mail.python.org/mailman/listinfo/python-list

Problems with Sizers

2006-08-16 Thread Mario Lacunza
Hello, I have troubbles in this code when I try to resize the form, all the widgets dont move. Any idea? Thansk in advance! - # -*- coding: utf8 -*-# #Boa:Dialog:frmPostales import wx #import modGlobals #from Conect

Re: sending mailing list with smtplib

2006-08-16 Thread 3KWA
3KWA wrote: > Just for education purposes (mine I guess :P) what was the idea behind > that design decision? >From the doc (self education :P) The following methods implement a mapping-like interface for accessing the message's RFC 2822 headers. Note that there are some semantic differences bet

Re: trouble understanding inheritance...

2006-08-16 Thread Fredrik Lundh
KraftDiner wrote: > This is not working the way I think it should > it would appear that fromfile and getName are calling the baseClass > methods which are > simple passes What have I done wrong? > > class baseClass: > def __init__(self, type): > if type == 'A': >

Re: Clean way to not get object back from instantiation attempt gone bad

2006-08-16 Thread Simon Forman
John Machin wrote: > Simon Forman wrote: > > > > > |>> class f: > > ... def __init__(self): > > ... del self > > Of course nothing happens. Args are local variables. 'self' is is a > vanilla arg of a vanilla function. I know. > > ... > > |>> e = f() > > |>> e > > <__main__.f insta

  1   2   >