Re: Striving for PEP-8 compliance

2010-04-10 Thread Lawrence D'Oliveiro
In message <18988a53-e88f-4abf- a83a-314b16653...@x12g2000yqx.googlegroups.com>, Patrick Maupin wrote: > I want nothing to do with any programmer who would mis-indent their > code. But what happens when you’re trying to reconcile two different indentation conventions? In Python, there can be pro

Re: Striving for PEP-8 compliance

2010-04-10 Thread Lawrence D'Oliveiro
In message , Grant Edwards wrote: > On 2010-04-10, Lawrence D'Oliveiro > wrote: > >> In message , Grant Edwards wrote: >> >>> Anybody who invents another brace-delimited language should be beaten. >>> You always end up with a big problem trying to make sure the braces >>> are consistent with the

Re: How to read file during module import?

2010-04-10 Thread Dave Angel
Jeremy wrote: I have a module that, when loaded, reads and parses a supporting file. The supporting file contains all the data for the module and the function that reads/parses the file sets up the data structure for the module. How can I locate the file during the import statement. The suppor

Re: Pythonic list reordering

2010-04-10 Thread Kent Engström
Ben Racine writes: > I have a list... > > ['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat', > 'dir_330_error.dat'] > > I want to sort it based upon the numerical value only. > > Does someone have an elegant solution to this? I use code like the hack below to sort miscellaneous string

"tv channels all over the world" "USA TV CHANNELS" "PAKISTANI TV CHANNELS" "INDIAN TV CHANNELS" "UK TV CHANNELS" "BRAZIL TV CHANNELS" "CANADA TV CHANNELS" "DANW TV" "GEO TV" "SAMA TV" "AAJ TV" ON htt

2010-04-10 Thread Naeem
"tv channels all over the world" "USA TV CHANNELS" "PAKISTANI TV CHANNELS" "INDIAN TV CHANNELS" "UK TV CHANNELS" "BRAZIL TV CHANNELS" "CANADA TV CHANNELS" "DANW TV" "GEO TV" "SAMA TV" "AAJ TV" ON http://all-time-tv.blogspot.com/"GREECE TV CHANNELS" "BELGIUM TV CHANNELS" "SWEDEN TV CHANNELS"

Re: Performance of list vs. set equality operations

2010-04-10 Thread Stefan Behnel
Steven D'Aprano, 08.04.2010 03:41: On Wed, 07 Apr 2010 10:55:10 -0700, Raymond Hettinger wrote: [Gustavo Nare] In other words: The more different elements two collections have, the faster it is to compare them as sets. And as a consequence, the more equivalent elements two collections have, th

Re: Striving for PEP-8 compliance

2010-04-10 Thread Ben Finney
I'm interested that you are holding what appear to be contradictory arguments, and don't seem to apply each one to the other. Let me take the latest expressions of these and show how they can apply equally in either direction: Lawrence D'Oliveiro writes: > But what happens when you’re trying to

Re: Striving for PEP-8 compliance

2010-04-10 Thread Grant Edwards
On 2010-04-10, Lawrence D'Oliveiro wrote: > In message , Grant Edwards wrote: > >> On 2010-04-10, Lawrence D'Oliveiro >> wrote: >> >>> In message , Grant Edwards wrote: >>> Anybody who invents another brace-delimited language should be beaten. You always end up with a big problem trying

Re: python as pen and paper substitute

2010-04-10 Thread Manuel Graune
Michael Torrie writes: > > Did you look at the link to Owen Taylor's reinteract program? I think > it's closer to what you want than any other thing mentioned here, with > the exception that it's a standalone GTK (graphical) app. Yes, I did. And I think this program is a great lightweight alerna

Re: braceless and semicolonless

2010-04-10 Thread CHEN Guang
Hi Peter, In PythoidC, I handled C header files (and other C files for INCLUDE) with Python regular expression (RE). First, I use the following RE to break C header files or C files into pieces sepRE=_re.compile(r'\; | \{ | \} | // | /\* | \*/ | \r?\n',_re.VERBOSE) Then, I carefully designed a loo

