Re: Counting Threads

2005-10-28 Thread David Poundall
Sorry Denis - but could you give me an example. I can't for the life of me see how the syntax for that would go. -- http://mail.python.org/mailman/listinfo/python-list

Re: a Haskell a Day

2005-10-28 Thread Wil Hadden
"steve" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > Stupid newbi wants $1 if you spend more than 30 minutes on his webshite, > looking at it you would be hard pressed to spend 30 seconds. > Anyway at least we know where to find him. > > Broadcasting his antics in Las Vegas

Re: Jpg

2005-10-28 Thread Juho Schultz
Tuvas wrote: > I am building a GUI interface at the moment, and would like to have > support for displaying a jpg file, and a FITS file if possible. Is > there any way to do this? My interface has been written in Tkinter at > the moment, especially because of it's great portability, I wouldn't > ha

Re: MSH (shell)

2005-10-28 Thread Paddy
Thanks, I'm enjoying reading the article. So far I noticed how their select functionality is similar to our comprehensions, but can also take a statement block. ( no wars please ;-). I liked the tabular output format for lists of similar items, with the automatic headings being displayed, e.g: msh

Spambayes modifications with web services

2005-10-28 Thread benmorganpowell
In the last few months many personal website owners (such as myself) have found that spammers have been using their domain names to masquerade as valid users to send spam, normally in the form of: [EMAIL PROTECTED] This new tactic has an annoying problem, which is that the bounced emails end up b

Re: Microsoft Hatred FAQ

2005-10-28 Thread Eike Preuss
David Schwartz wrote: > "Eike Preuss" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > >>>Right, except that's utterly absurd. If every vendor takes their tiny >>>cut of the 95%, a huge cut of the 5% is starting to look *REALLY* good. > > >>Sure, that would be true if the

Re: xml.dom.minidom - parseString - How to avoid ExpatError?

2005-10-28 Thread Paul Dale
Hi Greg, Not really an answer to your question but I've found 4Suite ( http://4suite.org/index.xhtml ) quite useful for my XML work and the articles linked to from there authored by Uche Ogbuji to be quite informative. Best, Paul Gregory Piñero wrote: > Thanks, John. That was all very hel

Re: Microsoft Hatred FAQ

2005-10-28 Thread Lasse Vågsæther Karlsen
David Schwartz wrote: > Lasse Vågsæther Karlsen wrote: > > >>David Schwartz wrote: > > >>>Burger King won't let you sell Whoppers or buy their burger >>>patties wholesale no matter what you want to call your store unless >>>you take the whole franchise deal. It's an all-or-nothing package.

Re: Suggestion for (re)try statement

2005-10-28 Thread Lasse Vågsæther Karlsen
Sori Schwimmer wrote: > Hi, > > I think that would be useful to have an improved > version of the "try" statement, as follows: > > try(retrys=0,timeout=0): > sleep(timeout) At the very least, "timeout" is the wrong wording, "delay" would be more appropriate. A timeout is usually associa

Tk

2005-10-28 Thread Shi Mu
When I run the following code, script kept running and I have to force it to stop. Could you check the code to give suggestions how to improve it? Thanks a lot! from Tkinter import * from Tkinter import _cnfmerge class Dialog(Widget): def __init__(self, master=None, cnf={}, **kw): cnf =

Re: creating/altering the OpenOffice spredsheet docs

2005-10-28 Thread yepp
Andy Leszczynski wrote: > Any idea how to do that the way ActiveX would be used on M$? > Fortunately, NO. You know http://udk.openoffice.org/python/python-bridge.html ?? yepp -- http://mail.python.org/mailman/listinfo/python-list

Re: Would there be support for a more general cmp/__cmp__

2005-10-28 Thread Antoon Pardon
Op 2005-10-26, Ron Adam schreef <[EMAIL PROTECTED]>: > > Adding complexity to cmp may not break code, but it could probably slow > down sorting in general. So I would think what ever improvements or > alternatives needs to be careful not to slow down existing sorting cases. As a result of Bengt

Re: how to associate files with application

