Removing an attribute from html with Regex

2010-12-29 Thread Selvam
Hi all, I have some HTML string which I would like to feed to BeautifulSoup. But, One malformed attribute breaks BeautifulSoup. My String I would like it to replace all the occurances of that attribute with an empty string. I am unable to figure out the exact regex, which can do this job.

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread Steven D'Aprano
On Wed, 29 Dec 2010 15:58:53 -0800, rantingrick wrote: > Tkinter: The good, the bad, and the ugly! > - > An expose by rantingrick Your ideas are intriguing to me and I wish to subscribe to your newsletter. > The answer is simple. We need a 100% Python

Re: Building sys.path at run-time?

2010-12-29 Thread Roy Smith
In article <87k4irhpoa@benfinney.id.au>, Ben Finney wrote: > Roy Smith writes: > > > I've got a problem that I'm sure many people have solved many times. > > > > Our project has a bunch of python scripts > > A very common problem. The solution is to switch to Perl. > > (Merry solstice si

Re: Building sys.path at run-time?

2010-12-29 Thread Ben Finney
Roy Smith writes: > I've got a problem that I'm sure many people have solved many times. > > Our project has a bunch of python scripts A very common problem. The solution is to switch to Perl. (Merry solstice silliness, everyone :-) -- \ “An idea isn't responsible for the people who be

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread Hank Fay
1) pyjamas has a desktop version. 2) I don't consider JSONRpc to be a deal-breaker, and since that's what pyjamas uses naturally, and since it's incredibly easy to use the Python middleware of your choice for the JSONRpc server, running in different browsers is unlikely to be an issue. 3) I do

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread Stef Mientki
On 30-12-2010 02:03, rantingrick wrote: > On Dec 29, 6:41 pm, Gerry Reno wrote: >> wxPython looks good but I don't see anyone developing support for things >> like smartphones. > No wx is not the answer to our problems Just partial ;-) Why not write a (Pythonic) wrapper and choose what will be un

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread Octavian Rasnita
From: "Katie T" > What's your opinion of the other gui toolkits with Python bindings > like PyQt and PyGtk? > > Katie > -- They are not accessible at all for screen readers, so the programs that still use them won't be accessible to all potential users. Octavian -- http://mail.python.org/

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread Octavian Rasnita
From: "rantingrick" > Back in the early days of Python --when this simplistic beauty of > programming bliss we enjoy today was just a tiny glimmer of hope in a > archaic world plagued by dark forest of braces and jagged caverns of > cryptic syntaxes-- our beloved dictator (Mr. Van Rossum) had the

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread rantingrick
On Dec 29, 6:41 pm, Gerry Reno wrote: > wxPython looks good but I don't see anyone developing support for things > like smartphones. No wx is not the answer to our problems > Also, what do you think about frameworks such as pyjamas?  It lets you > write in python and compiles everything down to

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread Almar Klein
On 30 December 2010 00:58, rantingrick wrote: > > Tkinter: The good, the bad, and the ugly! > - > An expose by rantingrick > > > -- > The Good > -- > Back in the early days of Python --when this simplistic beauty of

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread Gerry Reno
wxPython looks good but I don't see anyone developing support for things like smartphones. Also, what do you think about frameworks such as pyjamas? It lets you write in python and compiles everything down to Javascript so it can be used across the Web as well as on the desktop. -- http://ma

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread Alexander Kapps
On 30.12.2010 00:58, rantingrick preached: Tkinter: The good, the bad, and the ugly! - An expose by rantingrick You are seriously starting to sound like Xah Lee. our beloved dictator (Mr. Van Rossum) had the foresight to include a simplistic GUI tool

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread rantingrick
On Dec 29, 6:07 pm, Katie T wrote: > On Wed, Dec 29, 2010 at 11:58 PM, rantingrick wrote: > > What's your opinion of the other gui toolkits with Python bindings > like PyQt and PyGtk? Hello KateT, Well i like wxPython as it is quite well rounded but we all know it has some shortcomings too and

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread Katie T
On Wed, Dec 29, 2010 at 11:58 PM, rantingrick wrote: > > Then and only then will Python be truly what GvR intended. I want > everyone here to consider what i am proposing and offer some opinions > because it is time for change. What's your opinion of the other gui toolkits with Python bindings li

Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread rantingrick
Tkinter: The good, the bad, and the ugly! - An expose by rantingrick -- The Good -- Back in the early days of Python --when this simplistic beauty of programming bliss we enjoy today was just a tiny glimmer of hope

gSOAP and Python/ctypes

