Speed of IDLE output degrades to 'unusable' after upgrade to Python 2.4

2005-02-11 Thread Anthra Norell
Upgraded from 2.2.2 to 2.4 and all seems to work as before except the output to the IDLE window is now twenty times slower than it was before. The statement    for i in range (100): print i now takes about forty-five seconds to complete! It used to be two seconds. Python 2.4 on Windows ME.

IDLE output too slow for practical use after upgrade from P2.2.2 to P2.4

2005-02-21 Thread Anthra Norell
Hi,    I upgraded from 2.2.2 to 2.4 and all is well except the output to the IDLE window is now twenty times slower than it was before, making the window utterly unusable for verbose output. The statement -- for i in range (100): print i -- now takes about forty-five seconds to complete! Used

Need direction to kill a virus

2005-03-01 Thread Anthra Norell
Hi all,     Here's an operator who instantantly destroys all messages he cannot identify within two seconds, saves and inspects all attachments before opening them and who thought himself immune from viruses for it. Years of trouble-free operation reinforced the perception.   I recen

Re: Regular Expressions: large amount of or's

2005-03-01 Thread Anthra Norell
  - Original Message - From: "André Søreng" <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Tuesday, March 01, 2005 8:46 PM Subject: Regular Expressions: large amount of or's > > Hi!> > Given a string, I want to find all ocurrences of> certain prede

Re: Need direction to kill a virus

