a question about my script

2006-08-29 Thread alper soyler
Hi all,I am trying to get some files from an ftp site by ftplib module and I wrote the below script. However I have a problem. With my script, I login to ftp.genome.jp site. then, I am changing the directory to pub/kegg/genomes/afm and I am downloading "a.fumigatus.pep" file. However, what I want i

Re: Is this a good idea or a waste of time?

2006-08-29 Thread Simon Forman
Antoon Pardon wrote: > On 2006-08-28, Scott David Daniels <[EMAIL PROTECTED]> wrote: > > Antoon Pardon wrote: > >> On 2006-08-25, Simon Forman <[EMAIL PROTECTED]> wrote: > >>> ... > >>> Generally asserts should be used to "enforce" invariants of your code > >>> (as opposed to typechecking), or to c

Re: naive misuse? (of PyThreadState_SetAsyncExc)

2006-08-29 Thread Simon Forman
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > The documentation for PyThreadState_SetAsyncExc says "To prevent naive > > misuse, you must write your own C extension to call this". Anyone care > > to list a few examples of such naive misuse? > > No? I'll take that then as proof that it's

Re: XML parsing and writing

2006-08-29 Thread Stefan Behnel
c00i90wn wrote: > Stefan Behnel wrote: >> c00i90wn wrote: >>> Hey, I'm having a problem with the xml.dom.minidom package, I want to >>> generate a simple xml for storing configuration variables, for that >>> purpose I've written the following code, but before pasting it I'll >>> tell you what my pr

Re: Don't use __slots__ (was Re: performance of dictionary lookup vs. object attributes)

2006-08-29 Thread Antoon Pardon
On 2006-08-27, Jacob Hallen <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Patrick Maupin <[EMAIL PROTECTED]> wrote: > > Unfortunately there is a side effect to slots. They change the behaviour of > the objects that have slots in a way that can be abused by control freaks > and stat

Re: Is this a good idea or a waste of time?