2005-10-28 Thread Lasse Vågsæther Karlsen
Ashok wrote: > hi, > i want to know how to make a specific type of file open in an > application i developed in python when the user clicks on the file.(in > windows) for eg. a .txt file when clicked opens in notepad, a .doc file > when clicked opens in MS-word. In the same way i want to make a .xy

Re: How to replace all None values with the string "Null" in a dictionary

2005-10-28 Thread bruno at modulix
dcrespo wrote: > Hi all, > > How can I replace all None values with the string 'Null' in a > dictionary? > > For example: > convert this: > a = {'item1': 45, 'item2': None} > > into this: > a = {'item1': 45, 'item2': 'Null'} > I think it would be time for you to read the Fine Manual... for ke

Re: db.DB_CREATE|db.DB_INIT_MPOOL|db.DB_THREAD|db.DB_INIT_CDB

2005-10-28 Thread Neville C. Dempsey
On Thu, 2005-10-27 at 12:30 -0400, Jean-Paul Calderone wrote: > On Fri, 28 Oct 2005 00:17:54 +0800, "Neville C. Dempsey" at 3ttechnology.com> wrote: > >import bsddb # twiceopen.py > >Maybe the solution needs one of: > > db.DB_CREATE|db.DB_INIT_MPOOL|db.DB_THREAD|db.DB_INIT_CDB > Except I don't

problem with gnuplot in XP

2005-10-28 Thread Titi Anggono
Hi all, I made 2 arrays, which are i and uzuy (both are float). And I want to plot the graph between those arrays. I followed from the manual == from Gnuplot import Gnuplot, Data g=Gnuplot() results=Data(i,uzuy) g.plot(results) = here I got the message

How to translate python into C

2005-10-28 Thread Johnny Lee
Hi, First, I want to know whether the python interpreter translate the code directly into machine code, or translate it into C then into machine code? Second, if the codes are translated directly into machine codes, how can I translate the codes into C COMPLETELY the same? if the codes are tr

Re: XML Tree Discovery (script, tool, __?)

2005-10-28 Thread George Sakkis
"[EMAIL PROTECTED]" wrote: > Hi all, > > Finally diving into XML programmatically. Does anyone have a best > practice recommendation for programmatically discovering the structure > of an arbitrary XML document via Python? > > It seems like it is a common wheel I'd be re-inventing. > > Thanks and

Re: Would there be support for a more general cmp/__cmp__

2005-10-28 Thread Antoon Pardon
Op 2005-10-28, Antoon Pardon schreef <[EMAIL PROTECTED]>: > Op 2005-10-26, Ron Adam schreef <[EMAIL PROTECTED]>: >> > > These are the results. > >: 1000 repeats, 1000 long, 10.061425 secs >: 1000 repeats, 1000 long, 9.544035 secs >: 1000 repeats, 1000 long, 10.450864 secs >: 1000 repeats, 1000 lon

Re: Spambayes modifications with web services

2005-10-28 Thread Neil Hodgson
benmorganpowell: > So, as a web programmer and someone who specialises in getting good > results on Google, I realised that I could simply post every spammer > website on a Google optimized page, which if searched for on Google > would return something like: > > "WARNING: DO NOT BUY FROM THIS WEB

Re: How to translate python into C

2005-10-28 Thread Szabolcs Nagy
python creates bytecode (like java classes) you cannot translate python directly to c or machine code, but there are some projects you probably want to look into Pypy is a python implemetation in python and it can be used to translate a python scrip to c or llvm code. (large project, work in pr

Re: Spambayes modifications with web services

2005-10-28 Thread Lasse Vågsæther Karlsen
[EMAIL PROTECTED] wrote: > In the last few months many personal website owners (such as myself) > have found that spammers have been using their domain names to > masquerade as valid users to send spam, normally in the form of: > So, as a web programmer and someone who specialises in getting good

Re: How to translate python into C

2005-10-28 Thread Johnny Lee
Szabolcs Nagy wrote: > python creates bytecode (like java classes) > > > you cannot translate python directly to c or machine code, but there > are some projects you probably want to look into > > > Pypy is a python implemetation in python and it can be used to > translate a python scrip to c or l

Re: How to translate python into C

2005-10-28 Thread Benjamin Niemann
Johnny Lee wrote: > Hi, >First, I want to know whether the python interpreter translate the > code directly into machine code, or translate it into C then into > machine code? Neither this nor that. The interpreter first compiles the code into python 'byte code' - something similar to machine

Re: Microsoft Hatred FAQ

2005-10-28 Thread imagespaul
http://www.idpz.net/wolfgang/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to translate python into C

2005-10-28 Thread Johnny Lee
Thanks for your tips Niemann:) Regards, Johnny -- http://mail.python.org/mailman/listinfo/python-list