2010-12-29 Thread A famous IT technical writer
For the moment onlly studied under Linux Fedora 13, here is a gSOAP + Python/ctypes + ctypesgen introduction available at http://vouters.dyndns.org/tima/Linux-gSOAP-C-Python-ctypes-Why_and_when_using_gSOAP-a_quick_introduction.html Hoping this will help some of you. -- http://mail.python.org/mailm

Interrput a thread

2010-12-29 Thread gervaz
Hi all, I need to stop a threaded (using CTR+C or kill) application if it runs too much or if I decide to resume the work later. I come up with the following test implementation but I wanted some suggestion from you on how I can implement what I need in a better or more pythonic way. Here the code:

Re: Does Python 3.1 accept \r\n in compile()?

2010-12-29 Thread Terry Reedy
On 12/29/2010 4:06 PM, jmfauth wrote: On 29 Dez., 21:14, Terry Reedy wrote: On 12/29/2010 2:31 PM, Terry Reedy wrote: "Changed in version 3.2: Allowed use of Windows and Mac newlines. Also input in 'exec' mode does not have to end in a newline anymore. Added the optimize parameter." Retest

Re: Does Python 3.1 accept \r\n in compile()?

2010-12-29 Thread jmfauth
On 29 Dez., 21:14, Terry Reedy wrote: > On 12/29/2010 2:31 PM, Terry Reedy wrote: > > > "Changed in version 3.2: Allowed use of Windows and Mac newlines. Also > > input in 'exec' mode does not have to end in a newline anymore. Added > > the optimize parameter." > > Retest shows that above is corre

Re: Does Python 3.1 accept \r\n in compile()?

2010-12-29 Thread Terry Reedy
On 12/29/2010 2:31 PM, Terry Reedy wrote: "Changed in version 3.2: Allowed use of Windows and Mac newlines. Also input in 'exec' mode does not have to end in a newline anymore. Added the optimize parameter." Retest shows that above is correct. >>> compile("print(999)\r\n", "blah", "exec") at

Re: Does Python 3.1 accept \r\n in compile()?

2010-12-29 Thread Terry Reedy
On 12/29/2010 11:07 AM, jmfauth wrote: I wrote miscellaneous interactive interpreters and I fall on this. In Python 2.7 (understand Python> 2.6), a source code can be compiled with "native" '\r\n' as eol. I am a bit surprised, but I presume this is one on many back-compatibility holdovers st

PyUSB 1.0.0 alpha 1 release

2010-12-29 Thread wander.lairson
Dear all, PyUSB 1.0.0 alpha 1 is out. Since alpha 0, this version : - Standard control requests through usb.control module. - String descriptors through usb.util module. - Complete PyUSB 0.4 API emulation. - Working libusb 1.0 support under Windows. For details check the ReleaseNotes.txt and Cha

Python 3 and SNMP Traps

2010-12-29 Thread Joe Hughes
All: I'm using Python 3.1.3 and need to incorporate sending SNMP traps from my script. I've researched and I found pysnmp and net-snmp with python bindings. The first appears to be only for Python 2.x. The second I'm not certain about. Has anyone experience with this and able to giv

Re: Trying to parse a HUGE(1gb) xml file

2010-12-29 Thread wingoo
maybe you can try http://vtd-xml.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Does Python 3.1 accept \r\n in compile()?

2010-12-29 Thread jmfauth
I wrote miscellaneous interactive interpreters and I fall on this. In Python 2.7 (understand Python > 2.6), a source code can be compiled with "native" '\r\n' as eol. In Python 3.1, it does not seem to be the case. (Python 3.2.a/b not checked). Bug, regression, deliberate choice? >>> sys.vers

Tiny4py, a little python wrapper to make shorten urls and QRCodes

2010-12-29 Thread Andrea Stagi
Hi, I would announce you my new python wrapper to make shorten urls and QRCodes, using main used services: goo.gl, bit.ly and tinyurl. Please, visit http://code.google.com/p/tiny4py/ Bests -- http://mail.python.org/mailman/listinfo/python-list

ANN: MyNewspaper v3.0

2010-12-29 Thread Iñigo Serna
Hi there, I'm really pleased to announce a new release of MyNewspaper, a web-based personal RSS aggregator and feeds reader. Although no public releases in last years, I've been improving MyNewspaper continually for my personal use, but I think it's the time to publish it again. Some technical p

Re: Making urllib2's POST 302 handle same as Perl LWP's behaviour