2006-08-29 Thread Jonathan Gardner
Simon Forman wrote: > > If you have a reason to restrict your code to using only ints (perhaps > you're packing them into an array of some sort, or passing them to a C > extension module) then yes, of course it's appropriate. I politely disagree. Rather than an interface that demands an actual in

prob with tkinter

2006-08-29 Thread JyotiC
hi, i am making a GUI using tkinter i need to get lot of data from user, it's in form of a excel sheets(many rows n columns) what i am using is grid for foramating, frame is from Toplevel, data collected from Entry widget I can't see most of the columns. I am not able to add scroll bar, i want it t

prob with tkinter

2006-08-29 Thread JyotiC
hi, i am making a GUI using tkinter i need to get lot of data from user, it's in form of a excel sheets(many rows n columns) what i am using is grid for foramating, frame is from Toplevel, data collected from Entry widget I can't see most of the columns. I am not able to add scroll bar, i want it t

Re: a question about my script

2006-08-29 Thread Gabriel Genellina
At Tuesday 29/8/2006 03:55, alper soyler wrote: I am trying to get some files from an ftp site by ftplib module and I wrote the below script. However I have a problem. With my script, I login to ftp.genome.jp site. then, I am changing the directory to pub/kegg/genomes/afm and I am downloading

Candygram

2006-08-29 Thread Salvatore
Hello, I am using the following code to fetch URL Is there a way to speed it. I cant't get rid of the time.sleep(1) for every request !!! Thank you for you advise Regards Salvatore from candygram import cg def fetchURL(): r = cg.Receiver() r.addHandler(cg.Any,getURL,cg.Message) fo

The lib email parse problem...

2006-08-29 Thread 叮叮当当
hi, all when a email body consist with multipart/alternative, i must know when the boundary ends to parse it, but the email lib have not provide some function to indicate the boundary end, how to solve it ? thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good idea or a waste of time?

2006-08-29 Thread Antoon Pardon
On 2006-08-29, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > > Simon Forman wrote: >> >> If you have a reason to restrict your code to using only ints (perhaps >> you're packing them into an array of some sort, or passing them to a C >> extension module) then yes, of course it's appropriate. > > I

Re: How ahead are you guys in the (Python) real world?

2006-08-29 Thread Fredrik Lundh
"Ray" wrote: > Since I haven't used Python at work, I am using Python 2.5 right now. > However I wonder, how fast are you guys moving from version to version > at work? fwiw, I work on systems that runs on 1.5.2, 2.1, 2.3 and "bleeding edge". -- http://mail.python.org/mailman/listinfo/pyth

Re: How ahead are you guys in the (Python) real world?

2006-08-29 Thread Fredrik Lundh
Jorge Vargas wrote: > for ones 2.5 is not consider production code yet so noone should be > running anything on it. same with 1.6. that's completely ignoring how Python's developed, though. if you know what you're doing, using stable (*) betas or release candidates can be an excellent idea.

Re: Desktop Notification/Alerts In Python

2006-08-29 Thread alex23
Chaos wrote: > I am looking for ways to have a Desktop Alert, like the one most IM > Messengers have (MSN, AIM) at the lower right above the taskbar. Can > anyone point me to the right resources to use? Under Windows, they're called "balloon tips". Here's a thread from a few years back asking for

Re: The lib email parse problem...

2006-08-29 Thread Fredrik Lundh
"" wrote: > when a email body consist with multipart/alternative, i must know when > the boundary ends to parse it, or use a library that understands multipart messages. > but the email lib have not provide some function to indicate the > boundary end, how to solve it ? http://docs.pyt

Re: How ahead are you guys in the (Python) real world?

2006-08-29 Thread Bruno Desthuilliers
Ray wrote: > Since I haven't used Python at work, I am using Python 2.5 right now. > However I wonder, how fast are you guys moving from version to version > at work? As an illustration my ex-company just moved to Java 5, which > was released around... what, 2-3 years ago? (While I am running Java

Re: XML parsing and writing

2006-08-29 Thread Fredrik Lundh
someone wrote: >> Nice package ElementTree is but sadly it doesn't have a pretty print, >> well, guess I'll have to do it myself, if you have one already can you >> please give it to me? thanks :) http://effbot.python-hosting.com/file/stuff/sandbox/elementlib/indent.py -- http://mail.pytho

Re: The lib email parse problem...

2006-08-29 Thread John Machin
叮叮当当 wrote: > hi, all > > when a email body consist with multipart/alternative, i must know when > the boundary ends to parse it, > > but the email lib have not provide some function to indicate the > boundary end, how to solve it ? By reading the manual. http://docs.python.org/lib/module-email.M

Re: Truly platform-independent DB access in Python?

2006-08-29 Thread Bruno Desthuilliers
Boris Dušek wrote: > Bruno Desthuilliers wrote: > >>> but what if the OS with server accessing the site that is on >>> shared area changes? >> And what if Python is not installed on it ?-) >> >> Seriously, do you think that hosting companies swap OS very often ? > > No, I don't. But I was trying

Re: unit test for a printing method

2006-08-29 Thread Fredrik Lundh
Marco Wahl wrote: > Fredrik Lundh <[EMAIL PROTECTED]> writes: >> >> Scott David Daniels wrote: >> >>> For silly module myprog.py: >>> def A(s): >>> print '---'+s+'---' >>> in test_myprog.py: >>> import unittest >>> from cStringIO import StringIO # or from StringIO ... >>

Re: The lib email parse problem...

2006-08-29 Thread 叮叮当当
this is not enough. when a part is mulitpart/alternative, i must find out which sub part i need, not all the subparts. so i must know when the alternative is ended. John Machin 写道: > 叮叮当当 wrote: > > hi, all > > > > when a email body consist with multipart/alternative, i must know when > > the

Re: The lib email parse problem...

2006-08-29 Thread Max M
叮叮当当 wrote: > this is not enough. > > when a part is mulitpart/alternative, i must find out which sub part i > need, not all the subparts. so i must know when the alternative is > ended. Have you tried the email module at all? -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Sci

Re: The lib email parse problem...

2006-08-29 Thread 叮叮当当
supose a email part like this: Content-Type: Multipart/Alternative; boundary="Boundary-=_iTIraXJMjfQvFKkvZlqprUgHZWDm" --Boundary-=_iTIraXJMjfQvFKkvZlqprUgHZWDm Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit abcd. --Boundary-=_iTIraXJMjfQvFKkvZlqprUgHZWDm Content-

Re: Pros/Cons of Turbogears/Rails?