Scanning a file

2005-10-28 Thread pinkfloydhomer
I want to scan a file byte for byte for occurences of the the four byte pattern 0x0100. I've tried with this: # start import sys numChars = 0 startCode = 0 count = 0 inputFile = sys.stdin while True: ch = inputFile.read(1) numChars += 1 if len(ch) < 1: break startCode = ((

Re: Scanning a file

2005-10-28 Thread Gerhard Häring
[EMAIL PROTECTED] wrote: > I want to scan a file byte for byte [...] > while True: > ch = inputFile.read(1) > [...] But it is very slow. What is the fastest way to do this? Using some > native call? Using a buffer? Using whatever? Read in blocks, not byte for byte. I had good experiences with

Re: Microsoft Hatred FAQ

2005-10-28 Thread JavaByExample_at_KickJava_com
> Part of their behavior really escape me. The whole thing about > browser wars confuses me. Web browsers represent a zero billion > dollar a year market. Why would you risk anything to own it? Wonder why MSN.com is one of the most visited sites, I speculate that it is largely because it is the

Re: Scanning a file

2005-10-28 Thread pinkfloydhomer
Okay, how do I do this? Also, if you look at the code, I build a 32-bit unsigned integer from the bytes I read. And the 32-bit pattern I am looking for can start on _any_ byte boundary in the file. It would be nice if I could somehow just scan for that pattern explicitly, without having to build a

Re: Scanning a file

2005-10-28 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I want to scan a file byte for byte for occurences of the the four byte > pattern 0x0100. I've tried with this: use re.search or string.find. The simplest way is just read the whole file into memory first. If the file is too big, you have to read it in chunks and

x-plat gui development question Mac OS X

2005-10-28 Thread Georg Christmann
Hello everybody, I have recently started tinkering about with Python. If there are any Macintosh-based Python developers reading this newsgroup I would like to ask them one Macintosh-specific question: If you want to write GUI scripts on the Mac, say with Tkinter, you need to invoke "pythonw"

Re: How to replace all None values with the string "Null" in a dictionary

2005-10-28 Thread dcrespo
> I think it would be time for you to read the Fine Manual... hi, thanks for your answer... I really did it the same way you suggested, but I forgot to tell you that I wanted to get a better way for doing it. By the way, knowing your wisdom, what do I have to install to get the following code wor

Re: Microsoft Hatred FAQ

2005-10-28 Thread Shmuel (Seymour J.) Metz
In <[EMAIL PROTECTED]>, on 10/25/2005 at 09:56 AM, [EMAIL PROTECTED] said: >Yes, I know, they can do whatever they want, it's not a crime, Actually, it is a crime and they've been convicted. -- Shmuel (Seymour J.) Metz, SysProg and JOAT Unsolicited bulk E-mail

xml-rpc - adodb - None type - DateTime type

2005-10-28 Thread dcrespo
Hi to all, I have functions defined in an xml-rpc server. Some functions query to a Postgres database (using adodb) and return its recordset. So, if some xml-rpc client runs the mentioned function, it will retrieve the recordset. The problem is that if a retrieved field has the Null value or the D

Re: How to replace all None values with the string "Null" in a dictionary

2005-10-28 Thread dcrespo
Thanks... I did it right that way, but asked it without telling how I did it just to see what are the occurences of others. I thing there's no better/faster solution. Many thanks Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Scanning a file

