Re: GUI apps in Windows with native widgets?

2007-06-18 Thread Tim Roberts
Gilles Ganault <[EMAIL PROTECTED]> wrote: > > I'd like to write a GUI app in Python exclusively for Windows. >Apparently, development of PythonWin has stopped a long time ago. I'm not sure why you would think so. The latest pywin32 release came out in September, and supports Python 2.2 thro

Re: Windows XMLRPC Service

2007-06-18 Thread half . italian
On Jun 18, 2:16 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 18 Jun 2007 00:25:25 -0300, <[EMAIL PROTECTED]> escribió: > > > > > > > I'm trying to serve up a simple XMLRPC server as a windows service. I > > got it to run properly, I'm just not sure how to stop it properly. > > Most

How do I trap errors in win32com.client?

2007-06-18 Thread Ramdas
How do I trap errors from win32com.client. I have tried the com_error classes from pywintypes and pythoncom sub modules. It is not catching for all cases. Is there any docs available? -- http://mail.python.org/mailman/listinfo/python-list

Re: HTMLParser.HTMLParseError: EOF in middle of construct

2007-06-18 Thread Stefan Behnel
Sergio Monteiro Basto wrote: > Can someone explain me, what is wrong with this site ? > > python linkExtractor3.py http://www.noticiasdeaveiro.pt > test > > HTMLParser.HTMLParseError: EOF in middle of construct, at line 1173, > column 1 > > at line 1173 of test file is perfectly normal . > > I

Re: Do U have anything to share with this students

2007-06-18 Thread Evan Klitzke
On 6/18/07, Stephen Cowell <[EMAIL PROTECTED]> wrote: > Are you a solipsist? I am what John Galt would call > a 'non-absolutist'... *never* say something's impossible, > there is a non-zero probability of *anything* happening. Because it's impossible for something to be impossible, right? ;-) --

Re: Does altering a private member decouple the property's value?

2007-06-18 Thread Jay Loden
Jay Loden wrote: > Can you elaborate (or just point me to a good doc) on what > you mean by an "old style" class versus the new style? I > learned Python (well, am still learning) from an older book, > and I just want to make sure that I'm using the preferred method. Answering my own question,

Re: sizeof() in python

2007-06-18 Thread Gabriel Genellina
En Tue, 19 Jun 2007 00:20:02 -0300, Alvin Delagon <[EMAIL PROTECTED]> escribió: > Is there a way to know the size of data in python? Like a sizeof feature > in > C? I need this because I have to make a python application that will send > packets at 1-2 kilobytes/sec via UDP. Thank you in advan

Re: HTMLParser.HTMLParseError: EOF in middle of construct

2007-06-18 Thread Gabriel Genellina
En Mon, 18 Jun 2007 16:38:18 -0300, Sergio Monteiro Basto <[EMAIL PROTECTED]> escribió: > Can someone explain me, what is wrong with this site ? > > python linkExtractor3.py http://www.noticiasdeaveiro.pt > test > > HTMLParser.HTMLParseError: EOF in middle of construct, at line 1173, > column 1

Re: Does altering a private member decouple the property's value?