On Class namespaces, calling methods

2010-04-10 Thread vsoler
Still learning python, especially OOP. While testing classes, I sometimes think of them as "ordinary containers" of values and functions (methods). That is, values and functions can be grouped together inside "namespaces" calles classes. class Uno: a=1 def m(): print "mouse" Say

Re: Clearing memory (namespace) before running code

2010-04-10 Thread vsoler
On Mar 21, 5:18 pm, Jon Clements wrote: > On 21 Mar, 15:02, vsoler wrote: > > > Hi, > > > Is there a way to erase/delete/clear memory before a piece of code is > > run? > > > Otherwise, the objects of the previous run are re-usable, and may > > bring confusion to the tester. > > > Thank you > > I

ANN: obfuscate 0.2.2

2010-04-10 Thread Steven D'Aprano
I am pleased to announce the first stable release of obfuscate, version 0.2.2. http://pypi.python.org/pypi/obfuscate/ obfuscate is a pure-Python module providing classical encryption algorithms suitable for obfuscating and unobfuscating text. This is a maintenance release of back-end and API ch

Re: On Class namespaces, calling methods

2010-04-10 Thread Duncan Booth
vsoler wrote: > I get the following error message: > > TypeError: m() takes no arguments (1 given) > > Since I have not created any instances of Uno, there is no self > object, and I do not understand what object is supplied to the > function call. > > Could anybody explain what argument

Re: On Class namespaces, calling methods

2010-04-10 Thread Alex Hall
On 4/10/10, vsoler wrote: > Still learning python, especially OOP. > > While testing classes, I sometimes think of them as "ordinary > containers" of values and functions (methods). That is, values and > functions can be grouped together inside "namespaces" calles classes. > > class Uno: > a=1

Re: Pythonic list reordering

2010-04-10 Thread alex23
On Apr 9, 8:52 am, Ben Racine wrote: > I have a list... > ['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat', > 'dir_330_error.dat'] > I want to sort it based upon the numerical value only. > Does someone have an elegant solution to this? This approach doesn't rely on knowing the format

Re: Pythonic list reordering

2010-04-10 Thread MRAB
alex23 wrote: On Apr 9, 8:52 am, Ben Racine wrote: I have a list... ['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat', 'dir_330_error.dat'] I want to sort it based upon the numerical value only. Does someone have an elegant solution to this? This approach doesn't rely on knowing th

Re: On Class namespaces, calling methods

2010-04-10 Thread vsoler
On Apr 10, 4:46 pm, Duncan Booth wrote: > vsoler wrote: > > I get the following error message: > > >      TypeError: m() takes no arguments (1 given) > > > Since I have not created any instances of Uno, there is no self > > object, and I do not understand what object is supplied to the > > functi

Re: On Class namespaces, calling methods

2010-04-10 Thread vsoler
On Apr 10, 4:46 pm, Duncan Booth wrote: > vsoler wrote: > > I get the following error message: > > >      TypeError: m() takes no arguments (1 given) > > > Since I have not created any instances of Uno, there is no self > > object, and I do not understand what object is supplied to the > > functi

Re: Pythonic list reordering

2010-04-10 Thread alex23
MRAB wrote: > The string module still exists in Python 3.x, but the string functions > which have been superseded by string methods have been removed. Awesome, thanks for the heads up. -- http://mail.python.org/mailman/listinfo/python-list

Re: On Class namespaces, calling methods

2010-04-10 Thread Laszlo Nagy
class Uno: a=1 def m(): print "mouse" Say that I have this "silly" class. While I can then write print Uno.a I cannot write Uno.m() I get the following error message: TypeError: m() takes no arguments (1 given) As a workaround, use this pattern: >>> cl

Re: Python and Regular Expressions