2005-10-28 Thread [EMAIL PROTECTED]
I'm now down to: f = open("filename", "rb") s = f.read() sub = "\x00\x00\x01\x00" count = s.count(sub) print count Which is quite fast. The only problems is that the file might be huge. I really have no need for reading the entire file into a string as I am doing here. All I want is to count occu

Re: Scanning a file

2005-10-28 Thread Björn Lindström
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > f = open("filename", "rb") > s = f.read() > sub = "\x00\x00\x01\x00" > count = s.count(sub) > print count That's a lot of lines. This is a bit off topic, but I just can't stand unnecessary local variables. print file("filename", "rb").read().coun

Re: Scanning a file

2005-10-28 Thread Jorge Godoy
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Which is quite fast. The only problems is that the file might be huge. > I really have no need for reading the entire file into a string as I am > doing here. All I want is to count occurences this substring. Can I > somehow count occurences in a f

Re: Scanning a file

2005-10-28 Thread Bernhard Herzog
Jorge Godoy <[EMAIL PROTECTED]> writes: > How about iterating through the file? You can read it line by line, two lines > at a time. Pseudocode follows: > > line1 = read_line > while line2 = read_line: > line_to_check = ''.join([line1, line2]) > check_for_desired_string > line1

Re: how to associate files with application

2005-10-28 Thread Colin J. Williams
Lasse Vågsæther Karlsen wrote: > Ashok wrote: > >> hi, >> i want to know how to make a specific type of file open in an >> application i developed in python when the user clicks on the file.(in >> windows) for eg. a .txt file when clicked opens in notepad, a .doc file >> when clicked opens in MS-w

Re: Scanning a file

2005-10-28 Thread [EMAIL PROTECTED]
First of all, this isn't a text file, it is a binary file. Secondly, substrings can overlap. In the sequence 0010010 the substring 0010 occurs twice. /David -- http://mail.python.org/mailman/listinfo/python-list

Typing tutor help script needed, please

2005-10-28 Thread Throw
G'day everyone! I would like to design typing tutor exercises for Afrikaans (and other languages possibly). This is for a GPL project. For this, I need a script that can extract words from a long list of words, based on which letters those words contain, and write then write output to a file. D

Re: Scanning a file

2005-10-28 Thread Andrew McCarthy
On 2005-10-28, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm now down to: > > f = open("filename", "rb") > s = f.read() > sub = "\x00\x00\x01\x00" > count = s.count(sub) > print count > > Which is quite fast. The only problems is that the file might be huge. > I really have no need for reading

OEM character set issue

2005-10-28 Thread Ladv�nszky K�roly
On my hungarian Win2k, some of the accented characters of the file names appear incorrectly when Python is driven from the command line. However, they appear okay when the same script is running within an IDE. The same problem holds in the case of text files edited by GUI editors. Is there any solu

Re: Scanning a file

2005-10-28 Thread Jeremy Sanders
Gerhard Häring wrote: > [EMAIL PROTECTED] wrote: >> I want to scan a file byte for byte [...] >> while True: >> ch = inputFile.read(1) >> [...] But it is very slow. What is the fastest way to do this? Using some >> native call? Using a buffer? Using whatever? > > Read in blocks, not byte for

Re: Suggestion for (re)try statement

2005-10-28 Thread Rocco Moretti
Sori Schwimmer wrote: > Hi, > > I think that would be useful to have an improved > version of the "try" statement, as follows: > > try(retrys=0,timeout=0): > # things to try > except: > # what to do if failed > > and having the following semantic: > > for i in range(retrys): > try: >

Re: Would there be support for a more general cmp/__cmp__

2005-10-28 Thread Ron Adam
Antoon Pardon wrote: > Op 2005-10-26, Ron Adam schreef <[EMAIL PROTECTED]>: > >>Adding complexity to cmp may not break code, but it could probably slow >>down sorting in general. So I would think what ever improvements or >>alternatives needs to be careful not to slow down existing sorting ca

Re: Suggestion for (re)try statement

