Re: Python SSH interface

2009-09-10 Thread Sean DiZazzo
On Sep 10, 6:14 pm, Mag Gam wrote: > its not a google/bing issue. Its about getting opinions from the > community and hear their experiences. I wanted to hear opinions and > war stories of people who tried using ssh with python, thats all. > This question gets asked at least once a week. It *is*

Re: An assessment of the Unicode standard

2009-09-10 Thread Jan Claeys
Op Sun, 30 Aug 2009 15:28:55 -0700, schreef r: > I said it before and i will say it again. I DON"T CARE WHAT LANGUAGE WE > USE AS LONG AS IT IS A MODERN LANGUAGE FOUNDED ON IDEALS OF > SIMPLICITY Maybe we should use a language that has a Turing-complete grammar, so that even computers can un

Re: Does python 3.1 support sybase module?

2009-09-10 Thread alex23
On Sep 10, 4:17 pm, "Michel Claveau - MVP" wrote: > What is this final comma?   My guess without looking at the code is that the line occurs in a dict definition: PACKET_OF_VALUES = dict( maintainer=u"Sebastien Sable", version=3.0, ... ) Either that or 'maintainer' is a tuple ;)

Re: Python SSH interface

2009-09-10 Thread Mag Gam
its not a google/bing issue. Its about getting opinions from the community and hear their experiences. I wanted to hear opinions and war stories of people who tried using ssh with python, thats all. On Fri, Sep 4, 2009 at 8:43 AM, Diez B. Roggisch wrote: > Mag Gam wrote: > >> Is there something

Re: Python server locks up

2009-09-10 Thread Zac Burns
On Wed, Sep 9, 2009 at 6:52 PM, David Stanek wrote: > On Wed, Sep 9, 2009 at 4:28 PM, Zac Burns wrote: >> >> How would you suggest to figure out what is the problem? >> > > I don't think you said your OS so I'll assume Linux. > > Sometimes it is more noise than value, but stracing the process may

Got homework? Need help?

2009-09-10 Thread bilawal samoon
Students at Salina Central High School who are receiving much needed help with their homework can perversely thank a racially motivated shooting in Woodland Park in early 2008. For more details www.technicaledu.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Bringing schools into the present: Teachers, schools lagging behind students in tech savvy

2009-09-10 Thread bilawal samoon
It's been said that in the "real world" students are more technologically advanced than their teachers because technology surrounds most of their day's activities. Teachers of the baby boom generation, on the other hand, having not grown up with computers, are constantly learning from their student

Re: threading question

2009-09-10 Thread MRAB
Mag Gam wrote: Hello, Currently, I am using a bash script to ssh into 400 servers and get an output, ie check if a file exists on a local filesystem. I am doing this linearly, however I am interesting in doing this with threads and more important using Python standard threading library. My pse

Re: Using freeze.py's output and compiling in Windows

2009-09-10 Thread John Yeung
On Sep 10, 7:53 am, "Di Biase, Paul A CIV NAVAIR, 4.4" wrote: > I'd like another avenue besides using > py2exe as a bundling tool. > > This lead me to looking at freeze.py. Judging by the wiki page (http://wiki.python.org/moin/Freeze) and some other miscellaneous Googling, it would seem freeze is

Re: AttributeError: 'module' object has no attribute 'pack'

2009-09-10 Thread Ben Kaplan
On Sep 10, 2009, at 4:21 PM, Sampsa Riikonen wrote: Hello, I already solved this.. I had to set PYTHONPATH= After that the error msg disappeared. Weird though.. I don't have any module called "subprocess" in my personal python modules directory. Anyway, thanks for the swift reply! Reg

threading question

2009-09-10 Thread Mag Gam
Hello, Currently, I am using a bash script to ssh into 400 servers and get an output, ie check if a file exists on a local filesystem. I am doing this linearly, however I am interesting in doing this with threads and more important using Python standard threading library. My pseudo code would be

Re: Using freeze.py's output and compiling in Windows

