python and web pages

2009-11-18 Thread Daniel Dalton
Hi, Here is my situation: I'm using the command line, as in, I'm not starting gnome or kde (I'm on linux.) I have a string of text attached to a variable,. So I need to use one of the browsers on linux, that run under the command line, eg. lynx, elinks, links, links2 and do the following. 1. Open

Re: ANN: Urwid 0.9.9 - Console UI Library

2009-11-18 Thread Michel Claveau - MVP
Hi! You forget to write "urwid" do not run under Windows. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Urwid 0.9.9 - Console UI Library

2009-11-18 Thread Michel Claveau - MVP
Hi! You forget to write "urwid" do not run under Windows. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Urwid 0.9.9 - Console UI Library

2009-11-18 Thread Michel Claveau - MVP
Hi! You forget to write "urwid" do not run under Windows. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: IOError: [Errno 28] No space left on device

2009-11-18 Thread Terry Reedy
hong zhang wrote: "cont_x --" doesn't work. So the above can't be the actual code. You never want to post the actual code you're running. That would make it too easy for people to help. It is typo. To avoid typos, copy and paste, as has been suggested many times. -- http://mail.python.

Re: is there any FIX message handle modules in Python?

2009-11-18 Thread alex23
On Nov 19, 3:21 pm, "Stephen.Wu" <54wut...@gmail.com> wrote: > FIX message is the "Financial information Exchange" protocol > messages... > any 3rd libs we have? You mean like this one that was the first result when I googled 'python "financial information exchange"'? http://www.quickfixengine.or

is there any FIX message handle modules in Python?

2009-11-18 Thread Stephen.Wu
FIX message is the "Financial information Exchange" protocol messages... any 3rd libs we have? -- http://mail.python.org/mailman/listinfo/python-list

Re: DeprecationWarning on md5

2009-11-18 Thread Zeynel
Thanks. I tried the suppress it but no success. I need to read the documentation more carefully. But since this is not error, I will ignore them for now. On Nov 18, 9:12 pm, Chris Rebert wrote: > On Wed, Nov 18, 2009 at 5:23 PM, Zeynel wrote: > > Hello, > > > I am a newbie both in Scrapy and Py

Re: Beautifulsoup code that is not running

2009-11-18 Thread Zeynel
Yes, it shows as empty string. But I learned about Scrapy and now I am studying the tutorial. I like it better than BeautifulSoup. For beginners it is better, I think. On Nov 18, 11:50 am, Peter Pearson wrote: > On Tue, 17 Nov 2009 14:38:55 -0800 (PST), Zeynel wrote: > > [snip] > > from Bea

mechanize login problem with website

2009-11-18 Thread elca
Hello I'm making auto-login script by use mechanize python. Before I was used mechanize with no problem, but http://www.gmarket.co.kr in this site I couldn't make it . whenever i try to login always login page was returned even with correct gmarket id , pass, i can't login and I saw some suspic

Qt Python radiobutton: activate event

2009-11-18 Thread Threader Slash
Hi Guys, I am trying to get the choice made by the user on Python Qt with radiobutton. QtCore.QObject.connect(self.radioButton1, QtCore.SIGNAL("toggled()"),self.radio_activateInput) QtCore.QObject.connect(self.radioButton2, QtCore.SIGNAL("toggled()"),self.radio_activateInput) and that QtCore.QO

Re: What is the naming convention for accessor of a 'private' variable?

2009-11-18 Thread Chris Rebert
On Wed, Nov 18, 2009 at 7:04 PM, Peng Yu wrote: > On Wed, Nov 18, 2009 at 8:47 PM, Chris Rebert wrote: >> On Wed, Nov 18, 2009 at 6:27 PM, Peng Yu wrote: >>> http://www.python.org/dev/peps/pep-0008/ >>> >>> The above webpage states the following naming convention. Such a >>> variable can be an i

Re: convert a string to a regex?

2009-11-18 Thread Peng Yu
On Wed, Nov 18, 2009 at 9:12 PM, Tim Chase wrote: >> There are many special characters listed on >> http://docs.python.org/library/re.html >> >> I'm wondering if there is a convenient function that can readily >> convert a string with the special characters to its corresponding >> regex. For examp

Re: convert a string to a regex?

2009-11-18 Thread Tim Chase
There are many special characters listed on http://docs.python.org/library/re.html I'm wondering if there is a convenient function that can readily convert a string with the special characters to its corresponding regex. For example, "some.thing" => "some\.thing" Did you try bothering to *read

Re: convert a string to a regex?

2009-11-18 Thread Chris Rebert
On Wed, Nov 18, 2009 at 6:51 PM, Peng Yu wrote: > There are many special characters listed on > http://docs.python.org/library/re.html > > I'm wondering if there is a convenient function that can readily > convert a string with the special characters to its corresponding > regex. For example, > >

Re: What is the naming convention for accessor of a 'private' variable?

2009-11-18 Thread Ben Finney
Peng Yu writes: > The above webpage states the following naming convention. Such a > variable can be an internal variable in a class. I'm wondering what is > the naming convention for the method that access such variable. A property http://docs.python.org/library/functions.html#property> named w

Re: What is the naming convention for accessor of a 'private' variable?

2009-11-18 Thread Peng Yu
On Wed, Nov 18, 2009 at 8:47 PM, Chris Rebert wrote: > On Wed, Nov 18, 2009 at 6:27 PM, Peng Yu wrote: >> http://www.python.org/dev/peps/pep-0008/ >> >> The above webpage states the following naming convention. Such a >> variable can be an internal variable in a class. I'm wondering what is >> th

Re: Invitation to connect on LinkedIn

2009-11-18 Thread Chris Rebert
On Wed, Nov 18, 2009 at 6:16 PM, Jim Qiu wrote: > > LinkedIn > > Jim Qiu requested to add you as a connection on LinkedIn: > > Jaime, > > I'd like to add you to my professional network on LinkedIn. > > - Jim > > > Accept View invitation from Jim Qiu > > > WHY MIGHT CONNECTING WITH JIM QIU BE A GOO

Re: What is the naming convention for accessor of a 'private' variable?

2009-11-18 Thread Peng Yu
On Wed, Nov 18, 2009 at 8:50 PM, Benjamin Kaplan wrote: > On Wed, Nov 18, 2009 at 9:27 PM, Peng Yu wrote: >> http://www.python.org/dev/peps/pep-0008/ >> >> The above webpage states the following naming convention. Such a >> variable can be an internal variable in a class. I'm wondering what is >>

Re: non-copy slices

2009-11-18 Thread Rami Chowdhury
On Wednesday 18 November 2009 17:47:09 tbour...@doc.ic.ac.uk wrote: > Hi, > > sth == something :) sorry for the abbreviation. I'm talking about the > shallow copy, still it's a copy. I'm not sure you're understanding the point others have been making. A list item is merely another reference to