2010-04-10 Thread Neil Cerutti
On 2010-04-08, Richard Lamboj wrote: > If someone knows good links to this thema, or can explain how > parsers should/could work, please post it, or explain it. > > Thanks for the Informations and the Help! I liked Crenshaw's "Let's Build a Compiler!". It's pretty trivial to convert his Pascal to

Re: Striving for PEP-8 compliance

2010-04-10 Thread Patrick Maupin
On Apr 10, 5:10 am, Lawrence D'Oliveiro wrote: > In message <18988a53-e88f-4abf- > > a83a-314b16653...@x12g2000yqx.googlegroups.com>, Patrick Maupin wrote: > > I want nothing to do with any programmer who would mis-indent their > > code. > > But what happens when you’re trying to reconcile two dif

Re: On Class namespaces, calling methods

2010-04-10 Thread vsoler
On Apr 10, 5:28 pm, Laszlo Nagy wrote: > > class Uno: > >     a=1 > >     def m(): > >         print "mouse" > > > Say that I have this "silly" class. > > > While I can then write > > >       print Uno.a > > > I cannot write > >       Uno.m() > > > I get the following error message: > > >      Typ

Re: On Class namespaces, calling methods

2010-04-10 Thread Patrick Maupin
On Apr 10, 9:26 am, vsoler wrote: > class Uno: >     a=1 >     def m(): >         print "mouse" > ... > I cannot write >       Uno.m() By default (at least in Python 2.x), Python will pass any function which is accessed through getattr on class or instance (usually called a "method") an instan

finding objects in a piece of functional code ?

2010-04-10 Thread Stef Mientki
hello, I would like to translate some functional description into some standard class object, so it can be used as a basic building brick into a larger piece of code. Suppose the functional description is: Name = 'Test_Function' Out = 3 * In That's all I would like to write. So it should be tra

Tempering Client Expectations (OT)

2010-04-10 Thread Victor Subervi
Hi; I'm working with my first client where I've developed a custom script. I way underbid the project and I ate that as part of my learning experience. We outlined as precisely as I knew how what functionality was needed. Then he went to input data and lo and behold he needed more functionality. I

Re: Python and Regular Expressions

2010-04-10 Thread Patrick Maupin
On Apr 8, 5:13 am, Nobody wrote: > On Wed, 07 Apr 2010 18:25:36 -0700, Patrick Maupin wrote: > >> Regular expressions != Parsers > > > True, but lots of parsers *use* regular expressions in their > > tokenizers.  In fact, if you have a pure Python parser, you can often > > get huge performance gai

Re: On Class namespaces, calling methods

2010-04-10 Thread Duncan Booth
vsoler wrote: > On Apr 10, 4:46 pm, Duncan Booth wrote: >> vsoler wrote: >> > I get the following error message: >> >> >      TypeError: m() takes no arguments (1 given) >> >> Which version of Python are you using? Python 2.6 gives: >> >> TypeError: unbound method m() must be called with Uno i

Re: Python and Regular Expressions

2010-04-10 Thread Neil Cerutti
On 2010-04-10, Patrick Maupin wrote: > Trust me, I already knew that. But what you just wrote is a > much more useful thing to tell the OP than "Every time someone > tries to parse nested structures using regular expressions, > Jamie Zawinski kills a puppy" which is what I was responding > to. A

"KARACHI UNIVERSITY Centers of BSc (Pass) 1st/2nd year Computer Science Practical Examination 2009" "KARACHI UNIVERSITY DATE SHEET B.COM" "BA / B.SC" "MA / M.SC" "FA / F.SC." "METRIC" "BOARD" ON http

2010-04-10 Thread saima81
"KARACHI UNIVERSITY Centers of BSc (Pass) 1st/2nd year Computer Science Practical Examination 2009" "KARACHI UNIVERSITY DATE SHEET B.COM" "BA / B.SC" "MA / M.SC" "FA / F.SC." "METRIC" "BOARD" ON http://interface-edu-pk.blogspot.com/ "KARACHI UNIVERSITY Centers of BSc (Pass) 1st/2nd ye