2009-09-10 Thread Peter
On Sep 11, 3:24 am, "Di Biase, Paul A CIV NAVAIR, 4.4" wrote: > No one? What's wrong with py2exe? You don't have to stop there you know - I distribute using py2exe and then use Inno Setup to create the Windows Installer. Works a treat. Note that if you are using Python 2.6 (not sure about 3.X) y

Re: unicode + xml

2009-09-10 Thread Laurent Luce
Still doesn't work from Windows Japanese python (2.6.2) to Django Python 2.5.2. Works fine from Linux python 2.5.2 to Django Python 2.5.2. Here is the flow: - post xml utf-8 encoded data from Windows client to Django server - On server: pass raw_post_data to minidom.parseString() ---> throws exc

Question about unpickling dict subclass with custom __setstate__

2009-09-10 Thread Matthew Wilson
I subclassed the dict class and added a __setstate__ method because I want to add some extra steps when I unpickle these entities. This is a toy example of what I am doing: class Entity(dict): def __setstate__(self, d): log.debug("blah...") Based on my experiments, the

Re: s.index(x[, i[, j]]) will change the s ?

2009-09-10 Thread Terry Reedy
Chris Rebert wrote: On Wed, Sep 9, 2009 at 10:00 PM, s7v7nislands wrote: I known index() does not modify the sequence itself. my question is so why the doc put the index() method in the mutable sequence types list? Because once upon a time, only lists and not tuples had the method. Ah, okay.

Re: How to create an array which can be used also as a dictionary

2009-09-10 Thread Terry Reedy
Hans Müller wrote: Hello, I have a lot of items having a name and a given sequence. To access these items fast in a sequence order they should be used as a list, but to be fetched fast by name they also should be in a dictionary. Have you looked at namedtuple or OrderedDict in collections mo

Re: New Tkinter windows don't get focus on OS X

2009-09-10 Thread Kevin Walzer
Hi Joshua, At first I was puzzled by this, because if you run something like "open -a TextEdit", TextEdit gets the focus. But then I realized this must be because of the "open" command. Indeed, if you try running something like "/Applications/MacPorts/Python\ 2.6/IDLE.app/Contents/ MacOS/IDLE" f

Re: Download and save a picture - urllib