convert a string to a regex?

2009-11-18 Thread Peng Yu
There are many special characters listed on http://docs.python.org/library/re.html I'm wondering if there is a convenient function that can readily convert a string with the special characters to its corresponding regex. For example, "some.thing" => "some\.thing" -- http://mail.python.org/mailma

Re: What is the naming convention for accessor of a 'private' variable?

2009-11-18 Thread Benjamin Kaplan
On Wed, Nov 18, 2009 at 9:27 PM, Peng Yu wrote: > http://www.python.org/dev/peps/pep-0008/ > > The above webpage states the following naming convention. Such a > variable can be an internal variable in a class. I'm wondering what is > the naming convention for the method that access such variable.

Invitation to connect on LinkedIn

2009-11-18 Thread Jim Qiu
LinkedIn Jim Qiu requested to add you as a connection on LinkedIn: -- Jaime, I'd like to add you to my professional network on LinkedIn. - Jim Accept invitation from Jim Qiu http://www.linkedin.com/e/I2LlXdLlWUhFABKmxVOlgGLlWUhFAfhMPPF/blk/I

Re: What is the naming convention for accessor of a 'private' variable?

2009-11-18 Thread Chris Rebert
On Wed, Nov 18, 2009 at 6:27 PM, Peng Yu wrote: > http://www.python.org/dev/peps/pep-0008/ > > The above webpage states the following naming convention. Such a > variable can be an internal variable in a class. I'm wondering what is > the naming convention for the method that access such variable.

Re: non-copy slices

2009-11-18 Thread Daniel Stutzbach
On Wed, Nov 18, 2009 at 2:22 PM, Themis Bourdenas < t.bourdena...@imperial.ac.uk> wrote: > It's nothing in the library that completely imitates the slice without the > copies, right? You might be interested in my blist extension type (link below). Syntactically, using a blist is just like using

Re: combinatorics via __future__ generators

2009-11-18 Thread Chris Rebert
On Wed, Nov 18, 2009 at 4:58 PM, Phlip wrote: > Python: > > I have a quaint combinatorics problem. Before I solve it, or find a > solution among "generators", I thought y'all might like to show off > any solutions. > > Given an array like this... > >  [0, 4, 3] > > Produce an array like this: > >