2005-10-28 Thread Grant Edwards
On 2005-10-27, Sori Schwimmer <[EMAIL PROTECTED]> wrote: > Hi, > > I think that would be useful to have an improved > version of the "try" statement, as follows: > > try(retrys=0,timeout=0): > # things to try > except: > # what to do if failed > > and having the following semantic: > > for i in

Re: How to translate python into C

2005-10-28 Thread Szabolcs Nagy
python script crashed and you want to debug it? if no trace back provided with the line number where the exception raised, then the crash caused by an extension module (most likely written in C), i don't know howto debug it, but at least you can find the place where the crash occures by adding lot

Re: Would there be support for a more general cmp/__cmp__

2005-10-28 Thread Christopher Subich
Antoon Pardon wrote: > If you are concerned about sorting times, I think you should > be more concerned about Guido's idea of doing away with __cmp__. > Sure __lt__ is faster. But in a number of cases writing __cmp__ > is of the same complexity as writing __lt__. So if you then > need a __lt__, __l

Re: Microsoft Hatred FAQ

2005-10-28 Thread Terry Hancock
Okay, I admit I'm wasting time answering this stupid thread, but what the hey, what's usenet without a flame war now and then. ;-) Into the fray ... On Thursday 27 October 2005 05:17 pm, David Schwartz wrote: > No. I have never received a dime from Microsoft, either directly or > indirectly.

Opaque documentation

2005-10-28 Thread egbert
Once in a while you come acros aline of documentation that you have to, or that invites you to, read it again. This is what I found in PyGTK: The set_screen method sets the 'screen" property to the gtk.gdk.Screen specified by screen. The "screen" property contains the screen that the

Re: Microsoft Hatred FAQ

2005-10-28 Thread David Blomstrom
"Everytime someone compares MS's behavior with some less controversial criminal behavior, you act like they accused MS of holding people up at gunpoint." Screwing literally millions of consumers and taxpayers and holding entire schools hostage is far worse than holding up an individual at gunpoint

Is bytecode machine (in)dependent?

2005-10-28 Thread Robert McLay
I'm trying to understand bytecodes generated on different machines. I understand that the bytecodes can change between version. But since I'm told that .pyc files are version dependent but not machine dependent, I'm wondering why the bytecodes are machine dependent. my friend and I created this s

Re: Opaque documentation

2005-10-28 Thread Ben Sizer
egbert wrote: > Once in a while you come acros aline of documentation > that you have to, or that invites you to, read it again. > This is what I found in PyGTK: > > The set_screen method sets the 'screen" property to > the gtk.gdk.Screen specified by screen. The "screen" property > co

[ANNOUNCE] EVENTS, HUMOUR, BOOKS related to SOFTWARE DEVELOPMENT

2005-10-28 Thread newswire_4_developers
CONTENTS: ** EVENTS ** EUROPE ** ** BOOKS ** ** EVENTS ** USA ** ** CALL FOR SPEAKERS ** EUROPE ** CALL FOR SPEAKERS ** USA ** HUMOUR ** ** OTHER INFORMATION - MAGAZINES, WHITEPAPERS ... ** ** EVENTS ** EUROPE ** ** Enterprise Architect Confer

Re: Scanning a file

2005-10-28 Thread Paul Watson
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I want to scan a file byte for byte for occurences of the the four byte > pattern 0x0100. I've tried with this: > > # start > import sys > > numChars = 0 > startCode = 0 > count = 0 > > inputFile = sys.stdin > > while True: >ch =

Re: Is bytecode machine (in)dependent?

2005-10-28 Thread Tim Peters
[Robert McLay] > I'm trying to understand bytecodes generated on different machines. > I understand that the bytecodes can change between version. But since > I'm told that .pyc files are version dependent but not machine > dependent, I'm wondering why the bytecodes are machine dependent. They ar

Re: replace words

2005-10-28 Thread Scott David Daniels
Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > >>What is the way for replacing in a string from . to . the sentence? >>for example: >>"been .taken. it may be .left. there, >>even if the .live coals were not. cleared" >>I want to do this-> replace(\.(.*)\.,\.start (1) end\.) >>result: >>"been

SNMP