2006-08-29 Thread Paul Boddie
[comp.lang.ruby snipped] Ray wrote: > Paul Boddie wrote: > > > > So actual maturity isn't important when using a technology: it's > > "perceived maturity" that counts, right? > > Well depends on "counts" in what sense. Counts as in the managers up > there perceive something as mature, despite proo

Re: The lib email parse problem...

2006-08-29 Thread 叮叮当当
i just use email module lib. Max M 写道: > 叮叮当当 wrote: > > this is not enough. > > > > when a part is mulitpart/alternative, i must find out which sub part i > > need, not all the subparts. so i must know when the alternative is > > ended. > > > Have you tried the email module at all? > > > -- > >

Re: How ahead are you guys in the (Python) real world?

2006-08-29 Thread Fuzzyman
Ray wrote: > Since I haven't used Python at work, I am using Python 2.5 right now. > However I wonder, how fast are you guys moving from version to version > at work? As an illustration my ex-company just moved to Java 5, which > was released around... what, 2-3 years ago? (While I am running Java

Re: Is this a good idea or a waste of time?

2006-08-29 Thread Steve Holden
Antoon Pardon wrote: > On 2006-08-29, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > >>At Tuesday 29/8/2006 02:45, Antoon Pardon wrote: >> >> >That may be true. But one may wonder if this is a failing of the >programmer or a failing of the language that doesn't support >such things. >>

Re: time.clock() going backwards??

2006-08-29 Thread Hendrik van Rooyen
"Grant Edwards" <[EMAIL PROTECTED]> Wrote: | On 2006-08-28, Grant Edwards <[EMAIL PROTECTED]> wrote: | | >>> For processors that run at (say) 2GHz, several million (say 10 | >>> million) represents a difference of 10e6/2e9 = 0.005 seconds | >>> between when the processors were sufficiently power

Re: How to let a loop run for a while before checking for break condition?

2006-08-29 Thread Hendrik van Rooyen
"Claudio Grondi" <[EMAIL PROTECTED]> wrote: 8<- | The test of the counter is what actually slows the loop down. Probably | the test of time slows the loop even more down. Any test slows a loop | down, so the idea here is to get rid of the test what can be done by | interrupti

Re: The lib email parse problem...

2006-08-29 Thread Fredrik Lundh
"" wrote: > the plain text is abcd, and the alternative content type is text/html, > i should prefer explain the html content, and i must not explaint the > two part ,so i want to get the boundary end. so use the email module: import email message_text = "..." message = email.m

Re: The lib email parse problem...

2006-08-29 Thread Steve Holden
叮叮当当 wrote: > supose a email part like this: > > Content-Type: Multipart/Alternative; > boundary="Boundary-=_iTIraXJMjfQvFKkvZlqprUgHZWDm" > > > --Boundary-=_iTIraXJMjfQvFKkvZlqprUgHZWDm > Content-Type: text/plain; charset="gb2312" > Content-Transfer-Encoding: 7bit > >abcd. > --Boundary-=_i

Re: Starting up the server

2006-08-29 Thread alex23
john Perry wrote: > how to solve these error > ImportError: No module named pkg_resources Hey John, There's a TurboGears group that will be better suited to answering TG-related questions: http://groups.google.com/group/turbogears It looks like this issue has come up before: http://groups.google

Re: Pros/Cons of Turbogears/Rails?

2006-08-29 Thread Christophe
Paul Boddie a écrit : > [comp.lang.ruby snipped] > > Ray wrote: >> I've met a number of >> people who've told me they'd program in Eiffel if they could. And hey, >> perhaps in its day Eiffel *was* the best OO language out there. >> Certainly it looked cleaner than C++! :) > > So why don't they? M

Re: The lib email parse problem...

2006-08-29 Thread 叮叮当当
this is just a temp solution for the simplest email format as my example, and i cannot always only show the html part. but in fact , there are many more difficult mail format btw, i know how to use walk(), and the question is not this. my code is as the following: def mail_content(mail): co

Re: The lib email parse problem...

2006-08-29 Thread 叮叮当当
i know how to use email module lib. the question is about how to handle the rfc 1521 mime mulitpart/alternitave part . i know emai can handle mulitpart , but the subpart alternative is special . Steve Holden 写道: > 叮叮当当 wrote: > > supose a email part like this: > > > > Content-Type: Multipart