hex

2009-11-18 Thread hong zhang
List, I want to input hex number instead of int number. in type="int" in following, parser.add_option("-F", "--forcemcs", dest="force_mcs", type="int", default=0, help="index of 11n mcs table. Default: 0.") How can I do it? Thanks. --henry -- http://mail.python.org/mailman/listinfo/p

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Steve Howell
On Nov 18, 5:42 pm, Steven D'Aprano wrote: > On Wed, 18 Nov 2009 17:14:27 -0800, Steve Howell wrote: > > In my rewritten code, here is the smell: > > >     dispatches = { > >             'dict': _dict, > >             'list': _list, > >             'attr': _attr, > >             'key': _key, > >  

What is the naming convention for accessor of a 'private' variable?

2009-11-18 Thread Peng Yu
http://www.python.org/dev/peps/pep-0008/ The above webpage states the following naming convention. Such a variable can be an internal variable in a class. I'm wondering what is the naming convention for the method that access such variable. - _single_leading_underscore: weak "internal use" in

Re: DeprecationWarning on md5

2009-11-18 Thread Chris Rebert
On Wed, Nov 18, 2009 at 5:23 PM, Zeynel wrote: > Hello, > > I am a newbie both in Scrapy and Python. When I create a project with > Scrapy I get these errors: > > C:\Python26\lib\site-packages\twisted\python\filepath.py:12: > DeprecationWarning: the sha module is deprecated; use the hashlib > modu

Re: New syntax for blocks

2009-11-18 Thread r
On Nov 18, 5:27 pm, Steven D'Aprano wrote: > On Wed, 18 Nov 2009 18:28:11 +1300, greg wrote: > > r wrote: > >> I think the syntax was chosen because the alternatives are even worse > >> AND since assignment is SO common in programming, would you *really* > >> rather type two chars instead of one?

Re: non-copy slices