2007-06-18 Thread Jay Loden
Alex Martelli wrote: > > class a_class: > > This is ALL of the problem: you're using a legacy (old-style) class, and > properties (particularly setters) don't work right on its instances (and > cannot, for backwards compatibility: legacy classes exist exclusively to > keep backwards compatibi

Re: Does altering a private member decouple the property's value?

2007-06-18 Thread Alex Martelli
Ethan Kennerly <[EMAIL PROTECTED]> wrote: ... > There are a lot of Python mailing lists. I hope this is an appropriate one > for a question on properties. yep, it's a fine one. > But a gotcha bit me in the behavior of properties that I didn't expect. > If another function accesses an underlyi

sizeof() in python

2007-06-18 Thread Alvin Delagon
Quick question: Is there a way to know the size of data in python? Like a sizeof feature in C? I need this because I have to make a python application that will send packets at 1-2 kilobytes/sec via UDP. Thank you in advance guys. -- http://mail.python.org/mailman/listinfo/python-list

Re: Trivial string substitution/parser

2007-06-18 Thread Graham Breed
Duncan Booth wote: > Also, of course, vars just needs to be something which quacks like a dict: > it can do whatever it needs to do such as looking up a database or querying > a server to generate the value only when it needs it, or even evaluating > the name as an expression; in the OP's case it

Does altering a private member decouple the property's value?

2007-06-18 Thread Ethan Kennerly
Hello, There are a lot of Python mailing lists. I hope this is an appropriate one for a question on properties. I am relatively inexperienced user of Python. I came to it to prototype concepts for videogames. Having programmed in C, scripted in Unix shells, and scripted in a number of proprie

Re: MI5 Persecution: Goldfish and Piranha 29/9/95 (5104)

2007-06-18 Thread John W. Kennedy
Mike wrote: > And this is here because ??? He's a broadband-spamming mental case. Plonk him and move on. -- John W. Kennedy If Bill Gates believes in "intelligent design", why can't he apply it to Windows? -- http://mail.python.org/mailman/listinfo/python-list

Re: getting the size of an object

2007-06-18 Thread Gabriel Genellina
En Mon, 18 Jun 2007 16:48:36 -0300, filox <[EMAIL PROTECTED]> escribió: > "Brett Hoerner" <[EMAIL PROTECTED]> wrote in message >> Although I have the feeling you mean "how many bytes does this object >> take in memory" - and I believe the short answer is no. > > is there a long answer? what i wa

Re: GUI apps in Windows with native widgets?

2007-06-18 Thread Michael Torrie
On Tue, 2007-06-19 at 04:13 +0200, Gilles Ganault wrote: > Hello > > I'd like to write a GUI app in Python exclusively for Windows. > Apparently, development of PythonWin has stopped a long time ago. > > Is there another thin wrapper to write apps in Windows? I'd rather not > have to ship e

GUI apps in Windows with native widgets?

2007-06-18 Thread Gilles Ganault
Hello I'd like to write a GUI app in Python exclusively for Windows. Apparently, development of PythonWin has stopped a long time ago. Is there another thin wrapper to write apps in Windows? I'd rather not have to ship eg. WxWidgets, GTK+, or QT. Thank you. -- http://mail.python.org/mai

Re: avoid script running twice

2007-06-18 Thread Gabriel Genellina
En Mon, 18 Jun 2007 16:30:05 -0300, Nick Craig-Wood <[EMAIL PROTECTED]> escribió: > Tim Williams <[EMAIL PROTECTED]> wrote: >> You can also do this by holding a file open in write mode until the >> script has finished. >> >>try: >> open('lock.txt','w') >> my_scr

Re: List sequential initialization

2007-06-18 Thread Steve Holden
Chris Mellon wrote: > On 6/12/07, HMS Surprise <[EMAIL PROTECTED]> wrote: >> Thanks for the explaination. It didn't seem natural and from the >> tutorial I read: >> >> A value can be assigned to several variables simultaneously: >> >> >>> x = y = z = 0 # Zero x, y and z >> >> >> Maybe I in

Re: The Modernization of Emacs

2007-06-18 Thread Galen Boyer
On Mon, 18 Jun 2007, [EMAIL PROTECTED] wrote: > The problem with this line of thinking is that it aims to make Emacs > appeal to people -- I think it is rather the other way around. > Certain people appeal to Emacs: certain kinds of people like Emacs > and the way it is set up, and they change it

Re: cStringIO unicode weirdness

2007-06-18 Thread Paul Rubin
Josiah Carlson <[EMAIL PROTECTED]> writes: > You would be wrong. The behavior of StringIO and cStringIO are > different under certain circumstances, and those differences are > intended. Among them is when they are confronted with unicode, as you > saw. Another is when provided with an initializ

Re: Do U have anything to share with this students

2007-06-18 Thread RichL
"Stephen Cowell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Scott en Aztlán" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > "Stephen Cowell" <[EMAIL PROTECTED]> said in misc.transport.road: > > > >>> Hope you're protected against malware. > >> > >>Yes, the l

Re: Efficient way of generating original alphabetic strings like unix file "split"

2007-06-18 Thread py_genetic
On Jun 14, 3:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jun 14, 4:39 pm, py_genetic <[EMAIL PROTECTED]> wrote: > > > > You didn't try hard enough. :) > > > >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465 > > > > -- > > > HTH, > > > Rob > > > Thanks Rob, "permutation"

Re: Python and (n)curses

2007-06-18 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I need to develop a cross-platform text-mode application. I would like > to do it in Python and I would like to use a mature text-mode library > for the UI stuff. > > The obvious choice, I thought, was ncurses. But as far as I can tell, > it is not available for Python o

Re: cStringIO unicode weirdness

2007-06-18 Thread Josiah Carlson
Paul Rubin wrote: > Python 2.5 (r25:51908, Oct 6 2006, 15:24:43) > [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import StringIO, cStringIO > >>> StringIO.StringIO('a').getvalu

Re: Do U have anything to share with this students

2007-06-18 Thread Stephen Cowell
"Scott en Aztlán" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Stephen Cowell" <[EMAIL PROTECTED]> said in misc.transport.road: > >>> Hope you're protected against malware. >> >>Yes, the link probably did what it was supposed to, >>just not what you thought it would do. Please,

Python and (n)curses

2007-06-18 Thread [EMAIL PROTECTED]
I need to develop a cross-platform text-mode application. I would like to do it in Python and I would like to use a mature text-mode library for the UI stuff. The obvious choice, I thought, was ncurses. But as far as I can tell, it is not available for Python on Windows? Is there a workaround? Or

Re: getting the size of an object

2007-06-18 Thread John Machin
On Jun 19, 9:00 am, 7stud <[EMAIL PROTECTED]> wrote: > On Jun 18, 10:07 am, "filox" <[EMAIL PROTECTED]> wrote: > > > is there a way to find out the size of an object in Python? e.g., how could > > i get the size of a list or a tuple? > > > -- > > You're never too young to have a Vietnam flashback >

Re: fetching text from the screen

2007-06-18 Thread Gabriel Genellina
En Mon, 18 Jun 2007 09:13:16 -0300, Juergen Kareta <[EMAIL PROTECTED]> escribió: > I'm thinking about a python script which fetch some text from the screen > independent of what application provides the text on the screen. In this > regard it should be similar to the babylon software: www.babylo

Re: Making static dicts?

2007-06-18 Thread Steven D'Aprano
On Mon, 18 Jun 2007 21:46:23 +0100, Ognjen Bezanov wrote: > Hello! > > Just to ask, is it possible to make a static dictionary in python. So > that the keys in the dictionary cannot be removed, changed or new ones > added, but the value pairs can. > > Is this possible with python? I'm sure i

Re: cStringIO unicode weirdness

2007-06-18 Thread John Machin
On Jun 19, 8:56 am, Paul Rubin wrote: > Python 2.5 (r25:51908, Oct 6 2006, 15:24:43) > [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import StringIO, cSt

Re: getting the size of an object

2007-06-18 Thread 7stud
On Jun 18, 10:07 am, "filox" <[EMAIL PROTECTED]> wrote: > is there a way to find out the size of an object in Python? e.g., how could > i get the size of a list or a tuple? > > -- > You're never too young to have a Vietnam flashback You can use the struct module to find the size in bytes: imp

cStringIO unicode weirdness

2007-06-18 Thread Paul Rubin
Python 2.5 (r25:51908, Oct 6 2006, 15:24:43) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import StringIO, cStringIO >>> StringIO.StringIO('a').getvalue() 'a' >>> cStringI

Re: getting the size of an object

2007-06-18 Thread Lenard Lindstrom
filox wrote: > "Brett Hoerner" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> On Jun 18, 11:07 am, "filox" <[EMAIL PROTECTED]> wrote: >>> is there a way to find out the size of an object in Python? e.g., how >>> could >>> i get the size of a list or a tuple? >> "Size" can mean a

I found i great site for it!!!

2007-06-18 Thread CW
http://www.bestpcbackup.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Making static dicts?

2007-06-18 Thread Matimus
On Jun 18, 1:46 pm, Ognjen Bezanov <[EMAIL PROTECTED]> wrote: > Hello! > > Just to ask, is it possible to make a static dictionary in python. So > that the keys in the dictionary cannot be removed, changed or new ones > added, but the value pairs can. > > Is this possible with python? > > thanks, >

Re: avoid script running twice

2007-06-18 Thread Nick Craig-Wood
Tim Williams <[EMAIL PROTECTED]> wrote: > On 18/06/07, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > On Windows the open-a-file-for-writing method works well, but as *nix > doesn't work the same way then maybe the socket solution is the best > cross-platform option. Actually you could combine y

Re: avoid script running twice

2007-06-18 Thread Nick Craig-Wood
Jeff McNeil <[EMAIL PROTECTED]> wrote: > I've got a rather large log processing job here that has the same > requirement. I process and sort Apache logs from an 8-way cluster. I > sort and calculate statistics in 15-minute batch jobs. Only one copy > should run at once. > > I open a file and

Re: A patch to support L.count(value, cmp=None, key=None)

2007-06-18 Thread John Machin
On Jun 19, 5:17 am, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > > persons.count("olle", key = attergetter("name")) > > is longer and just barely more readable than > > sum(1 for x in persons if x.name == "olle")) > The OP's proposal seems to have a very narrow focus, whereas the generator a

Re: getting the size of an object

2007-06-18 Thread Brett Hoerner
On Jun 18, 2:48 pm, "filox" <[EMAIL PROTECTED]> wrote: > is there a long answer? what i want is to find out the number of bytes the > object takes up in memory (during runtime). since python has a lot of > introspection mechanisms i thought that should be no problem... There isn't an automatic way

Re: using Mac OS X CoreGraphics via ctypes

2007-06-18 Thread Richard Jones
Daniel wrote: > Thanks Diez. I'll try that if I decide to keep going with ctypes. I > got a bit further but had some problems with memory management (i.e. > retaining and releasing object references). It seemed like Python/ > ctypes was accessing referenced objects after I had released them, > whic

Re: XMLRPC and SSL

2007-06-18 Thread Martin v. Löwis
Chaz Ginger schrieb: > I have a web service that I built and it requires using SSL. I have > found a few examples of clients using SSL but none that allow me to > change the client's certificate or the chain of certificates the client > will use to authenticate the server. > > I was wondering if a

Re: passing arguments to tcpserver classes

2007-06-18 Thread Eric Spaulding
Great -- thanks! (and also to J. Ezequiel). Mark T wrote: "Eric Spaulding" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Is there an easy way to pass arguments to a handler class that is used by the standard TCPServer? normally --> srvr =SocketServer.TCPServer(('',port_num),

Re: avoid script running twice

2007-06-18 Thread Jeff McNeil
Note that in real life, the script exits cleanly if another copy is running... On 6/18/07, Jeff McNeil <[EMAIL PROTECTED]> wrote: > I've got a rather large log processing job here that has the same > requirement. I process and sort Apache logs from an 8-way cluster. I > sort and calculate statist

Re: avoid script running twice

2007-06-18 Thread Jeff McNeil
I've got a rather large log processing job here that has the same requirement. I process and sort Apache logs from an 8-way cluster. I sort and calculate statistics in 15-minute batch jobs. Only one copy should run at once. I open a file and lock it via something like this: import fcntl fhandle

Re: avoid script running twice

2007-06-18 Thread David Wahler
On 6/18/07, Robin Becker <[EMAIL PROTECTED]> wrote: > Evan Klitzke wrote: > > Another method that you can use is to open up a socket on some > > predetermined port (presumably above 1024), and then have your program > > try to connect to that port and "talk" to the other program to > > determine wh

Re: csv search and print

2007-06-18 Thread Sergio Monteiro Basto
On Mon, 2007-06-18 at 13:11 -0700, John Machin wrote: > On Jun 19, 4:12 am, [EMAIL PROTECTED] wrote: > > I have a csv file containing lot of rows & columns. I wanted to search thru > > the > > heading for each column for a string and then print all the headings and the > > corresponding rows if a

Making static dicts?

2007-06-18 Thread Ognjen Bezanov
Hello! Just to ask, is it possible to make a static dictionary in python. So that the keys in the dictionary cannot be removed, changed or new ones added, but the value pairs can. Is this possible with python? thanks, Ognjen. -- http://mail.python.org/mailman/listinfo/python-list

Re: csv search and print

2007-06-18 Thread John Machin
On Jun 19, 4:12 am, [EMAIL PROTECTED] wrote: > I have a csv file containing lot of rows & columns. I wanted to search thru > the > heading for each column for a string and then print all the headings and the > corresponding rows if a match is found. > > Any advise? 1. Clarify your requirements: "

Re: getting the size of an object

2007-06-18 Thread filox
"Brett Hoerner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Jun 18, 11:07 am, "filox" <[EMAIL PROTECTED]> wrote: >> is there a way to find out the size of an object in Python? e.g., how >> could >> i get the size of a list or a tuple? > > "Size" can mean a lot of things, > >

Re: avoid script running twice

2007-06-18 Thread Tim Williams
On 18/06/07, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Tim Williams <[EMAIL PROTECTED]> wrote: > > You can also do this by holding a file open in write mode until the > > script has finished. > > > >try: > > open('lock.txt','w') > > my_script() > > except:

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-18 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > |>oug writes: >> Scheme has a powerful syntax extension mechanism > I did not and do not see this as relevant to the main points of my > summary above. Python has powerful extension mechanisms too, but > comparing the two languages on this basis is a

Re: Memory problem with Python

2007-06-18 Thread Josiah Carlson
Squzer Crawler wrote: > On Jun 18, 11:06 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> On Jun 17, 8:51 pm, Squzer Crawler <[EMAIL PROTECTED]> wrote: >> >>> i am developing distributed environment in my college using Python. I >>> am using therads in client for downloading wepages. Even thou

HTMLParser.HTMLParseError: EOF in middle of construct

2007-06-18 Thread Sergio Monteiro Basto
Hi, Can someone explain me, what is wrong with this site ? python linkExtractor3.py http://www.noticiasdeaveiro.pt > test HTMLParser.HTMLParseError: EOF in middle of construct, at line 1173, column 1 at line 1173 of test file is perfectly normal . I like to know what I have to clean up before p

Re: avoid script running twice

2007-06-18 Thread Nick Craig-Wood
Robin Becker <[EMAIL PROTECTED]> wrote: > I looked at the temporary files idea, but I'm not certain about the exact > details. Normally your create a file and then remove it whilst keeping the > file > handle; that allows your program to write to it whilst guaranteeing that it > will > van

Re: avoid script running twice

2007-06-18 Thread Nick Craig-Wood
Tim Williams <[EMAIL PROTECTED]> wrote: > You can also do this by holding a file open in write mode until the > script has finished. > >try: > open('lock.txt','w') > my_script() > except: >#print script is already running That only works under w

Re: A patch to support L.count(value, cmp=None, key=None)

2007-06-18 Thread BJörn Lindqvist
> I patched Objects/listobject.c to support > L.count(value, cmp=None, key=None). > I tested it with the same script above by replacing slist > with built-in list. It worked correctly with this small > test. The patch is below (126 lines, I hope that's not Great! If you want this change includ

Re: avoid script running twice

2007-06-18 Thread Jay Loden
Robin Becker wrote: > I wish to prevent a python script from running twice; it's an hourly job, but > can take too long. > > My simplistic script looks like > > > ... > def main(): > fn = 'MARKER' > if os.path.isfile(fn): > log('%s: hourly job running already' % formatTi

Re: avoid script running twice

2007-06-18 Thread Tim Williams
On 18/06/07, Robin Becker <[EMAIL PROTECTED]> wrote: > Wildemar Wildenburger wrote: > > Robin Becker wrote: > . > > > > Well I can think of a dumb way: create a temporary file during the > > transaction and have your script check for that before running its main > > body. > > > > > > I thin

Re: Parsing HTML, extracting text and changing attributes.

2007-06-18 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > I see there is a couple of tools I could use, and I also heard of > sgmllib and htmllib. So now there is lxml, Beautiful soup, sgmllib, > htmllib ... > > Is there any of those tools that does the job I need to do more easily > and what should I use? Maybe a combination o

Re: How to get existing frames in non-current thread?

2007-06-18 Thread Fabio Zadrozny
> > Thanks a lot... I guess I'll have to find another way for versions before > 2.5 ;-) The original idea came from but it uses a compiled C extension, yes. The code is really small and you should not have problems compiling it...

Re: suggestion: recursive collections.defaultdict

2007-06-18 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > It seems like > > x = defaultdict(defaultdict(list)) > > should do the obvious, but it doesn't. It *does* the obvious. Parenthesis after a name means: call this object *now*. Any other behavior wouldn't be obvious. Ciao, Marc 'Bl

Re: avoid script running twice

2007-06-18 Thread Evan Klitzke
On 6/18/07, Robin Becker <[EMAIL PROTECTED]> wrote: > Evan Klitzke wrote: > > > > > > Another method that you can use is to open up a socket on some > > predetermined port (presumably above 1024), and then have your program > > try to connect to that port and "talk" to the other program to

Re: BeautifulSoup - extract the

2007-06-18 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, gcmartijn wrote: > I'm trying to extract something like this: > > codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/ > swflash.cab#version=7,0,19,0" width=640 height=400> > > > http://www.macromedia.com/go/ > getflashplayer type=application/x-shockwave-f

Re: Parsing HTML, extracting text and changing attributes.

2007-06-18 Thread sebzzz
I see there is a couple of tools I could use, and I also heard of sgmllib and htmllib. So now there is lxml, Beautiful soup, sgmllib, htmllib ... Is there any of those tools that does the job I need to do more easily and what should I use? Maybe a combination of those tools, which one is better fo

BeautifulSoup - extract the

2007-06-18 Thread gcmartijn
I'm trying to extract something like this: http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=7,0,19,0" width=640 height=400> http://www.macromedia.com/go/ getflashplayer type=application/x-shockwave-flash width=640 height=400 bgcolor=#00 scale= showall> I d

Re: Line Wrapping

2007-06-18 Thread Evan Klitzke
On 6/18/07, TeroV <[EMAIL PROTECTED]> wrote: > Evan Klitzke wrote: > > All, > > > > Mail messages should be wrapped at 78 characters (as suggested in RFC > > 2822). I want my python batch scripts/cron jobs to enforce this > > behavior, and format the mail that is sent out so that newline > > charac

Re: Line Wrapping

2007-06-18 Thread TeroV
Evan Klitzke wrote: > All, > > Mail messages should be wrapped at 78 characters (as suggested in RFC > 2822). I want my python batch scripts/cron jobs to enforce this > behavior, and format the mail that is sent out so that newline > characters are inserted as appropriate to keep line lengths at 7

Re: avoid script running twice

2007-06-18 Thread Robin Becker
Wildemar Wildenburger wrote: > Robin Becker wrote: > > Well I can think of a dumb way: create a temporary file during the > transaction and have your script check for that before running its main > body. > > > I think thats the most hassle free way of doing it. > /W I looked at the te

Re: The Modernization of Emacs

2007-06-18 Thread Hal Vaughan
Joel J. Adamson wrote: > Xah Lee <[EMAIL PROTECTED]> writes: > >> >> SIMPLE CHANGES >> >> In the following, i describe some critical changes that are also very >> easy to fix in emacs. If emacs officially adopt these changes, i think >> it will make a lot

csv search and print

2007-06-18 Thread axjacob
I have a csv file containing lot of rows & columns. I wanted to search thru the heading for each column for a string and then print all the headings and the corresponding rows if a match is found. Any advise? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Line Wrapping

2007-06-18 Thread Evan Klitzke
All, Mail messages should be wrapped at 78 characters (as suggested in RFC 2822). I want my python batch scripts/cron jobs to enforce this behavior, and format the mail that is sent out so that newline characters are inserted as appropriate to keep line lengths at 78 characters or less. I wrote a

Re: Thunderbird access to this newsgroup

2007-06-18 Thread Steve Holden
Ben Finney wrote: > Rostfrei <[EMAIL PROTECTED]> writes: > >> What is the news server for this >> newsgroup. > > Usenet newsgroups are redistributed over many servers worldwide. > > http://en.wikipedia.org/wiki/Usenet> > >> If I ping comp.lang.python it is not resolved. > > That's right. I

Re: avoid script running twice

2007-06-18 Thread Robin Becker
Evan Klitzke wrote: > > Another method that you can use is to open up a socket on some > predetermined port (presumably above 1024), and then have your program > try to connect to that port and "talk" to the other program to > determine whether or not to run (or whether to do some of the

Re: copy locked files

2007-06-18 Thread Jay Loden
Adam Pletcher wrote: > Do you mean files marked in-use by the OS, like DLLs used by an open > application? > > There shouldn't be anything preventing you from copying in-use files, or > even read-only files if that's what you meant: > > import shutil > shutil.copy('C:\\my_application\\test.

Re: avoid script running twice

2007-06-18 Thread Evan Klitzke
On 6/18/07, Tim Williams <[EMAIL PROTECTED]> wrote: > On 18/06/07, Evan Klitzke <[EMAIL PROTECTED]> wrote: > > On 6/18/07, Robin Becker <[EMAIL PROTECTED]> wrote: > > > I wish to prevent a python script from running twice; it's an hourly job, > > > but > > > can take too long. > > > > > > My simpl

IPV6 Fatal Error

2007-06-18 Thread Tim Graber
Hello. I am trying to install version 2.5.1 for the first time on our Solaris 10 server (64 bit). When I execute #./config as root user, I get the following error: checking gettaddrinfo bug... buggy Fatal: You must get wroking getaddrinfo() function. or you can specify "--disable-ip

A patch to support L.count(value, cmp=None, key=None)

2007-06-18 Thread Ping
Hi, I patched Objects/listobject.c to support L.count(value, cmp=None, key=None). I tested it with the same script above by replacing slist with built-in list. It worked correctly with this small test. The patch is below (126 lines, I hope that's not too big to be pasted here). This is the fi

Re: avoid script running twice

2007-06-18 Thread Tim Williams
On 18/06/07, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Robin Becker wrote: > > I wish to prevent a python script from running twice; it's an hourly job, > > but > > can take too long. > > > > [snip] > > but it occurs to me that I might be killed with prejudice during the long > > running

Re: Parsing HTML, extracting text and changing attributes.

2007-06-18 Thread Jay Loden
Stefan Behnel wrote: > Jay Loden wrote: >> Someone else mentioned lxml but as I understand it lxml will only work if >> it's valid XHTML that they're working with. > > No, it was meant as the OP requested. It even has a very good parser from > broken HTML. > > http://codespeak.net/lxml/dev/parsi

Re: Parsing HTML, extracting text and changing attributes.

2007-06-18 Thread Jay Loden
Stefan Behnel wrote: > Jay Loden wrote: >> Someone else mentioned lxml but as I understand it lxml will only work if >> it's valid XHTML that they're working with. > > No, it was meant as the OP requested. It even has a very good parser from > broken HTML. > > http://codespeak.net/lxml/dev/parsi

Re: avoid script running twice

2007-06-18 Thread Tim Williams
On 18/06/07, Evan Klitzke <[EMAIL PROTECTED]> wrote: > On 6/18/07, Robin Becker <[EMAIL PROTECTED]> wrote: > > I wish to prevent a python script from running twice; it's an hourly job, > > but > > can take too long. > > > > My simplistic script looks like > > > > > > ... > > def main(): > >

Re: avoid script running twice

2007-06-18 Thread Wildemar Wildenburger
Robin Becker wrote: > I wish to prevent a python script from running twice; it's an hourly job, but > can take too long. > > [snip] > but it occurs to me that I might be killed with prejudice during the long > running work(). Is there a smart way to avoid running simultaneously. > Well I can

Re: avoid script running twice

2007-06-18 Thread Evan Klitzke
On 6/18/07, Robin Becker <[EMAIL PROTECTED]> wrote: > I wish to prevent a python script from running twice; it's an hourly job, but > can take too long. > > My simplistic script looks like > > > ... > def main(): > fn = 'MARKER' > if os.path.isfile(fn): > log('%s: hourly job

Re: copy locked files

2007-06-18 Thread rubbishemail
Hi Adam, On 18 Jun., 18:41, "Adam Pletcher" <[EMAIL PROTECTED]> wrote: > Do you mean files marked in-use by the OS, like DLLs used by an open > application? I dont know the exact name, but some programs totally lock the files, like Visual Studio shutil.copy('C:\\a\\test\\test.ncb','C:\\b\test.n

Re: Parsing HTML, extracting text and changing attributes.

2007-06-18 Thread Stefan Behnel
Jay Loden wrote: > Someone else mentioned lxml but as I understand it lxml will only work if > it's valid XHTML that they're working with. No, it was meant as the OP requested. It even has a very good parser from broken HTML. http://codespeak.net/lxml/dev/parsing.html#parsing-html Stefan -- htt

avoid script running twice

2007-06-18 Thread Robin Becker
I wish to prevent a python script from running twice; it's an hourly job, but can take too long. My simplistic script looks like ... def main(): fn = 'MARKER' if os.path.isfile(fn): log('%s: hourly job running already' % formatTime()) else: f = open(fn,'w')

suggestion: recursive collections.defaultdict

2007-06-18 Thread [EMAIL PROTECTED]
It seems like x = defaultdict(defaultdict(list)) should do the obvious, but it doesn't. This seems to work y = defaultdict(lambda: defaultdict(list)) though is a bit uglier. -- http://mail.python.org/mailman/listinfo/python-list

RE: copy locked files

2007-06-18 Thread Adam Pletcher
Do you mean files marked in-use by the OS, like DLLs used by an open application? There shouldn't be anything preventing you from copying in-use files, or even read-only files if that's what you meant: import shutil shutil.copy('C:\\my_application\\test.dll', 'C:\\new_folder\\test.dll') Alth

Re: Parsing HTML, extracting text and changing attributes.

2007-06-18 Thread Jay Loden
Neil Cerutti wrote: > You could get good results, and save yourself some effort, using > links or lynx with the command line options to dump page text to > a file. Python would still be needed to automate calling links or > lynx on all your documents. OP was looking for a way to parse out part of

Re: Matrix Multiplication

2007-06-18 Thread sturlamolden
On Jun 18, 11:20 am, Jeremy Sanders wrote: > > NumPy has a matrix type that overloads the * operator. > Just a tiny followup, which may be important unless you carefully read the > documentation. The "*" operator doesn't do matrix multiplication for normal > numpy arrays That's what I wrote: "

Re: getting the size of an object

2007-06-18 Thread Brett Hoerner
On Jun 18, 11:07 am, "filox" <[EMAIL PROTECTED]> wrote: > is there a way to find out the size of an object in Python? e.g., how could > i get the size of a list or a tuple? "Size" can mean a lot of things, len(my_list) len(my_tuple) Although I have the feeling you mean "how many bytes does this

Re: The Modernization of Emacs

2007-06-18 Thread Robin Becker
Joel J. Adamson wrote: > people aware of it; as soon as I became aware of Emacs (from reading > Wikipedia, ironically), I began using it and I knew I was stuck with > it. It's not even important for the survival of Emacs that it be more many others get stuck with a preferred editor/system/languag

getting the size of an object

2007-06-18 Thread filox
is there a way to find out the size of an object in Python? e.g., how could i get the size of a list or a tuple? -- You're never too young to have a Vietnam flashback -- http://mail.python.org/mailman/listinfo/python-list

Re: Custom wxPython Widget

2007-06-18 Thread kyosohma
On Jun 15, 10:24 pm, Jens Thiede <[EMAIL PROTECTED]> wrote: > What is the best source code to read? Any tips; suggestions? > > Thanks in advance > Jens Thiede I would recommend reading the wxPython demo source code. Also, this website has some custom widgets written in "pure wxPython", some of whi

Re: PyRun_String with Py_single_input to stdout?

2007-06-18 Thread [EMAIL PROTECTED]
I found a solution using sys.displayhook here: http://groups.google.com/group/comp.lang.python/browse_thread/thread/593cd28e568c32e1/1e0f930e7ac5ebb2?#1e0f930e7ac5ebb2 On Jun 18, 4:24 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 18 Jun 2007 01:45:38 -0300, [EMAIL PROTECTED] > <[EMA

Re: smtp server simulation using Python

2007-06-18 Thread Dave Borne
> I have a (web) development computer w/o an SMTP server and want to test > form generated e-mail using a dummy SMTP server that delivers the mail > message to a file, or better yet, to a text editor instead of actually > sending it. Here's a quick and dirty script I use this for email testing pur

Re: Do U have anything to share with this students

2007-06-18 Thread John Ashby
Josh Hill wrote: > On Sat, 16 Jun 2007 13:06:23 -, Milt > <[EMAIL PROTECTED]> wrote: > >>On Jun 15, 1:00?pm, [EMAIL PROTECTED] wrote: >>> This is a network of students. Find the people of your kind there >>> >>> http://tinyurl.com/33uvla >>> >>> Click and register to access millions of studen

Re: Parsing HTML, extracting text and changing attributes.

2007-06-18 Thread Neil Cerutti
On 2007-06-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I work at this company and we are re-building our website: http://caslt.org/. > The new website will be built by an external firm (I could do it > myself, but since I'm just the summer student worker...). Anyways, to > help them, they fi

Re: sqlite3 bug??

2007-06-18 Thread Hyuga
On Jun 18, 11:01 am, Hyuga <[EMAIL PROTECTED]> wrote: > In fact, I have code in which references to a > db connection are passed around, so I have to be careful about > explicitly closing the connection, lest it be in use by some other > method somewhere. > Hate to reply to myself, but I should cl

  1   2   >