Gregory Ewing wrote:
On 07/05/2010 11:07 AM, Anthra Norell wrote:
I try to use "new.new.classobj (name, baseclass, dict)" and have no
clue
what the "dict" of the current name space is.
Are you sure that's what you really want to know? The
'dict' argument t
Chris Rebert wrote:
On Mon, Jul 5, 2010 at 2:07 AM, Anthra Norell wrote:
I try to use "new.new.classobj (name, baseclass, dict)" and have no clue
Slight tangent:
Note that both the `new` module and old-style classes (which are what
`classobj` produces) are deprecated.
To p
Thomas Jollans wrote:
On 07/05/2010 11:07 AM, Anthra Norell wrote:
I try to use "new.new.classobj (name, baseclass, dict)" and have no clue
what the "dict" of the current name space is. I can name dicts of
imported modules, because their name exists in the current
I try to use "new.new.classobj (name, baseclass, dict)" and have no clue
what the "dict" of the current name space is. I can name dicts of
imported modules, because their name exists in the current name space.
If, for instance, I import a module "service" then that module's name
space would be
Back9 wrote:
Hi,
I have a string like this:
0x340x5A0x9B0xBA
I want to extract 0x from the string but the first one.
How I can use re for this case?
The string size will vary.
TIA
Unless the use of a regular expression is a requirement I'd do it like this:
'0x%s' % s.split ('x', 1)[1].
Anthra Norell wrote:
Sebastian Bassi wrote:
Hi,
Could you post a minimal version of the DB (a DB dump) to test it?
Just remove most information and leave on the ones needed to reproduce
the error. Also remove any personal/confidential information. Then
dump the DB so I can test it here.
Best
Hi all,
Can anyone explain this? Three commands with three different cutoff
dates (12/30, 12/31 and 1/1) produce a formatting inconsistency. Examine
the third field. The first and last run represents it correctly. The
second run strips it. The field happens to be a record ID and getting it
Hi all,
I have spent the better part of this day reading docs and googling
archives to no avail. About this: I understand that I can access
password protected sites with urllib2. However, the protocol seems to
be: I try without password and catch the error coming back. The header
will then
Tobiah wrote:
Now that I use python, this is the amount of time
per day that I spend adding forgotten semicolons while
debugging other languages.
What compels you to write Python code without semicolons?
Frederic
--
http://mail.python.org/mailman/listinfo/python-list
Schif Schaf wrote:
On Feb 7, 8:57 am, Tim Chase wrote:
Steve Holden wrote:
Really? Under what circumstances does a simple one-for-one character
replacement operation fail?
Failure is only defined in the clarified context of what the OP
wants :) Replacement operations only fai
Gabriel,
After reinstalling the whole package things are shaping up. It still
doesn't work but it fails more to the point of your suggestions. I
update the responses to your questions:
Anthra Norell wrote:
Gabriel,
Thanks for your hints. I take them up one by one:
Gabriel Gene
Gabriel,
Thanks for your hints. I take them up one by one:
Gabriel Genellina wrote:
En Fri, 05 Feb 2010 10:23:57 -0300, Anthra Norell
escribió:
I upgraded from 2.4 to 2.5 and am unable to start an 2.5 idle
window. The OS is Windows ME. The download of 2.5 finished with a
warning
Duncan Booth wrote:
Anthra Norell wrote:
Using pythonw.exe will start the program with all error output dumped in
the bit bucket. Running from a command prompt with python.exe will at
least let you see if there are any errors.
python.exe from the command line works all right in
Thank you both (Alf and Duncan) for your comments. I answer Duncan's
questions interleaved:
Duncan Booth wrote:
Anthra Norell wrote:
Hi,
I upgraded from 2.4 to 2.5 and am unable to start an 2.5 idle
window.
This is the command I have been using:
C:\Python24\pythonw.
Hi,
I upgraded from 2.4 to 2.5 and am unable to start an 2.5 idle window.
This is the command I have been using:
C:\Python24\pythonw.exe C:\Python24\Lib\IDLELIB\idle.pyw -n -c
execfile('C:\\Python24\\i')
And this is the command that doesn't start anything:
C:\Python25\pythonw.exe C:\Pyt
Iain King wrote:
On Jan 21, 2:18 pm, Wilbert Berendsen wrote:
Op maandag 18 januari 2010 schreef Adi:
keys = [(len(key), key) for key in mapping.keys()]
keys.sort(reverse=True)
keys = [key for (_, key) in keys]
pattern = "(%s)" % "|".join(keys)
repl = lambda x : mapping[x.grou
superpollo wrote:
hi.
what is the most pythonic way to substitute substrings?
eg: i want to apply:
foo --> bar
baz --> quux
quuux --> foo
so that:
fooxxxbazyyyquuux --> barxxxquuxyyyfoo
bye
Third attempt. Clearly something doesn't work right. My code gets
clipped on the way up. I have
Anthra Norell wrote:
superpollo wrote:
hi.
what is the most pythonic way to substitute substrings?
eg: i want to apply:
foo --> bar
baz --> quux
quuux --> foo
so that:
fooxxxbazyyyquuux --> barxxxquuxyyyfoo
bye
So it goes. The more it matters, the sillier the misatakes
superpollo wrote:
hi.
what is the most pythonic way to substitute substrings?
eg: i want to apply:
foo --> bar
baz --> quux
quuux --> foo
so that:
fooxxxbazyyyquuux --> barxxxquuxyyyfoo
bye
Try the code below the dotted line. It does any number of substitutions
and handles overlaps corre
Robert Kern wrote:
On 2010-01-12 05:59 AM, Anthra Norell wrote:
Robert Kern wrote:
On 2010-01-11 14:09 PM, Anthra Norell wrote:
Robert Kern wrote:
On 2010-01-09 03:52 AM, Anthra Norell wrote:
Upon which another critic
conjured up the horror vision of gigahertzes hacking my pathetic
little
Robert Kern wrote:
On 2010-01-11 14:09 PM, Anthra Norell wrote:
Robert Kern wrote:
On 2010-01-09 03:52 AM, Anthra Norell wrote:
"Don't use a random generator for encryption purposes!" warns the
manual, of which fact I was reminded in no uncertain terms on this
forum
a few y
Robert Kern wrote:
On 2010-01-09 03:52 AM, Anthra Norell wrote:
Daniel Fetchinson wrote:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. I'd like to
> encrypt/convert it into a binary file in such a way th
Daniel Fetchinson wrote:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. I'd like to
> encrypt/convert it into a binary file in such a way that possession of
> a password allows anyone to convert it back into the original tex
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
Gabriel Genellina wrote:
En Thu, 29 Oct 2009 13:18:30 -0300, Anthra Norell
escribió:
Gabriel Genellina wrote:
En Wed, 28 Oct 2009 08:05:22 -0300, Anthra Norell
escribió:
Gabriel Genellina wrote:
En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell
escribió:
I am trying to upload a bunch
Gabriel Genellina wrote:
En Wed, 28 Oct 2009 08:05:22 -0300, Anthra Norell
escribió:
Gabriel Genellina wrote:
En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell
escribió:
I am trying to upload a bunch of web pages to a hosting
service.[...] I wrote a loop that iterates through the file
Gabriel Genellina wrote:
En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell
escribió:
I am trying to upload a bunch of web pages to a hosting service. I
have a connected ftplib.FTP object and can upload files manually from
an IDLE command line using the methods storlines () for html files
Hi,
I made a bunch of web pages and am now trying to upload them to a
hosting service. I have an ftplib.FTP object that connects just fine. It
calls storbinary () and storlines () (as appropriate) inside a loop
iterating through my html and jpg files. Calling either of the stor...
methods fr
Hi,
I am trying to upload a bunch of web pages to a hosting service. I
have a connected ftplib.FTP object and can upload files manually from an
IDLE command line using the methods storlines () for html files and
storbinary () for the pictures. So far no problem. In order to upload
the whole s
Kushal Kumaran wrote:
On Tue, Oct 27, 2009 at 2:04 AM, Anthra Norell wrote:
No, I didn't. There's a number of modules I know by name only and shutils
was one of them. A quick peek confirmed that it is exactly what I am looking
for. Thank you very much for the advice.
Diez B. Roggisch wrote:
Anthra Norell wrote:
I have a Python program that needs to copy files around. I could read
and write which would be inefficient and would time-stamp the copy. The
module "os" has lots of operating system functions, but none that copies
files I could make o
I have a Python program that needs to copy files around. I could read
and write which would be inefficient and would time-stamp the copy. The
module "os" has lots of operating system functions, but none that copies
files I could make out reading the doc twice. The function "os.system
('copy fil
Dylan Palmboom wrote:
Does anyone know what python libraries are available to do the following:
1. I would like to take a photograph of an object with a colour. In this
case, it is a sheet of sponge.
2. Feed this image into a function in a python library and let the function
"automatically sca
Vlastimil Brom wrote:
2009/8/28 hoffik :
Hello,
I'm quite new in Python and I have one question. I have a 2D matrix of
values stored in list (3 columns, many rows). I wonder if I can select one
column without having to go through the list with 'for' command.
...
I guess, it won't be p
MRAB wrote:
ryniek90 wrote:
Hi.
I started learning regexp, and some things goes well, but most of
them still not.
I've got problem with some regexp. Better post code here:
"
>>> import re
>>> mail = '\nn...@mail.com\nname1 [at] mail [dot] com\nname2 [$at$]
mail [$dot$] com\n'
>>> mail
'
alex23 wrote:
Anthra Norell wrote:
def entries (l):
r = re.compile ('([0-9]+) entr(y|ies)')
match = r.search (l)
if match: return match.group (1)
So the question is: does "r" get regex-compiled once at py-compile time
or repeatedly at entries()
Hi all,
I have a regex that has no use outside of a particular function. From
an encapsulation point of view it should be scoped as restrictively as
possible. Defining it inside the function certainly works, but if
re.compile () is run every time the function is called, it isn't such a
good
Dennis Lee Bieber wrote:
On Thu, 18 Jun 2009 13:39:28 +0200, Anthra Norell
declaimed the following in
gmane.comp.python.general:
utility. So, my question is: How do I convert a bunch of
three-dimensional coordinates defining lines into a file format Sketch
Up can read (skp, dwg, dxf, 3ds
norseman wrote:
Anthra Norell wrote:
Andres Acosta wrote:
HI there Anthara have you checked out www.Blender.org, It is open
source and accepts a lot of your formats. for import and export.
Anrdres
Anthra Norell wrote:
Hi,
Anyone working with CAD who knows about numeric data entry? I
have
Andres Acosta wrote:
HI there Anthara have you checked out www.Blender.org, It is open
source and accepts a lot of your formats. for import and export.
Anrdres
Anthra Norell wrote:
Hi,
Anyone working with CAD who knows about numeric data entry? I have
3d coordinates of a construction site
Hi,
Anyone working with CAD who knows about numeric data entry? I have 3d
coordinates of a construction site on a slope (borders, setbacks and
isometric elevation lines). Someone made me aware of Google's Sketch Up.
It looks very attractive for the purpose of architectural planning,
especial
Terry Reedy wrote:
News123 wrote:
Anthra Norell wrote:
I can't run Firefox and Thunderbird without getting these upgrade
ordering windows. I don't touch them, because I have reason to suspect
that they are some (Russian) virus that hijacks my traffic.
Occasionally
one of these w
I can't run Firefox and Thunderbird without getting these upgrade
ordering windows. I don't touch them, because I have reason to suspect
that they are some (Russian) virus that hijacks my traffic. Occasionally
one of these window pops up the very moment I hit a key and next a
confirmation messa
utab wrote:
On May 4, 10:06 pm, Anthra Norell wrote:
utab wrote:
Dear all,
I have to change some lines from a template file, which is rather long
to paste here, but I would like to make some parts of some lines
optional with my command line arguments but I could not see this
utab wrote:
Dear all,
I have to change some lines from a template file, which is rather long
to paste here, but I would like to make some parts of some lines
optional with my command line arguments but I could not see this
directly, I can count the line numbers and decide on this basis to
decide
Reckoner wrote:
hi,
I have the following problem: I have two objects, say, A and B, which
are both legitimate stand-alone objects with lives of their own.
A contains B as a property, so I often do
A.B.foo()
the problem is that some functions inside of B actually need A
(remember I said they w
Bruno Desthuilliers wrote:
Chris Rebert a écrit :
On Wed, Mar 18, 2009 at 6:09 AM, Anthra Norell
wrote:
Would anyone who knows the inner workings volunteer to clarify
whether or
not every additional derivation of a class hierarchy adds an
indirection to
the base class's method call
Would anyone who knows the inner workings volunteer to clarify whether
or not every additional derivation of a class hierarchy adds an
indirection to the base class's method calls and attribute read-writes.
In C++, I suppose, a three-level inheritance would resolve into
something like *(*(*(*(b
cptn.spoon wrote:
I'm trying to create an incredibly simple stock market simulator to be
used in a childrens classroom and I'm wondering whether someone can
point me in the right direction.
I basically want to be able to have a stock struct as follows:
StockName = "Test"
StockPriceList = (12,13
Diez B. Roggisch wrote:
> [EMAIL PROTECTED] schrieb:
>> Hello
>>
>> I am looking for python code that takes as input a list of strings
>> (most similar,
>> but not necessarily, and rather short: say not longer than 50 chars)
>> and that computes and outputs the python regular expression that
>> mat
s = '''
$14.99
,
$27.99
,
$66.99
,
$129.99
,
$254.99
'''
>>> for line in [l.strip () for l in s.splitlines ()]:
if line [0] == '$': print line
$14.99
$27.99
$66.99
$129.99
$254.99
Why parse? Why regular expressions?
Frederic
--
http:
> Hi,
>
> I'm trying to use the Beautiful Soup package to parse through the
> "bookmarks.html" file which Firefox exports all your bookmarks into.
> 've been struggling with the documentation trying to figure out how to
> extract all the urls. Has anybody got a couple of longer examples using
> Bea
t out import se the program works and when
> I use import se everything connected to the library crashes on the
> import line..
>
>
>
>
> Anthra Norell wrote:
> > - Original Message -
> > From: <[EMAIL PROTECTED]>
> > Newsgroups: comp.lang.pytho
- Original Message -
From: <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Monday, September 04, 2006 4:58 AM
Subject: Re: newbe question about removing items from one file to another file
>
> Anthra Norell wrote:
> > Dexter,
> >
> > Here
Dexter,
Whenever I can I post solutions. And when I do, I run them in an IDLE
window and copy my commands plus the output over into
the message. So my posting should be replicable, if you would copy the commands
into your IDLE window one by one and hitting return.
Please do this and c
- Original Message -
From: "Carl Banks" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Saturday, September 02, 2006 6:33 AM
Subject: Re: Using eval with substitutions
> [EMAIL PROTECTED] wrote:
> > >>> a,b=3,4
> > >>> x="a+b"
...
> Careful. Here be dragons.
...
> However,
Abhishek,
I hesitate to propose this idea, because there's got to be a better (more
conventional) way of doing this. Anyway consider
this:
>>> x = "a+b"; y = "x*a; z = "x+y" # Your definitions
>>> import SE
>>> def f (x, y, z):
substitutions = 'z=(%s) | y=(%s) | x=(%s)' % (z,
Nico, perhaps this would be suitable:
>>> s = '''Example text:
This is a test. A test.
/www/mydoc1
And I need to extraxt /www/mydoc1 and /www/mydoc2 from this text.
/foo/bar/doc ...'''
>>> import SE
>>> Thing_Filter = SE.SE (' "~>> key="path">(.|\n)*?~==" | "~<.*?>~= " ')
>>> print Thing_Filte
ou, take them out with an additional
definition when you make your
Instrument_Block_Filter: (13)= or "\r=")
Regards
Frederic
- Original Message -
From: <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Wednesday, August 30, 2006 1:51 AM
Subject: Re: ne
Message -
From: <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Monday, August 28, 2006 10:48 AM
Subject: Re: newbe question about removing items from one file to another file
>
> Anthra Norell wrote:
> > Eric,
> >Having played around with problems of this ki
(3, 6, 34)] # That's what I want
Thank you all
Frederic
- Original Message -
From: "Gerard Flanagan" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Sunday, August 27, 2006 2:59 PM
Subject: Re: unpaking sequences of unknown length
>
> Anth
Eric,
Having played around with problems of this kind for quite some time I find
them challenging even if I don't really have time to
get sidetracked. Your description of the problem makes it all the more
challenging, because its 'expressionist' quality adds the
challenge of guessing what you
Hi,
I keep working around a little problem with unpacking in cases in which I
don't know how many elements I get. Consider this:
def tabulate_lists (*arbitray_number_of_lists):
table = zip (arbitray_number_of_lists)
for record in table:
# etc ...
data from a text file to parse html page
> Anthra Norell wrote:
> > No, I am not running Linux to any extent. But I am very strict about case.
> > There is not a single instance of "se.py" or "sel.py"
> > anywhere on my system. You' ll have to f
No, I am not running Linux to any extent. But I am very strict about case.
There is not a single instance of "se.py" or "sel.py"
anywhere on my system. You' ll have to find out where lower case sneaks in on
yours. The zip file preserves case and in the zip file
the names are upper case. I am baff
is that before the statement row[0] =
> re.sub(r'<.*?>', '', row[0]), I have row[0]=re.sub(r'[^
> 0-9A-Za-z\"\'\.\,[EMAIL PROTECTED](\)\*\&\%\%\\\/\:\;\?\`\~\<\>]', '', row[0])
> statement. Hence, the line separators are
Dylan,
It seems there is an
installation routine that doesn't work. I just has a similar complaint. Fact is,
I am not familiar with the routine. It sounds like it automates
complicated downloads. This is as simple a download as can be. So just forget
about install. Download the zip f
---
>
> [EMAIL PROTECTED]:~/Desktop/SE-2.2$ sudo python SETUP.PY install
> running install
> running build
> running build_py
> file SEL.py (for module SEL) not found
> file SE.py (for module SE) not found
> file SEL.p
Roman,
Your re works for me. I suspect you have tags spanning lines, a thing you get
more often than not. If so, processing linewise
doesn't work. You need to catch the tags like this:
>>> text = re.sub ('<(.|\n)*?>', '', text)
If your text is reasonably small I would recommend this solution. E
You may also want to look at this stream editor:
http://cheeseshop.python.org/pypi/SE/2.2%20beta
It allows multiple replacements in a definition format of utmost simplicity:
>>> your_example = '''
"Python has been an important part of Google since the
beginning, and remains so as the system grow
DH,
Could you be more specific describing what you have and what you want?
You are addressing people, many of whom are good at
stripping useless junk once you tell them what 'useless junk' is.
Also it helps to post some of you data that you need to process and a
sample of the same dat
Steve,
I thought Fredrik Lundh's proposal was perfect. Are you now saying it
doesn't solve your problem because your description of the
problem was incomplete? If so, could you post a worst case piece of htm, one
that contains all possible complications, or a
collection of different cases all
Hitesh, You might want to try this:
>>> tricky_path_name = '\\serverName\\C:\\exe files\\example.exe -u ABC -g DEF'
>>> import SE
>>> Editor = SE.SE ('C:=C$: "exe -=exe"')
>>> edited_path_name = Editor (tricky_path_name)
>>> print edited_path_name# See what it did
\serverName\C$:\exe fil
This might well take the trouble out ot the OP's replace:
http://cheeseshop.python.org/pypi/SE/2.2%20beta
Regards
Frederic
--
And here is how it works:
>>> text = '''defgefabcdefy
effwerbyuuuterrfr'''
>>> im
No one could do it any better. Good for you! - Frederic
- Original Message -
From: "John Salerno" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Friday, August 11, 2006 4:08 PM
Subject: Re: using python to edit a word file?
> Anthra Norell wrote:
> &
John,
I have a notion about translating stuff in a mess and could help you with
the translation. But it may be that the conversion
from DOC to formatted test is a bigger problem. Loading the files into Word and
saving them in a different format may not be a
practical option if you have man
Anton,
See if this suits your purpose: http://cheeseshop.python.org/pypi/SE/2.2%20beta
Below the dotted line is how it works.
Frederic
- Original Message -
From: "Anton81" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Wednesday, August 09, 2006 7:48 PM
Subject: Escape sequ
If you go to http://www.python.org/pypi. you see it about in the middle of the
recently updated packages. It's blue, so you can
click it and you're there.
The update page shows only the twenty most recent updates. So they drop
out at the bottom rather fast. If it's gone by the
time you chec
HJi all,
In the short period of time since I introduced SE. the feedback has been
overwhelmingly postive. Thank you all! I am still cleaning
up minor functional imperfections as I encounter them working out solutions to
posted problems. So the other day I discovered that
version 2.1 failed to pr
Harald,
This works. 's' is your SQL sample.
>>> import SE # From the Cheese Shop with a good manual
>>> Split_Marker = SE.SE (' ";=\" "~\$_?\$(.|\n)*?\$_?\$~==" ')
>>> s_with_split_marks = Split_Marker (s)
>>> s_split = s_with_split_marks.split ('')
That's it! And it isn't as complicated as
- Original Message -
From: "Claudio Grondi" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Tuesday, August 01, 2006 2:42 PM
Subject: Re: Html character entity conversion
> Anthra Norell wrote:
>
> >>>>import SE# Available at
Pak (or Andrei, whichever is your first name),
My proposal below:
- Original Message -
From: <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Sunday, July 30, 2006 8:52 PM
Subject: Re: Html character entity conversion
> danielx wrote:
> > [EMAIL PROTECTED] wrote:
> > >
I will give thisone a go first and if there is anything I can do for
> you just ask and I will try my best.
> I really appreciate what you have done.
> Of course I will try to follow your code to see if any will fall on
> meLOL
> Regards
> Graham
>
> "Anthra Norell&qu
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Friday, July 28, 2006 10:30 PM
Subject: Looking for a regular expression for this...
> Hi,
> My string is a multi line string that contains "filename
> \n" and "host \n" entries among other things.
>
> For example: s
- Original Message -
From: "Graham Feeley" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Friday, July 28, 2006 5:11 PM
Subject: Re: Newbie..Needs Help
> Thanks Nick for the reply
> Of course my first post was a general posting to see if someone would be
> able to help
> her
- Original Message -
From: "Paul McGuire" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Wednesday, July 26, 2006 1:01 AM
Subject: Re: Parsing Baseball Stats
> "Anthra Norell" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTEC
- Original Message -
From: "Paul McGuire" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Tuesday, July 25, 2006 7:48 PM
Subject: Re: Parsing Baseball Stats
> "Anthra Norell" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTE
Hi,
Below your solution ready to run. Put get_statistics () in a loop that
feeds it the names from your file, makes an ouput file
name from it and passes both 'statistics' and the ouput file name to
file_statistics ().
Cheers,
Frederic
- Original Message -
From: <[EMAIL PROTECT
Hi, see below ...
- Original Message -
From: "Paul McGuire" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Monday, July 17, 2006 10:09 AM
Subject: Re: embedding executable code in a regular expression in Python
> Avi Kak wrote:
> > Folks,
> >
> > Does regular expression proc
- Original Message -
From: "Avi Kak" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Sunday, July 16, 2006 11:05 PM
Subject: embedding executable code in a regular expression in Python
> Folks,
>
> Does regular expression processing in Python allow for executable
> code to be
- Original
Message -From: "Tom Plunket" <[EMAIL PROTECTED]>Newsgroups: comp.lang.pythonTo: Sent: Friday, July 14, 2006 12:49 AMSubject: String handling
and the percent operator> I have some code to autogenerate some
boilerplate code so that I don't> need to do
>>> import SE
>>> Editor = SE.SE ('sleeping=dead sleeping.htm== sleeping<==')
>>> Editor ('This parrot is
sleeping. Really, it is sleeping.'
'This parrot is sleeping. Really, it
is dead.'
Or:
>>> Editor ( (name of htm file), (name of output file) )
Usage: You make an explicit list of what you want
Hi all,
I have
invested probably 500 hours in the development of a module which I think could
fill a gap, judging by some problems regularly discussed on this
forum. The module is finished and I want to contribute it. A kind
sould recently suggested I upload it to the Cheese Shop. I
- Original Message -
From: "Ben Finney" <[EMAIL PROTECTED]>
To:
Sent: Friday, June 02, 2006 12:30 AM
Subject: Re: losing handles of open files
> Please don't post non-text message bodies to discussion
> forums. Message bodies should be plain text.
>
>
Hi
If a piece of code
exits with an exception before it closes an open file, that file seems to remain
locked, which is real pain in the butt if I develop a file in parallel with
a piece of code. Is there a way to close
such lost files short of starting a new session?
Frederic
--
This is the third problem today which I propose to solve with my stream
editor SE. If the group thinks it could be useful I would submit it the
moment I'm done with the doc, which is in the final stage.
Frederic
>>> se = SE.SE (' ~addr=[0-9.]+~==(10) | addr\== ')
>>> string = """(a)test="192.168.
>>> se = SE.SE (' "~/[A-Za-z0-9_]+/CHECKEDOUT~==" | /= CHECKEDOUT=')
>>> se
('/main/parallel_branch_1/release_branch_1.0/dbg_for_python/CHECKEDOUT')
'dbg_for_python'
If I understand your problem, this might be a solution. It is a stream
editor I devised on the impression that it could handle in a
se = SE.SE (r' "~=.~=\=#')
>>> se ('tyrtrbd =ffgtyuf == =tyryr =u=p ff')
'tyrtrbd =#fgtyuf =# =#yryr =#=# ff'
I am in the final stages of documenting my stream editor SE. There are quite
a few problems raised on this list which SE would handle elegantly. Where do
I propose it for distribu
- Original Message -
From: "Konstantin Veretennicov" <[EMAIL PROTECTED]>
To: "Anthra Norell" <[EMAIL PROTECTED]>
Cc: "Python SIG"
Sent: Wednesday, June 15, 2005 11:28 AM
Subject: Re: Single test for a class and all its subclasses?
> On 6/1
class C: ...
class C2 (C): ...
# What I want to do:
if x.__class__ in (C, C2):
do_something_with (x)
# Requires an exhaustive genealogy, which normally is impractical and often
impossible
# Another approach
class_tree = inspect.getclasstree ((x.__class__,))
if classtree_con
1 - 100 of 126 matches
Mail list logo