Re: The lib email parse problem...

2006-08-29 Thread Fredrik Lundh
"" wrote: > btw, i know how to use walk(), and the question is not this. so what is the question? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good idea or a waste of time?

2006-08-29 Thread Antoon Pardon
On 2006-08-29, Steve Holden <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: >> On 2006-08-29, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> >>>At Tuesday 29/8/2006 02:45, Antoon Pardon wrote: >>> >>> >>That may be true. But one may wonder if this is a failing of the >>programmer or a f

Re: The lib email parse problem...

2006-08-29 Thread John Machin
叮叮当当 wrote: > this is not enough. > > when a part is mulitpart/alternative, i must find out which sub part i > need, not all the subparts. so i must know when the alternative is > ended. > So you'll have to write your own tree-walker. It would seem that is_multipart(), get_content_type() and get_p

Re: about daemons and IPC

2006-08-29 Thread flupke
[EMAIL PROTECTED] schreef: > Hey people! > For the first time I'm doing a client/server application, and I'm > really confused with IPC stuff. > > I read the fastest method is shared memory, but I tryed mmap and found > it tedious for the amount of data I'm handling (which is 30K at most, > but mm

ntp in python

2006-08-29 Thread Janto Dreijer
I want to measure the packet delivery delays over various network links. For this I need to synchronise the times of the sender and receiver, either against NTP or eachother. Unfortunately I won't necessarily have root priviledges to change the PCs' clocks. So I'm looking for a way I can determine

Re: unit test for a printing method

2006-08-29 Thread noro
Fredrik Lundh wrote: > Scott David Daniels wrote: > > > For silly module myprog.py: > > def A(s): > > print '---'+s+'---' > > in test_myprog.py: > > import unittest > > from cStringIO import StringIO # or from StringIO ... > > why are you trying to reinvent doctest ? > >

Re: unit test for a printing method

