Re: PyPI editing

2009-03-05 Thread Chris Rebert
On Wed, Mar 4, 2009 at 11:42 PM, andrew cooke wrote: > > Not sure where to ask this, but how do I edit my PyPI page? > > http://pypi.python.org/pypi/LEPL/2.0 doesn't have any text compared to > http://pypi.python.org/pypi/pypp/0.0.2 (selected at random).  How do I the > "Benefits", "Drawbacks" etc

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-03-05 Thread jelle feringa
Hi Josh, > http://www.pythonocc.org/ However, I'm > not entirely clear on the license for this so that might be an issue. We're using a French license for the moment, but will move to something more standard soon. PythonOCC ( the current SVN version ) wraps 85% of the OpenCASCADE kernel. Consi

Can't override class |__new__

2009-03-05 Thread jelle feringa
Hi, I'm working with a C++ module ( CGAL, comp.geom. with exact arithmic ) and am having troubles finding a way to override how the modules returns objects. What I'm trying to do is to extend the Facet class, but when I try to use my version of the class, the parent class is still being returned

Re: PyPI editing

2009-03-05 Thread andrew cooke
Apparently not (this will probably change, but see http://pypi.python.org/pypi/LEPL/2.0.1 which is currently displaying restructured text literally) Thanks, Andrew Chris Rebert wrote: > On Wed, Mar 4, 2009 at 11:42 PM, andrew cooke wrote: >> >> Not sure where to ask this, but how do I edit my P

Re: qt, gtk, wx for py3 ?

2009-03-05 Thread Peter Billam
> On 4 Mar, 00:40, Peter Billam wrote: >>  http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits >> seemed surprisingly even-handed. On 2009-03-04, Paul Boddie wrote: > I don't have a horse in this race, but apart from needing to > update that page based on recent developments (at least

Re: 2to3 Help?

2009-03-05 Thread John Machin
On Mar 5, 6:47 pm, jjh wrote: > On Jan 14, 10:01 pm, marco.m.peter...@gmail.com wrote: [snipped] > Sorry to bring this back up. The correct thing to do is to start a NEW post. Marco's problem is nothing to do with yours. > I'm a newbie trying to run 2to3 on > Windows. I ran the following: >

Re: Peculiar swap behavior

2009-03-05 Thread Aaron Brady
On Feb 23, 12:43 pm, Tim Chase wrote: > I stumbled across this oddity and was hoping folks on the list > might be able to provide a little understanding: > > # swap scalars >  >>> x,y = 1,2 >  >>> x,y = y,x >  >>> x,y > (2, 1) > > # swap lists >  >>> a,b = [1,2,3],[4,5,6] >  >>> a,b = b,a >  >>> a

Re: Can't override class |__new__

2009-03-05 Thread Aaron Brady
On Mar 5, 2:27 am, jelle feringa wrote: > Hi, > > I'm working with a C++ module ( CGAL, comp.geom. with exact arithmic ) > and am having troubles finding a way to override how the modules returns > objects. What I'm trying to do is to extend the Facet class, but when I try > to use my version of t

Does profiling remove some optimisations?

2009-03-05 Thread andrew cooke
I have a core loop that is critical to performance. The code is at http://www.acooke.org/lepl/api/lepl.parser-pysrc.html#trampoline If I write a separate "optimised" version of that function for when "monitor" is empty, with all the "if monitor" tests removed, the profiler (cProfile) indicates a

Re: Roulette wheel

2009-03-05 Thread Peter Otten
mattia wrote: >> Note how get_roulette_wheel() is now completeley independent of the >> concrete problem you are using it for. > > Ok, but also a lot more memory consuming ;-) I don't think so. Python references objects; therefore the list [tiny_little_thing]*N does not consume more memory th

wx, qt, gtk

2009-03-05 Thread Stefano
Hello everybody After many little programs now I must prepare a serious desktop application . Without discussing about licensing but only from the technical point of view I have tried wx,wt,gtk graphical gui to build 'normal gui apps ' and everyone goes well. In the end of all i searched in i

Re: Can't override class |__new__

2009-03-05 Thread jelle feringa
Hi Aaron, Thanks so much for your feedback. > Regardless of CGAL's dictionary, it instantiates a Facet. True, when I add attributes to it, they are disregarded when looping through the facets later on. > Depending on the details, you may need only to cut-and-paste your own > 'make_triangle' fu

Number of Packages in the "cheeseshop"