2009-09-10 Thread MRAB
mattia wrote: You were right, the problem was with the print function, using a normal write everythong works fine. You should open the output file as binary (it doesn't matter on Linux/Unix, but is a good idea anyway for portability). Il Thu, 10 Sep 2009 18:56:07 +0200, Diez B. Roggisch ha s

Re: AttributeError: 'module' object has no attribute 'pack'

2009-09-10 Thread Jerry Hill
On Thu, Sep 10, 2009 at 4:21 PM, Sampsa Riikonen wrote: > Hello, > > I already solved this.. I had to set > > PYTHONPATH= > > After that the error msg disappeared. > Weird though.. I don't have any module called "subprocess" > in my personal python modules directory. You have a module named struc

Re: logging sound / speech handler?

2009-09-10 Thread Matteo
On Sep 9, 6:02 pm, Tim Chase wrote: > > For an application in an industrial environment where the workers are > > not always sitting in front of the monitor, but are within earshot of > > the PC I would need an sound / speech handler for the standard logging > > system. It should beep or better sa

Re: AttributeError: 'module' object has no attribute 'pack'

2009-09-10 Thread Sampsa Riikonen
Hello, I already solved this.. I had to set PYTHONPATH= After that the error msg disappeared. Weird though.. I don't have any module called "subprocess" in my personal python modules directory. Anyway, thanks for the swift reply! Regards, Sampsa On Thursday 10 September 2009 10:40:11 pm Albe

Re: How to create an array which can be used also as a dictionary

2009-09-10 Thread Chris Rebert
On Thu, Sep 10, 2009 at 12:51 PM, Hans Müller wrote: > Diez B. Roggisch wrote: >> Hans Müller wrote: >>> But what happens if i modify >>> a[1].value1 = 1000 >>> is >>> d["aax"].value1 now 1000 or still "hello" as in this example ? >> >> It's changed. Didn't you try that? >> > to be true, no - not

Re: How to create an array which can be used also as a dictionary

2009-09-10 Thread Hans Müller
Diez B. Roggisch wrote: > Hans Müller wrote: > >> Hello, >> >> I have a lot of items having a name and a given sequence. >> >> To access these items fast in a sequence order they should be used as >> a list, but to be fetched fast by name they also should be in a >> dictionary. >> >> Code could be

Re: AttributeError: 'module' object has no attribute 'pack'

2009-09-10 Thread Albert Hopkins
On Thu, 2009-09-10 at 21:07 +0300, Sampsa Riikonen wrote: > Dear List, > > I have a freshly installed opensuse 11.2 and I am experiencing the following > problem with the module "subprocess": > > sam...@linux-912g:~> python > Python 2.6 (r26:66714, Feb 3 2009, 20:52:03) > [GCC 4.3.2 [gcc-4_3-bra

AttributeError: 'module' object has no attribute 'pack'

2009-09-10 Thread Sampsa Riikonen
Dear List, I have a freshly installed opensuse 11.2 and I am experiencing the following problem with the module "subprocess": sam...@linux-912g:~> python Python 2.6 (r26:66714, Feb 3 2009, 20:52:03) [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2 Type "help", "copyright", "credits" or "li

Re: Download and save a picture - urllib

2009-09-10 Thread mattia
You were right, the problem was with the print function, using a normal write everythong works fine. Il Thu, 10 Sep 2009 18:56:07 +0200, Diez B. Roggisch ha scritto: > mattia wrote: > >> Hi all, in order to download an image. In order to correctly retrieve >> the image I need to set the referer

Re: ANN: dh, the daemon helper

2009-09-10 Thread John Kelly
On Thu, 10 Sep 2009 06:38:20 + (UTC), garabik-news-2005...@kassiopeia.juls.savba.sk wrote: >John Kelly wrote: >> dh, the daemon helper >> dh is its name; a natural companion to sh. >A useful little program, but... >this might be OT, but let me point out that the name collides >with Debi

Re: From Perl to Python

2009-09-10 Thread Ethan Furman
Raful CIV Mitchell H wrote: General newbie type question…open ended. I have been scripting in Perl for 8 years for net management purposes. Mostly interacting with SNMP and Cisco MIBS in general. I would like to re-write these scripts in Python. Any suggestions in how to get started in Pyth

Re: a question about numpy

2009-09-10 Thread Robert Kern
On 2009-09-09 20:46 PM, rechard wrote: Robert Kern wrote: On 2009-09-08 20:45 PM, hi_roger wrote: hello, i want to ask a question about numpy. i know how to select a submatrix using the slice object in numpy. But how can i select a submatrix A[i1,i2,i3;j1,j2,j3] (elements in A on line i1,i2,i3

Re: search term parsing like Google/Gmail

2009-09-10 Thread Robert Kern
On 2009-09-09 16:37 PM, Randy Syring wrote: I am looking for a string parser that works kind of like Google's or Gmail's advanced search capabilities. So it would turn something like this: (subject:"hi there" from:[tim, tom, -fred]) or (subject:foobar from:sam) into a python structure that

Re: Using freeze.py's output and compiling in Windows

2009-09-10 Thread Di Biase, Paul A CIV NAVAIR, 4.4
No one? -- http://mail.python.org/mailman/listinfo/python-list

From Perl to Python

2009-09-10 Thread Raful CIV Mitchell H
General newbie type question...open ended. I have been scripting in Perl for 8 years for net management purposes. Mostly interacting with SNMP and Cisco MIBS in general. I would like to re-write these scripts in Python. Any suggestions in how to get started in Python and , especially, needin

Re: PYTHONPATH issue with sibling package names

2009-09-10 Thread Stuart Moffatt
On Sep 10, 10:12 am, "Diez B. Roggisch" wrote: > Stuart Moffatt wrote: > > Environment: Eclipse 3.4.2, Windows XP Pro SP2, Pydev 1.4.4, python > > 2.6 > > > When I work in eclipse with java, I like to break up my client and > > server packages, like this: > > > client-project/src/org/me/client > >

Re: Help with cumulative sum

2009-09-10 Thread Andreas Waldenburger
On Thu, 10 Sep 2009 17:48:32 +0200 Giacomo Boffi wrote: > Maggie writes: > > > [...] > > else: > >print 'The loop is finito' > > do you know of it.comp.lang.python? > Neat! They use computers in IT now? *flees, snickering* /W -- INVALID? DE! -- http://mail.python.org/mailman/listinf

Re: Instatiable Pseudo-Random Number Generator

2009-09-10 Thread Hans Georg Schaathun
On Thu, 10 Sep 2009 02:53:33 -0700 (PDT), sturlamolden wrote: : On 10 Sep, 10:50, Hans Georg Schaathun wrote: : : > Can anyone recommend a PRNG which supported multiple instances : > with independent states, and that also can return numpy.array (or : > something similar) efficiently? : : nu

From Perl to Python

2009-09-10 Thread Raful CIV Mitchell H
General newbie type question...open ended. I have been scripting in Perl for 8 years for net management purposes. Mostly interacting with SNMP and Cisco MIBS in general. I would like to re-write these scripts in Python. Any suggestions in how to get started in Python and , especially, needin

Re: Download and save a picture - urllib

2009-09-10 Thread Diez B. Roggisch
mattia wrote: > Hi all, in order to download an image. In order to correctly retrieve the > image I need to set the referer and handle cookies. > > opener = urllib.request.build_opener(urllib.request.HTTPRedirectHandler > (), urllib.request.HTTPCookieProcessor()) > urllib.request.install_opener(o

python-list@python.org

2009-09-10 Thread opengis
Hello Python User, I am using python in an openlayers application to access another server on my network via javascript. The proxy script works fine when the application runs in Apache HTTP Server, but I get a "" error after moving the application to Tomcat. The tomcat cgi configuration teste

Re: New Tkinter windows don't get focus on OS X

2009-09-10 Thread Joshua Bronson
Hey Kevin, Thanks for your quick reply. On Sep 10, 10:12 am, Kevin Walzer wrote: > On 9/10/09 1:27 AM, Joshua Bronson wrote: > > If you try something like: > > > $ python -m Tkinter -c 'Tkinter._test()' > > > in Terminal on OS X, you'll notice that the window that is spawned > > does not get foc

Re: Simple Text Processing

2009-09-10 Thread AJAskey
Never mind. I guess I had been trying to make it more difficult than it is. As a note, I can work on something for 10 hours and not figure it out. But the second I post to a group, then I immediately figure it out myself. Strange snake this Python... Example for anyone else interested: line =

Re: Accessing objects at runtime.

2009-09-10 Thread Jochen Schulz
jacopo: > >> What exactly do you want to know? The names of existing attributes or >> their content? The latter is probably obvious to you and the former is >> easy, too. See hasattr, getattr and isinstance. > > I want to know the value of the attributes. > What you suggest works when the program

Re: Simple Text Processing

2009-09-10 Thread Benjamin Kaplan
On Thu, Sep 10, 2009 at 11:36 AM, AJAskey wrote: > New to Python. I can solve the problem in perl by using "split()" to > an array. Can't figure it out in Python. > > I'm reading variable lines of text. I want to use the first number I > find. The problem is the lines are variable. > > Input

Vectorized laziness inside

2009-09-10 Thread Bearophile
I've just seen this good Google Talk video from Jan 2008, "MonetDB/ X100: a (very) fast column-store", about a more efficient column- oriented DBMS: http://www.youtube.com/watch?v=yrLd-3lnZ58 The efficiency of this DBMS (something like 50 times faster) is produced by few things: - It's column-wise

Simple Text Processing

2009-09-10 Thread AJAskey
New to Python. I can solve the problem in perl by using "split()" to an array. Can't figure it out in Python. I'm reading variable lines of text. I want to use the first number I find. The problem is the lines are variable. Input example: this is a number: 1 here are some numbers 1 2 3 4

Re: How to create an array which can be used also as a dictionary

2009-09-10 Thread Diez B. Roggisch
Hans Müller wrote: > Hello, > > I have a lot of items having a name and a given sequence. > > To access these items fast in a sequence order they should be used as > a list, but to be fetched fast by name they also should be in a > dictionary. > > Code could be something like this. > > class i

[cmd] Uppercase H

2009-09-10 Thread cryzed
Hello, I'm currently using the "cmd" module with Python 2.6.2 on Ubuntu GNU/Linux 9.04 (Jaunty Jackalope) and have got a bit of a problem. How can I write an uppercase H into the input? If I try that it always starts to show all available commands (which is probably related to the use of the "r

Re: Accessing objects at runtime.

2009-09-10 Thread jacopo
> > What exactly do you want to know? The names of existing attributes or > their content? The latter is probably obvious to you and the former is > easy, too. See hasattr, getattr and isinstance. I want to know the value of the attributes. What you suggest works when the program stops, objects a

Re: Accessing objects at runtime.

2009-09-10 Thread Jochen Schulz
jacopo: > > I would like to find a way to inspect the objects at run time. In > other words I would like to check certain attributes in order to > understand in which status the object is. What exactly do you want to know? The names of existing attributes or their content? The latter is probably

Accessing objects at runtime.

2009-09-10 Thread jacopo
I have a system comprising many objects cooperating with each others. (For the time being, everything is running on the same machine, in the same process but things might change in the future). The system starts a infinite loop which keeps triggering operations from the instantiated objects. I wo

How to create an array which can be used also as a dictionary

2009-09-10 Thread Hans Müller
Hello, I have a lot of items having a name and a given sequence. To access these items fast in a sequence order they should be used as a list, but to be fetched fast by name they also should be in a dictionary. Code could be something like this. class item def __init__(name, value1,

Accessing objects at runtime.

2009-09-10 Thread jacopo
I have a system comprising many objects cooperating with each others. (For the time being, everything is running on the same machine, in the same process but things might change in the future). The system starts a infinite loop which keeps triggering operations from the instantiated objects. I wo

Re: multiprocessing: Correct usage of pool & queue?

2009-09-10 Thread Aahz
In article , Allen Fowler wrote: > >1) Have a maximum of 20 "in-flight" tasks. (thus worker processes?) Good bet. >3) Certain tasks in my list must be processed in the correct order. (I >guess the asignment logic must somehow tag those to by done by the same >worker?) The simpler way to do t

Re: python and openSSL

2009-09-10 Thread Luca Bel
I had already installed and tested M2Crypto. My problem is that with this library I've not found a way to replicate the operation that I can made with openssl. As you can see, here: openssl smime -decrypt -verify -inform DER -in ReadmeDiKe.pdf.p7m -noverify -out ReadmeDike.pdf No certificate is u

Re: PYTHONPATH issue with sibling package names

2009-09-10 Thread Diez B. Roggisch
Stuart Moffatt wrote: > Environment: Eclipse 3.4.2, Windows XP Pro SP2, Pydev 1.4.4, python > 2.6 > > When I work in eclipse with java, I like to break up my client and > server packages, like this: > > client-project/src/org/me/client > > server-project/src/org/me/api > server-project/src/org/

Re: New Tkinter windows don't get focus on OS X

2009-09-10 Thread Kevin Walzer
On 9/10/09 1:27 AM, Joshua Bronson wrote: If you try something like: $ python -m Tkinter -c 'Tkinter._test()' in Terminal on OS X, you'll notice that the window that is spawned does not get focus, rather focus remains in Terminal. Furthermore, if you hit Command+Tab to switch focus to the Pytho

Re: "Rapid GUI Programming with Python and Qt" source code

2009-09-10 Thread David Boddie
On Thursday 10 September 2009, Steven Woody wrote: > On Wed, Sep 9, 2009 at 9:33 PM, David Boddie wrote: > > See this page for the links: > > > > http://www.qtrac.eu/pyqtbook.html > > but the URL is not reachable from here. is there another URL? thanks. Can't you access anything from qtrac.eu

Re: "Rapid GUI Programming with Python and Qt" source code

2009-09-10 Thread Steven Woody
On Wed, Sep 9, 2009 at 9:33 PM, David Boddie wrote: > On Wed Sep 9 07:11:26 CEST 2009, Steven Woody wrote: > > > *I've searched google and cannot find a valid link for the source code of > > the book "Rapid GUI Programming with Python and Qt". Could anyone please > > give me a non-broken URL?* >

Site Scarpping with Beautiful Soup

2009-09-10 Thread aditya shukla
Hello Guys, I would like to scrap a site by using Beautiful Soup library.The site has various options listed in a drop down menu.What I want to do is pass the drop down option with the python script and scrap the result obtained for each value.Let's say we have three values i the drop down menu

PYTHONPATH issue with sibling package names

2009-09-10 Thread Stuart Moffatt
Environment: Eclipse 3.4.2, Windows XP Pro SP2, Pydev 1.4.4, python 2.6 When I work in eclipse with java, I like to break up my client and server packages, like this: client-project/src/org/me/client server-project/src/org/me/api server-project/src/org/me/dao server-project/src/org/me/entity ser

Re: [repost] Does standard python have BeautifulSoup (or something like it) ?

2009-09-10 Thread Stefan Behnel
steve wrote: > I had sent this question below a couple of months ago but didn't receive > any replies. I forgot about it though, since I had moved on to using > BeautifulSoup. Now however, I am wondering why something like this is > not present in the standard lib. What is the accepted procedure to

Re: Instatiable Pseudo-Random Number Generator

2009-09-10 Thread Joachim Strömbergson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Aloha! Hans Georg Schaathun wrote: > Can anyone recommend a PRNG which supported multiple instances > with independent states, and that also can return numpy.array (or > something similar) efficiently? > > The distribution is currently Gaussian. Do

Using freeze.py's output and compiling in Windows

2009-09-10 Thread Di Biase, Paul A CIV NAVAIR, 4.4
I have learned python (and wxpython) over the past year and it has taken over every other language in my work environment for almost every task (langs: matlab, VBA, fortran...yes fortran, c++, more too...). My main concern has always been distribution of software over our internal networked compu

Re: Q on explicitly calling file.close

2009-09-10 Thread David C . Ullrich
On Wed, 9 Sep 2009 15:13:49 -0700 (PDT), r wrote: >On Sep 9, 4:19 pm, Charles Yeomans wrote: >(snip:) >> Unfortunately, both of these simple templates have the following   >> problem -- if open fails, a NameError will be raised from the finally   >> block. > >(snip) >> I removed the except block

Re: [Guppy-pe-list] An iteration idiom (Was: Re: loading files containing multiple dumps)

2009-09-10 Thread Sverker Nilsson
On Wed, 2009-09-09 at 13:47 +0100, Chris Withers wrote: > Sverker Nilsson wrote: > > As the enclosing class or frame is deallocated, so is its attribute h > > itself. > > Right, but as long as the h hangs around, it hangs on to all the memory > it's used to build its stats, right? This caused me

[repost] Does standard python have BeautifulSoup (or something like it) ?

2009-09-10 Thread steve
Hi, I had sent this question below a couple of months ago but didn't receive any replies. I forgot about it though, since I had moved on to using BeautifulSoup. Now however, I am wondering why something like this is not present in the standard lib. What is the accepted procedure to propose the

Re: [Tkinter] messed callbacks

2009-09-10 Thread Giacomo Boffi
Terry Reedy writes: > Reedy's Lambda Rule: [detailed explanation omitted] i'm beginning to _understand_ what's going on with my code > Terry Jan Reedy thanks, grazie 1000 Terry, g -- "Lord, what fools these mortals be!" -- http://mail.

Re: [Tkinter] messed callbacks

2009-09-10 Thread Giacomo Boffi
John Posner writes: > def output(x,y,op): > if op == "<": >print x, "<---", y > elif op == ">": >print x, "--->", y > else: >print "Operation argument error!" uh, nice!, i'll adapt this to my real problem thank you John,

Urllib and login

2009-09-10 Thread Massi
Hi everyone, I'm trying to get data from an internet page which is accessed from a login page. Looking at the html source code of the login page I found that the name of the controls which handle username and password are "login_un" and "login_pw". So I tried to write a piece of code to access the

Re: hanning python

2009-09-10 Thread pdpi
On Sep 9, 7:01 pm, sturlamolden wrote: > On 9 Sep, 16:57, pdpi wrote: > > > Raising this to 1 million, rather than 100, nodes in the window, the > > timing difference between your version and NumPy's is tiny (but numpy > > still edges you out, but just barely), but they trounce my naive > > versi

Re: [Tkinter] messed callbacks

2009-09-10 Thread Giacomo Boffi
Scott David Daniels writes: > Giacomo Boffi wrote: >> Giacomo Boffi writes: > ... >> | def create_cb(a,b): >> | return lambda: output(a+'->'+b) >> | | def doit(fr,lst): >> | for c1,c2 in zip(lst[::2], lst[1::2]): >> | subframe=Frame(fr) >> | Label(subframe,text=c1+' <-> >> '+c2).p

Re: Instatiable Pseudo-Random Number Generator

2009-09-10 Thread sturlamolden
On 10 Sep, 10:50, Hans Georg Schaathun wrote: > Can anyone recommend a PRNG which supported multiple instances > with independent states, and that also can return numpy.array (or > something similar) efficiently? numpy.random.RandomState ;-) S.M. -- http://mail.python.org/mailman/listinfo/pyt

Re: Help with cumulative sum

2009-09-10 Thread Steven D'Aprano
On Thu, 10 Sep 2009 09:55:29 +0200, Bruno Desthuilliers wrote: > Maggie a écrit : > > (snip - lots of answers and sensible suggestions already) > >>tmp_string = str(count) + ' ' + item > > Mays I suggest you learn about string formatting ? Which is generally good advice, but for a o

Re: Instatiable Pseudo-Random Number Generator

2009-09-10 Thread Vlastimil Brom
2009/9/10 Hans Georg Schaathun : > I wonder if someone knows of an API with the features I need... > random.Random and numpy.random each have only half of it... > > My application includes an object to hold a pseudo-randomly > generated matrix too large to be kept in memory.  Hence I > try to store

gaierror

2009-09-10 Thread vpr
Hi I have a working python app that consumers SOAP services on a 32bit platform. I've packaged it with cx_freeze and executed it on a 64bit plaform. If I use the IP address as the hostname I have no problem, it works as expected. However if I use a DNS name, which I can resolve manuallty i.e. nslo

Re: lxml question

2009-09-10 Thread Diez B. Roggisch
mattia wrote: > I would like to click on an image in a web page that I retrieve using > urllib in order to trigger an event. > Here is the piece of code with the image that I want to click: > onclick="return checkPhoneField(document.contactFrm, 'mobile');" > alt="sms" src="images/button_sms.bmp"

Instatiable Pseudo-Random Number Generator

2009-09-10 Thread Hans Georg Schaathun
I wonder if someone knows of an API with the features I need... random.Random and numpy.random each have only half of it... My application includes an object to hold a pseudo-randomly generated matrix too large to be kept in memory. Hence I try to store only the seed, and generate the numbers on

Re: Help with cumulative sum

2009-09-10 Thread Bruno Desthuilliers
Maggie a écrit : (snip - lots of answers and sensible suggestions already) tmp_string = str(count) + ' ' + item Mays I suggest you learn about string formatting ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Less APIs or more encapsulation?

2009-09-10 Thread Bruno Desthuilliers
一首诗 a écrit : 2 class, B contains C. Given your code snippet, I assume you meant that B instances have an instance of C as attribute. When user want to use some service of C, s/C/instances of C/ Python's classes are objects by themselves, so it's really important to make clear whethe

Re: Less APIs or more encapsulation?

2009-09-10 Thread Bruno Desthuilliers
Tycho Andersen a écrit : On Wed, Sep 9, 2009 at 10:08 AM, 一首诗 wrote: But when C has many many methods to expose to outer user, 2nd choice seems to be more reasonable I In the first design, B.newMethod did nothing really useful. Is there any reason you can't do something like the following? cl