2006-08-29 Thread Fredrik Lundh
"noro" wrote: >> why are you trying to reinvent doctest ? > > it was my understanding that "doctest" is intented to test the little > examples in a function/class documention, do people use it for more > then that, i.e - do an extentive output testing for thier apps? yes (by using doctest to test

Re: NEED HELP

2006-08-29 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Below is my code, which is kind of virtual and with its help ill use it > in my main project. > Now what i am looking for is can anybody write all the code inside a > class...so that I can reuse it. I am kind of novice...n kind of stuc > with that. > > from Tkinter impor

Re: Pros/Cons of Turbogears/Rails?

2006-08-29 Thread Ray
Paul Boddie wrote: > Sure. Just get certified on whatever today's middle management are > advocating, spend a few years working with that stuff, then repeat the > process for the next generation of middle management - it can certainly > make money for people who don't seek any meaning in what the

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Joachim Durchholz
Jim Gibson schrieb: > > The problem addressed by what is know in Perl as the 'Schwartzian > Transform' is that the compare operation can be an expensive one, > regardless of the whether the comparison uses multiple keys. Since in > comparison sorts, the compare operation will be executed N(logN) t

Extending the dict class

2006-08-29 Thread chosechu
Hello Pythoneers: I need to pass a list of named arguments to a function in a given order, and make sure these named arguments are retrieved using keys() in the same order they were given. Example: keyargs={} keyargs['one']=1 keyargs['two']=2 keyargs['three']=3 myfunc(**keyargs) -> myfunc would

Re: Extending the dict class

2006-08-29 Thread Duncan Booth
chosechu wrote: > Is it possible to force dictionary creation in these case to use > my own dict class instead of the default one? No > I guess we can formulate this as a more generic question: if I > want to modify the behaviour of the dictionary class, is there > any way to do it interpreter-w

Re: Pros/Cons of Turbogears/Rails?

2006-08-29 Thread Paul Boddie
Ray wrote: > > It can certainly make money--true. "Don't seek any meaning in what they > do"?! You're just accusing a lot of honest hardworking people to be > mindless drones there. We have feelings too, you know :( Well, I'm sorry for the unintentional insult. However, I've come to believe that s

Re: Extending the dict class

2006-08-29 Thread chosechu
Duncan Booth wrote: > > Is it possible to force dictionary creation in these case to use > > my own dict class instead of the default one? > > No Ouch. I was expecting something like that, thanks for confirming it. If I may: this seems inconsistent to me. I have created an augmented version of t

Re: Extending the dict class

2006-08-29 Thread Bruno Desthuilliers
chosechu wrote: > Hello Pythoneers: > > I need to pass a list of named arguments to a function in a given > order, > and make sure these named arguments are retrieved using keys() in the > same order they were given. Example: > > keyargs={} > keyargs['one']=1 > keyargs['two']=2 > keyargs['three']

Re: Pros/Cons of Turbogears/Rails?

2006-08-29 Thread Bruno Desthuilliers
Paul Boddie wrote: > Ray wrote: (snip) >> We're a Java shop so >> our developers are trained in Java, Struts, Tomcat, etc. Any switch to >> a dynamic language will be a huge change. However it baffles me that >> they are open to at least a PoC in Rails. but when I suggested Python, >> they went: "n

Python and Prolog

2006-08-29 Thread rodmc
Can anyone recommend a library which will let me bridge between Python and Prolog? I have looked around but as yet have had no luck. Either the libraries are no longer being updated or the links do not work. FYI: I am using Python 2.4 and SWI Prolog, I would also like to make sure it can run on Mac

Re: Extending the dict class

2006-08-29 Thread chosechu
> I'm not sure to understand why you want to do so - perhaps you could > tell more about your real use case ? Without diving into too many details: I am calling SOAPpy to build SOAP requests. When calling a proxy, named arguments are used to build up the corresponding XML like: proxy.call(alpha=

subprocess woes

2006-08-29 Thread km
Hi all, I have a strange question. a program on shell looks as follows: $cat test.fa |fasta34 -q @ s where test.fa contains a protein sequence (alphabets); s is the database to be searched and @ +indicates that the input is from stdin (ie., 'cat test.fa') now instead of 'cat test.fa' i take that i

Re: Extending the dict class

2006-08-29 Thread Fredrik Lundh
"chosechu" wrote: > Yes, if I could simply modify myfunc() I would have workarounds. > This would mean me modifying SOAPpy and specializing it for > my needs. maybe you could fake it: class fakedict(dict): def __init__(self, *data): self.data = list(data) for k, v in data:

Re: Extending the dict class

2006-08-29 Thread Duncan Booth
chosechu wrote: > SOAPpy cannot know in advance the argument names since > they are server-dependent and SOAPpy is generic, so retrieving > named arguments with **k seems like the sensible thing to do. > Unfortunately this gets converted to a dict so looses all ordering > when being received. Exte

Re: Extending the dict class

2006-08-29 Thread chosechu
Duncan Booth wrote: > If the order of the argument names matters, then it seems to me that should > be handled by the SOAP library, not pushed onto the end user whoch should > just be calling the function with the named arguments in the most > convenient order. > > Shouldn't SOAPpy be able to get

Re: How ahead are you guys in the (Python) real world?

2006-08-29 Thread A.M. Kuchling
On 28 Aug 2006 20:13:54 -0700, Ray <[EMAIL PROTECTED]> wrote: > Since I haven't used Python at work, I am using Python 2.5 right now. > However I wonder, how fast are you guys moving from version to version > at work? At our company, we build a product on top of Debian (product line 1) o

Re: ntp in python

2006-08-29 Thread Jeremy Sanders
Janto Dreijer wrote: > I want to measure the packet delivery delays over various network > links. For this I need to synchronise the times of the sender and > receiver, either against NTP or eachother. Couldn't you just use NTP itself to get the delivery delay? You can read the delay out from the

Re: Extending the dict class

2006-08-29 Thread chosechu
> (the exact set of methods you need to override depends on how SOAPpy > fetches the members). [fakedict class] This I did. And checking out the source it seems SOAPpy retrieves named parameters through keys(), which is the method I tried to overload. Trouble is: something happens to my fakedict

Re: Extending the dict class

2006-08-29 Thread Duncan Booth
chosechu wrote: > > Duncan Booth wrote: >> If the order of the argument names matters, then it seems to me that >> should be handled by the SOAP library, not pushed onto the end user >> whoch should just be calling the function with the named arguments in >> the most convenient order. >> >> Shoul

Re: Extending the dict class

2006-08-29 Thread chosechu
Duncan Booth wrote: > No, you weren't able to extend the builtin dict class nor touch any its > constructor. Yes, sorry. Forgot the negation. > All you did was to create a subclass with its own constructor and hide the > name for the builtin dictionary type. The original type was still unchanged

Re: Extending the dict class

2006-08-29 Thread Tim N. van der Leeuw
Fredrik Lundh wrote: > "chosechu" wrote: > > > Yes, if I could simply modify myfunc() I would have workarounds. > > This would mean me modifying SOAPpy and specializing it for > > my needs. > > maybe you could fake it: > No you cannot fake it, because the ** form of passing arguments constructs a

Re: Extending the dict class

2006-08-29 Thread Tim N. van der Leeuw
chosechu wrote: > Duncan Booth wrote: > > If the order of the argument names matters, then it seems to me that should > > be handled by the SOAP library, not pushed onto the end user whoch should > > just be calling the function with the named arguments in the most > > convenient order. > > > > Sh

Re: Extending the dict class

2006-08-29 Thread Fredrik Lundh
Tim N. van der Leeuw wrote: >> maybe you could fake it: >> > No you cannot fake it, because the ** form of passing arguments > constructs a new dictionary (and that dictionary is the standard > built-in type of dictionary, not your own fake-dictionary). yeah, I thought he was passing a dictionary

Re: Max OSX and Excel

2006-08-29 Thread Jorge Vargas
On 28 Aug 2006 15:50:57 -0700, John Machin <[EMAIL PROTECTED]> wrote: > Jorge Vargas wrote: > > On 8/28/06, Johanna Pfalz <[EMAIL PROTECTED]> wrote: > > > To be more specific, I'm interested in reading in certain rows and columns > > > from an excel spreadsheet directly without converting the infor

absolute imports (python-2.5)

2006-08-29 Thread [EMAIL PROTECTED]
Hello all I just played around a bit with python 2.5 and relative imports. Bit disappointed so far. Hoped to be able to use this new feature to develop standalone libraries that can be just dropped into any project without having to adjust any imports. pkg/ pkg/__init__.py pkg/main.py pkg/string.

Re: ntp in python

2006-08-29 Thread Sander Steffann
Hi, > I want to measure the packet delivery delays over various network > links. For this I need to synchronise the times of the sender and > receiver, either against NTP or eachother. Maybe you can contact RIPE. They have test-boxes for exactly these kind of tests. I know AMS-IX uses them to me

Re: Python daemon process

2006-08-29 Thread Thomas Dybdahl Ahle
I might not have made myself very clear, since you both got me wrong. What I need, is not a method to terminate a process, but a way to terminate a process when the main process dies. >From the atexit module info: Note: the functions registered via this module are not called when the program is ki

Re: newbe question about removing items from one file to another file

2006-08-29 Thread Anthra Norell
Dexter, I looked at the format specification. It contains an example: --- ; ; test.csd - a Csound structured data file -W -d -o tone.wav ;optional section Before 4.10 ;these two statements check for After 4.08 ; Csound version 4.09

Re: Extending the dict class

2006-08-29 Thread chosechu
Tim N. van der Leeuw wrote: > Anyways, modifiying SOAPpy might not be a bad idea: submit your changes > to the project, and you can write on your CV that you have contributed > to open-source projects! ;-) Been there, done that. Don't worry, my contributions to open-source projects is largely pos