2009-03-05 Thread Michael Rudolf
Hi, I just wondered how many Packages are in the Python Package Index. I could not find any counter, but I found that there is a category overview on http://pypi.python.org/pypi?%3Aaction=browse . A quick look at the HTML told me that the number of Packages per Category is listed surrounded by pa

Re: Response codes and \r\n

2009-03-05 Thread Peter Otten
Catherine Heathcote wrote: > I am reading an XML file (code at the end if it helps) and all goes well > except I am getting the http response code printed. So everything (hat > works of course) has "200 OK" on the first line. Am I missing some > simple way of surprising this, or should I just del

Re: Response codes and \r\n

2009-03-05 Thread Marc 'BlackJack' Rintsch
On Thu, 05 Mar 2009 09:37:49 +, Catherine Heathcote wrote: > I am reading an XML file (code at the end if it helps) and all goes well > except I am getting the http response code printed. So everything (hat > works of course) has "200 OK" on the first line. Am I missing some > simple way of s

Re: Response codes and \r\n

2009-03-05 Thread Richard Brodie
"Catherine Heathcote" wrote in message news:n3nrl.2951$lc7.2...@text.news.virginmedia.com... = > I am reading an XML file (code at the end if it helps) and all goes well > except I am > getting the http response code printed. I suggest you comment out line 22. The status shouldn't be in the d

Re: FW: Anyone read "Python Interview Questions: Python Certification Review"?

2009-03-05 Thread Paul Sammy
Thanks for the comments on this topic. I shall read the thread suggest by Tim and avoid the book. (I did look for reviews on Amazon, but I used amazon.co.uk, so I missed the Perl book reviews). I also emailed the company to ask more about the 'Python Certification' that the book title alluded to;

Re: Roulette wheel

2009-03-05 Thread mattia
Il Thu, 05 Mar 2009 10:46:58 +0100, Peter Otten ha scritto: > mattia wrote: > >>> Note how get_roulette_wheel() is now completeley independent of the >>> concrete problem you are using it for. >> >> Ok, but also a lot more memory consuming ;-) > > I don't think so. Python references objects; th

problem with pydoc under python 2.6.1

2009-03-05 Thread steve . ferg . bitbucket
Has anybody encountered problems running pydoc with version 2.6.1? I'm getting an error message that pydoc cannot import namedtuple (details below). (I'm running under 64-bit Windows Vista, although that probably is not important.) Here's my batch file, pydoc_test.bat: ===

Re: problem with pydoc under python 2.6.1

2009-03-05 Thread yinoneh
On Mar 5, 1:29 pm, steve.ferg.bitbuc...@gmail.com wrote: > Has anybody encountered problems running pydoc with version 2.6.1? > I'm getting an error message that pydoc cannot import namedtuple > (details below). > (I'm running under 64-bit Windows Vista, although that probably is not > important.)

Re: Roulette wheel

2009-03-05 Thread Peter Otten
mattia wrote: > Il Thu, 05 Mar 2009 10:46:58 +0100, Peter Otten ha scritto: > >> mattia wrote: >> Note how get_roulette_wheel() is now completeley independent of the concrete problem you are using it for. >>> >>> Ok, but also a lot more memory consuming ;-) >> >> I don't think so. Py

Re: Can't override class |__new__

2009-03-05 Thread Lie Ryan
jelle feringa wrote: Hi, I'm working with a C++ module ( CGAL, comp.geom. with exact arithmic ) and am having troubles finding a way to override how the modules returns objects. What I'm trying to do is to extend the Facet class, but when I try to use my version of the class, the parent class is

Re: problem with pydoc under python 2.6.1

2009-03-05 Thread Yinon Ehrlich
On Mar 5, 1:48 pm, yino...@gmail.com wrote: > On Mar 5, 1:29 pm, steve.ferg.bitbuc...@gmail.com wrote: > > > > > Has anybody encountered problems running pydoc with version 2.6.1? > > I'm getting an error message that pydoc cannot import namedtuple > > (details below). > > (I'm running under 64-bit

Re: Dr Dobbs' Python Weekly URL Archive?

2009-03-05 Thread Steve Holden
Hendrik van Rooyen wrote: > "Steve Holden" wrote: >> My well-known-search-engine-foo must be at an all-time low today. *Is* >> there an index and I can't see for looking? >> > typing in python weekly at google gives me: > > Python-URL!The bookmark for this page is: > http://purl.org/thecliff/pyt

how to convert from network to host byte order

2009-03-05 Thread Evan
Hello ~ I'm new with python, what my problem is, I have a binary file, I want to read first 2 bytes and convert it to host byte order, then write it to another file. I try to use 'socket' and 'struct', but somehow i can not get it working fine: for example, totally I'm not sure if my steps is c