Re: Cleanup guarantees?

2010-04-10 Thread Alf P. Steinbach
* Gabriel Genellina: En Fri, 09 Apr 2010 01:13:37 -0300, Alf P. Steinbach escribió: > > import urllib.request # urlopen > import codecs # getreader > import sys # stderr > > def text_stream_from( url, encoding ): > text_reader = codecs.getreader( encoding

file events using fsevents for mac

2010-04-10 Thread gmail
Hi Everyone, I m using python3 for my application and i need to capture file events using fsevents. Is ter anyone knows to access fsevents in python3. thanks for help in advance rgds mathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Regular Expressions

2010-04-10 Thread Patrick Maupin
On Apr 10, 11:35 am, Neil Cerutti wrote: > On 2010-04-10, Patrick Maupin wrote: > > as Pyparsing".  Which is all well and good, except then the OP > > will download pyparsing, take a look, realize that it uses > > regexps under the hood, and possibly be very confused. > > I don't agree with that.

Re: Automatic import ?

2010-04-10 Thread Aahz
In article <4bac361d$0$8840$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: >On Thu, 25 Mar 2010 18:03:58 -0700, C. B. wrote: >> >> from mymodule import AAA >> from mymodule import BBB >> >> a = AAA(BBB())) >> >> But, as there is no case where AAA can be used without BBB, I would like >> to

Re: Classes as namespaces?

2010-04-10 Thread Aahz
In article , kj wrote: > >What's the word on using "classes as namespaces"? E.g. > >class _cfg(object): >spam = 1 >jambon = 3 >huevos = 2 > >breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos) There is one gotcha associated with using classes as namespaces: you have to be careful to

Re: Python and Regular Expressions

2010-04-10 Thread Stefan Behnel
Patrick Maupin, 10.04.2010 19:11: On Apr 10, 11:35 am, Neil Cerutti wrote: On 2010-04-10, Patrick Maupin wrote: as Pyparsing". Which is all well and good, except then the OP will download pyparsing, take a look, realize that it uses regexps under the hood, and possibly be very confused. I

[RELEASED] 2.7 beta 1

2010-04-10 Thread Benjamin Peterson
On behalf of the Python development team, I'm merry to announce the first beta release of Python 2.7. Python 2.7 is scheduled (by Guido and Python-dev) to be the last major version in the 2.x series. Though more major releases have not been absolutely ruled out, it's likely that the 2.7 release w

Re: Tempering Client Expectations (OT)

2010-04-10 Thread Tim Chase
On 04/10/2010 11:10 AM, Victor Subervi wrote: Hi; I'm working with my first client where I've developed a custom script. I way underbid the project and I ate that as part of my learning experience. We outlined as precisely as I knew how what functionality was needed. Then he went to input data an

bps coordinate identification

2010-04-10 Thread Luis Quesada
Dear all, Given a gps coordinate, I would like to find out the country the coordinate belongs to. I wonder whether there is a python library that offers this capability... Thanks in advance for any pointer. Cheers, Luis PS: I am already aware of basemap but it seems we cannot answer this type

Re: The Regex Story

2010-04-10 Thread Dotan Cohen
> Unreasonable phobia to regex is just as much harmful as overuse of it. > Agreed. I did not mean to sound as if I am against the use of regular expressions. -- Dotan Cohen http://bido.com http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: obfuscate 0.2.2

2010-04-10 Thread Paul Rubin
Steven D'Aprano writes: > DISCLAIMER: obfuscate is not cryptographically strong, and should not be > used where high security is required. Certainly no one should never use obfuscate's rot13 function for high security. Use at least double-rot13 instead, or maybe even quadruple rot13 ;-). -- htt

Re: [Python-Dev] [RELEASED] 2.7 beta 1