2005-03-03 Thread Anthra Norell
Josef Albert Meile, James Stroud, Sean Blakey,   Thank you very very much for your valuable suggestions and kind encouragement.   Frederic   ( No, I don't have any particular affection for Microsoft stuff. Very much on the contrary. I have a plan to start using Unix. This plan is over twent

Re: GOTO (was Re: Appeal for python developers)

2005-03-06 Thread Anthra Norell
> Please include "goto" command in future python realeses> know that proffesional programers doesn't like to use it, > but for me as newbie it's too hard to get used replacing it > with "while", "def" or other commands> -- I believe the bad reputation of 'goto' goes back to the originators

Re: GOTO (was Re: Appeal for python developers)

2005-03-07 Thread Anthra Norell
> Heiko wrote:   > SETUP = object()> ELSE = object()> BREAK = object() > > machine = {"WAITING FOR ACTION":>   {customer_drops_coin:"COIN HAS BEEN DROPPED",>    customer_selects_beverage:"ORDER RECEIVED",>    customer_cancels_order:"ACCOUNT CLOSURE IS

Re: Your suggestions re virus, round 6: Virus KO

2005-03-09 Thread Anthra Norell
Josef, I'll definitely take a close look at all the suggestions I have been offered, in the interest of future damage prevention. This time, though, the fight is over and I emerge victorious! Poking around here and I came across huge startup or execution log files listing rather unabash

Re: Can't seem to insert rows into a MySQL table

2005-03-14 Thread Anthra Norell
Try to use % instead of a comma (a Python quirk) and quotes around your strings (a MySQL quirk): cursor.execute("INSERT INTO edict (kanji, kana, meaning) VALUES ('%s', '%s', '%s')" % ("a", "b", "c") ) Frederic - Original Message - From: "grumfish" <[EMAIL PROTECTED]> Newsgroups: comp

Re: Can't seem to insert rows into a MySQL table

2005-03-15 Thread Anthra Norell
o it looks like the problem is with MySQL (e.g. table name, column names, ...) Frederic - Original Message - From: "Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Monday, March 14, 2005 11:55 PM Subject: Re: Can't seem to

__iadd__ and __isub__ map to += and -= but don't return result

2005-04-08 Thread Anthra Norell
Hi!   If I am missing a point here, what could it be? Watch the hot spots (***)   Frederic     #     # Python 2.4, Windows ME  X = 0, Y = 1    class Vertex (list):    def __init__ (self, *coordinates): self [:] = l

Re: __iadd__ and __isub__ map to += and -= but don't return result

2005-04-08 Thread Anthra Norell
I see! It's the in-place aspect that led me to assume that the assignment to self inside the method would do the trick. Next the explicit call reinforced the perception. Anyway, thank you very much for the clarification. Frederic   > Anthra Norell wrote:> >> If I am mis

Data smoothing algorithms?

2005-04-28 Thread Anthra Norell
Hi,   The following are differences of solar declinations from one day to the next, (never mind the unit). Considering the inertia of a planet, any progress of (apparent) celestial motion over regular time intervals has to be highly regular too, meaning that a plot cannot be jagged. The data

Re: Data smoothing algorithms? - Thank you all

2005-04-30 Thread Anthra Norell
ww.mirror5.com/software/plotutils/plotutils.html > > Good Luck > Larry Bates > > John J. Lee wrote: > > "Anthra Norell" <[EMAIL PROTECTED]> writes: > > > > > >>Hi, > >> > >>The following are differences of solar declinations from

Re: String handling and the percent operator

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

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: 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

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: 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

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 PROTECT

Re: Parsing Baseball Stats

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

Re: Parsing Baseball Stats

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

Re: Newbie..Needs Help

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

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

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

Re: Newbie..Needs Help

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

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: Sent: Sunday, July 30, 2006 8:52 PM Subject: Re: Html character entity conversion > danielx wrote: > > [EMAIL PROTECTED] wrote: > > >

Re: Html character entity conversion

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

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 (' ";=\" "~\$_?\$(.|\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

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 pr

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 chec

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: Sent: Wednesday, August 09, 2006 7:48 PM Subject: Escape sequ

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 man

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: Sent: Friday, August 11, 2006 4:08 PM Subject: Re: using python to edit a word file? > Anthra Norell wrote: > &

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''' >>> im

Re: Adding a char inside path string

2006-08-16 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 -=exe"') >>> edited_path_name = Editor (tricky_path_name) >>> print edited_path_name# See what it did \serverName\C$:\exe fil

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

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 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   --

Re: losing handles of open files

2006-06-02 Thread Anthra Norell
- 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. > >

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 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

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 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

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

2006-08-23 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 dat

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 = ''' "Python has been an important part of Google since the beginning, and remains so as the system grow

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. E

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

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

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 it automates complicated downloads. This is as simple a download as can be. So just forget about install. Download the zip f

Re: RE Module

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

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 baff

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 f

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: newbe question about removing items from one file to another file

2006-08-27 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
(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

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

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

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

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

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. 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

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,

Re: Using eval with substitutions

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

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 c

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: 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

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

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

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 > Bea

Extracting text from a string

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

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 >> mat

Re: Ron Grossi: God is not a man

2005-04-30 Thread Anthra Norell
It must be because there aren't enough real problems that so many people devote so much energy to inventing so many imaginary ones. Frederic (GOD tells me---much against my will; I categorically refuse to be a prophet!---to throw this piece of HIS divine wisdom into the melee.) - Original

Re: Data smoothing algorithms? - Thank you all

2005-05-03 Thread Anthra Norell
To contribute to this interesting discussion, which after having provided practical solutions, has become academic, I believe we are dealing with a particularly innocuous case of noise infection, innocuous on account of the noise being conspicuously distinct from the signal. The signal is the orbta

Re: Setting the corner color in rotated PIL images

2005-05-03 Thread Anthra Norell
I just had the same problem the other day. I solved it by starting out with an image large enough to retain enough white area following the rotation. Frederic - Original Message - From: "rzed" <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Sunday, May 01, 2005 1:17 PM Subject

Re: Setting the corner color in rotated PIL images

2005-05-06 Thread Anthra Norell
Sent: Tuesday, May 03, 2005 8:13 PM Subject: Re: Setting the corner color in rotated PIL images > "Anthra Norell" <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > [in response to: > >> I'm using PIL to generate some images which may be rotated at >

Re: Encryption with Python?

2005-05-07 Thread Anthra Norell
I rolled my own for relatively short sequences, like passwords. The key is an integer. To decrypt use the negative encryption key. I consider the encryption unbreakable, as it is indistinguishable from a random sequence. Frederic ### def crypt (sequence, key): import random sign = (key > 0

Re: Encryption with Python?

2005-05-07 Thread Anthra Norell
nt: Saturday, May 07, 2005 11:11 AM Subject: Re: Encryption with Python? > Anthra Norell wrote: > > I rolled my own for relatively short sequences, like passwords. The key is > > an integer. To decrypt use the negative encryption key. I consider the > > encryption unbrea

Re: Encryption with Python?

2005-05-09 Thread Anthra Norell
Robert, Thanks a lot for your thorough explanations. - Original Message - From: "Robert Kern" <[EMAIL PROTECTED]> To: Sent: Saturday, May 07, 2005 3:18 PM Subject: Re: Encryption with Python? ( snip ) > >>You do realize that if I have two ciphertexts encrypted with the same > >>ke

Re: Encryption with Python?

2005-05-09 Thread Anthra Norell
Paul, I thank you too for your response. Let me just tell you what goes through my mind. - Original Message - From: "Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> Newsgroups: comp.lang.python To: Sent: Monday, May 09, 2005 9:45 PM Subject: Re: Encryptio

Re: Encryption with Python?

2005-05-10 Thread Anthra Norell
Original Message - From: "Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> Newsgroups: comp.lang.python To: Sent: Tuesday, May 10, 2005 12:59 AM Subject: Re: Encryption with Python? > .. > Since good encryption schemes that don't have significant performance > penalties are widely availa

Re: BluWater: God is not a man

2005-05-16 Thread Anthra Norell
- Original Message - From: "flamesrock" <[EMAIL PROTECTED]> Newsgroups: microsoft.public.windowsxp.network_web, rec.music.beatles,rec.music.makers.guitar.acoustic, alt.showbiz.gossip,comp.lang.python To: Sent: Thursday, May 12, 2005 2:04 AM Subject: Re: BluWater: God is not a man > I'm c

Re: Encryption with Python?

2005-05-24 Thread Anthra Norell
_ [o[ii]] = s_ [ii] s += ''.join (s__) i += l return s - Original Message - From: "Christos TZOTZIOY Georgiou" <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Friday, May 13, 2005 11:06 AM Subject: Re: Encryption with Python? > On

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 wil

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_con

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" Sent: Wednesday, June 15, 2005 11:28 AM Subject: Re: Single test for a class and all its subclasses? > On 6/1

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 distribu

Re: Reg Ex help

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

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 (' ~addr=[0-9.]+~==(10) | addr\== ') >>> string = """(a)test="192.168.

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 = (12,13

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 *(*(*(*(b

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 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

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 w

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 decide

Re: change some lines from a read file

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

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 messa

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 w

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 tex

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 th

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 y

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: 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 corre

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

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

Re: substitution

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

Re: Colour sampling

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

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 fil

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 o

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 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.

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 s

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 fr

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 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

  1   2   >