Re: String Identity Test

2009-03-05 Thread Bruno Desthuilliers
Hendrik van Rooyen a écrit : "S Arrowsmith" wrote: "Small" integers get a similar treatment: a = 256 b = 256 a is b True a = 257 b = 257 a is b False This is weird - I would have thought that the limit of "small" would be at 255 - the biggest number to fit in a byte. 256 takes two byt

Re: Can't override class |__new__

2009-03-05 Thread jelle feringa
> > CGAL.Facet = OtherFacet > > CGAL.Polyhedron.Facet = OtherFacet > > p = CGAL.Polyhedron_3() > You're not creating Facet object here, not even Polyhedron.Facet. Right, which is not the point; I'm trying to override the Facet, a topological entity of which a Polyhedron is composed of . ( vertex

Re: String Identity Test

2009-03-05 Thread Bruno Desthuilliers
Avetis KAZARIAN a écrit : > Well, it's not about curiosity, it's more about performance. Steve Holden wrote: (snip) So, don't try to translate concepts from one language to another. I'll try ;] Also and FWIW: 1/ Python has some very handy tools when it comes to perfs - like a couple pr

Re: how to convert from network to host byte order

2009-03-05 Thread Peter Otten
Evan wrote: > Hello ~ > > I'm new with python, what my problem is, I have a binary file, I want > to read first 2 bytes and convert it to host byte order, then write it > to another file. > > I try to use 'socket' and 'struct', but somehow i can not get it > working fine: > > for example, tota

Response codes and \r\n

2009-03-05 Thread Catherine Heathcote
Heya, I am reading an XML file (code at the end if it helps) and all goes well except I am getting the http response code printed. So everything (hat works of course) has "200 OK" on the first line. Am I missing some simple way of surprising this, or should I just delete the 1st line before p

Re: siple for in expression

2009-03-05 Thread Matko
Thanks everyone! Matko ;) Thanks "Matko" wrote in message news:gojkfo$2p...@gregory.bnet.hr... > Hello! > > Can someone help me to understand the following code: > > uv_face_mapping = [[0,0,0,0] for f in faces] > > Thank You very much! > > Matko from Croatia > -- http://mail.python.org/mailm

RE: Help required to read and print lines based on the type of first character

2009-03-05 Thread rdmurray
abhinayaraj.r...@emulex.com wrote: > Thank you for the suggestions. > > Some little reading gave the idea and it works well too. :) > > Here is the code: > fileIN = open("test.txt") > count = 0 > for line in fileIN: > data= line > > if '' in data: > count = 4 >

Re: Help required to read and print lines based on the type of first character

2009-03-05 Thread Bruno Desthuilliers
(answering to the OP) En Wed, 04 Mar 2009 07:36:01 -0200, escribió: I am a beginner in Python. In fact, beginner to coding/ scripting. Here is a scenario, I need to code. Need your help on this: Your first task here should be to refine the specs - too much ambiguities in it: A script th

Re: Can't override class |__new__

2009-03-05 Thread Lie Ryan
jelle feringa wrote: CGAL.Facet = OtherFacet CGAL.Polyhedron.Facet = OtherFacet p = CGAL.Polyhedron_3() You're not creating Facet object here, not even Polyhedron.Facet. Right, which is not the point; I'm trying to override the Facet, a topological entity of which a Polyhedron is composed o

Re: how to convert from network to host byte order

2009-03-05 Thread Joe Riopel
On Thu, Mar 5, 2009 at 7:26 AM, Evan wrote: > Hello ~ > > I'm new with python,  what my problem is, I have a binary file, I want > to read first 2 bytes and convert it to host byte order, then write it > to another file. Have you checked out socket.htons, socket.ntohs, etc ? -- http://mail.python

Re: wx, qt, gtk

2009-03-05 Thread sturlamolden
On Mar 5, 11:11 am, "Stefano" wrote: > In the end of all  i searched in internet and i've found that applications > ( even commercial ) written with gtk are more and more than other written > with wx and qt (not only with python) >From a technical point of view, Qt is the superior toolkit. Lice

Re: Number of Packages in the "cheeseshop"

2009-03-05 Thread John Machin
On Mar 5, 9:40 pm, Michael Rudolf wrote: > Hi, I just wondered how many Packages are in the Python Package Index. > > I could not find any counter, Main page (http://pypi.python.org/pypi), right at the top: """ The Python Package Index is a repository of software for the Python programming langua

Re: how to convert from network to host byte order

2009-03-05 Thread Philipp Hagemeister
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Evan wrote: >>> inp='\x04\x00' >>> out = socket.ntohs(struct.unpack('H',inp[:2])[0])) > Traceback (most recent call last): > File "", line 1, in > TypeError: argument 1 must be string or read-only buffer, not int Your approach is nearly right. Fi