2010-04-10 Thread average
> On behalf of the Python development team, I'm merry to announce the first beta > release of Python 2.7. > > Python 2.7 is scheduled (by Guido and Python-dev) to be the last major version > in the 2.x series.  Though more major releases have not been absolutely ruled > out, it's likely that the 2.

Re: [Python-Dev] [RELEASED] 2.7 beta 1

2010-04-10 Thread Melton Low
On Sat, Apr 10, 2010 at 4:13 PM, average wrote: > > On behalf of the Python development team, I'm merry to announce the first > beta > > release of Python 2.7. > > > > Python 2.7 is scheduled (by Guido and Python-dev) to be the last major > version > > in the 2.x series. Though more major releas

Re: [Python-Dev] [RELEASED] 2.7 beta 1

2010-04-10 Thread Michael Ströder
average wrote: >> On behalf of the Python development team, I'm merry to announce the first >> beta >> release of Python 2.7. >> >> Python 2.7 is scheduled (by Guido and Python-dev) to be the last major >> version >> in the 2.x series. Though more major releases have not been absolutely ruled >>

Re: [RELEASED] 2.7 beta 1

2010-04-10 Thread Mensanator
On Apr 10, 5:45 pm, Michael Ströder wrote: > average wrote: > >> On behalf of the Python development team, I'm merry to announce the first > >> beta > >> release of Python 2.7. > > >> Python 2.7 is scheduled (by Guido and Python-dev) to be the last major > >> version > >> in the 2.x series.  Tho

Re: [RELEASED] 2.7 beta 1

2010-04-10 Thread Chris Rebert
On Sat, Apr 10, 2010 at 4:47 PM, Mensanator wrote: > On Apr 10, 5:45 pm, Michael Ströder wrote: >> average wrote: >> >> On behalf of the Python development team, I'm merry to announce the first >> >> beta >> >> release of Python 2.7. >> >> >> Python 2.7 is scheduled (by Guido and Python-dev) to

Re: Python and Regular Expressions

2010-04-10 Thread Ethan Furman
Stefan Behnel wrote: Patrick Maupin, 10.04.2010 19:11: On Apr 10, 11:35 am, Neil Cerutti wrote: On 2010-04-10, Patrick Maupin wrote: as Pyparsing". Which is all well and good, except then the OP will download pyparsing, take a look, realize that it uses regexps under the hood, and possib

Re: On Class namespaces, calling methods

2010-04-10 Thread Steven D'Aprano
On Sat, 10 Apr 2010 16:35:29 +, Duncan Booth wrote: > Anyway, the moral is never, ever to use old-style classes in Python 2.x. > You will get weird and unexpected results. That's a bit strong. They're only weird and unexpected if you're not expecting them and don't understand them. Why are

Re: ANN: obfuscate 0.2.2

2010-04-10 Thread Steven D'Aprano
On Sat, 10 Apr 2010 13:34:17 -0700, Paul Rubin wrote: > Steven D'Aprano writes: >> DISCLAIMER: obfuscate is not cryptographically strong, and should not >> be used where high security is required. > > Certainly no one should never use obfuscate's rot13 function for high > security. Use at least

Re: Python and Regular Expressions

2010-04-10 Thread Steven D'Aprano
On Sat, 10 Apr 2010 10:11:07 -0700, Patrick Maupin wrote: > On Apr 10, 11:35 am, Neil Cerutti wrote: >> On 2010-04-10, Patrick Maupin wrote: >> > as Pyparsing".  Which is all well and good, except then the OP will >> > download pyparsing, take a look, realize that it uses regexps under >> > the

Re: Performance of list vs. set equality operations

2010-04-10 Thread Terry Reedy
On 4/10/2010 8:32 AM, Stefan Behnel wrote: Steven D'Aprano, 08.04.2010 03:41: On Wed, 07 Apr 2010 10:55:10 -0700, Raymond Hettinger wrote: If the two collections have unequal sizes, then both ways immediately return unequal. Perhaps I'm misinterpreting what you are saying, but I can't conf