2005-10-28 Thread py
>From what I have seen Python does not come with an snmp module built in, can anyone suggest some other SNMP module (preferably one you have used/experienced)..I have googled and seen yapsnmp and pysnmp (which seem to be the two most active SNMP modules). Thanks -- http://mail.python.org/mailman

Re: SNMP

2005-10-28 Thread py
...also I am looking to work with windows, as well as linux. -- http://mail.python.org/mailman/listinfo/python-list

Re: xml-rpc - adodb - None type - DateTime type

2005-10-28 Thread infidel
> I can replace all None values with the string 'Null', there's no > problem, but I can't detect the DateTime type object I retrieve from > the database. > > I have something like this: > def xmlrpc_function(): > conn = adodb.NewADOConnection('postgres') > conn.Connect(host,user,password,da

Re: syntax question - if 1:print 'a';else:print 'b'

2005-10-28 Thread Christopher Subich
Steve Holden wrote: >> On Thu, 2005-10-27 at 14:00, Gregory Piñero wrote: >> >>> Not quite because if something(3) fails, I still want something(4) to >>> run. > Then the obvious extension: > > for i in range(20): >... > > but I get the idea that Gregory was thinking of different statement

tkinter blues (greens, reds, ...)

2005-10-28 Thread Sean McIlroy
hi all i recently wrote a script that implements a puzzle. the interface mostly consists of a bunch of colored disks on a tkinter canvas. the problem is that the disks change their colors in ways other than the way they're supposed to. it certainly isn't just a bug in my script, since i can someti

popen2

2005-10-28 Thread g.franzkowiak
I start a process in my application with popen2.popen3('MyOtherProcess'). That's ok, but what can I do if the other process is running ? Can I fetch some information and start with that ? gerd -- http://mail.python.org/mailman/listinfo/python-list

Re: How to translate python into C

2005-10-28 Thread Lawrence Oluyede
Il 2005-10-28, Johnny Lee <[EMAIL PROTECTED]> ha scritto: > Thanks, Szabolcs. In fact, I want to reproduce a crush on cygwin. I > used a session of python code to produce the crush, and want to > translate it into C and reproduce it. Is the tools provided by you help > with these issues? Of coz, I'

Re: Newbie question: string replace

2005-10-28 Thread [EMAIL PROTECTED]
Now it works: rex = re.compile(r'(^.*username *=[^"]*")([^"]*)(".*$)') for line in fileinput.input(FILE, inplace=1): m = rex.match(line) if m is not None: line = "%s%s%s\n" % (m.group(1), new_name, m.group(3)) print line But there is an extra line break after each line in F

Tkinter Frame Size

2005-10-28 Thread Tuvas
I'm tyring to set the size of the window that is opened when you open a Tkinter window, without much sucess. I have tried changing the heigth and width atributes, but it doesn't do anything. I tried using the grid_propagate command that I saw to use, but made the window even smaller... What can I d

Re: Tkinter Frame Size

2005-10-28 Thread James Stroud
On Friday 28 October 2005 10:38, Tuvas wrote: > I'm tyring to set the size of the window that is opened when you open a > Tkinter window, without much sucess. I have tried changing the heigth > and width atributes, but it doesn't do anything. I tried using the > grid_propagate command that I saw

Re: Scanning a file

2005-10-28 Thread James Stroud
On Friday 28 October 2005 06:29, Björn Lindström wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > f = open("filename", "rb") > > s = f.read() > > sub = "\x00\x00\x01\x00" > > count = s.count(sub) > > print count > > That's a lot of lines. This is a bit off topic, but I just can't stand

Why doesn't this work? :)

2005-10-28 Thread Jeremy Moles
Jumping right into the code (which should speak for itself): # --- try: # this will fail and be caught # below, w import foobar except ImportError, error: class foobar: @staticmethod def __getattr

Re: Tkinter Frame Size

2005-10-28 Thread Tuvas
Okay. I have alot of items that are put on the basic frame already, using a grid method. Will this change anything? -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter blues (greens, reds, ...)

2005-10-28 Thread Steve Holden
Sean McIlroy wrote: > hi all > > i recently wrote a script that implements a puzzle. the interface > mostly consists of a bunch of colored disks on a tkinter canvas. the > problem is that the disks change their colors in ways other than the > way they're supposed to. it certainly isn't just a bug

Re: Newbie question: string replace

2005-10-28 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Now it works: > rex = re.compile(r'(^.*username *=[^"]*")([^"]*)(".*$)') > for line in fileinput.input(FILE, inplace=1): > m = rex.match(line) > if m is not None: > line = "%s%s%s\n" % (m.group(1), new_name, m.group(3)) > print line > > But there

Re: Typing tutor help script needed, please

2005-10-28 Thread SPE - Stani's Python Editor
#---Input data #List of words; every word or sentence on one line #If from file: WORDS = open(fileName).readlines() WORDS = """\ Afrikaans Anna Bread red word bored python""".split('\n') #---Main program import re PATTERN = ['[^(%s)]+','[%s]+'] FILENAME= ['not_%s.txt','%s.txt']

Re: popen2

2005-10-28 Thread David Wahler
g.franzkowiak wrote: > I start a process in my application with popen2.popen3('MyOtherProcess'). > That's ok, but what can I do if the other process is running ? > Can I fetch some information and start with that ? > > gerd It's not clear what you're asking for. Could you please clarify? -- David

Re: SNMP

2005-10-28 Thread Larry Bates
py wrote: >>From what I have seen Python does not come with an snmp module built > in, can anyone suggest some other SNMP module (preferably one you have > used/experienced)..I have googled and seen yapsnmp and pysnmp (which > seem to be the two most active SNMP modules). > > Thanks > Google tu

Re: Scanning a file

2005-10-28 Thread Mike Meyer
Andrew McCarthy <[EMAIL PROTECTED]> writes: > On 2005-10-28, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> I'm now down to: >> >> f = open("filename", "rb") >> s = f.read() >> sub = "\x00\x00\x01\x00" >> count = s.count(sub) >> print count >> >> Which is quite fast. The only problems is that the

How do I sort these?

2005-10-28 Thread KraftDiner
I have two lists. I want to sort by a value in the first list and have the second list sorted as well... Any suggestions on how I should/could do this? -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 problem

2005-10-28 Thread John J. Lee
"Jeremy Martin" <[EMAIL PROTECTED]> writes: [...] > website. I originally just used urllib.urlopen and everything worked > fine on my Windows PC at work. I tried the same script at home on my > Fedora COre 3 box using python 2.4, and whenever I try to connect to > the site I get the (110, Connec

Re: Why doesn't this work? :)

2005-10-28 Thread Chris Lambacher
I think what you really want is: try: # this will fail and be caught # below, w import foobar except ImportError, error: class foobarclass: def __getattr__(*args, **kargs): return None foobar = foobarclass() print fo

Re: Typing tutor help script needed, please

2005-10-28 Thread Mike Meyer
"Throw" <[EMAIL PROTECTED]> writes: > G'day everyone! > > I would like to design typing tutor exercises for Afrikaans (and other > languages possibly). This is for a GPL project. For this, I need a > script that can extract words from a long list of words, based on which > letters those words co

Re: tkinter blues (greens, reds, ...)

2005-10-28 Thread Ron Adam
Steve Holden wrote: > Sean McIlroy wrote: > >> hi all >> >> i recently wrote a script that implements a puzzle. the interface >> mostly consists of a bunch of colored disks on a tkinter canvas. the >> problem is that the disks change their colors in ways other than the >> way they're supposed t

Re: Scanning a file

2005-10-28 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > I want to scan a file byte for byte for occurences of the the four byte > pattern 0x0100. data = sys.stdin.read() print data.count('\x00\x00\x01\x00') Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: OEM character set issue

2005-10-28 Thread Kent Johnson
Dennis Lee Bieber wrote: > On Fri, 28 Oct 2005 15:55:56 +0200, "Ladvánszky Károly" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >>On my hungarian Win2k, some of the accented characters of the file names >>appear incorrectly when Python is driven from the command line. Ho

Re: How do I sort these?

2005-10-28 Thread Steve Holden
KraftDiner wrote: > I have two lists. > I want to sort by a value in the first list and have the second list > sorted as well... Any suggestions on how I should/could do this? > >>> first = [1, 3, 5, 7, 9, 2, 4, 6, 8] >>> second = ['one', 'three', 'five', 'seven', 'nine', 'two', 'four', 'six',

Re: How do I sort these?

2005-10-28 Thread Diez B. Roggisch
KraftDiner wrote: > I have two lists. > I want to sort by a value in the first list and have the second list > sorted as well... Any suggestions on how I should/could do this? I guess you mean that you have two lists of same size where each index position pointing to corrsponding items - like two

Re: Opaque documentation

2005-10-28 Thread Mike Meyer
"Ben Sizer" <[EMAIL PROTECTED]> writes: > Documentation is often a problem with Python and its libraries, sadly. > The same almost certainly goes for most open source projects. You over-specified the last clause. It should say "most software projects." http://www.mired.

Re: Newbie question: string replace

2005-10-28 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Now it works: > rex = re.compile(r'(^.*username *=[^"]*")([^"]*)(".*$)') > for line in fileinput.input(FILE, inplace=1): > m = rex.match(line) > if m is not None: > line = "%s%s%s\n" % (m.group(1), new_name, m.group(3)) > pr

Re: Typing tutor help script needed, please

2005-10-28 Thread Anno Siegel
Throw <[EMAIL PROTECTED]> wrote in comp.lang.perl.misc: > > G'day everyone! > > I would like to design typing tutor exercises for Afrikaans (and other > languages possibly). This is for a GPL project. For this, I need a > script that can extract words from a long list of words, based on which >

Re: Typing tutor help script needed, please

2005-10-28 Thread RedGrittyBrick
> Throw wrote: >> I must be able to extract words which contain only >> certain letters (they need not contain all of those letters, >> but they may not contain any other letters). SPE - Stani's Python Editor wrote: > #---Input data > > #List of words; every word or sentence on one line > #

Re: Why doesn't this work? :)

2005-10-28 Thread Jeremy Moles
On Fri, 2005-10-28 at 14:50 -0400, Chris Lambacher wrote: > I think what you really want is: > > try: > # this will fail and be caught > # below, w > import foobar > > except ImportError, error: > class foobarclass: > def __getattr__(*args, **kargs): >

Re: Newbie question: string replace

2005-10-28 Thread [EMAIL PROTECTED]
hm...Is there a way to get rid of the newline in "print"? -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question: string replace

2005-10-28 Thread [EMAIL PROTECTED]
Got it, thanks all! -- http://mail.python.org/mailman/listinfo/python-list

Print to printer

2005-10-28 Thread avnit
I can't seem to figure out how to print with my printer using python. I'm using Mac OSX 10.4. I was thinking maybe something with applescript. Does anyone know? -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Hatred FAQ

2005-10-28 Thread David Schwartz
"Mike Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The quote about the mafia doesn't compare MS's actions to "actual use > of force". I'm sorry, that's just absurd. I won't speculate on what motivates you to engage in such crazy distortion. Of course the quote about

drag/move image from staticBitmap control?

2005-10-28 Thread James Hu
Hi, all gurus,   I have an application to show bitmap image on one wx.staticBitmap control area, I can display part of the image, or the whole image(detail is unclear), But I would like to use mouse to drag/move the image inside thewx.staticBitmap control when only part image on the scre

Re: Microsoft Hatred FAQ

2005-10-28 Thread David Schwartz
"Lasse Vågsæther Karlsen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ok, let me just make my opinion very clear on this and then I'll just > leave this thread altogether. > > I think you are comparing apples and oranges so whatever conclusion you > manage to draw from that i

? Pythoncard

2005-10-28 Thread LenS
I have created a small gui stub as follows using Pythoncard: c:\myhome lmsgui.py lmsgui.rsrc.py When I try to run I get the following error: (Errno2) no such file or directory lmsqui.rsrc.py I understand why I am getting the error the question is how do I fix this so it looks in the p

  1   2   >