SOAPpy question

2006-08-29 Thread Yusnel Rojas
hello ,I'm wondering if SOAPpy doesn't have something to generate a wsdl for a specific application.Let's say, I wrote a web service with SOAPpy, is there any way to generate the wsdl for it. If there aren't can someone give a little example of both. thanks -- http://mail.python.org/mailman/lis

refering to base classes

2006-08-29 Thread glenn
hi - Im quite new to python, wondering if anyone can help me understand something about inheritance here. In this trivial example, how could I modify the voice method of 'dog' to call the base class 'creatures' voice method from with in it? class creature: def __init__(self): self.noi

Re: Python editor

2006-08-29 Thread John Salerno
Jerry Fleming wrote: > Larry Bates wrote: >> Jason Jiang wrote: >>> Hi, >>> >>> Could someone recommend a good Python editor? Thanks. >>> >>> Jason >>> >>> >> For just getting started use Idle that comes with Python. >> If you are already a user or if you are looking for a more >> powerful solution

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread xhoster
Joachim Durchholz <[EMAIL PROTECTED]> wrote: > Jim Gibson schrieb: > > > > The problem addressed by what is know in Perl as the 'Schwartzian > > Transform' is that the compare operation can be an expensive one, > > regardless of the whether the comparison uses multiple keys. Since in > > comparison

