Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread Jeroen Ruigrok van der Werven
-On [20080201 19:06], JKPeck ([EMAIL PROTECTED]) wrote: >In both of these cases, there are only plain, 7-bit ascii characters >in the xml, and it really is valid utf-16 as far as I can tell. Did you mean to say that the only characters they used in the UTF-16 encoded file are characters fr

Share the experience of Mobile with Quran features

2008-02-01 Thread Farooq
www.enmac.com.hk GSM Mobile Phones, Digital iPods, Digital Clocks, Digital Pens, Digital Quran. Enjoy these products with Islamic Features (Complete Holy Quran with Text and Audio, Tafaseer books, Ahadees Books, Daily Supplications, Universal Qibla Direction, Prayer Timing and much more) visit our

Re: read_nonblocking error in pxssh

2008-02-01 Thread kayvansylvan
On Feb 1, 4:31 pm, Jinno <[EMAIL PROTECTED]> wrote: > I don't know if anyone ever got back to you with a fix, but for me the > fix was really simple. > > I just added a self.sendline() and a time.sleep(0.5) right before the > first read_nonblocking() call within synch_original_prompt Thank you!!!

LuaJIT improves

2008-02-01 Thread bearophileHUGS
There are news: http://article.gmane.org/gmane.comp.lang.lua.general/44781 I think Psyco may deserve some updates, because it can be useful on Python 3.0 too, on 64bit, and on iterators (with itertools) too. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: REALLY simple xml reader

2008-02-01 Thread Stefan Behnel
Steven D'Aprano wrote: > The same way it knows that " encoding. If the parser knows that the hex bytes > > 3c 3f 78 6d 6c > > (or 3c 00 3f 00 78 00 6d 00 6c 00 if you prefer UTF-16, and feel free to > swap the byte order) > > mean " > then it can equally know that bytes > > 20 09 0a > > a

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Gabriel Genellina
En Sat, 02 Feb 2008 01:40:50 -0200, Steve Holden <[EMAIL PROTECTED]> escribi�: > Gabriel Genellina wrote: >> I don't understand the comment. Most of the readline functionality is >> already present on Windows XP (command history, up/down arrows, edit >> [...] > Until you try to do something li

Re: urllib supports javascript

2008-02-01 Thread J. Peng
js 写道: > AFAIK, nothing. > How abount letting a browser do it? > By using pamie [1] or selenium, you can drive a browser from python. > > [1] http://pamie.sourceforge.net/ > > On Feb 2, 2008 11:07 AM, J. Peng <[EMAIL PROTECTED]> wrote: >> hello, >> >> Which useragent lib supports javascript?

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-01 Thread gene tani
On Jan 30, 4:40 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > I do not understand why no one has answered the following question: > > Has anybody worked with Gene Expression Programming > > David Blubaugh > David (may i call you David?) May i suggest you lock your workstation when you

Re: urllib supports javascript

2008-02-01 Thread js
AFAIK, nothing. How abount letting a browser do it? By using pamie [1] or selenium, you can drive a browser from python. [1] http://pamie.sourceforge.net/ On Feb 2, 2008 11:07 AM, J. Peng <[EMAIL PROTECTED]> wrote: > hello, > > Which useragent lib supports javascript? > I know something about the

functools possibilities

2008-02-01 Thread castironpi
1. functools.partialpre: partialpre( f, x, y )( z )-> f( z, x, y ) 2. functools.pare: pare( f, 1 )( x, y )-> f( y ) 3. functools.parepre: parepre( f, 1 )( x, y )-> f( x ) 4. functools.calling_default: calling_default( f, a, DefaultA, b )-> f( a, , b ) -- http://mail.python.org/mailman/listinfo/pyt

Re: urllib supports javascript

2008-02-01 Thread Steve Holden
J. Peng wrote: > hello, > > Which useragent lib supports javascript? > I know something about these libs: urllib,urllib2,cookielib,httplib > But I'm not sure which one of them can support javascript scripts. > Thanks! None of them do. Javascript support is a very complex task! I believe there ha

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Steve Holden
Gabriel Genellina wrote: > En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge > <[EMAIL PROTECTED]> escribió: > >> If you're using the offficial Win32 port of Python than you probably >> want to use the Cygwin version because Win32 version doesn't support >> readline anyways. > > I don't understand

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread Martin v. Löwis
> The basic fact, though, remains, the same code works for me with the > same input but not for two particular users (out of hundreds). I see. That's mysterious. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