Re: PyPI editing

2009-03-05 Thread David Stanek
On Thu, Mar 5, 2009 at 3:32 AM, andrew cooke wrote: > > Apparently not (this will probably change, but see > http://pypi.python.org/pypi/LEPL/2.0.1 which is currently displaying > restructured text literally) > Did you put the ReST in the description or the long_description? Take a look at the se

Re: 2to3 Help?

2009-03-05 Thread Ant
On Jan 15, 6:43 am, "James Mills" wrote: ... > That is a good idea :) Windows teaches you nothing! Not true. Windows teaches you the art of the workaround... -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPI editing

2009-03-05 Thread andrew cooke
ah! thanks very much. that is obviously what i need to do. i am pretty sure i was doing the wrong thing, but am now at work. i'll check this tonight. thanks again, andrew David Stanek wrote: > On Thu, Mar 5, 2009 at 3:32 AM, andrew cooke wrote: >> >> Apparently not (this will probably chan

Re: how to convert from network to host byte order

2009-03-05 Thread Evan
On Mar 5, 9:50 pm, Philipp Hagemeister wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > Evan wrote: > >>> inp='\x04\x00' > >>> out = socket.ntohs(struct.unpack('H',inp[:2])[0])) > > Traceback (most recent call last): > >   File "", line 1, in > > TypeError: argument 1 must be string

Re: Number of Packages in the "cheeseshop"

