Re: What is the name of the name space I am in?

2010-07-06 Thread Anthra Norell
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 to classobj() defines the attributes

What is the name of the name space I am in?

2010-07-05 Thread Anthra Norell
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

Re: What is the name of the name space I am in?

2010-07-05 Thread Anthra Norell
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 name space. If, for instance

Re: What is the name of the name space I am in?

2010-07-05 Thread Anthra Norell
Chris Rebert wrote: On Mon, Jul 5, 2010 at 2:07 AM, Anthra Norell anthra.nor...@bluewin.ch 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

Re: Regular expression

2010-05-19 Thread Anthra Norell
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',

MySQLdb - weird formatting inconsistency

2010-04-24 Thread Anthra Norell
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

Re: MySQLdb - weird formatting inconsistency

2010-04-24 Thread Anthra Norell
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

How to access a web site with an authentication template.

2010-03-17 Thread Anthra Norell
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

Re: Six Minutes and fourty two seconds

2010-03-01 Thread Anthra Norell
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

Re: Help with regex search-and-replace (Perl to Python)

2010-02-08 Thread Anthra Norell
Schif Schaf wrote: On Feb 7, 8:57 am, Tim Chase python.l...@tim.thechases.com 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 :)

Re: C:\Python25\Lib\IDLELIB\idle.pyw won't start

2010-02-06 Thread Anthra Norell
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 anthra.nor...@bluewin.ch 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

Re: C:\Python25\Lib\IDLELIB\idle.pyw won't start

2010-02-06 Thread Anthra Norell
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 Genellina

C:\Python25\Lib\IDLELIB\idle.pyw won't start

2010-02-05 Thread Anthra Norell
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

Re: C:\Python25\Lib\IDLELIB\idle.pyw won't start

2010-02-05 Thread Anthra Norell
Thank you both (Alf and Duncan) for your comments. I answer Duncan's questions interleaved: Duncan Booth wrote: Anthra Norell anthra.nor...@bluewin.ch 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

Re: C:\Python25\Lib\IDLELIB\idle.pyw won't start

2010-02-05 Thread Anthra Norell
Duncan Booth wrote: Anthra Norell anthra.nor...@bluewin.ch 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

Re: substitution

2010-01-21 Thread Anthra Norell
Iain King wrote: On Jan 21, 2:18 pm, Wilbert Berendsen wbs...@xs4all.nl 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 :

Re: substitution

2010-01-18 Thread Anthra Norell
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

Re: substitution

2010-01-18 Thread Anthra Norell
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. The method __init__

Re: substitution

2010-01-18 Thread Anthra Norell
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 to

Re: lightweight encryption of text file

2010-01-12 Thread Anthra Norell
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 years ago when I

Re: lightweight encryption of text file

2010-01-12 Thread Anthra Norell
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

Re: lightweight encryption of text file

2010-01-11 Thread Anthra Norell
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 that possession

Re: lightweight encryption of text file

2010-01-09 Thread Anthra Norell
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 text

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

Re: ftpilb.FTP.stor...() freeze mystery

2009-10-30 Thread Anthra Norell
Gabriel Genellina wrote: En Thu, 29 Oct 2009 13:18:30 -0300, Anthra Norell anthra.nor...@bluewin.ch escribió: Gabriel Genellina wrote: En Wed, 28 Oct 2009 08:05:22 -0300, Anthra Norell anthra.nor...@bluewin.ch escribió: Gabriel Genellina wrote: En Tue, 27 Oct 2009 07:53:36 -0300, Anthra

Re: ftpilb.FTP.stor...() freeze mystery

2009-10-29 Thread Anthra Norell
Gabriel Genellina wrote: En Wed, 28 Oct 2009 08:05:22 -0300, Anthra Norell anthra.nor...@bluewin.ch escribió: Gabriel Genellina wrote: En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell anthra.nor...@bluewin.ch escribió: I am trying to upload a bunch of web pages to a hosting service.[...] I

Re: ftpilb.FTP.stor...() freeze mystery

2009-10-28 Thread Anthra Norell
Gabriel Genellina wrote: En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell anthra.nor...@bluewin.ch 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