2009-11-18 Thread tbourden
Hi, sth == something :) sorry for the abbreviation. I'm talking about the shallow copy, still it's a copy. Unnecessary in my case and the worst part in my scenario is the creation (allocation) and deletion of a very large number of lists of moderate size (a few hundred objects) generated due to sl

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Steven D'Aprano
On Wed, 18 Nov 2009 17:14:27 -0800, Steve Howell wrote: > In my rewritten code, here is the smell: > > dispatches = { > 'dict': _dict, > 'list': _list, > 'attr': _attr, > 'key': _key, > 'as': _as, > 'call': _call, >

Re: Arcane question regarding white space, editors, and code collapsing

2009-11-18 Thread Ben Finney
Steven D'Aprano writes: > On Thu, 19 Nov 2009 10:56:35 +1100, Ben Finney wrote: > > > It's quite improper (though syntactically null, in Python) to have > > trailing whitespace on lines. That includes blank lines. > > Blank lines are far from improper in Python, they're recommended by > PEP 8. I

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Steve Howell
On Nov 18, 5:13 pm, Steven D'Aprano wrote: > On Wed, 18 Nov 2009 15:58:24 -0800, Steve Howell wrote: > > On Nov 18, 2:22 pm, Steven D'Aprano > > wrote: > >> On Wed, 18 Nov 2009 02:06:49 -0800, Steve Howell wrote: > >> > P.S. The underscores before the method names might look a little > >> > funny

DeprecationWarning on md5

2009-11-18 Thread Zeynel
Hello, I am a newbie both in Scrapy and Python. When I create a project with Scrapy I get these errors: C:\Python26\lib\site-packages\twisted\python\filepath.py:12: DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha C:\Python26\lib\site-packages\twisted\sp

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Steve Howell
On Nov 18, 3:02 pm, Steven D'Aprano wrote: > Lexical duplication is one of the weakest code smells around, because it > is so prone to false negatives. You often can't avoid referring to the > same lexical element multiple times: > > def sinc(x): >     if x != 0: >         return sin(x)/x >     re

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Steven D'Aprano
On Wed, 18 Nov 2009 15:58:24 -0800, Steve Howell wrote: > On Nov 18, 2:22 pm, Steven D'Aprano > wrote: >> On Wed, 18 Nov 2009 02:06:49 -0800, Steve Howell wrote: >> > P.S. The underscores before the method names might look a little >> > funny for inner methods, but it's the nature of the code..._

Re: combinatorics via __future__ generators

2009-11-18 Thread Phlip
On Nov 18, 4:58 pm, Phlip wrote: > Python: > > I have a quaint combinatorics problem. Before I solve it, or find a > solution among "generators", I thought y'all might like to show off > any solutions. > > Given an array like this... > >   [0, 4, 3] > > Produce an array like this: > >   [ >     [0

Re: Arcane question regarding white space, editors, and code collapsing

2009-11-18 Thread Steven D'Aprano
On Thu, 19 Nov 2009 10:56:35 +1100, Ben Finney wrote: > Wells writes: > >> Is it... pythonic, then, to have these lines of tabs/spaces to support >> code collapsing? Is it proper, improper, or irrelevant? > > It's quite improper (though syntactically null, in Python) to have > trailing whitespa

Re: Writing a Carriage Return in Unicode

2009-11-18 Thread MRAB
Doug wrote: Hi! I am trying to write a UTF-8 file of UNICODE strings with a carriage return at the end of each line (code below). filOpen = codecs.open("c:\\temp\\unicode.txt",'w','utf-8') str1 = u'This is a test.' str2 = u'This is the second line.' str3 = u'This is the third line.' strCR = u

combinatorics via __future__ generators

2009-11-18 Thread Phlip
Python: I have a quaint combinatorics problem. Before I solve it, or find a solution among "generators", I thought y'all might like to show off any solutions. Given an array like this... [0, 4, 3] Produce an array like this: [ [0, 0, 0], [0, 1, 0], [0, 2, 0], [0, 3, 0],

Re: DOM related question and problem

2009-11-18 Thread elca
Chris Rebert-6 wrote: > > On Wed, Nov 18, 2009 at 10:04 AM, elca wrote: >> Hello, >> these day im making python script related with DOM. >> >> problem is these day many website structure is very complicate . >> >> what is best method to check DOM structure and path.. >> >> i mean...following i

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Steve Howell
On Nov 18, 3:02 pm, Steven D'Aprano wrote: > > That depends on the code. In particular, it depends on how coupled the > code is. Ideally, you should have loosely coupled code, not highly > coupled. If the code is loosely coupled, then there's no problem with > understanding it in isolation. If the

Writing a Carriage Return in Unicode

2009-11-18 Thread Doug
Hi! I am trying to write a UTF-8 file of UNICODE strings with a carriage return at the end of each line (code below). filOpen = codecs.open("c:\\temp\\unicode.txt",'w','utf-8') str1 = u'This is a test.' str2 = u'This is the second line.' str3 = u'This is the third line.' strCR = u"\u240D" fil

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Steve Howell
On Nov 18, 2:22 pm, Steven D'Aprano wrote: > On Wed, 18 Nov 2009 02:06:49 -0800, Steve Howell wrote: > > P.S. The underscores before the method names might look a little funny > > for inner methods, but it's the nature of the code..._dict and _list > > would lead to confusion with builtins, if not

Re: Arcane question regarding white space, editors, and code collapsing

2009-11-18 Thread Ben Finney
Wells writes: > Is it... pythonic, then, to have these lines of tabs/spaces to support > code collapsing? Is it proper, improper, or irrelevant? It's quite improper (though syntactically null, in Python) to have trailing whitespace on lines. That includes blank lines. One major reason is that t

Arcane question regarding white space, editors, and code collapsing

2009-11-18 Thread Wells
I work in TextMate a lot, which I generally love, but it's code collapsing confounds me. Essentially you have to indent blank lines to the proper level for the current block. Then it will collapse that section as one section. If you have simply a new line, it will see it as a break, and not collaps

Re: New syntax for blocks

2009-11-18 Thread Steven D'Aprano
On Wed, 18 Nov 2009 18:28:11 +1300, greg wrote: > r wrote: >> I think the syntax was chosen because the alternatives are even worse >> AND since assignment is SO common in programming, would you *really* >> rather type two chars instead of one? > > Smalltalk solved the problem by using a left-arr

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Steven D'Aprano
On Wed, 18 Nov 2009 01:53:50 -0800, Steve Howell wrote: > On Nov 18, 1:32 am, Chris Rebert wrote: >> On Wed, Nov 18, 2009 at 1:15 AM, Steve Howell >> wrote: >> > On the topic of "switch" statements and >> > even-more-concise-then-we-have- already if/elif/else/end constructs, >> > I have to say t

Re: Using "setup.py" for an application, not a library module.

2009-11-18 Thread Alan Franzoni
On 11/18/09 9:53 PM, John Nagle wrote: > Most of the documentation for "setup.py" assumes you're packaging a > library module. (Ref: "http://docs.python.org/distutils/setupscript.html";) > How do you properly package an application? What happens > on "setup.py install"? Where does the applica

Re: python gui builders

2009-11-18 Thread Kevin Walzer
On 11/18/09 4:15 PM, Simon Hibbs wrote: On 17 Nov, 23:25, Kevin Walzer wrote: On 11/17/09 4:25 PM, Tim Daneliuk wrote: +1 Tkinter for the simple stuff You can actually use Tkinter to do quite sophisticated GUI's that rival anything found in Qt or wx... Neither Tkinteror Wx have anything t

Re: using struct module on a file

2009-11-18 Thread Simon Forman
On Wed, Nov 18, 2009 at 11:42 AM, Ulrich Eckhardt wrote: > Hia! > > I need to read a file containing packed "binary" data. For that, I find the > struct module pretty convenient. What I always need to do is reading a chunk > of data from the file (either using calcsize() or a struct.Struct instanc

Re: A Good Mailer

2009-11-18 Thread Nick Stinemates
On Wed, Nov 18, 2009 at 03:27:11PM -0400, Victor Subervi wrote: > Hi; > I need a good mailer that will enable me to mail email from web forms. smtplib > Suggestions? silly example.. #!/usr/bin/env python import smtplib session = smtplib.SMTP("localhost") username = "abc" password = "def" sessi

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Steven D'Aprano
On Wed, 18 Nov 2009 02:06:49 -0800, Steve Howell wrote: > P.S. The underscores before the method names might look a little funny > for inner methods, but it's the nature of the code..._dict and _list > would lead to confusion with builtins, if not actual conflict. Then name them something sensib

Re: Using "setup.py" for an application, not a library module.

2009-11-18 Thread Philip Semanchuk
On Nov 18, 2009, at 3:53 PM, John Nagle wrote: Most of the documentation for "setup.py" assumes you're packaging a library module. (Ref: "http://docs.python.org/distutils/setupscript.html ") How do you properly package an application? What happens on "setup.py install"? Where does the ap

Re: python gui builders

2009-11-18 Thread Stef Mientki
Simon Hibbs wrote: On 18 Nov, 07:51, sturlamolden wrote: GPL PyQT is GPL for now, but Qt itself is available under the LGPL as is PySide. Eventualy PySide, which tracks the PyQT API, will supplant it and the issue will be moot. For now it can be a problem, but PyQT developer licenses

Solved: Inserting Unicode text with MySQLdb in Python 2.4-2.5?

2009-11-18 Thread Threader Slash
-- Forwarded message -- From: Keith Hughitt To: python-list@python.org Date: Wed, 18 Nov 2009 06:09:11 -0800 (PST) Subject: Inserting Unicode text with MySQLdb in Python 2.4-2.5? Hi all, I ran into a problem recently when trying to add support for earlier versions of Python (2.4 a

Re: question about tree in python

2009-11-18 Thread Lie Ryan
nospam wrote: How should I write a tree using diconary. I have used a dictonary to make a tree. dictionary tree? root = { 'node_a': { 'node_a_a': 'blah', 'node_a_b': 'foo', 'node_a_c': 'bar', }, 'node_b': { 'node_b_a': 'soo', 'node_b_b': 'fle

Re: WindowsError is not available on linux?

2009-11-18 Thread Dave Angel
Benjamin Kaplan wrote: On Wed, Nov 18, 2009 at 2:53 PM, Aahz wrote: In article , Peng Yu wrote: It's not clear to me whether WindowsError is available on linux or not, after I read the document. Here's what I told a co-worker to do yesterday: if os.name ='nt': DiskError

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Steven D'Aprano
On Wed, 18 Nov 2009 09:33:38 +0200, Dotan Cohen wrote: >> Is there any particular reason why this might be a *bad* language- >> design idea? > > It is about as far from OO as one could get. Whether or not that is > "bad" depends on the use case. That's crazy talk. IF...ENDIF is *syntax*, not a

Re: python gui builders

2009-11-18 Thread David Bolen
Simon Hibbs writes: > I've had this problem for a few years. I've tried PythonCard, > WxWidgets with WxDesigner, BoaConstructor, etc. None of them come > anywhere close to PyQT/QTDesigner. For me, the killer feature missing from of all of the wx-based designers is that they require sizer based d

Re: python gui builders

2009-11-18 Thread Simon Hibbs
On 17 Nov, 23:25, Kevin Walzer wrote: > On 11/17/09 4:25 PM, Tim Daneliuk wrote: > > > +1 Tkinter for the simple stuff > > You can actually use Tkinter to do quite sophisticated GUI's that rival > anything found in Qt or wx... Neither Tkinteror Wx have anything that come close to QGraphicsView, t

Re: non-copy slices

2009-11-18 Thread Ethan Furman
tbour...@doc.ic.ac.uk wrote: Hi, I was looking for a facility similar to slices in python library that would avoid the implicit creation of a new list and copy of elements that is the default behaviour. Instead I'd rather have a lazy iteratable object on the original sequence. Well, in the en

Re: WindowsError is not available on linux?

2009-11-18 Thread Christian Heimes
Dave Angel wrote: > Worse, even if the exception cannot be thrown on a non-Windows > environment, leaving it undefined makes it very awkward to write > portable code. An except clause that can never happen in a particular > environment is pretty innocent. Or somebody can use a base class for

Re: IOError: [Errno 28] No space left on device

2009-11-18 Thread hong zhang
--- On Wed, 11/18/09, Grant Edwards wrote: > From: Grant Edwards > Subject: Re: IOError: [Errno 28] No space left on device > To: python-list@python.org > Date: Wednesday, November 18, 2009, 2:00 PM > On 2009-11-18, Diez B. Roggisch > > wrote: > > hong zhang wrote: > >>> > >>> > but followin

Re: python gui builders

2009-11-18 Thread Simon Hibbs
On 18 Nov, 07:51, sturlamolden wrote: > > GPL PyQT is GPL for now, but Qt itself is available under the LGPL as is PySide. Eventualy PySide, which tracks the PyQT API, will supplant it and the issue will be moot. For now it can be a problem, but PyQT developer licenses are very afordable at only

Re: WindowsError is not available on linux?

2009-11-18 Thread exarkun
On 07:53 pm, a...@pythoncraft.com wrote: In article , Peng Yu wrote: It's not clear to me whether WindowsError is available on linux or not, after I read the document. Here's what I told a co-worker to do yesterday: if os.name == 'nt': DiskError = (OSError, WindowsError) else: DiskEr

Using "setup.py" for an application, not a library module.

2009-11-18 Thread John Nagle
Most of the documentation for "setup.py" assumes you're packaging a library module. (Ref: "http://docs.python.org/distutils/setupscript.html";) How do you properly package an application? What happens on "setup.py install"? Where does the application get installed? Where does the main progr

Re: WindowsError is not available on linux?

2009-11-18 Thread Benjamin Kaplan
On Wed, Nov 18, 2009 at 2:53 PM, Aahz wrote: > In article , > Peng Yu   wrote: >> >>It's not clear to me whether WindowsError is available on linux or >>not, after I read the document. > > Here's what I told a co-worker to do yesterday: > > if os.name == 'nt': >    DiskError = (OSError, WindowsErr

Re: non-copy slices

2009-11-18 Thread Themis Bourdenas
Sth else that I noticed as I started using islice. The name is somewhat misleading. Having the slice part in the name I would expect it to imitate the functionality of normal slices. Random access, sub-slicing etc. However, it is only iteratable. Any particular reasons for that? My guess is that it

Re: Language mavens: Is there a programming with "if then else ENDIF"syntax?

2009-11-18 Thread Dotan Cohen
> The OP explicitly said no block delimiters. Your example uses {..}, and > doesn't have endif. > Just out of habit. I think that PHP, like C, lets you avoid the block deliminators so long as the block all fits on one line. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-18 Thread Simon Forman
On Wed, Nov 18, 2009 at 4:15 AM, Steve Howell wrote: > On the topic of "switch" statements and even-more-concise-then-we-have- > already if/elif/else/end constructs, I have to say that Python does > occasionally force you to write code like the code below.  Maybe > "force" is too strong a word, bu

Re: IOError: [Errno 28] No space left on device

2009-11-18 Thread Grant Edwards
On 2009-11-18, Diez B. Roggisch wrote: > hong zhang wrote: >>> >>> > but following is good. >>> > >>> > cont_tx = 1 >>> > for i in >>> glob.glob('/sys/kernel/debug/ieee80211/phy*/iwlagn/data/continuous_tx'): >>> >with open(i, 'w') as f: >>> >print >>f, >>> cont_tx >>> >>> Well, if that works, th

Re: WindowsError is not available on linux?

2009-11-18 Thread Aahz
In article , Peng Yu wrote: > >It's not clear to me whether WindowsError is available on linux or >not, after I read the document. Here's what I told a co-worker to do yesterday: if os.name == 'nt': DiskError = (OSError, WindowsError) else: DiskError = WindowsError try: disk_opera

A Good Mailer

2009-11-18 Thread Victor Subervi
Hi; I need a good mailer that will enable me to mail email from web forms. Suggestions? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: python gui builders

2009-11-18 Thread Dave Cook
On 2009-11-18, sturlamolden wrote: > GPL If it's an issue for your project, I suggest wxPython. It's cross-platform, fairly complete, and extensible. But the API is clunky compared to Qt. Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: Minimally intrusive XML editing using Python

2009-11-18 Thread Nobody
On Wed, 18 Nov 2009 13:55:52 +0100, Thomas Lotze wrote: > I wonder what Python XML library is best for writing a program that makes > small modifications to an XML file in a minimally intrusive way. By that I > mean that information the program doesn't recognize is kept, as are > comments and whit

Re: Minimally intrusive XML editing using Python

2009-11-18 Thread Dave Angel
Thomas Lotze wrote: Chris Rebert wrote: Have you considered using an XML-specific diff tool such as: I'm afraid I'll have to fall back to using such a thing if I don't find a solution to what I actually want to do. I do realize that XML isn't primarily about its textual representatio

Re: IOError: [Errno 28] No space left on device

2009-11-18 Thread hong zhang
--- On Wed, 11/18/09, Diez B. Roggisch wrote: > From: Diez B. Roggisch > Subject: Re: IOError: [Errno 28] No space left on device > To: python-list@python.org > Date: Wednesday, November 18, 2009, 12:11 PM > hong zhang wrote: > > > > > > > --- On Wed, 11/18/09, Grant Edwards > wrote: > >

Re: IOError: [Errno 28] No space left on device

2009-11-18 Thread hong zhang
--- On Wed, 11/18/09, Grant Edwards wrote: > From: Grant Edwards > Subject: Re: IOError: [Errno 28] No space left on device > To: python-list@python.org > Date: Wednesday, November 18, 2009, 9:22 AM > On 2009-11-18, hong zhang > wrote: > > >> Apparently the harddisk where you stored the file

Re: non-copy slices

2009-11-18 Thread Terry Reedy
tbour...@doc.ic.ac.uk wrote: Hi, I was looking for a facility similar to slices in python library that would avoid the implicit creation of a new list and copy of elements that is the default behaviour. Instead I'd rather have a lazy iteratable object on the original sequence. Well, in the en

Re: getting properly one subprocess output

2009-11-18 Thread Nobody
On Wed, 18 Nov 2009 12:25:14 +0100, Jean-Michel Pichavant wrote: > I'm currently inspecting my Linux process list, trying to parse it in > order to get one particular process (and kill it). > I ran into an annoying issue: > The stdout display is somehow truncated (maybe a terminal length issue,

Re: Calling Python functions from Excel

2009-11-18 Thread Cannonbiker
On 18 lis, 03:09, "Mark Tolonen" wrote: > "Chris Withers" wrote in message > > news:4b02d1e3.6080...@simplistix.co.uk... > > > Mark Tolonen wrote: > > Please I need Calling Python functions from Excel and receive result > back in Excel. Can me somebody advise simplest solution please? I

Re: Command line arguments??

2009-11-18 Thread Nobody
On Tue, 17 Nov 2009 23:57:55 +, Rhodri James wrote: >>> Quote the filenames or escape the spaces: >>> >>> C:\Python26\Python.exe C:\echo.py "C:\New Folder\text.txt" >>> >>> We've been living with this pain ever since windowed GUIs encouraged >>> users >>> to put spaces in their file names (A

Re: Minimally intrusive XML editing using Python

2009-11-18 Thread Anthra Norell
Thomas Lotze wrote: Chris Rebert wrote: Have you considered using an XML-specific diff tool such as: I'm afraid I'll have to fall back to using such a thing if I don't find a solution to what I actually want to do. I do realize that XML isn't primarily about its textual representatio

Re: IOError: [Errno 28] No space left on device

2009-11-18 Thread Diez B. Roggisch
hong zhang wrote: > > > --- On Wed, 11/18/09, Grant Edwards wrote: > >> From: Grant Edwards >> Subject: Re: IOError: [Errno 28] No space left on device >> To: python-list@python.org >> Date: Wednesday, November 18, 2009, 9:22 AM >> On 2009-11-18, hong zhang >> wrote: >> >> >> Apparently the

Re: break LABEL vs. exceptions + PROPOSAL

2009-11-18 Thread Terry Reedy
Chris Rebert wrote: On Wed, Nov 18, 2009 at 4:05 AM, Lo'oris wrote: I've found this email, back from 10 years ago: http://mail.python.org/pipermail/python-list/1999-September/009983.html I guess it went unnoticed, because that proposal looks really intresting. I think it went unnoticed becau

Re: DOM related question and problem

2009-11-18 Thread Chris Rebert
On Wed, Nov 18, 2009 at 10:04 AM, elca wrote: > Hello, > these day im making python script related with DOM. > > problem is these day many website structure is very complicate . > > what is best method to check DOM structure and path.. > > i mean...following is some example. > > what is best metho

Re: ANN: Urwid 0.9.9 - Console UI Library

2009-11-18 Thread Chris Jones
I noticed that when run on a 256-color capable xterm, upon exiting the demo programs the colors in the bash shell are modified - e.g the bash prompt, the output of colored ls commands. For instance, due to my fiddling with dircolors, a file with executable flags on is normally displayed in light

DOM related question and problem

2009-11-18 Thread elca
Hello, these day im making python script related with DOM. problem is these day many website structure is very complicate . what is best method to check DOM structure and path.. i mean...following is some example. what is best method to check can extract such like following info quickly? bef

Re: IOError: [Errno 28] No space left on device

2009-11-18 Thread hong zhang
--- On Wed, 11/18/09, Grant Edwards wrote: > From: Grant Edwards > Subject: Re: IOError: [Errno 28] No space left on device > To: python-list@python.org > Date: Wednesday, November 18, 2009, 9:22 AM > On 2009-11-18, hong zhang > wrote: > > >> Apparently the harddisk where you stored the file

Re: _winreg error on open key (64bit) - proper usage of _winreg.DisableReflectionKey

2009-11-18 Thread Brian Curtin
On Tue, Nov 17, 2009 at 19:59, Mark Hammond wrote: > On 18/11/2009 6:29 AM, Randall Walls wrote: > >> I don't believe so, but it seems like I'm in a catch 22, where I need to >> _winreg.OpenKey the key first before I can pass it to >> _winreg.DisableReflectionKey, but it doesn't exist, so I can't

Re: using struct module on a file

2009-11-18 Thread Jon Clements
On Nov 18, 4:42 pm, Ulrich Eckhardt wrote: > Hia! > > I need to read a file containing packed "binary" data. For that, I find the > struct module pretty convenient. What I always need to do is reading a chunk > of data from the file (either using calcsize() or a struct.Struct instance) > and then

Re: ANN: a mini-language for encapsulating deep-copy operations on Python data structures

2009-11-18 Thread Steve Howell
On Nov 18, 4:34 am, "M.-A. Lemburg" wrote: > Steve Howell wrote: > > [...] > > Here is an example of the DDL (and I hate the terminology "DDL," just > > cannot think of anything better): > > >             { > >                 'show_table_of_contents', > >                 'author' { > >          

Re: Beautifulsoup code that is not running

2009-11-18 Thread Peter Pearson
On Tue, 17 Nov 2009 14:38:55 -0800 (PST), Zeynel wrote: [snip] from BeautifulSoup import BeautifulSoup > soup = BeautifulSoup (file("test.html").read()) title = soup.find('title') titleString = title.string open('extract.text', 'w').write(titleString) > > This runs without

question about tree in python

2009-11-18 Thread nospam
How should I write a tree using diconary. I have used a dictonary to make a tree. tree={best:collections.defaultdict(lambda:default)} in a id3 tree. Is there a way to multple values and when then only return on type of values. I tried this apporach but it did not work. class Tree: def _

using struct module on a file

2009-11-18 Thread Ulrich Eckhardt
Hia! I need to read a file containing packed "binary" data. For that, I find the struct module pretty convenient. What I always need to do is reading a chunk of data from the file (either using calcsize() or a struct.Struct instance) and then parsing it with unpack(). For that, I repeatedly wri

Re: getting properly one subprocess output

2009-11-18 Thread Jon Clements
On Nov 18, 4:14 pm, Jon Clements wrote: > On Nov 18, 11:25 am, Jean-Michel Pichavant > wrote: > > > > > Hi python fellows, > > > I'm currently inspecting my Linux process list, trying to parse it in > > order to get one particular process (and kill it). > > I ran into an annoying issue: > > The s

Re: getting properly one subprocess output

2009-11-18 Thread Jon Clements
On Nov 18, 11:25 am, Jean-Michel Pichavant wrote: > Hi python fellows, > > I'm currently inspecting my Linux process list, trying to parse it in > order to get one particular process (and kill it). > I ran into an annoying issue: > The stdout display is somehow truncated (maybe a terminal length i

  1   2   >