Re: Python and Regular Expressions

2010-04-10 Thread Paul Rubin
Steven D'Aprano writes: > As entertaining as this is, the analogy is rubbish. Skis are far too > simple to use as an analogy for a parser (he says, having never seen skis > up close in his life *wink*). Have you looked at PyParsing's source code? > Regexes are only a small part of the parser, a

Re: ANN: obfuscate 0.2.2

2010-04-10 Thread geremy condra
On Sun, Apr 11, 2010 at 1:17 AM, Steven D'Aprano wrote: > On Sat, 10 Apr 2010 13:34:17 -0700, Paul Rubin wrote: > >> Steven D'Aprano writes: >>> DISCLAIMER: obfuscate is not cryptographically strong, and should not >>> be used where high security is required. >> >> Certainly no one should never u

doctest.testfile fails on text files with Windows line endings

2010-04-10 Thread Steven D'Aprano
After converting a text file containing doctests to use Windows line endings, I'm getting spurious errors: ValueError: line 19 of the docstring for examples.txt has inconsistent leading whitespace: '\r' I don't believe that doctest.testfile is documented as requiring Unix line endings, and th

Re: ANN: obfuscate 0.2.2

2010-04-10 Thread Steven D'Aprano
On Sun, 11 Apr 2010 03:00:50 +, geremy condra wrote: > On Sun, Apr 11, 2010 at 1:17 AM, Steven D'Aprano > wrote: >> On Sat, 10 Apr 2010 13:34:17 -0700, Paul Rubin wrote: >> >>> Steven D'Aprano writes: DISCLAIMER: obfuscate is not cryptographically strong, and should not be used whe

[Possibly OT] Comments on PyPI

2010-04-10 Thread Steven D'Aprano
How do I leave comments on PyPI? There's a checkbox "Allow comments on releases" which I have checked, but no obvious way to actually post a comment. There's a link on the sidebar called "Comments", but it goes to a page about the Catalog SIG. I know there was a push to remove comments from Py

Re: daemon.DaemonContext and logging

2010-04-10 Thread Ben Finney
Sean DiZazzo writes: > I'm finally getting around to trying out the python-daemon module and > have hit a wall. I'm trying to set up logging inside of the "with > daemon.DaemonContext" block. But when I try to use a logger inside > the block it throws an error: Specifically, it's throwing an e

Re: doctest.testfile fails on text files with Windows line endings

2010-04-10 Thread Patrick Maupin
On Apr 10, 10:16 pm, Steven D'Aprano wrote: > After converting a text file containing doctests to use Windows line > endings, I'm getting spurious errors: > > ValueError: line 19 of the docstring for examples.txt has inconsistent > leading whitespace: '\r' > > I don't believe that doctest.testfile

Re: 2.7 beta 1

2010-04-10 Thread Mensanator
On Apr 10, 7:15�pm, Chris Rebert wrote: > On Sat, Apr 10, 2010 at 4:47 PM, Mensanator wrote: > > On Apr 10, 5:45�pm, Michael Str�der wrote: > >> average wrote: > >> >> On behalf of the Python development team, I'm merry to announce the > >> >> first beta > >> >> release of Python 2.7. > > >> >>

SEC proposes the use of Python and XML

2010-04-10 Thread Ted Larson Freeman
This week the SEC proposed new requirements for asset-backed securities that include the use of XML and Python: "The asset-level information would be provided according to proposed standards and in a tagged data format using eXtensible Markup Language (XML). In addition, we are proposing to requir

Re: Python and Regular Expressions

2010-04-10 Thread Paul McGuire
On Apr 10, 8:38 pm, Paul Rubin wrote: > The impression that I have (from a distance) is that Pyparsing is a good > interface abstraction with a kludgy and slow implementation.  That the > implementation uses regexps just goes to show how kludgy it is.  One > hopes that someday there will be a more

Re: ANN: obfuscate 0.2.2