urllib supports javascript

2008-02-01 Thread J. Peng
hello, Which useragent lib supports javascript? I know something about these libs: urllib,urllib2,cookielib,httplib But I'm not sure which one of them can support javascript scripts. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: finding memory leak in edgewall trac 0.11

2008-02-01 Thread rupert.thurner
On Jan 20, 2:59 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > rupert.thurner wrote: > > i forgot to mention that i cannot see any explicit sys._getframe(), or > > __del__ in the genshi code, while the ones intrac-core seemed to be > > there in 0.10.4. > > Does the code keep a reference to a tra

Re: REALLY simple xml reader

2008-02-01 Thread Steven D'Aprano
On Thu, 31 Jan 2008 18:35:17 +0100, Stefan Behnel wrote: > Hi, > > Steven D'Aprano wrote: >> On Fri, 01 Feb 2008 00:40:01 +1100, Ben Finney wrote: >> >>> Quite apart from a human thinking it's pretty or not pretty, it's *not >>> valid XML* if the XML declaration isn't immediately at the start of

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Grant Edwards
On 2008-02-02, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge ><[EMAIL PROTECTED]> escribió: > >> If you're using the offficial Win32 port of Python than you >> probably want to use the Cygwin version because Win32 version >> doesn't support readline

Re: Multiple interpreters retaining huge amounts of memory

2008-02-01 Thread Martin v. Löwis
> Is there some way to track references per interpreter, or to get the > memory allocator to set up seperate arenas per interpreter so that it > can remove all allocated memory when the interpreter exits? No. The multi-interpreter feature doesn't really work, so you are basically on your own. If y

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Martin v. Löwis
> Is there a reason why "/" is considered an absolute pathname by > CPython? Yes: it tests whether a path is absolute on the current volume. Use the source, Luke. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: What should I use under *nix instead of freeze?

2008-02-01 Thread Martin v. Löwis
> "I think nobody really cares about freeze any more -- it isn't > maintained." > > That being the case, what is the preferred/best replacement for freeze > on a *nix platform? I don't think that there is one, or that there should be one. If you care about the feature (i.e. provide a single exec

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Martin v. Löwis
> That's odd, because readline seems to work fine in a Windows > console (recalling previous lines and line editing). That's an illusion. The Windows version of Python does not support or use GNU readline at all. What you see is a feature of the console window. Regards, Martin -- http://mail.pyt

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Gabriel Genellina
En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge <[EMAIL PROTECTED]> escribió: > If you're using the offficial Win32 port of Python than you probably > want to use the Cygwin version because Win32 version doesn't support > readline anyways. I don't understand the comment. Most of the readline fun

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Grant Edwards
On 2008-02-02, Ross Ridge <[EMAIL PROTECTED]> wrote: >>When I ssh into a windows machine (running Cygwin sshd), I can >>invoke python at the shell prompt (you have to use -i option >>and I don't really understand why). >> >>Once it's started there are couple rather odd behaviors: >> >> 1) readline

Multiple interpreters retaining huge amounts of memory

2008-02-01 Thread Bronner, Gregory
I have an application that simultaneously extends and embeds the python interpreter. It is threaded, but all python calls are performed in one thread. Several interpreters are running simultaneously -- the application receives an event, activates a particular interpreter, and calls some python c

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Ross Ridge
Grant Edwards <[EMAIL PROTECTED]> wrote: >When I ssh into a windows machine (running Cygwin sshd), I can >invoke python at the shell prompt (you have to use -i option >and I don't really understand why). > >Once it's started there are couple rather odd behaviors: > > 1) readline support doesn't wo

Re: What should I use under *nix instead of freeze?