Re: refering to base classes

2006-08-29 Thread Chaz Ginger
glenn wrote: > hi - Im quite new to python, wondering if anyone can help me understand > something about inheritance here. In this trivial example, how could I > modify the voice method of 'dog' to call the base class 'creatures' > voice method from with in it? > > class creature: > def __ini

Re: refering to base classes

2006-08-29 Thread Chaz Ginger
Chaz Ginger wrote: > glenn wrote: >> hi - Im quite new to python, wondering if anyone can help me understand >> something about inheritance here. In this trivial example, how could I >> modify the voice method of 'dog' to call the base class 'creatures' >> voice method from with in it? >> >> class

Re: Extending the dict class

2006-08-29 Thread Bruno Desthuilliers
chosechu wrote: > Duncan Booth wrote: >> No, you weren't able to extend the builtin dict class nor touch any its >> constructor. > > Yes, sorry. Forgot the negation. > >> All you did was to create a subclass with its own constructor and hide the >> name for the builtin dictionary type. The origin

Re: refering to base classes

2006-08-29 Thread Roberto Bonvallet
glenn wrote: > [...] In this trivial example, how could I modify the voice method of > 'dog' to call the base class 'creatures' voice method from with in it? > > class creature: >def __init__(self): >self.noise="" >def voice(self): >return "voice:" + self.noise > > class

Re: Python editor

2006-08-29 Thread [EMAIL PROTECTED]
John Salerno wrote: > Is it possible to get vim-python for Windows, or is that just a Linux build? It builds for windows. -- http://mail.python.org/mailman/listinfo/python-list

Re: refering to base classes

2006-08-29 Thread Bruno Desthuilliers
glenn wrote: > hi - Im quite new to python, wondering if anyone can help me understand > something about inheritance here. In this trivial example, how could I > modify the voice method of 'dog' to call the base class 'creatures' > voice method from with in it? > > class creature: > def __ini

Re: RE Module

2006-08-29 Thread Roman
It turns out false alarm. It work. I had other logic in the expression involving punctuation marks and got all confused with the escape characters. It becomes a mess trying to keep track of all the reserved character as you are going from module to module. tobiah wrote: > Roman wrote: > > I l

Re: Python editor

2006-08-29 Thread Andrew Robert
[EMAIL PROTECTED] wrote: > John Salerno wrote: >> Is it possible to get vim-python for Windows, or is that just a Linux build? > > > It builds for windows. > When installed, you may also want to consider the python add-on located at http://www.vim.org/scripts/script.php?script_id=790 Enhanced

Re: Python editor