Re: how to get os.system () call to cooperate on Windows

2009-10-27 Thread Anthra Norell
Kushal Kumaran wrote: On Tue, Oct 27, 2009 at 2:04 AM, Anthra Norell anthra.nor...@bluewin.ch wrote: snip 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

ftpilb.FTP.stor...() freeze mystery

2009-10-27 Thread Anthra Norell
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

urllib.FTP.stor...() freeze mystery

2009-10-27 Thread Anthra Norell
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

how to get os.system () call to cooperate on Windows

2009-10-26 Thread Anthra Norell
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

Re: how to get os.system () call to cooperate on Windows

2009-10-26 Thread Anthra Norell
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 out reading

Re: Select column from a list

2009-08-28 Thread Anthra Norell
Vlastimil Brom wrote: 2009/8/28 hoffik be...@seznam.cz: 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

Re: How to write replace string for object which will be substituted? [regexp]

2009-08-05 Thread Anthra Norell
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

Re: Compiling regex inside function?

2009-08-04 Thread Anthra Norell
alex23 wrote: Anthra Norell anthra.nor...@bluewin.ch 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

Compiling regex inside function?

2009-08-03 Thread Anthra Norell
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

Re: CAD file format specifications?

2009-06-19 Thread Anthra Norell
Dennis Lee Bieber wrote: On Thu, 18 Jun 2009 13:39:28 +0200, Anthra Norell anthra.nor...@bluewin.ch 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

Re: CAD file format specifications?

2009-06-18 Thread Anthra Norell
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

Re: CAD file format specifications?

2009-06-13 Thread Anthra Norell
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

CAD file format specifications?

2009-06-12 Thread Anthra Norell
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,

Re: OT: Can;'t find a Mozilla user group

2009-06-04 Thread Anthra Norell
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 window pops

OT: Can;'t find a Mozilla user group

2009-06-03 Thread Anthra Norell
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

Re: change some lines from a read file

2009-05-05 Thread Anthra Norell
utab wrote: On May 4, 10:06 pm, Anthra Norell anthra.nor...@bluewin.ch 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

Re: change some lines from a read file

2009-05-04 Thread Anthra Norell
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

Re: object knows which object called it?

2009-04-06 Thread Anthra Norell
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

Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Anthra Norell
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

Re: Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Anthra Norell
Bruno Desthuilliers wrote: Chris Rebert a écrit : On Wed, Mar 18, 2009 at 6:09 AM, Anthra Norell anthra.nor...@bluewin.ch 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

Re: Simple question - stock market simulation

2009-02-09 Thread Anthra Norell
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 =

Re: Looking for a regexp generator based on a set of known string representative of a string set

2006-09-09 Thread Anthra Norell
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 matches these

Using Beautiful Soup to entangle bookmarks.html

2006-09-07 Thread Anthra Norell
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 Beautiful

Extracting text from a string

2006-09-07 Thread Anthra Norell
s = '''span class=sale $14.99 /span, span class=sale $27.99 /span, span class=sale $66.99 /span, span class=sale $129.99 /span, span class=sale $254.99 /span''' for line in [l.strip () for l in s.splitlines ()]: if line [0] == '$': print line

Re: newbe question about removing items from one file to another file

2006-09-05 Thread Anthra Norell
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.python To: python-list@python.org Sent: Monday, September 04, 2006 4:58 AM

Re: This seems to crash my program and gives me errors on the#include statements

2006-09-04 Thread Anthra Norell
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

Re: newbe question about removing items from one file to another file