2010-12-29 Thread Octavian Rasnita
I have tried: In httpd.conf: Redirect /one/ http://localhost/two/ Redirect /two/ http://localhost/three/ redirect /three/ http://www.google.com/ Then I made a POST request with LWP::UserAgent to /one: use LWP::UserAgent; print LWP::UserAgent->new->post('http://localhost/one/')->as_string; And

Re: Making urllib2's POST 302 handle same as Perl LWP's behaviour

2010-12-29 Thread Karra
On Dec 29, 3:57 pm, Karra wrote: > Can someone point me to how I can get the default LWP:UserAgent > behaviour of handling this scenario using urllib2? Out of frustration, I decided to give 'mechanize' a try. It came as an awesome surprise that mechanize implements the exact api of urllib2 - mea

Re: O'Reilly Python Certification

2010-12-29 Thread Stephen Bunn
At Tue, 28 Dec 2010 20:07:29 + (UTC), J. Altman wrote: > > I have a general question. > > Does it seem odd that a certificate in Python, an Open Source > language; taught at O'Reilly, which offers an Open Source Programming > Certificate and is something like waist-deep in Open Source > publi

Re: O'Reilly Python Certification

2010-12-29 Thread Stephen Bunn
At Tue, 28 Dec 2010 20:07:29 + (UTC), J. Altman wrote: > > I have a general question. > > Does it seem odd that a certificate in Python, an Open Source > language; taught at O'Reilly, which offers an Open Source Programming > Certificate and is something like waist-deep in Open Source > publi

Re: O'Reilly Python Certification

2010-12-29 Thread Stephen Bunn
At Tue, 28 Dec 2010 20:07:29 + (UTC), J. Altman wrote: > > I have a general question. > > Does it seem odd that a certificate in Python, an Open Source > language; taught at O'Reilly, which offers an Open Source Programming > Certificate and is something like waist-deep in Open Source > publi

Re: Interning own classes like strings for speed and size?

2010-12-29 Thread Hrvoje Niksic
Christian Heimes writes: > You are right as long as you don't try to rebind the variable. And then only if you assign through an instance, which doesn't make sense for a class-level cache. Assignment like Example2._cache = {} would work. -- http://mail.python.org/mailman/listinfo/python-list

Re: etl tool!!!!!

2010-12-29 Thread meitham
BOn Dec 28, 1:14 pm, Stefan Sonnenberg-Carstens wrote: > Am 28.12.2010 13:57, schrieb krishna kumar:> Is there any efficient etl tool > developed in python? > > Yes, Python. I use SQLAlchemy for both sources and targets, just because I hate to type sql queries :-) I am convincing clients to ditch

Making urllib2's POST 302 handle same as Perl LWP's behaviour

2010-12-29 Thread Karra
I am doing a POST to a webserver and get a 302 Found response (redirect). urllib2's default behaviour is to do a GET on the new url from the Location: URI in the 302 response. This is different from what I have found with LWP::UserAgent- >request() in perl. After much searching I understand there

Re: round in 2.6 and 2.7

2010-12-29 Thread Mark Dickinson
On Dec 28, 9:47 pm, "Martin v. Loewis" wrote: > >> "Float-to-string and string-to-float conversions are correctly rounded. > >> The round() function is also now correctly rounded." > > >> Not sure that this is correct English; I think it means that the > >> round() function is now correct. > > > W

A wrap for a multi-tabbed terminal. Some questions

2010-12-29 Thread Steve
http://pastie.org/763792/wrap This in IMHO, a really useful piece of code, to wrap and run terminal commands, on a gtk+vte python based gui. I would to make some improvements, in order to wrap some terminal applications. How can SET_FOCUS (at start) to the first vte frame? (Avoiding to click on

Re: Noob question on 2 vs 3 Python releases

2010-12-29 Thread Anssi Saari
Franck Ditter writes: > Pardon my noobness (?) but why is there a 2.x and 3.x development > teams working concurrently in Python ? Well, Python 2.7 is the last major 2.x release, only bugfixes are done for it, like the 2.7.1 release. Actual developement is in the 3.x branch now. > Which one sh

Re: NameError: global name 'btn_Matlab' is not defined ?

2010-12-29 Thread Stef Mientki
On 28-12-2010 15:15, Steven D'Aprano wrote: > On Tue, 28 Dec 2010 14:34:19 +0100, Stef Mientki wrote: > >> hello, >> >> Never seen this before and I've no explanation whatsoever (Python 2.6) >> >> I've some dynamic generated code, >> one of objects generated is a wx.Button, called 'btn_Matlab'. > H