2008-02-01 Thread Wildemar Wildenburger
Mike Kent wrote: > That being the case, what is the preferred/best replacement for freeze > on a *nix platform? Don't know about best or preferred, but pyinstaller seems to do that. http://pyinstaller.python-hosting.com> good luck /W -- http://mail.python.org/mailman/listinfo/python-list

Re: read_nonblocking error in pxssh

2008-02-01 Thread Jinno
On Feb 1, 10:49 am, [EMAIL PROTECTED] wrote: > On Jan 16, 9:24 am, jrpfinch <[EMAIL PROTECTED]> wrote: > > > > > I'm attempting to use thepxsshto execute commands on a remote > > machine and do stuff with the output. Both machines are running SSH > > Version Sun_SSH_1.0, protocol versions 1.5/2.0

Re: What should I use under *nix instead of freeze?

2008-02-01 Thread Noah
On Feb 1, 3:08 pm, Mike Kent <[EMAIL PROTECTED]> wrote: > In a comment Guido made on a recent bug report for the 'freeze' > utility, he stated: > > "I think nobody really cares about freeze any more -- it isn't > maintained." > > That being the case, what is the preferred/best replacement for freez

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Ross Ridge
Grant Edwards <[EMAIL PROTECTED]> wrote: >I guess it depends on your definition of "absolute". In my >mind, it means that it always refers to the same location >regardless of the CWD. Strictly speaking "/" refers to same location regardless of the current working directory (CWD) on Windows. It'

Re: help with apache + mod_python on mac os x

2008-02-01 Thread pnrdnz
I could correct version mismatch by handling files under: $ ls -l /usr/lib |grep python lrwxr-xr-x1 root wheel16 Feb 2 01:17 libpython.dy -> libpython2.dylib lrwxr-xr-x1 root wheel16 Feb 2 01:11 libpython2.5.dylib -> libpython2.dylib lrwxr-xr-x1 root wheel7

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Steven D'Aprano
On Fri, 01 Feb 2008 06:09:49 -0800, Paul McGuire wrote: > IIRC, the optimization of successive string concatentions is only > available when running Python on Windows. If you are running on Linux, > this should have more benefit.) There's no reason to believe it is platform-dependent, although it

What should I use under *nix instead of freeze?

2008-02-01 Thread Mike Kent
In a comment Guido made on a recent bug report for the 'freeze' utility, he stated: "I think nobody really cares about freeze any more -- it isn't maintained." That being the case, what is the preferred/best replacement for freeze on a *nix platform? I'm looking for something that, like freeze,

Re: Meta Class

2008-02-01 Thread Gabriel Genellina
En Fri, 01 Feb 2008 15:46:05 -0200, Trevor Johnson <[EMAIL PROTECTED]> escribió: > I think I have a good candidate for a meta class here. Never done this > before and would like someone to help. In the code that follows, there is > one variable that needs to be changed: the letter 'a' as inserte

Re: bags? 2.5.x?

2008-02-01 Thread Paul Rubin
Dan Stromberg <[EMAIL PROTECTED]> writes: > > * Is the feature useful for the broad mass? > > Yes, probably, at least if this kind of feature's inclusion in other > languages and my two recent needs for it are any indication. In other > languages, they are sometimes called bags or multisets. I

Re: bags? 2.5.x?

2008-02-01 Thread Dan Stromberg
On Wed, 23 Jan 2008 08:51:13 +0100, Christian Heimes wrote: > Dan Stromberg wrote: >> Is there a particular reason why bags didn't go into 2.5.x or 3000? >> >> I keep wanting something like them - especially bags with something >> akin to set union, intersection and difference. > > Ask yourself

help with apache + mod_python on mac os x

2008-02-01 Thread pnrdnz
Hi, I am new on everything about web development. I did many things to get the error at the end. My system has Apache 1.3 by default. I could install Apache 2.2 with no problem. I had to change all binaries in /usr/bin and /usr/sbin to new apache binaries. All ok. System came with python 2.3.1. I r

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Grant Edwards
On 2008-02-01, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: >> >> Sure seems like a bug to me.  On Unix, "/" is an absolute path. >> >> On windows, "/" is relative to the current device. >> >> > If you mean "the current drive letter" it's not actually true >> > since "\ \" is used for that: >> >>