2006-09-04 Thread Anthra Norell
- Original Message - From: [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org 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's a function

Re: Using eval with substitutions

2006-09-02 Thread Anthra Norell
- Original Message - From: Carl Banks [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org 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. ...

Re: Searching a string and extract all occurancies of a substring

2006-08-31 Thread Anthra Norell
Nico, perhaps this would be suitable: s = '''Example text: This is a test. link url=/www/folder target=_self title= A test. source id=boxparameter key=path/www/mydoc1/parameter/source And I need to extraxt /www/mydoc1 and /www/mydoc2 from this text. source id=boxparameter

Re: Using eval with substitutions

2006-08-31 Thread Anthra Norell
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, y, x)

Re: newbe question about removing items from one file to another file

2006-08-30 Thread Anthra Norell
: [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org Sent: Wednesday, August 30, 2006 1:51 AM Subject: Re: newbe question about removing items from one file to another file Anthra Norell wrote: Dexter, I looked at the format specification. It contains an example

Re: newbe question about removing items from one file to another file

2006-08-29 Thread Anthra Norell
about removing items from one file to another file Anthra Norell wrote: 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

Re: newbe question about removing items from one file to another file

2006-08-28 Thread Anthra Norell
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

Re: unpaking sequences of unknown length

2006-08-28 Thread Anthra Norell
want Thank you all Frederic - Original Message - From: Gerard Flanagan [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org Sent: Sunday, August 27, 2006 2:59 PM Subject: Re: unpaking sequences of unknown length Anthra Norell wrote: Hi, I keep working

unpaking sequences of unknown length

2006-08-27 Thread Anthra Norell
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 ...

Re: Taking data from a text file to parse html page

2006-08-26 Thread Anthra Norell
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

Re: Taking data from a text file to parse html page

2006-08-26 Thread Anthra Norell
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 find out where lower case sneaks in on yours. The zip file

Re: RE Module

2006-08-25 Thread Anthra Norell
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. Else

Re: Taking data from a text file to parse html page

2006-08-25 Thread Anthra Norell
build running build_py file SEL.py (for module SEL) not found file SE.py (for module SE) not found file SEL.py (for module SEL) not found file SE.py (for module SE) not found -- Anthra Norell wrote: You

Re: SE 2.2 install

2006-08-25 Thread Anthra Norell
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 itautomates complicated downloads. This is as simple a download as can be. So just forget about install. Download the zip file,

Re: RE Module

2006-08-25 Thread Anthra Norell
mentioned the size of the string could be a factor. If so what is the max size before I see problems? Thanks again Anthra Norell wrote: 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

Re: Taking data from a text file to parse html page

2006-08-24 Thread Anthra Norell
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

Re: Taking data from a text file to parse html page

2006-08-24 Thread Anthra Norell
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 = ''' divpemquot;Python has been an important part of Google since the beginning, and remains so as the

Re: Regular Expression question

2006-08-22 Thread Anthra Norell
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

Re: Adding a char inside path string

2006-08-17 Thread Anthra Norell
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 -=execlip here') edited_path_name = Editor (tricky_path_name) print edited_path_name# See what it did \serverName\C$:\exe

Re: trouble with replace

2006-08-13 Thread Anthra Norell
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''' import

Re: using python to edit a word file?

2006-08-11 Thread Anthra Norell
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

Re: using python to edit a word file?

2006-08-11 Thread Anthra Norell
No one could do it any better. Good for you! - Frederic - Original Message - From: John Salerno [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org Sent: Friday, August 11, 2006 4:08 PM Subject: Re: using python to edit a word file? Anthra Norell wrote: John

Re: Escape sequences (colour) and padding with %8s%

2006-08-10 Thread Anthra Norell
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: python-list@python.org Sent: Wednesday, August 09, 2006 7:48 PM

Re: Ann: SE 2.2b

2006-08-07 Thread Anthra Norell
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

Ann: SE 2.2b

2006-08-05 Thread Anthra Norell
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

Re: need help of regular expression genius

2006-08-02 Thread Anthra Norell
Harald, This works. 's' is your SQL sample. import SE # From the Cheese Shop with a good manual Split_Marker = SE.SE (' ;=\split here ~\$_?\$(.|\n)*?\$_?\$~== ') s_with_split_marks = Split_Marker (s) s_split = s_with_split_marks.split ('split here') That's it! And it isn't as

Re: Html character entity conversion

2006-08-01 Thread Anthra Norell
Pak (or Andrei, whichever is your first name), My proposal below: - Original Message - From: [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org Sent: Sunday, July 30, 2006 8:52 PM Subject: Re: Html character entity conversion danielx wrote: [EMAIL

Re: Html character entity conversion

2006-08-01 Thread Anthra Norell
- Original Message - From: Claudio Grondi [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org Sent: Tuesday, August 01, 2006 2:42 PM Subject: Re: Html character entity conversion Anthra Norell wrote: import SE# Available at the Cheese Shop I mean

Re: Looking for a regular expression for this...

2006-07-30 Thread Anthra Norell
- Original Message - From: [EMAIL PROTECTED] To: python-list@python.org 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 filename\n and host host\n entries among other

Re: Newbie..Needs Help

2006-07-30 Thread Anthra Norell
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 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] - Original Message - From: Graham Feeley [EMAIL PROTECTED] Newsgroups

Re: Newbie..Needs Help

2006-07-29 Thread Anthra Norell
- Original Message - From: Graham Feeley [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org 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

Re: Parsing Baseball Stats

2006-07-26 Thread Anthra Norell
- Original Message - From: Paul McGuire [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org Sent: Wednesday, July 26, 2006 1:01 AM Subject: Re: Parsing Baseball Stats Anthra Norell [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] snip

Re: Parsing Baseball Stats

2006-07-25 Thread Anthra Norell
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

Re: Parsing Baseball Stats

2006-07-25 Thread Anthra Norell
- Original Message - From: Paul McGuire [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org Sent: Tuesday, July 25, 2006 7:48 PM Subject: Re: Parsing Baseball Stats Anthra Norell [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Below your

Re: embedding executable code in a regular expression in Python

2006-07-18 Thread Anthra Norell
Hi, see below ... - Original Message - From: Paul McGuire [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org 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

Re: embedding executable code in a regular expression in Python

2006-07-16 Thread Anthra Norell
- Original Message - From: Avi Kak [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org 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

Re: String handling and the percent operator

2006-07-14 Thread Anthra Norell
- Original Message -From: "Tom Plunket" [EMAIL PROTECTED]Newsgroups: comp.lang.pythonTo: python-list@python.orgSent: 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 the

Re: RegEx conditional search and replace

2006-07-06 Thread Anthra Norell
import SE Editor = SE.SE ('sleeping=dead sleeping.htm== sleeping==') Editor ('This parrot a href=sleeping.htm target=newis sleeping/a. Really, it is sleeping.' 'This parrot a href=sleeping.htm target=newis sleeping/a. Really, it is dead.' Or: Editor ( (name of htm file), (name of output file)

Requesting advice on uploading a module

2006-07-04 Thread Anthra Norell
Hi all, I have invested probably 500 hours in the development of a module which I think could fill a gap, judging bysome problems regularly discussed on this forum.The module is finishedand I want to contribute it. A kind sould recently suggested I upload it to theCheese Shop. Ihave made

Re: losing handles of open files

2006-06-02 Thread Anthra Norell
- Original Message - From: Ben Finney [EMAIL PROTECTED] To: python-list@python.org 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. Anthra Norell [EMAIL

losing handles of open files

2006-06-01 Thread Anthra Norell
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 Idevelop 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 --

Re: Replace

2006-05-12 Thread Anthra Norell
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

Re: Reg Ex help

2006-05-12 Thread Anthra Norell
se = SE.SE ('EAT ~/[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

Re: How to get a part of string which follows a particular pattern usingshell script

2006-05-12 Thread Anthra Norell
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 ('EAT ~addr=[0-9.]+~==(10) | addr\== ') string =

Re: Single test for a class and all its subclasses?

2005-06-16 Thread Anthra Norell
- Original Message - From: Konstantin Veretennicov [EMAIL PROTECTED] To: Anthra Norell [EMAIL PROTECTED] Cc: Python SIG python-list@python.org Sent: Wednesday, June 15, 2005 11:28 AM Subject: Re: Single test for a class and all its subclasses? On 6/15/05, Anthra Norell [EMAIL PROTECTED

Single test for a class and all its subclasses?

2005-06-15 Thread Anthra Norell
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_contains

Re: Encryption with Python?

2005-06-01 Thread Anthra Norell
Thank you all, James, Dennis, Christos, Paul, Isn't it remarkable that it takes foolishness to earn a little respect. Anyway, even as I write this, my account balance stands unchanged at ... no, come to think of it, the account balance is definitely not a part of the problem. I will

  1   2   >