2006-08-29 Thread Neil Cerutti
On 2006-08-29, John Salerno <[EMAIL PROTECTED]> wrote: >> Vim (vim-python) or emacs (python.el) is always the best >> solution. > > Is it possible to get vim-python for Windows, or is that just a > Linux build? The windows binary for the latest version, 7.0, includes the Python commands (the versi

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Gabriel Genellina
At Tuesday 29/8/2006 07:50, Joachim Durchholz wrote: Wikipedia says it's going from 2NlogN to N. If a sort is massively dominated by the comparison, that could give a speedup of up to 100% (approximately - dropping the logN factor is almost irrelevant, what counts is losing that factor of 2).

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-29 Thread Fredrik Lundh
alf wrote: > ok, let me clarify, by M$ I meant Micro$oft. http://www.catb.org/~esr/faqs/smart-questions.html#writewell -- http://mail.python.org/mailman/listinfo/python-list

Re: refering to base classes

2006-08-29 Thread Jason
Chaz Ginger wrote: > Chaz Ginger wrote: > > glenn wrote: > >> hi - Im quite new to python, wondering if anyone can help me understand > >> something about inheritance here. In this trivial example, how could I > >> modify the voice method of 'dog' to call the base class 'creatures' > >> voice meth

Re: How to let a loop run for a while before checking for break condition?

2006-08-29 Thread Hendrik van Rooyen
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: 8<- Here are some more results, three runs without, and three with a comment in the body of the interesting loop: (a summary follows the detail) > python junk.py 0x501 Loop 1 Elapsed time is: 31.2168951035 L

Re: refering to base classes

2006-08-29 Thread Chaz Ginger
Jason wrote: > Chaz Ginger wrote: >> Chaz Ginger wrote: >>> glenn wrote: hi - Im quite new to python, wondering if anyone can help me understand something about inheritance here. In this trivial example, how could I modify the voice method of 'dog' to call the base class 'creatures'

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-29 Thread DH
Fredrik Lundh wrote: > alf wrote: > >> ok, let me clarify, by M$ I meant Micro$oft. > > http://www.catb.org/~esr/faqs/smart-questions.html#writewell > > > And by /F, you mean fuck off? http://www.libervis.com/blogs/15/Jastiv/eric_raymond_and_the_rtfm_jerks http://www.codinghorror.com/blog/ar

Re: How to let a loop run for a while before checking for break condition?

2006-08-29 Thread Fredrik Lundh
Sorin Schwimmer wrote: > I am thinking on something in the following form: > > > import time > import thread > > delay=True > > def fn() > global delay > time.sleep() > delay=False > > thread.start_new_thread(fn,()) > > while delay: > > > ... if the loop calls out to python funct

distributing modules to machines

2006-08-29 Thread r1pp3r
I'm in the the process of designing a build system written in python. It runs from a central server with various build machines hosting server processes, written in Python. Pyro is the chosen RPC mechanism. What I would like to do is have the system update itself on demand. In other words, pass pic

SWIG wrapper/Python2.5c1 problem

2006-08-29 Thread andrew . gregory
If compiling a SWIG wrapper with MinGW 3.2.3 (Windows) get the following compilation error: pyprog_wrap.cxx: In function `int SWIG_Python_ConvertFunctionPtr(PyObject*, void**, swig_type_info*)': pyprog_wrap.cxx:2051: invalid conversion from `const char*' to `char*' Extract from wrapper: /* Co

Re: How ahead are you guys in the (Python) real world?

2006-08-29 Thread [EMAIL PROTECTED]
Ray wrote: > Since I haven't used Python at work, I am using Python 2.5 right now. > However I wonder, how fast are you guys moving from version to version > at work? As an illustration my ex-company just moved to Java 5, which > was released around... what, 2-3 years ago? (While I am running Java

Re: ntp in python

2006-08-29 Thread Janto Dreijer
Jeremy Sanders wrote: > Janto Dreijer wrote: > > > I want to measure the packet delivery delays over various network > > links. For this I need to synchronise the times of the sender and > > receiver, either against NTP or eachother. > > Couldn't you just use NTP itself to get the delivery delay? Y

Re: Desktop Notification/Alerts In Python

2006-08-29 Thread Chaos
alex23 wrote: > Chaos wrote: > > I am looking for ways to have a Desktop Alert, like the one most IM > > Messengers have (MSN, AIM) at the lower right above the taskbar. Can > > anyone point me to the right resources to use? > > Under Windows, they're called "balloon tips". Here's a thread from a

Re: distributing modules to machines

2006-08-29 Thread Fredrik Lundh
r1pp3r wrote: > What I would like to do is have the system update itself on demand. In > other words, pass pickled objects (the code comprising the server) down > the pipeline to the server, have them copied to the right place, and > then restart the server which can then invoke the new code. sho

Re: about daemons and IPC

2006-08-29 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: > Hey people! > For the first time I'm doing a client/server application, and I'm > really confused with IPC stuff. [...] > Any suggestions? http://pyro.sourceforge.net depending on your needs --Irmen -- http://mail.python.org/mailman/listinfo/python-list

sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread gmax2006
Hi, I use RedHat linux. How can I find where exactly the current python script is running? I use this code: #test.py import os,sys print sys.argv os.chdir(os.path.dirname(sys.argv[0])) It doesn't work when I run this command from the directory that test.py is located: python test.py That me

  1   2   >