Re: numpy or _numpy or Numeric?

2007-01-24 Thread George Sakkis
On Jan 24, 2:24 am, auditory <[EMAIL PROTECTED]> wrote: > I am a newbie here > > I am trying to read "space separated floating point data" from file > > I read about csv module by searching this group, > but I couldn't read space separated values with csv. > (which may be matter of course..) > > I

Re: How to use dynamic properties? <-- Noob

2007-01-24 Thread Sean Schertell
Yep, that was it. Thanks Gary :-) Sean On Jan 23, 2007, at 5:05 PM, Gary Herron wrote: > Sean Schertell wrote: >> person.name = 'Joe' >> person.age = 20 >> person.sex = 'm' >> >> info_I_need = name >> >> print person.info_I_need >> >> # How can I make it print 'Joe' ? >> >> >> Sean >> >> >> ::

Re: numpy or _numpy or Numeric?

2007-01-24 Thread auditory
George Sakkis ? ?: > On Jan 24, 2:24 am, auditory <[EMAIL PROTECTED]> wrote: > >> I am a newbie here >> >> I am trying to read "space separated floating point data" from file >> >> I read about csv module by searching this group, >> but I couldn't read space separated values with csv. >> (which ma

sys.path issue in cygwin

2007-01-24 Thread Wang Shuhao
I successfully built and installed Python 2.2.3 in cygwin. But there is something wrong in the sys.path. I use following statments for a test. >>> import sys >>> print sys.path ['', 'C/lib/python2.2/', 'C/lib/python2.2/plat-cygwin', 'C/lib/python2.2/lib-tk' , '\\Python24/lib/python2.2/lib-dynlo

Re: numpy or _numpy or Numeric?

2007-01-24 Thread auditory
Travis E. Oliphant ? ?: > auditory wrote: >> I am a newbie here >> >> I am trying to read "space separated floating point data" from file >> >> I read about csv module by searching this group, >> but I couldn't read space separated values with csv. >> (which may be matter of course..) >> >> I also

sys.path issue in cygwin

2007-01-24 Thread Wang Shuhao
I successfully built and installed Python 2.2.3 in cygwin. But there is something wrong in the sys.path. I use following statments for a test. >>> import sys >>> print sys.path ['', 'C/lib/python2.2/', 'C/lib/python2.2/plat-cygwin', 'C/lib/python2.2/lib-tk' , '\\Python24/lib/python2.2/lib-dynload

Re: Getting to an SSH account over a HTTP proxy

2007-01-24 Thread amadain
use pexpect to set the prompt after the login. class Login(General): """Class spawning an ssh expect instance""" def __init__(self, user, host, pwd, cfg_name=None, log=None): if cfg_name: self.testcell = test_config(cfg_name)

[OT]Could anyone send me a copy of "timeout sockets for jython"

2007-01-24 Thread Slowness Chen
The information about this module: http://www.xhaus.com/alan/python/timeout.html I can't access the download url due to the severe network issue these days, and I need to use this module for work. Could anyone do me a favor to send a copy? the download url : http://cvs.sourceforge.net/viewcvs.py/

Re: Overloading assignment operator

2007-01-24 Thread John Pye
Hi thre, On Jan 24, 5:24 am, Achim Domma <[EMAIL PROTECTED]> wrote: > I want to use Python to script some formulas in my application. Depending on what you're trying to do, you might possibly find it useful to lake a look at the approach used by PyGINAC, which is a symbolic algebra system (in C++

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread Laurent Rahuel
Hi, I known this can be impossible but what about an "HTML" GUI ? Daniel Jonsson wrote: > So, I've reached the point where my building pipeline tools actually > needs to be used by other people in my company. By this reason I > actually need to think about the usability, and I've come to the > c

Q: Why Python is bad for web from the point of URLs?

2007-01-24 Thread techtonik
A: Because you need three modules to parse, edit and reassemble query string. urlparse, cgi and urllib -- http://mail.python.org/mailman/listinfo/python-list

Re: smtplib starttls gmail example - comments?

2007-01-24 Thread Tim Williams
On 24/01/07, py <[EMAIL PROTECTED]> wrote: > I would love for anybody to comment on this code with regard to > redundancy/efficiency/wordiness or whatever else. > for instance, do i understand correctly that i cant have a try: else: without > an intervening except:? > -dave > > stdout.wri

use of a GChildWatch source

2007-01-24 Thread awalter1
Hello I am using python, pyGTK and GTK+ on HPUX (unix) In this context, the pygtk documentation about gobject.spawn_async says : ... you must use a GChildWatch source to be notified about the death of the child process ... Does someone know where to find details about GChildWatch ? I didn't retrie

Pydev 1.2.6 Released

2007-01-24 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.2.6 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions: --

Re: Rendering text question (context is MSWin UI Automation)

2007-01-24 Thread Boris Borcic
imageguy wrote: > > I was looking for ( and still am searching for) similiar functionality. > Specifically I would like to be able to capture a small area of the > screen (a number or a code) and convert this to text that can be used > in my application. There is a windows executable version of

Re: Rendering text question (context is MSWin UI Automation)

2007-01-24 Thread Boris Borcic
Chris Mellon wrote: > On 1/23/07, Boris Borcic <[EMAIL PROTECTED]> wrote: >> ...A simple - >> with Tkinter or otherwise - way to wrap access to the MS Windows UI text >> rendering engine, as a function that would return a picture of rendered >> text, >> given a string, a font, a size and col

Re: Q: Why Python is bad for web from the point of URLs?

2007-01-24 Thread Jia Lu
But you can do capsulation to them. On 1月24日, 午後7:50, "techtonik" <[EMAIL PROTECTED]> wrote: > A: Because you need three modules to parse, edit and reassemble query > string. urlparse, cgi and urllib -- http://mail.python.org/mailman/listinfo/python-list

Re: easy_install pylons failure - www.myghty.org unavailable

2007-01-24 Thread skip
Robert, Thanks, I passed the contents of this thread along to distutils-sig. Hopefully the list moderator is awake, as I'm not subscribed there... ;-) Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: smtplib starttls gmail example - comments?

2007-01-24 Thread BJ Swope
On 1/24/07, Tim Williams <[EMAIL PROTECTED]> wrote: On 24/01/07, py <[EMAIL PROTECTED]> wrote: > I would love for anybody to comment on this code with regard to redundancy/efficiency/wordiness or whatever else. > for instance, do i understand correctly that i cant have a try: else: without an in

Re: How to get self reference from within a module?

2007-01-24 Thread Lavoie Érick
I finally found what I was searching for here: http://www.thescripts.com/forum/thread25264.html I wanted the reference to the current module and we can obtain it this way: sys.modules[__name__] so its property can be used. Thanks, Erick -- http://mail.python.org/mailman/listinfo/python-lis

Py_DECREF after an exception

2007-01-24 Thread Hrvoje Nikšić
I'm wondering what happens with the exception info during object cleanup immediately after an exception is thrown. Consider this code: PyObject *args = PyBuild_Value("(O(O){})", name, parent); if (!args) return NULL; PyObject *val = some_python_func(x, args, NULL); Py_DECREF(args);

Thoughts on using isinstance

2007-01-24 Thread abcd
In my code I am debating whether or not to validate the types of data being passed to my functions. For example def sayHello(self, name): if not name: rasie "name can't be null" if not isinstance(name, str): raise "name must be a string" print "Hello " + name Is the u

Re: sys.path issue in cygwin

2007-01-24 Thread Jason Tishler
Wang, On Wed, Jan 24, 2007 at 04:14:48PM +0800, Wang Shuhao wrote: > I successfully built and installed Python 2.2.3 in cygwin. > [snip] > Obviously, 'C/lib/python2.2/' is a wrong path. In fact my python is > installed in /usr/local/lib/python2.2.3. The result of the issue is > that when you run a

Re: newbie question: ftp.storbinary()

2007-01-24 Thread Facundo Batista
Scott Ballard wrote: > Sorry for the lame question, I'm still trying to pick up Python and new to > the list here. Welcome! > I'm assuming that I should use storbinary( command, file[, blocksize]) to > transfer the files. the documentation says "command should be an appropriate > "STOR" com

Re: Thoughts on using isinstance

2007-01-24 Thread Maxim Sloyko
On Jan 24, 3:38 pm, "abcd" <[EMAIL PROTECTED]> wrote: > In my code I am debating whether or not to validate the types of data > being passed to my functions. For example > > def sayHello(self, name): > if not name: > rasie "name can't be null" > if not isinstance(name, str): >

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread David Boddie
On Jan 24, 12:09 am, "Daniel" <[EMAIL PROTECTED]> wrote: > I've downloaded both the wxPython and the PyQt4 package, and by the > first impression I must say that the PyQt4 system had a very > compelling presentation. From what I can understand from the feedback > I've gotten so far is that the wxPy

Re: Thoughts on using isinstance

2007-01-24 Thread Steve Holden
abcd wrote: > In my code I am debating whether or not to validate the types of data > being passed to my functions. For example > > def sayHello(self, name): > if not name: > rasie "name can't be null" > if not isinstance(name, str): > raise "name must be a string" > p

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread hg
Laurent Rahuel wrote: > Hi, > > I known this can be impossible but what about an "HTML" GUI ? > > Daniel Jonsson wrote: > >> So, I've reached the point where my building pipeline tools actually >> needs to be used by other people in my company. By this reason I >> actually need to think about t

Re: Thoughts on using isinstance

2007-01-24 Thread Duncan Booth
"abcd" <[EMAIL PROTECTED]> wrote: > In my code I am debating whether or not to validate the types of data > being passed to my functions. For example > > def sayHello(self, name): > if not name: > rasie "name can't be null" > if not isinstance(name, str): > raise "name mu

Re: Missing .dlls when installing PyQt!? :(

2007-01-24 Thread Phil Thompson
On Wednesday 24 January 2007 1:36 pm, [EMAIL PROTECTED] wrote: > Hello! > > I must be doing something wrong here because I'm getting all these > missing .dll messages after installing PyQT. This is what I've done (no > step excluded): > > 1. Fresh installation of Python25 > 2. I run the PyQt-gpl-4.

Re: sys.path issue in cygwin

2007-01-24 Thread Steve Holden
Wang Shuhao wrote: > > > I successfully built and installed Python 2.2.3 in cygwin. But there is > something wrong in the sys.path. I use following statments for a test. > > >>> import sys > >>> print sys.path > ['', 'C/lib/python2.2/', 'C/lib/python2.2/plat-cygwin', > 'C/lib/python2.2/li

Missing .dlls when installing PyQt!? :(

2007-01-24 Thread wd . jonsson
Hello! I must be doing something wrong here because I'm getting all these missing .dll messages after installing PyQT. This is what I've done (no step excluded): 1. Fresh installation of Python25 2. I run the PyQt-gpl-4.1.1-Py2.5-Qt4.2.2.exe file which should include SIP 3. I run the qt-win-opens

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread Giovanni Bajo
On 24/01/2007 1.45, Joshua J. Kugler wrote: >> I've downloaded both the wxPython and the PyQt4 package, and by the >> first impression I must say that the PyQt4 system had a very >> compelling presentation. From what I can understand from the feedback >> I've gotten so far is that the wxPython is

Re: Missing .dlls when installing PyQt!? :(

2007-01-24 Thread Giovanni Bajo
On 24/01/2007 14.36, [EMAIL PROTECTED] wrote: > I must be doing something wrong here because I'm getting all these > missing .dll messages after installing PyQT. This is what I've done (no > step excluded): > > 1. Fresh installation of Python25 > 2. I run the PyQt-gpl-4.1.1-Py2.5-Qt4.2.2.exe file

AFP library for Python

2007-01-24 Thread Luca Masini
Hi, googled for a Python library that support AFP but found only a PERL module: http://search.cpan.org/src/AUTRIJUS/Parse-AFP-0.24/ Maybe someone know of a similar library for Python ? PS: in alternative if there are some interested people we can implement it... :-)) Thanks Luca.

Re: Thoughts on using isinstance

2007-01-24 Thread abcd
> The "Python way" is to validate by performing the operations you need to > perform and catching any exceptions that result. In the case of your > example, you seem to be saying that you'd rather raise your own > exception (which, by the way, should really be a subclass of Exception, > but we will

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-24 Thread Steve Holden
Carroll, Barry wrote: > Greetings: > > Personally, I don't think top-posting is the most annoying newsgroup > habit. I think it's making a big fuss about minor inconveniences. > > One of the nicest things about being human is the amazing flexibility of > our brains. For example, if a block of

Re: Thoughts on using isinstance

2007-01-24 Thread Neil Cerutti
On 2007-01-24, abcd <[EMAIL PROTECTED]> wrote: > In my code I am debating whether or not to validate the types of data > being passed to my functions. For example > > def sayHello(self, name): > if not name: > rasie "name can't be null" > if not isinstance(name, str): > rai

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread David Boddie
On Jan 24, 3:00 pm, Giovanni Bajo <[EMAIL PROTECTED]> wrote: > Thus, it is well possible to write internal GPL software, using the Qt Open > Source library, and to release/distribute/use it *ONLY* internally. http://www.gnu.org/licenses/gpl-faq.html#GPLRequireSourcePostedPublic > Also, it > shou

Re: Rendering text question (context is MSWin UI Automation)

2007-01-24 Thread Boris Borcic
Chris Mellon wrote: > > Using either win32 or wxPython you will be able to produce bitmaps > directly, without needing to create a visible window. > > > Some quick & dirty wxPython code > > def getTextBitmap(text, font, fgcolor, bgcolor): > dc = wx.MemoryDC() > dc.SetFont(font) > wi

Re: Thoughts on using isinstance

2007-01-24 Thread Bruno Desthuilliers
abcd a écrit : > In my code I am debating whether or not to validate the types of data > being passed to my functions. For example > > def sayHello(self, name): > if not name: > rasie "name can't be null" > if not isinstance(name, str): > raise "name must be a string" >

Re: sys.path issue in cygwin

2007-01-24 Thread Wang Shuhao
There is only python2.2.3 on my machine, and the location is /usr/local/lib/python2.2 . I say the 'C/lib/python2.2/' is a wrong path is because the leading C/lib is not point to the location of my python installation. I'v found the solution anyway. The environment variable PYTHONHOME controls t

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread Harry George
"Joshua J. Kugler" <[EMAIL PROTECTED]> writes: > Daniel wrote: > > > I've downloaded both the wxPython and the PyQt4 package, and by the > > first impression I must say that the PyQt4 system had a very > > compelling presentation. From what I can understand from the feedback > > I've gotten so fa

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread Kevin Walzer
Daniel Jonsson wrote: > So, I've reached the point where my building pipeline tools actually > needs to be used by other people in my company. By this reason I > actually need to think about the usability, and I've come to the > conclusion that I need a GUI. So, which of the two packages should

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread Kevin Walzer
Kevin Walzer wrote: > > Tablelist: http://www.nemethi.de/ > Tabelist for Tkinter (with Tile support): > http://tkinter.unpythonic.net/wiki/TableListTileWrapper > Additionally, here is a link to some screenshots for Tablelist: http://www.nemethi.privat.t-online.de/tablelist/screenshots.html -

Re: Python does not play well with others

2007-01-24 Thread Harry George
John Nagle <[EMAIL PROTECTED]> writes: >The major complaint I have about Python is that the packages > which connect it to other software components all seem to have > serious problems. As long as you don't need to talk to anything > outside the Python world, you're fine. But once you do, th

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread hg
Kevin Walzer wrote: > Kevin Walzer wrote: > >> >> Tablelist: http://www.nemethi.de/ >> Tabelist for Tkinter (with Tile support): >> http://tkinter.unpythonic.net/wiki/TableListTileWrapper >> > > Additionally, here is a link to some screenshots for Tablelist: > > http://www.nemethi.privat.t-on

Email attachments

2007-01-24 Thread Steve Holden
I'm having some trouble getting attachments right for all recipients, and it seems like Apple's mail.app is the pickiest client at the moment. It doesn't handle attachments that both Thunderbird and Outlook find perfectly acceptable. Since the code I'm using is currently ugly and embedded, befo

Re: smtplib starttls gmail example - comments?

2007-01-24 Thread Tim Williams
On 24/01/07, BJ Swope <[EMAIL PROTECTED]> wrote: > > > > On 1/24/07, Tim Williams <[EMAIL PROTECTED]> wrote: > > > > On 24/01/07, py <[EMAIL PROTECTED]> wrote: > > > I would love for anybody to comment on this code with regard to > redundancy/efficiency/wordiness or whatever else. > > > for instanc

Re: Thoughts on using isinstance

2007-01-24 Thread Steve Holden
abcd wrote: >> The "Python way" is to validate by performing the operations you need to >> perform and catching any exceptions that result. In the case of your >> example, you seem to be saying that you'd rather raise your own >> exception (which, by the way, should really be a subclass of Exceptio

Re: sys.path issue in cygwin

2007-01-24 Thread Jason Tishler
Wang, Please keep your replies on-list. On Wed, Jan 24, 2007 at 10:28:51PM +0800, Wang Shuhao wrote: > > Why not use the Python that is part of the standard Cygwin > > distribution? > > > Cause the Cygwin version python has the same problem, that why I try > to build python from source. The abo

for thibaut: genuinely excellent pictures - umcu - (1/1)

2007-01-24 Thread rocky
Hello, Images, video, mp3 music, the real news from around the world... it's all inside waiting for you. You can find almost anything you are looking for. They offer some of the best premium newsgroup access anywhere. One thing I love about them, they don't keep log files of the news I read or f

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread Chris Mellon
On 1/24/07, Giovanni Bajo <[EMAIL PROTECTED]> wrote: > On 24/01/2007 1.45, Joshua J. Kugler wrote: > > >> I've downloaded both the wxPython and the PyQt4 package, and by the > >> first impression I must say that the PyQt4 system had a very > >> compelling presentation. From what I can understand fr

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread Kevin Walzer
hg wrote: > Kevin Walzer wrote: > >> Kevin Walzer wrote: >> >>> Tablelist: http://www.nemethi.de/ >>> Tabelist for Tkinter (with Tile support): >>> http://tkinter.unpythonic.net/wiki/TableListTileWrapper >>> >> Additionally, here is a link to some screenshots for Tablelist: >> >> http://www.nemeth

Re: Rendering text question (context is MSWin UI Automation)

2007-01-24 Thread Chris Mellon
On 1/24/07, Boris Borcic <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > > > Using either win32 or wxPython you will be able to produce bitmaps > > directly, without needing to create a visible window. > > > > > > Some quick & dirty wxPython code > > > > def getTextBitmap(text, font, fgcolor,

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread jean-michel bain-cornu
Hi > > Just for info - one of the reasons I stopped using Tkinter a few years ago > was for the lack of print support (preview ...) - is there such an > extension today ? > Same for me, it was a point for what I choosed wx. Nowadays, I'd say users commonly accept to get pdf reports instead of di

module email

2007-01-24 Thread Sergey Dorofeev
Hello. Why does not work? -- import email.message import smtplib import time m=email.message.Message() m.set_type("multipart/mixed") m["From"]="Sergey Dorofeev <[EMAIL PROTECTED]>" m["To"]="Sergey Dorofeev <[EMAIL PROTECTED]>" m["Date"]=time.asctime() m["Subject"]="test" p1=email.m

The blog on Pc trouble shooting skills,Networking,Linux

2007-01-24 Thread lucky
HI Friends This blog is very useful to all sections of people. For Pc trouble shooting skills,Linux,Html Webdesigning,Free softwares,Networking skills,Gaming news and For Tips visit the blog: http://technodata.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Regex for URL extracting

2007-01-24 Thread Johny
Does anyone know about a good regular expression for URL extracting? J. -- http://mail.python.org/mailman/listinfo/python-list

Re: smtplib starttls gmail example - comments?

2007-01-24 Thread BJ Swope
Sweet! -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on using isinstance

2007-01-24 Thread abcd
Well my example function was simply taking a string and printing, but most of my cases would be expecting a list, dictionary or some other custom object. Still propose not to validate the type of data being passed in? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: for thibaut: genuinely excellent pictures - umcu - (1/1)

2007-01-24 Thread [EMAIL PROTECTED]
Just inclined to fire up python to decode the latter part, just to realise i've got dictd binding yet ;-) Probably injected 2 instances of pythons in the spammer thread, for completion's sake. -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on using isinstance

2007-01-24 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, abcd wrote: > Well my example function was simply taking a string and printing, but > most of my cases would be expecting a list, dictionary or some other > custom object. Still propose not to validate the type of data being > passed in? Yes because usually you don't expe

The reliability of python threads

2007-01-24 Thread Carl J. Van Arsdall
Hey everyone, I have a question about python threads. Before anyone goes further, this is not a debate about threads vs. processes, just a question. With that, are python threads reliable? Or rather, are they safe? I've had some strange errors in the past, I use threading.lock for my critic

Re: Regex for URL extracting

2007-01-24 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, "Johny" <[EMAIL PROTECTED]> wrote: > Does anyone know about a good regular expression for URL extracting? Extracting URLs from what? If it is HTML, then I'd look at some existing HTML parsing modules like Beautiful Soup and Barnes' HTMLData. -- Philip http://

Re: The reliability of python threads

2007-01-24 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> writes: |> Hey everyone, I have a question about python threads. Before anyone |> goes further, this is not a debate about threads vs. processes, just a |> question. |> |> With that, are python threads reliable? Or rath

Re: Python does not play well with others

2007-01-24 Thread Chris Mellon
On 1/23/07, John Nagle <[EMAIL PROTECTED]> wrote: >The major complaint I have about Python is that the packages > which connect it to other software components all seem to have > serious problems. As long as you don't need to talk to anything > outside the Python world, you're fine. But once

Re: Python does not play well with others

2007-01-24 Thread John Nagle
Harry George wrote: > John Nagle <[EMAIL PROTECTED]> writes: > You experience isn't shared by everyone. Some of us find Python the > most functional and portable of the candidates you mention. The language is fine. It's the bindings to other packages that are the problem. There are three d

Re: Thoughts on using isinstance

2007-01-24 Thread abcd
Well my example function was simply taking a string and printing, but most of my cases would be expecting a list, dictionary or some other custom object. Still propose not to validate the type of data being passed in? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Matrix class

2007-01-24 Thread Gabriel Genellina
At Wednesday 24/1/2007 02:40, Paul McGuire wrote: > The points should be aligned on a log-log plot to be a power function. > As Robert Kern stated before, this problem should be not worse than > O(n**3) - how have you implemented it? > Sure enough, the complete equation is t = 5e-05exp(1.1n), or

Re: The reliability of python threads

2007-01-24 Thread Chris Mellon
On 24 Jan 2007 17:12:19 GMT, Nick Maclaren <[EMAIL PROTECTED]> wrote: > > In article <[EMAIL PROTECTED]>, > "Carl J. Van Arsdall" <[EMAIL PROTECTED]> writes: > |> Hey everyone, I have a question about python threads. Before anyone > |> goes further, this is not a debate about threads vs. processes

Re: Thoughts on using isinstance

2007-01-24 Thread abcd
>Yes because usually you don't expect a list or dictionary but some object > that *acts* like a list or dictionary. Or you even expect just some > aspects of the type's behavior. For example that it is something you can > iterate over. > > Ciao, > Marc 'BlackJack' Rintsch good point. is

Re: Python does not play well with others

2007-01-24 Thread Chris Mellon
On 1/24/07, John Nagle <[EMAIL PROTECTED]> wrote: > Harry George wrote: > > John Nagle <[EMAIL PROTECTED]> writes: > > > You experience isn't shared by everyone. Some of us find Python the > > most functional and portable of the candidates you mention. > > The language is fine. It's the bindi

Re: The reliability of python threads

2007-01-24 Thread skip
Carl> Does anyone have any conclusive evidence that python threads/locks Carl> are safe or unsafe? In my experience Python threads are generally safer than the programmers that use them. ;-) Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.path issue in cygwin

2007-01-24 Thread Gabriel Genellina
At Wednesday 24/1/2007 04:58, Wang Shuhao wrote: To keep the question simple, I've set PATH= in cygwin.bat to avoid python initialze sys.path from Windows' PATH environment. The simple answer is that sys.path has nothing to do with the PATH environment variable. sys.path is initialized from t

Re: smtplib starttls gmail example - comments?

2007-01-24 Thread Gabriel Genellina
At Wednesday 24/1/2007 09:12, BJ Swope wrote: Both examples have included the cardinal sin in smtp... They both send the message text followed by new line dot new line. The smtp protocol specifically mentions CRLF dot CRLF. Please please please use \r\n.\r\n in your code... No. The SMTP o

Re: Python does not play well with others

2007-01-24 Thread Paul Boddie
On 24 Jan, 02:50, John Nagle <[EMAIL PROTECTED]> wrote: >The major complaint I have about Python is that the packages > which connect it to other software components all seem to have > serious problems. As long as you don't need to talk to anything > outside the Python world, you're fine. I t

Re: Noob Question: Force input to be int?

2007-01-24 Thread consmash
On 23 Sty, 10:59, [EMAIL PROTECTED] wrote: > Hello everyone! > I have a piece of code that looks like this: > > if len(BuildList) > 0: > print "The script found %d game directories:" % len(BuildList) > print > num = 0 > for i in BuildList: > print str(num) +" " + i >

Python 2.5 and Zeus

2007-01-24 Thread Daniel Klein
Does anyone know if the Zeus IDE is compatible with Python 2.5? I sent an email to Zeus a couple days ago but have not heard anything. Thanks, Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on using isinstance

2007-01-24 Thread Diez B. Roggisch
abcd wrote: > good point. is there place that documents what methods/attrs I should > check for on an object? for example, if its a list that I expect I > should verify the object that is passed in has a ??? function? etc. Don't check, try. Catch a possible exception, and continue with another

Re: Thoughts on using isinstance

2007-01-24 Thread Gabriel Genellina
At Wednesday 24/1/2007 14:21, abcd wrote: >Yes because usually you don't expect a list or dictionary but some object > that *acts* like a list or dictionary. Or you even expect just some > aspects of the type's behavior. For example that it is something you can > iterate over. > > Ciao, >

Re: The reliability of python threads

2007-01-24 Thread Carl J. Van Arsdall
[EMAIL PROTECTED] wrote: > Carl> Does anyone have any conclusive evidence that python threads/locks > Carl> are safe or unsafe? > > In my experience Python threads are generally safer than the programmers > that use them. ;-) > Haha, yea, tell me about it. The whole GIL thing made me ne

Re: module email

2007-01-24 Thread Gabriel Genellina
At Wednesday 24/1/2007 13:02, Sergey Dorofeev wrote: Why does not work? Some details please? -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imag

Re: The reliability of python threads

2007-01-24 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Chris Mellon" <[EMAIL PROTECTED]> writes: |> > |> |> > |> Does anyone have any conclusive evidence that python threads/locks are |> > |> safe or unsafe? |> > |> > Unsafe. They are built on top of unsafe primitives (POSIX, Microsoft |> > etc.) Python will shield y

Re: Thoughts on using isinstance

2007-01-24 Thread Duncan Booth
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > In > the example above, you can validate that fileobject has a write > attribute: getattr(fileobject, "write"). But I'd only do that if I > have a good reason (perhaps if the file is used after some lengthy > calculation,and I want to be sure that

Re: Thoughts on using isinstance

2007-01-24 Thread Matthew Woodcraft
abcd <[EMAIL PROTECTED]> wrote: > Well my example function was simply taking a string and printing, but > most of my cases would be expecting a list, dictionary or some other > custom object. Still propose not to validate the type of data being > passed in? There are many people here who will in

Re: The reliability of python threads

2007-01-24 Thread Chris Mellon
On 24 Jan 2007 18:21:38 GMT, Nick Maclaren <[EMAIL PROTECTED]> wrote: > > In article <[EMAIL PROTECTED]>, > "Chris Mellon" <[EMAIL PROTECTED]> writes: > |> > |> > |> > |> Does anyone have any conclusive evidence that python threads/locks are > |> > |> safe or unsafe? > |> > > |> > Unsafe. They are

Re: Type casting a base class to a derived one?

2007-01-24 Thread Cliff Wells
On Thu, 2007-01-11 at 08:41 -0600, Chris Mellon wrote: > On 11 Jan 2007 15:01:48 +0100, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > On 2007-01-11, Frederic Rentsch <[EMAIL PROTECTED]> wrote: > > > If I derive a class from another one because I need a few extra > > > features, is there a way to prom

Re: The reliability of python threads

2007-01-24 Thread Carl J. Van Arsdall
Chris Mellon wrote: > On 24 Jan 2007 18:21:38 GMT, Nick Maclaren <[EMAIL PROTECTED]> wrote: > >> [snip] >> >> > > I'm aware of the issues with the POSIX threading model. I still stand > by my statement - bringing up the problems with the provability of > correctness in the POSIX model amoun

Re: Simple Matrix class

2007-01-24 Thread Paul McGuire
On Jan 24, 11:21 am, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Wednesday 24/1/2007 02:40, Paul McGuire wrote: > > > > The points should be aligned on a log-log plot to be a power function. > > > As Robert Kern stated before, this problem should be not worse than > > > O(n**3) - how have you

Re: Type casting a base class to a derived one?

2007-01-24 Thread Chris Mellon
On 1/24/07, Cliff Wells <[EMAIL PROTECTED]> wrote: > On Thu, 2007-01-11 at 08:41 -0600, Chris Mellon wrote: > > On 11 Jan 2007 15:01:48 +0100, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > > On 2007-01-11, Frederic Rentsch <[EMAIL PROTECTED]> wrote: > > > > If I derive a class from another one becaus

Re: Regex for URL extracting

2007-01-24 Thread Paul McGuire
On Jan 24, 10:20 am, "Johny" <[EMAIL PROTECTED]> wrote: > Does anyone know about a good regular expression for URL extracting? > > J. Google turns this up: http://geekswithblogs.net/casualjim/archive/2005/12/01/61722.aspx But I've seen other re's for this problem that are hundreds of characters

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread Harry George
"Chris Mellon" <[EMAIL PROTECTED]> writes: > On 1/24/07, Giovanni Bajo <[EMAIL PROTECTED]> wrote: [snip] > > > > That page is legal babble, trying to trick you into buying (or making your > > boss buy) a commercial license. The Qt Open Source edition *IS* GPL and thus > > it falls under all the no

newbie - returned values from cscript.exe

2007-01-24 Thread Rich
I am writing my first python script and I'm guessing this is something obvious but I can't find any examples of doing something like this. I have a python script that is running a vbscript through cscript.exe. The vbscript looks up a server name, username, password etc and returns these values in

Re: Type casting a base class to a derived one?

2007-01-24 Thread Cliff Wells
On Wed, 2007-01-24 at 12:57 -0600, Chris Mellon wrote: > > In Python, you can do this simply by re-assigning the __class__. I'm > not convinced that your type system makes sense, here though. Any > reasonable ORM should be able to persist and reload an object without > losing the type information

Re: Thoughts on using isinstance

2007-01-24 Thread Bruno Desthuilliers
Matthew Woodcraft a écrit : > abcd <[EMAIL PROTECTED]> wrote: > >>Well my example function was simply taking a string and printing, but >>most of my cases would be expecting a list, dictionary or some other >>custom object. Still propose not to validate the type of data being >>passed in? > > >

Re: Simple Matrix class

2007-01-24 Thread Robert Kern
Paul McGuire wrote: > And the purpose/motivation for "reimplementing it better" would be > what, exactly? So I can charge double for it? So you can have accurate results, and you get a good linear solver out of the process. The method you use is bad in terms of accuracy as well as efficiency. --

Re: Type casting a base class to a derived one?

2007-01-24 Thread Cliff Wells
On Wed, 2007-01-24 at 11:37 -0800, Cliff Wells wrote: > > class Person: # assume this is something from the ORM > name = "Kenny" > > class PersonRow ( Person ): > pass > > def flatten_person ( p ): > return "omg, you've killed %p" % p.name > > def flatten_personrow ( p ): > ret

Re: Thoughts on using isinstance

2007-01-24 Thread Bruno Desthuilliers
abcd a écrit : > Well my example function was simply taking a string and printing, but > most of my cases would be expecting a list, dictionary or some other > custom object. Still propose not to validate the type of data being > passed in? Yes - unless you have a *very* compelling reason to do o

Re: Python Windows Editors

2007-01-24 Thread Hertha Steck
Am Mon, 22 Jan 2007 00:33:12 + schrieb W. Watson: > [EMAIL PROTECTED] wrote: >> W. Watson wrote: >>> I downloaded python-2.5.msi and installed it. I believe its editor is IDE. I >>> understand there's a Win editor called pythonwin. I believe it's in the >>> download pywin32-210.win32-py2.5.exe

  1   2   3   >