2010-04-10 Thread Aahz
In article , geremy condra wrote: >On Sun, Apr 11, 2010 at 1:17 AM, Steven D'Aprano > wrote: >> On Sat, 10 Apr 2010 13:34:17 -0700, Paul Rubin wrote: >>> Steven D'Aprano writes: DISCLAIMER: obfuscate is not cryptographically strong, and should not be used where high security is re

Re: ANN: obfuscate 0.2.2

2010-04-10 Thread geremy condra
On Sun, Apr 11, 2010 at 3:44 AM, Steven D'Aprano wrote: > On Sun, 11 Apr 2010 03:00:50 +, geremy condra wrote: > >> On Sun, Apr 11, 2010 at 1:17 AM, Steven D'Aprano >> wrote: >>> On Sat, 10 Apr 2010 13:34:17 -0700, Paul Rubin wrote: >>> Steven D'Aprano writes: > DISCLAIMER: obfuscat

Re: ANN: obfuscate 0.2.2

2010-04-10 Thread geremy condra
On Sun, Apr 11, 2010 at 4:37 AM, Aahz wrote: > In article , > geremy condra   wrote: >>On Sun, Apr 11, 2010 at 1:17 AM, Steven D'Aprano >> wrote: >>> On Sat, 10 Apr 2010 13:34:17 -0700, Paul Rubin wrote: Steven D'Aprano writes: > > DISCLAIMER: obfuscate is not cryptographically stron

Re: 2.7 beta 1

2010-04-10 Thread alex23
Mensanator wrote: > 3.x won't be adopted by WINDOWS developers WHO USE IDLE until it's fixed. I think you left your hyperbole level too high so I turned it down for you. I don't know of _anyone_ who uses IDLE to run production code, nor do I follow how one errant IDE shows that Python 3.x as a la

Error Occurs: Replace a character in a String

2010-04-10 Thread Jimbo
Hello, I am getting an error in my python script when I try to change a character in a string. [b]But I dont know why or what to do to fix it?[/b] I have commented in my code where the error occurs [code] def format_file(filename): HTML_file = open(filename,'r') HTML_source = HTML_file

Re: Error Occurs: Replace a character in a String

2010-04-10 Thread Steven D'Aprano
On Sat, 10 Apr 2010 22:01:51 -0700, Jimbo wrote: > Hello, I am getting an error in my python script when I try to change a > character in a string. [b]But I dont know why or what to do to fix > it?[/b] > > I have commented in my code where the error occurs Generally speaking, posting the actual

Re: SEC proposes the use of Python and XML

2010-04-10 Thread Chris Rebert
On Sat, Apr 10, 2010 at 9:13 PM, Ted Larson Freeman wrote: > This week the SEC proposed new requirements for asset-backed > securities that include the use of XML and Python: > > "The asset-level information would be provided according to proposed > standards and in a tagged data format using eXte

Re: Error Occurs: Replace a character in a String

2010-04-10 Thread Patrick Maupin
On Apr 11, 12:01 am, Jimbo wrote: > Hello, I am getting an error in my python script when I try to change > a character in a string. [b]But I dont know why or what to do to fix > it?[/b] > > I have commented in my code where the error occurs > > [code] > def format_file(filename): > >     HTML_fil

Re: SEC proposes the use of Python and XML

2010-04-10 Thread Patrick Maupin
On Apr 10, 11:13 pm, Ted Larson Freeman wrote: > This week the SEC proposed new requirements for asset-backed > securities that include the use of XML and Python: > > "The asset-level information would be provided according to proposed > standards and in a tagged data format using eXtensible Marku

Re: Python and Regular Expressions

2010-04-10 Thread Patrick Maupin
On Apr 10, 1:05 pm, Stefan Behnel wrote: > Running a Python program in CPython eventually boils down to a sequence of > commands being executed by the CPU. That doesn't mean you should write > those commands manually, even if you can. It's perfectly ok to write the > program in Python instead. A