2009-03-05 Thread Michael Rudolf
Am Thu, 5 Mar 2009 05:38:58 -0800 (PST) schrieb John Machin : > Main page (http://pypi.python.org/pypi), right at the top: > """ > The Python Package Index is a repository of software for the Python > programming language. There are currently 5883 packages here. > """ Ooops... totally missed that

Re: Dr Dobbs' Python Weekly URL Archive?

2009-03-05 Thread Mike Driscoll
On Mar 5, 6:15 am, Steve Holden wrote: > Hendrik van Rooyen wrote: > >  "Steve Holden" wrote: > >> My well-known-search-engine-foo must be at an all-time low today. *Is* > >> there an index and I can't see for looking? > > > typing in python weekly at google gives me: > > > Python-URL!The bookmar

Re: Reading a file

2009-03-05 Thread MRAB
Aahz wrote: In article , Terry Reedy wrote: for line in open('char.txt'): if line.find('sweet') != -1 or line.find('blue') != -1: print(line) For any recent Python, this should be: if 'sweet' in line or 'blue' in line: Although I think that for the OP's use case, it ought to be:

RE: Help required to read and print lines based on the type of first character

2009-03-05 Thread Abhinayaraj . Raju
Thank you so much for your guidance, Bruno. This should help me in a long way. Here is the code I have written. path = raw_input("\nEnter location eg. c:/buffer/test.txt : \n") fileIN = open(path) count = 0 for line in fileIN: data= line if '' in data:

monitoring/restarting an application

2009-03-05 Thread Ghirai
Hello list, I need to keep x number of instances of an external applications running, say /bin/x, but also kill and restart each one after y seconds. What would be the best way to do this (with python 2.5.x)? I'm thinking of having a list of running pids, then have a thread check if len(list) <

How to access a containing objects properties from an object inside.

2009-03-05 Thread nuwandame
I have two objects obj1 and obj2. Inside obj1 there is an attribute for success (obj1.success) and for containing other objects (obj1.data) I am using setattr() to add obj2 as an attribute to obj1.data (obj1.data.obj2) this is working fine. My problem is when someone changes a variable in obj2 in

Re: monitoring/restarting an application

2009-03-05 Thread Marco Mariani
Ghirai wrote: I need to keep x number of instances of an external applications running, say /bin/x, but also kill and restart each one after y seconds. What would be the best way to do this (with python 2.5.x)? easy_install supervisor it should do everything for you -- http://mail.python.org

Re: How to access a containing objects properties from an object inside.

2009-03-05 Thread Aaron Brady
On Mar 5, 8:44 am, nuwandame wrote: > I have two objects obj1 and obj2. Inside obj1 there is an attribute for > success (obj1.success) and for containing other objects (obj1.data) > > I am using setattr() to add obj2 as an attribute to obj1.data > (obj1.data.obj2) this is working fine. > > My prob

Re: Number of Packages in the "cheeseshop"

2009-03-05 Thread Gerard Flanagan
Michael Rudolf wrote: > Hi, I just wondered how many Packages are in the Python Package Index. fwiw http://bitbucket.org/djerdo/musette/src/tip/tools/download-pypi.py regards G. -- http://mail.python.org/mailman/listinfo/python-list

RE: Parsing/Crawler Questions..

2009-03-05 Thread bruce
hi john.. You're missing the issue, so a little clarification... I've got a number of test parsers that point to a given classlist site.. the scripts work. the issue that one faces is that you never "know" if you've gotten all of the items/links that you're looking for based on the XPath functio

Re: Roulette wheel

2009-03-05 Thread mattia
Il Thu, 05 Mar 2009 12:54:39 +0100, Peter Otten ha scritto: > mattia wrote: > >> Il Thu, 05 Mar 2009 10:46:58 +0100, Peter Otten ha scritto: >> >>> mattia wrote: >>> > Note how get_roulette_wheel() is now completeley independent of the > concrete problem you are using it for.

question about ctrl-d and atexit with threads

2009-03-05 Thread Darren Dale
I have a function that stops execution of a thread, and this function is registered with atexit.register. A simple example module is included at the end of this post, say its called test.py. If I do the following in the interactive interpreter, the thread stops executing as I hoped: >>> from test

Re: Does profiling remove some optimisations?

2009-03-05 Thread Gabriel Genellina
En Thu, 05 Mar 2009 07:39:20 -0200, andrew cooke escribió: I have a core loop that is critical to performance. The code is at http://www.acooke.org/lepl/api/lepl.parser-pysrc.html#trampoline If I write a separate "optimised" version of that function for when "monitor" is empty, with all the

Re: Question about binary file reading

2009-03-05 Thread vibgyorbits
k,thanks all. l=map(lambda x: '%02x' %ord(x),d) s=string.join(l,sep='') PS#. Endedup learning little bit of Lambda functions. :-) Scott David Daniels <<< Thanks for your wisdom about the "spaces". Its a 3 liner code-snippet! -- http://mail.python.org/mailman/listinfo/python-list

Re: question about ctrl-d and atexit with threads

2009-03-05 Thread Darren Dale
Actually, this problem can also be seen by running this code as a script, it hangs up if the sys.exit lines are commented, and exits normally if uncommented. import atexit import threading import time class MyThread(threading.Thread): def __init__(self): threading.Thread.__init__(se

Re: Question about binary file reading

2009-03-05 Thread Marco Mariani
vibgyorbits wrote: l=map(lambda x: '%02x' %ord(x),d) s=string.join(l,sep='') PS#. Endedup learning little bit of Lambda functions. :-) That's so 2007... The 2.5-esque way to write that is s = ''.join('%02x' % ord(x) for x in d) -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about binary file reading

2009-03-05 Thread vibgyorbits
On Mar 5, 9:24 am, Marco Mariani wrote: > vibgyorbits wrote: > > l=map(lambda x: '%02x' %ord(x),d) > > s=string.join(l,sep='') > > > PS#. Endedup learning little bit of Lambda functions. :-) > > That's so 2007... > > The 2.5-esque way to write that is > > s = ''.join('%02x' % ord(x) for x in d) Y

Re: Does profiling remove some optimisations?

2009-03-05 Thread andrew cooke
Gabriel Genellina wrote: > En Thu, 05 Mar 2009 07:39:20 -0200, andrew cooke > escribió: > >> I have a core loop that is critical to performance. The code is at >> http://www.acooke.org/lepl/api/lepl.parser-pysrc.html#trampoline >> >> If I write a separate "optimised" version of that function for

Re: monitoring/restarting an application

2009-03-05 Thread Paul Rubin
Ghirai writes: > Does this sound reasonable, or is there an easier way? Use something like daemontools or upstart. Don't roll your own. -- http://mail.python.org/mailman/listinfo/python-list

Re: Roulette wheel

2009-03-05 Thread mattia
Il Wed, 04 Mar 2009 21:30:54 +0100, Peter Otten ha scritto: > mattia wrote: > >> Hi everyone, I'm new to python and I want to create some simple code in >> order to code the classical genetic algorithm example: given a >> population of chromosomes, encoded using 1 and 0, find the chromosome >> wi

Re: How to access a containing objects properties from an object inside.

2009-03-05 Thread nuwandame
Aaron Brady wrote: > On Mar 5, 8:44 am, nuwandame wrote: >> I have two objects obj1 and obj2. Inside obj1 there is an attribute for >> success (obj1.success) and for containing other objects (obj1.data) >> >> I am using setattr() to add obj2 as an attribute to obj1.data >> (obj1.data.obj2) this is

Re: how to convert from network to host byte order

2009-03-05 Thread Mark Tolonen
"Evan" wrote in message news:79582a34-5d0b-49b2-8c1e-4139324ff...@b38g2000prf.googlegroups.com... Hello ~ I'm new with python, what my problem is, I have a binary file, I want to read first 2 bytes and convert it to host byte order, then write it to another file. There is a piece of infor

Re: monitoring/restarting an application

2009-03-05 Thread Ghirai
On 05 Mar 2009 07:44:44 -0800 Paul Rubin wrote: > Ghirai writes: > > Does this sound reasonable, or is there an easier way? > > Use something like daemontools or upstart. Don't roll your own. > -- Alright, i'll have a look at those as well as supervisor. Thanks.

Re: How to access a containing objects properties from an object inside.

2009-03-05 Thread Aaron Brady
On Mar 5, 9:51 am, nuwandame wrote: > Aaron Brady wrote: > > On Mar 5, 8:44 am, nuwandame wrote: > >> I have two objects obj1 and obj2. Inside obj1 there is an attribute for > >> success (obj1.success) and for containing other objects (obj1.data) > > >> I am using setattr() to add obj2 as an attr

Re: Parsing/Crawler Questions..

2009-03-05 Thread John Nagle
bruce wrote: hi john.. You're missing the issue, so a little clarification... I've got a number of test parsers that point to a given classlist site.. the scripts work. the issue that one faces is that you never "know" if you've gotten all of the items/links that you're looking for based on th

Re: String Identity Test

2009-03-05 Thread Terry Reedy
Hendrik van Rooyen wrote: "S Arrowsmith" wrote: "Small" integers get a similar treatment: a = 256 b = 256 a is b True a = 257 b = 257 a is b False This is weird - I would have thought that the limit of "small" would be at 255 - the biggest number to fit in a byte. 256 takes two bytes,

distutils: "build" command

2009-03-05 Thread TP
Hi everybody, I have programmed a python package, and I would like to use distutils with it. My package has the following structure after doing sdist and build: $ python setup.py sdist [...] $ python setup.py build [...] $ tree . |-- MANIFEST |-- MANIFEST.in |-- README |-- build | `-- lib |

Re: distutils: "build" command

2009-03-05 Thread andrew cooke
don't know if this is useful, but setuptools is a plug-in replacement for distutils that makes this kind of thing easier (i think). http://peak.telecommunity.com/DevCenter/setuptools andrew TP wrote: > Hi everybody, > > I have programmed a python package, and I would like to use distutils with

Re: How to access a containing objects properties from an object inside.

2009-03-05 Thread nuwandame
Aaron Brady wrote: > On Mar 5, 9:51 am, nuwandame wrote: >> Aaron Brady wrote: >>> On Mar 5, 8:44 am, nuwandame wrote: I have two objects obj1 and obj2. Inside obj1 there is an attribute for success (obj1.success) and for containing other objects (obj1.data) I am using setattr() to

Re: String Identity Test

2009-03-05 Thread Terry Reedy
Terry Reedy wrote: Hendrik van Rooyen wrote: "S Arrowsmith" wrote: "Small" integers get a similar treatment: a = 256 b = 256 a is b True a = 257 b = 257 a is b False This is weird - I would have thought that the limit of "small" would be at 255 - the biggest number to fit in a byte. 2

help understanding class or function

2009-03-05 Thread Vincent Davis
If I have a list and I what to make changes to it.a = [1,2,3,4,5,6,7,8,9] and maybe I want to drop the odd and double the even numbers and I will need to do this repeatedly. How is this best done? That is as a function or class. All I know how to do is def doubleeven(alist): blist = [2*x for

Re: Pickle Problem

2009-03-05 Thread Fab86
On Mar 4, 2:49 pm, MRAB wrote: > Fab86 wrote: > > On Mar 4, 1:40 am, "Gabriel Genellina" wrote: > >> En Tue, 03 Mar 2009 23:11:30 -0200, Fab86 escribió: > > >>> On Mar 4, 12:00 am, MRAB wrote: > Fab86 wrote: > > On Mar 3, 8:59 pm, "Gabriel Genellina" wrote: > >> How to "spell" exa

Re: Inverse of dict(zip(x,y))

2009-03-05 Thread Tino Wildenhain
Piet van Oostrum wrote: Andre Engels (AE) wrote: AE> On Wed, Mar 4, 2009 at 11:02 AM, lone_eagle wrote: Can someone suggest a easy method to do the inverse of dict(zip(x,y)) to get two lists x and y? So, if x and y are two lists, it is easier to make a dictionary using d = dict(zip(x,y)),

Re: question about ctrl-d and atexit with threads

2009-03-05 Thread skip
What happens if you simply call my_thread.setDaemon(True) (or in Python 2.6): my_thread.daemon = True ? That is the documented way to exit worker threads when you want the application to exit. From the threading module docs: "The entire Python program exits when no alive non-daem

While loop

2009-03-05 Thread Fab86
Hello, I am currently working on my program which send queries to Yahoo and then saves them into a flatfile. The problem I have is that I need to conduct 200 searches and Yahoo typically times out during the search with an error. I have caught the error and told it to time.sleep(10) however I can

Re: Roulette wheel

2009-03-05 Thread Peter Otten
mattia wrote: > The last question: how can I improve readability in this piece of code? > > def crossover(pop, prob=0.6): > """ > With a crossover probability cross over the parents to form new > offspring. If no crossover was performed, offspring is the exact copy > of parents. "

Python3 on the Web

2009-03-05 Thread Johannes Permoser
Hi, I wanted to learn Python from scratch and start off with Version 3. Since I already know PHP very well, I thought it would be nice to start off with a small web-project. But what's the way to bring python3 to the Web? mod_python isn't available, cgi is said to be slow, mod_wsgi looks complica

Re: Help required to read and print lines based on the type of first character

2009-03-05 Thread Bruno Desthuilliers
abhinayaraj.r...@emulex.com a écrit : Please, don't top-post, and learn to quote & snip (if you don't know what top-posting is, google is your friend). Thank you so much for your guidance, Bruno. This should help me in a long way. Here is the code I have written. path = raw_input("\nEnter

Re: While loop

2009-03-05 Thread Tino Wildenhain
Hi, Fab86 wrote: Hello, I am currently working on my program which send queries to Yahoo and then saves them into a flatfile. The problem I have is that I need to conduct 200 searches and Yahoo typically times out during the search with an error. I have caught the error and told it to time.slee

Re: Python3 on the Web

2009-03-05 Thread Jean-Paul Calderone
On Thu, 05 Mar 2009 18:13:05 +0100, Johannes Permoser wrote: Hi, I wanted to learn Python from scratch and start off with Version 3. Since I already know PHP very well, I thought it would be nice to start off with a small web-project. But what's the way to bring python3 to the Web? mod_python

Sphinx for API documentation

2009-03-05 Thread Paul Hildebrandt
I really like the look of Sphinx BUT I want autogenerated documentation like Epydoc/doxygen. Does anyone know of a frontend for Sphix that will make it work like Epydoc? Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: While loop

2009-03-05 Thread Marco Mariani
Fab86 wrote: Is it possible to get the program to catch the exception, wait 10 seconds, then carry of from where it was rather than starting again? something like this? probably works in PASCAL as well :) i=0 while i < len(stuff): try: do_with(stuff[i]) except SomeError: s

Re: Python3 on the Web

2009-03-05 Thread Bruno Desthuilliers
Johannes Permoser a écrit : Hi, I wanted to learn Python from scratch and start off with Version 3. Since I already know PHP very well, I thought it would be nice to start off with a small web-project. But what's the way to bring python3 to the Web? mod_python isn't available, cgi is said to be

Re: question about ctrl-d and atexit with threads

2009-03-05 Thread Darren Dale
On Mar 5, 12:02 pm, s...@pobox.com wrote: > What happens if you simply call > >     my_thread.setDaemon(True) > > (or in Python 2.6): > >     my_thread.daemon = True > > ?  That is the documented way to exit worker threads when you want the > application to exit.  From the threading module docs: >

RE: Parsing/Crawler Questions..

2009-03-05 Thread bruce
hi.. the url i'm focusing on is irrelevant to the issue i'm trying to solve at this time. i think an approach will be to fire up a number of parsing attempts, and to track the returned depts/classes/etc... in theory (hopefully) i should be able to create a process to build a kind of statistical r

Re: Parsing/Crawler Questions..

2009-03-05 Thread Philip Semanchuk
On Mar 5, 2009, at 12:31 PM, bruce wrote: hi.. the url i'm focusing on is irrelevant to the issue i'm trying to solve at this time. Not if we're to understand the situation you're trying to describe. From what I can tell, you're saying that the target site displays different results e

Re: Inverse of dict(zip(x,y))

2009-03-05 Thread Andre Engels
On Thu, Mar 5, 2009 at 6:01 PM, Tino Wildenhain wrote: > Still I'd like to see an application where this really matters (that > keys() and values() match in order) I think there are many such applications, but also that in each of those cases it's a mis-programming of something that would be don

Re: While loop

2009-03-05 Thread Fab86
On Mar 5, 5:23 pm, Marco Mariani wrote: > Fab86 wrote: > > Is it possible to get the program to catch the exception, wait 10 > > seconds, then carry of from where it was rather than starting again? > > something like this? probably works in PASCAL as well :) > > > i=0 > > while i < len(stuff): > >

Re: Pickle Problem

2009-03-05 Thread MRAB
Fab86 wrote: On Mar 4, 2:49 pm, MRAB wrote: Fab86 wrote: On Mar 4, 1:40 am, "Gabriel Genellina" wrote: En Tue, 03 Mar 2009 23:11:30 -0200, Fab86 escribió: On Mar 4, 12:00 am, MRAB wrote: Fab86 wrote: On Mar 3, 8:59 pm, "Gabriel Genellina" wrote: How to "spell" exactly the exception nam

Re: Roulette wheel

2009-03-05 Thread Scott David Daniels
mattia wrote: ... The last question: how can I improve readability in this piece of code? def crossover(pop, prob=0.6): """ With a crossover probability cross over the parents to form new offspring. If no crossover was performed, offspring is the exact copy of parents. """ c

Re: Python3 on the Web

2009-03-05 Thread Christian Heimes
Johannes Permoser wrote: > But what's the way to bring python3 to the Web? > mod_python isn't available, cgi is said to be slow, mod_wsgi looks > complicated... WSGI is the right way to go. It's *the* Python standard for web application interfaces. You don't need mod_wsgi and Apache to run a WSGI

Re: Inverse of dict(zip(x,y))

2009-03-05 Thread psykeedelik
On Mar 5, 6:01 pm, Tino Wildenhain wrote: > Piet van Oostrum wrote: > >> Andre Engels (AE) wrote: > > >> AE> On Wed, Mar 4, 2009 at 11:02 AM, lone_eagle wrote: > Can someone suggest a easy method to do the inverse of dict(zip(x,y)) > to get two lists x and y? > > So, if x and

Re: Parsing/Crawler Questions - solution

2009-03-05 Thread John Nagle
Philip Semanchuk wrote: On Mar 5, 2009, at 12:31 PM, bruce wrote: hi.. the url i'm focusing on is irrelevant to the issue i'm trying to solve at this time. Not if we're to understand the situation you're trying to describe. From what I can tell, you're saying that the target site displays d

Re: Inverse of dict(zip(x,y))

2009-03-05 Thread Andre Engels
On Thu, Mar 5, 2009 at 7:07 PM, psykeedelik wrote: > I usually get properties that I compute, in a dictionary like property > = [key1: val1, key2:val2, ...] and then I usually want to plot them in > pylab, which AFAIK requires x and y as lists for the plot argument. > Then I need to get the lists

Re: Inverse of dict(zip(x,y))

2009-03-05 Thread Andre Engels
On Thu, Mar 5, 2009 at 7:46 PM, Andre Engels wrote: > If the dict = {key1: val1, key2: val2, ...}, you can do: > > for key in dict: >    plot(key,dictionary[key]) Of course I meant: for key in dict: plot(key,dict[key]) -- André Engels, andreeng...@gmail.com -- http://mail.python.org/mail

RE: Parsing/Crawler Questions - solution

2009-03-05 Thread bruce
john... again the problem i'm facing really has nothing to do with a specific url... the app i have for the usc site works... but for any number of reasons... you might get different results when running the app.. -the server could be screwed up.. -data might be cached -data might be changed,

Re: While loop

2009-03-05 Thread Andre Engels
On Thu, Mar 5, 2009 at 6:49 PM, Fab86 wrote: > On Mar 5, 5:23 pm, Marco Mariani wrote: >> Fab86 wrote: >> > Is it possible to get the program to catch the exception, wait 10 >> > seconds, then carry of from where it was rather than starting again? >> >> something like this? probably works in PASC

Re: While loop

2009-03-05 Thread Chris Rebert
On Thu, Mar 5, 2009 at 9:49 AM, Fab86 wrote: > On Mar 5, 5:23 pm, Marco Mariani wrote: >> Fab86 wrote: >> > Is it possible to get the program to catch the exception, wait 10 >> > seconds, then carry of from where it was rather than starting again? > using sleep and then continue just makes the s

  1   2   >