Win32 python: odd behavior when run via ssh

2008-02-01 Thread Grant Edwards
When I ssh into a windows machine (running Cygwin sshd), I can invoke python at the shell prompt (you have to use -i option and I don't really understand why). Once it's started there are couple rather odd behaviors: 1) readline support doesn't work. 2) you have call sys.exit() to exit (neithe

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Giampaolo Rodola'
On Feb 1, 10:34 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-02-01, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > > > > > > > On Feb 1, 9:55 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > >> On 2008-02-01, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > > >> > I'm trying to solve a jython

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Grant Edwards
On 2008-02-01, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > On Feb 1, 9:55 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: >> On 2008-02-01, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: >> >> > I'm trying to solve a jython-related issue and I discovered a >> > different behavior affecting os.path.is

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Grant Edwards
On 2008-02-01, Steve Holden <[EMAIL PROTECTED]> wrote: > Personally I'd say it was Jython that was wrong. Anything > beginning with a slash has to be absolute - "/" and "\" are > treated as equivalent in most parts of the Windows > environment. I guess it depends on your definition of "absolute".

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Giampaolo Rodola'
On Feb 1, 9:55 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-02-01, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > > > I'm trying to solve a jython-related issue and I discovered a > > different behavior affecting os.path.isabs between CPython and > > Jython. > > [...] > > > Is there a rea

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Arnaud Delobelle
On Feb 1, 8:34 pm, "Neil Cerutti" <[EMAIL PROTECTED]> wrote: > On Feb 1, 2008 3:16 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > The total number of iterations is 1+2+...+n = n(n+1)/2 (when n is the > > number of intervals) so this has quadratic behaviour regardless of > > input.[...] > But

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread JKPeck
On Feb 1, 1:51 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > They sent me the actual file, which was created on Windows, as an > > email attachment. They had also sent the actual dataset from which > > the XML was generated so that I could generate it myself using the > > same version of o

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Grant Edwards
On 2008-02-01, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > I'm trying to solve a jython-related issue and I discovered a > different behavior affecting os.path.isabs between CPython and > Jython. [...] > Is there a reason why "/" is considered an absolute pathname > by CPython? Sure seems li

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Steve Holden
Giampaolo Rodola' wrote: > Hi, > I'm trying to solve a jython-related issue and I discovered a > different behavior affecting os.path.isabs between CPython and Jython. > > > C:\Python23>python.exe > Python 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] > on win32 > Type "help", "c

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread Martin v. Löwis
> They sent me the actual file, which was created on Windows, as an > email attachment. They had also sent the actual dataset from which > the XML was generated so that I could generate it myself using the > same version of our app as the user has. I did that but did not get > an exception. So

Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Giampaolo Rodola'
Hi, I'm trying to solve a jython-related issue and I discovered a different behavior affecting os.path.isabs between CPython and Jython. C:\Python23>python.exe Python 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread JKPeck
On Feb 1, 1:22 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > In both of these cases, there are only plain, 7-bit ascii characters > > in the xml, and it really is valid utf-16 as far as I can tell. > > What do you mean by "7-bit ascii characters"? If it means what I think > it means (namely,

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Neil Cerutti
On Feb 1, 2008 3:16 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Feb 1, 2:44 pm, "Neil Cerutti" <[EMAIL PROTECTED]> wrote: > > Here's another contender, basically the same as yours, but spelled > > without iterators. > > > > def overlaps(eranges): > > """Determine, from a list of number

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Arnaud Delobelle
On Feb 1, 8:17 pm, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: [...] > def strip_sort (a, b): >     if a[0] < b[0]: >         return -1 >     if a[0] > b[0]: >         return 1 >     if a[0] == 'L': return -1 >     return 0 > > def overlaps (strips_given): >     s2 = [((s[0], 'L', i) , (s[1], 'R',

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread Martin v. Löwis
> In both of these cases, there are only plain, 7-bit ascii characters > in the xml, and it really is valid utf-16 as far as I can tell. What do you mean by "7-bit ascii characters"? If it means what I think it means (namely, a sequence of bytes whose values are between 1 and 127), then it is *no

Re: subprocess and & (ampersand)

2008-02-01 Thread Albert van der Horst
In article <[EMAIL PROTECTED]>, Tim Golden <[EMAIL PROTECTED]> wrote: > >So, even assuming we're looking at the same situation, >I suppose one solution for you is to break out the >.bat file. But that may not be a possibility. Unless you need compatibility with Windows 3.1., I suggest you stay a

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Karthik Gurusamy
On Jan 31, 8:12 am, erikcw <[EMAIL PROTECTED]> wrote: > Hi, > > I have a list of numbers each with a +/- margin of error. I need to > identify which ones overlab each other. > > For example: > 55 +/- 3 > 20 +/- 2 > 17 +/- 4 > 60 +/- 3 > > #base, max, min > list = [ > (55, 58, 52), > (20, 22, 18),

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Arnaud Delobelle
On Feb 1, 2:44 pm, "Neil Cerutti" <[EMAIL PROTECTED]> wrote: > On Feb 1, 2008 8:28 AM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > > Yours  is O(n^2) and \Omega(n^2).  I think mine is O(max(c, nlogn)) > > (assuming constant time access for dictionaries, but 'inside' could be > > replaced with a

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-01 Thread Martin v. Löwis
> Seems like they'd have trouble with cooling problems... > (okay, I was just told yesterday that "hell is hot" is a > culturally relative thing, and that the Nordic version of hell > involves extreme cold. ymmv) That depends on the rate at which hell is expanding. If it is expanding at a slower

build tool opinions

2008-02-01 Thread Tim Arnold
Hi, I'm going through the various build tools (i.e., make-like) available and could use some advice. My documentation-build system is written in python and uses the pdflatex and plasTeX engines to create pdfs, html, and docbook XML from latex source files. All that is ok, but I can clean up a l

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Carl Banks
On Feb 1, 9:09 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > 2. Bugfix: In 2 places, change: > newgene=genes[randint(0,14)-1] > to > newgene=genes[randint(0,14-1)] > > randint(a,b) returns values from a to b inclusive, and genes is a list > containing 14 elements (so you want subsc

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Arnaud Delobelle
On Feb 1, 1:28 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Yours  is O(n^2) and \Omega(n^2).  I think mine is O(max(c, nlogn)) > (assuming constant time access for dictionaries, but 'inside' could be > replaced with a list) where c is the number of overlaps.  I'll try to > post a proof later

Nested compound statements.

2008-02-01 Thread Neil Cerutti
The docs say: A suite can be one or more semicolon-separated simple statements on the same line as the header, following the header's colon, or it can be one or more indented statements on subsequent lines. Only the latter form of suite can contain nested compound statements; the following is il

Re: read_nonblocking error in pxssh

2008-02-01 Thread kayvansylvan
On Jan 16, 9:24 am, jrpfinch <[EMAIL PROTECTED]> wrote: > I'm attempting to use thepxsshto execute commands on a remote > machine and do stuff with the output. Both machines are running SSH > Version Sun_SSH_1.0, protocol versions 1.5/2.0 and Intel Solaris 9. > > I am hitting a problem with read_n

lxml 2.0 released

2008-02-01 Thread Stefan Behnel
Hi everyone, I'm very happy to announce the official release of lxml 2.0! http://codespeak.net/lxml/ http://pypi.python.org/pypi/lxml/2.0 ** What is lxml? """ In short: lxml is the most feature-rich and easy-to-use library for working with XML and HTML in the Python language. lxml is a Pythoni

Re: SimpleXMLRPCServer to fastcgi via WSGI?

2008-02-01 Thread Joshua Kugler
Ivan Voras wrote: > Is there a straightforward way to convert an XML-RPC server application > (written for SimpleXMLRPCServer) to use WSGI so that it can be used as s > fastcgi server? By "straightforward" I mean something simple, without > using some external framework. > > Alternatively, I don't

Re: Pyrex bitten by the exception bug

2008-02-01 Thread Paul Sijben
Stefan Behnel wrote: > Paul Sijben wrote: >> I am running into the (apparently) well-known issue with pyrex that >> trying to raise an exception using python2.5 and pyrex will lead to a >> TypeError, as "TypeError: exceptions must be strings, classes, or >> instances, not exceptions.ImportError" >

proxy testing code with multi-thread

2008-02-01 Thread [EMAIL PROTECTED]
hi all I'm now meeting some problem when using threading to test whether or not a proxy is good or not and the total number of proxies is just 60 but each time my programme stopped just at approaching the end, say, for each proxy I made a proxy but it just stopped working at maybe 58 or 59 or some

Mysterious xml.sax Encoding Exception

2008-02-01 Thread JKPeck
I have a module that uses xml.sax and feeds it a string of xml as in xml.sax.parseString(dictfile,handler) The xml is always encoded in utf-16, and the XML string always starts with This almost always works fine, but two users of this module get an exception whatever input they use it on. (The

MyHDL project for FPGA development!

2008-02-01 Thread Blubaugh, David A.
Dan, Thank you very much for your reply. My Master's thesis is for Wright State University and is of the following nature: I am currently engaged with a Masters project, that utilizes a linear array of isotropic sensors, or in my case electromagnetic antennas. I am trying to develop a special

Meta Class

2008-02-01 Thread Trevor Johnson
Hi; I think I have a good candidate for a meta class here. Never done this before and would like someone to help. In the code that follows, there is one variable that needs to be changed: the letter 'a' as inserted in construction of the variable 'word'. In other applications, I will need to change

Half-Broken filetype association in XP

2008-02-01 Thread Gerry
Under XP, until yesterday, I typed a.py in a dos box and a.py ran fine; typed a.xls and opened an excel window; typed a.doc and opened a word Document. Type, all of those fail - if typed in a DOS window. They all work -- if clicked in an explorer window. The registry looks fine (to me, fwtw):

Re: MyHDL project !!!!!

2008-02-01 Thread Grant Edwards
On 2008-02-01, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > I would be honored to start a project such as that in mind. > How do we begin ?? You need to get the punctuation keys on your keyboard fixed. They're sticking, and it's making your posts look like they come from a hyperactive 4th

Re: dict comprehension

2008-02-01 Thread Stefan Behnel
Wildemar Wildenburger wrote: > Arnaud Delobelle wrote: >>> I believe both set and dict comprehensions will be in 3.0. >> >> Python 3.0a1+ (py3k:59330, Dec 4 2007, 18:44:39) >> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >>

Re: Pyrex bitten by the exception bug

2008-02-01 Thread Stefan Behnel
Paul Sijben wrote: > I am running into the (apparently) well-known issue with pyrex that > trying to raise an exception using python2.5 and pyrex will lead to a > TypeError, as "TypeError: exceptions must be strings, classes, or > instances, not exceptions.ImportError" You should use a recent Pyre

Re: Removal of element from list while traversing causes the next element to be skipped

2008-02-01 Thread William McBrine
On Wed, 30 Jan 2008 06:07:45 -0800, cokofreedom wrote: > Anyone else noticed that the OP has not actually replied to any of the > suggestions... Sorry. I was just fascinated at the turns it was taking. But the first answer was fine for me: for name in apps[:]: etc. Thanks all. -- 09 F9 11

Re: How to convert markup text to plain text in python?

2008-02-01 Thread Paul McGuire
On Feb 1, 10:54 am, Tim Chase <[EMAIL PROTECTED]> wrote: > >> Well, if all you want to do is remove everything from a "<" to a > >> ">", you can use > > >>   >>> s = "Today is Friday" > >>   >>> import re > >>   >>> r = re.compile('<[^>]*>') > >>   >>> print r.sub('', s) > >>   Today is Friday > >

Re: how to include text data in source code?

2008-02-01 Thread Sun
"Matimus" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Feb 1, 9:28 am, "Sun" <[EMAIL PROTECTED]> wrote: >> as the subject, I 'd like to know how to include a piece of text as input >> in >> the source code so that I do not need to read in data from files. I >> remember >> th

Re: Pyrex bitten by the exception bug

2008-02-01 Thread bearophileHUGS
Paul Sijben: > Is there a fixc for this issue? At the moment I think it's better to drop Pyrex and to use Cython. Maybe you can try that, or ask to their developers. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Matthew_WARREN
> Another interesting technique, similar to GA, is SA or Simulated > Annealing. You should be able to adapt your quickga.py program to an > SA approach without too much trouble, and comparing the two should > tickle your academic bemusement. I shall take a look. This message and any at

Re: How to convert markup text to plain text in python?

2008-02-01 Thread Tim Chase
>> Well, if all you want to do is remove everything from a "<" to a >> ">", you can use >> >> >>> s = "Today is Friday" >> >>> import re >> >>> r = re.compile('<[^>]*>') >> >>> print r.sub('', s) >> Today is Friday >> [Tim's ramblings about pathological cases snipped] > > The real answer

checkpoint/restart python processes

2008-02-01 Thread Neal Becker
Hi numeric processing fans. I'm pleased to report that you can now have convenient checkpoint/restart, at least if you are running fedora linux. Example: python -i blcr_mod.py <<< this will start python, then checkpoint it c_int(2) (ignore this debug) >>> [quit] cr_restart checkpoint.nbecker1.2

Re: How to convert markup text to plain text in python?

2008-02-01 Thread Steve Holden
Tim Chase wrote: >> I have some marked up text and would like to convert it to plain text, >> by simply removing all the tags. Of course I can do it from first >> principles but I felt that among all Python's markup tools there must >> be something that would do this simply, without having to creat

Re: How to convert markup text to plain text in python?

2008-02-01 Thread ph
On 01-Feb-2008, geoffbache wrote: > I have some marked up text and would like to convert it to plain text, > by simply removing all the tags. Of course I can do it from first > principles but I felt that among all Python's markup tools there must > be something that would do this simply, without ha

Re: PyWeek 6 is coming!

2008-02-01 Thread rockingred
On Jan 31, 4:11 pm, [EMAIL PROTECTED] wrote: > PyWeek 6 will run from 00:00 UTC on March 30th through to 00:00 UTC on April > 6th. > > Registration is NOT OPEN YET. It will open on Friday 2008/02/29. > > If you're new (or even coming back again) please have a look at the rules and > help pages atht

Re: Will Python on day replace MATLAB?

2008-02-01 Thread Steve Holden
Pete Forman wrote: > Jaap Spies <[EMAIL PROTECTED]> writes: > > > Have a look at Sage: http://www.sagemath.org/ > > Of relevance to SciPy is the following > > http://wiki.sagemath.org/days8 > > | The Sage_ and Scipy_ teams and `Enthought Inc.`_ are pleased to > | announce the first collabora

Re: MyHDL project

2008-02-01 Thread Steve Holden
chewie54 wrote: >> Dan, >> >> I would be honored to start a project such as that in mind. How do we >> begin ?? >> >> David Blubaugh >> >> >> Why not use MyHDL which is written in Python and translates to Verilog. >> I assume ImpulseC is a commercial product and costs a log. MyHDL is >> free.

Re: How to convert markup text to plain text in python?

2008-02-01 Thread Tim Chase
> I have some marked up text and would like to convert it to plain text, > by simply removing all the tags. Of course I can do it from first > principles but I felt that among all Python's markup tools there must > be something that would do this simply, without having to create an > XML parser etc

Re: CDA conversion

2008-02-01 Thread Dan Upton
On Jan 31, 2008 9:00 PM, Sick Monkey <[EMAIL PROTECTED]> wrote: > Good evening. I am trying to write an application in Python that will allow > a person to insert a CD into their computer and this python script will > convert the music to mp3. > > NOTE: I have already google'd this, and nothing r

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Matthew_WARREN
On Feb 1, 9:11 am, [EMAIL PROTECTED] wrote: > > > 0. Tack this bit onto the end of quickga.py, and you wont have to > > write a separate routine to import quickga and invoke evolve(): > > > > >     if __name__ == "__main__": > > >         evolve() > > > > I hear you, but something I dont ten

Re: PLEASE ACCEPT MY SINCERE APOLOGIES

2008-02-01 Thread Robert Dailey
> > And for top-posting :) That's a matter of opinion ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: MyHDL project !!!!!

2008-02-01 Thread chewie54
> Dan, > > I would be honored to start a project such as that in mind. How do we > begin ?? > > David Blubaugh > > > Why not use MyHDL which is written in Python and translates to Verilog. > I assume ImpulseC is a commercial product and costs a log. MyHDL is > free. > If you have any interest

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-02-01 Thread Robert Dailey
> > This is not part of his Masters... :-) Lmfao -- http://mail.python.org/mailman/listinfo/python-list

How to convert markup text to plain text in python?

2008-02-01 Thread geoffbache
I have some marked up text and would like to convert it to plain text, by simply removing all the tags. Of course I can do it from first principles but I felt that among all Python's markup tools there must be something that would do this simply, without having to create an XML parser etc. I've lo

Re: giving imp.load_module not a real file, HOW?

2008-02-01 Thread Christian Heimes
Paul Sijben wrote: > For some reason imp.load_module insists on getting a real open file as > the second parameter. I have not able to fool it with stringIO or > overloaded file objects. > > So now I have two questions: > 1) why does load_module insist on a real file > 2) is there a way around it

Re: issues with searching through dictionaries for certain values

2008-02-01 Thread Sion Arrowsmith
Connolly <[EMAIL PROTECTED]> wrote: >Right basically I've got to the end of my main section of my program an I've >got it comparing the same dictionary to ensure that the values are the same >(sounds stupid I know), yet what my line of code I am using to do this is >failing to do is to check eve

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Paul McGuire
On Jan 31, 10:43 am, [EMAIL PROTECTED] wrote: > Hi, > > I got some help with this from here, and there's been a little bit of > discussion around GA's recently, so thought I'd post up my likey slow and > clunky version of a GA that in essence just 'evolves' a solution to 'make a > sum that evaluate

MyHDL project !!!!!

2008-02-01 Thread Blubaugh, David A.
Dan, I would be honored to start a project such as that in mind. How do we begin ?? David Blubaugh -Original Message- From: chewie54 [mailto:[EMAIL PROTECTED] Sent: Thursday, January 31, 2008 9:34 PM To: python-list@python.org Subject: Re: Will Python on day replaceMATLAB

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Paul McGuire
On Feb 1, 9:11 am, [EMAIL PROTECTED] wrote: > > > 0. Tack this bit onto the end of quickga.py, and you wont have to > > write a separate routine to import quickga and invoke evolve(): > > >     if __name__ == "__main__": > >         evolve() > > I hear you, but something I dont tend to do as I use

Re: issues with searching through dictionaries for certain values

2008-02-01 Thread Steve Holden
Connolly wrote: > Hey, > > Right basically I've got to the end of my main section of my program an I've > got it comparing the same dictionary to ensure that the values are the same > (sounds stupid I know), yet what my line of code I am using to do this is > failing to do is to check every sin

Re: issues with searching through dictionaries for certain values

2008-02-01 Thread Zentrader
On Feb 1, 6:27 am, "Connolly" <[EMAIL PROTECTED]> wrote: > Hey, > > Right basically I've got to the end of my main section of my program an I've > got it comparing the same dictionary to ensure that the values are the same > (sounds stupid I know), yet what my line of code I am using to do this is

Re: how to include text data in source code?

2008-02-01 Thread Paddy
On Feb 1, 2:28 pm, "Sun" <[EMAIL PROTECTED]> wrote: > as the subject, I 'd like to know how to include a piece of text as input in > the source code so that I do not need to read in data from files. I remember > there is some thing like this in Perl, have no idea if python has the same > thing? > >

Re: how to include text data in source code?

2008-02-01 Thread Matimus
On Feb 1, 9:28 am, "Sun" <[EMAIL PROTECTED]> wrote: > as the subject, I 'd like to know how to include a piece of text as input in > the source code so that I do not need to read in data from files. I remember > there is some thing like this in Perl, have no idea if python has the same > thing? > >

  1   2   >