PythonTidy 1.10

2007-01-19 Thread Chuck Rhode
PythonTidy cleans up, regularizes, and reformats the text of Python scripts. It is released under the GNU General Public License. Python scripts are usually so good looking that no beautification is required. However, from time to time, it may be necessary to alter the style to conform to

FlightFeather Social Networking Platform 0.2.8 (First Beta)

2007-01-19 Thread George Belotsky
FlightFeather's goal is social networking for everyone. This means that *anyone* should have a chance to run a *popular* social networking site -- on minimal hardware, and without wasting bandwidth. Release 0.2.8 is the first beta version of FlightFeather. This release also adds a facility for

Re: Pass 'this' to a python script in an extended application

2007-01-19 Thread Stou Sandalski
I figured it out. I just made my main class a singleton and it worked fine... it always works right after I post a message =) Stou Stou Sandalski wrote: Hi, I have an application consisting of a main C++ class (and other classes) stored inside a DLL. The application uses a small main

Re: Units of measurement

2007-01-19 Thread Tim Roberts
Paul Rubin http://[EMAIL PROTECTED] wrote: I'm sure this has been done before, but it just struck my fancy, an example of Python's emulating numeric types, inspired by the old Unix units utility, and the Frink language. ... # could include more units but you get the idea ... c =

Re: Is it possible to fasten the import of cgi?

2007-01-19 Thread Tim Roberts
Cecil Westerhof [EMAIL PROTECTED] wrote: I have a cgi-script dat uses the modules cgi, os, sys and time. Offcourse I can not time the time used to import time, but os and sys do not take more as a millisecond. My script itself takes 3 or 4 milliseconds. But importing cgi takes 95 milliseconds.

Re: How to read and write huge binary files

2007-01-19 Thread Tim Roberts
Lad [EMAIL PROTECTED] wrote: What is a good way to read binary data from HUGE file and write it to another file? How huge? I regularly process 100-megabyte MPEG files in Python, both by reading the whole thing in as a string, and by using mmap to map the file into memory. -- Tim Roberts,

Login Form

2007-01-19 Thread Ghirai
Hello python-list, I need to make a login form, if possible without cookies. Can anyone point me in the right direction? Or are there any examples? Thanks. -- Best regards, Ghirai. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyODBC Stored proc calling

2007-01-19 Thread king kikapu
No one is using pyodbc ?? :) -- http://mail.python.org/mailman/listinfo/python-list

error when import gtk.glade

2007-01-19 Thread Milad Rastian
hello when I import gtk.glade I got this error : Traceback (most recent call last): File MainWindow.py, line 20, in ? import gtk.glade ImportError: DLL load failed: The specified module could not be found. I setup gtk and when I create my interface in my code my gtk window open correctly

www.OutpatientSurgicare.com/video/

2007-01-19 Thread AwesomeMultimedia.com
www.OutpatientSurgicare.com/video/ Outpatient Doctors Surgery Center is committed to offering the healthcare the community needs. We offer patients a meaningful alternative to traditional surgery. This state-of-the-art outpatient surgery center, located in the heart of Orange County, at 10900

Re: Is it possible to fasten the import of cgi?

2007-01-19 Thread BJörn Lindqvist
On 1/18/07, Cecil Westerhof [EMAIL PROTECTED] wrote: I have a cgi-script dat uses the modules cgi, os, sys and time. Offcourse I can not time the time used to import time, but os and sys do not take more as a millisecond. My script itself takes 3 or 4 milliseconds. But importing cgi takes 95

Re: Why this script can work?

2007-01-19 Thread Diez B. Roggisch
Jm lists wrote: Please help with this script: class ShortInputException(Exception): '''A user-defined exception class.''' def __init__(self,length,atleast): Exception.__init__(self) self.length=length self.atleast=atleast

Re: Match 2 words in a line of file

2007-01-19 Thread harvey . thomas
Rickard Lindberg wrote: I see two potential problems with the non regex solutions. 1) Consider a line: foo (bar). When you split it you will only get two strings, as split by default only splits the string on white space characters. Thus 'bar' in words will return false, even though bar is

Re: Why this script can work?

2007-01-19 Thread Jm lists
Thanks for all the helps. I'm not habitual for this usage of 'else',other languages seem don't support this syntax. i.g,writting the codes below by Perl would get an error: # perl -le 'for $i (1..10){print $i} else{print finished}' syntax error at -e line 1, near }else Execution of -e aborted

Re: Match 2 words in a line of file

2007-01-19 Thread harvey . thomas
Rickard Lindberg wrote: I see two potential problems with the non regex solutions. 1) Consider a line: foo (bar). When you split it you will only get two strings, as split by default only splits the string on white space characters. Thus 'bar' in words will return false, even though bar is

Re: How to find out if another process is using a file

2007-01-19 Thread Tom Wright
js wrote: How about using lock? Let writing process locks the files before writing, and unlock after the job's done. Is locking mandatory or co-operative? I don't have any control over the process which is doing the writing, so if it's co-operative it's no good to me. If it's mandatory, then

Re: Match 2 words in a line of file

2007-01-19 Thread bearophileHUGS
Rickard Lindberg, yesterday I was sleepy and my solution was wrong. 2) If you have a line something like this: foobar hello then 'foo' in line will return true, even though foo is not a word (it is part of a word). Right. Now I think the best solution is to use __contains__ (in) to quickly

Re: selective logger disable/enable

2007-01-19 Thread Vinay Sajip
Gary Jefferson wrote: Suppose I have 3 modules that belong to a project, 'A', 'A.a' and 'B', and each module has its own logger, created with: module1logger = logging.getLogger('project.A') and module2logger = logging.getLogger('project.A.a') and module3logger =

Re: How to find out if another process is using a file

2007-01-19 Thread Diez B. Roggisch
Tom Wright wrote: js wrote: How about using lock? Let writing process locks the files before writing, and unlock after the job's done. Is locking mandatory or co-operative? I don't have any control over the process which is doing the writing, so if it's co-operative it's no good to me.

Re: Why this script can work?

2007-01-19 Thread Diez B. Roggisch
Jm lists wrote: Thanks for all the helps. I'm not habitual for this usage of 'else',other languages seem don't support this syntax. i.g,writting the codes below by Perl would get an error: I personally consider this part of python also somewhat obscure. But I just don't use it and don't

Re: Traversing the properties of a Class

2007-01-19 Thread Steven D'Aprano
On Thu, 18 Jan 2007 18:03:41 +, Neil Cerutti wrote: On 2007-01-18, EdG [EMAIL PROTECTED] wrote: For debugging purposes, I would like to traverse the class listing out all the properties. This is the first thing that came to mind. def show_properties(cls): for attr in dir(cls):

Re: How to find out if another process is using a file

2007-01-19 Thread Tom Wright
Jean-Paul Calderone wrote: A better solution is to name or place files which are begin written in a which is recognizable and only rename or move them to their final location when they have been completely written. For example, name files .new as they are being written. When they are fully

Re: Iterator length

2007-01-19 Thread Steven D'Aprano
On Thu, 18 Jan 2007 16:55:39 -0800, bearophileHUGS wrote: What's your point? Maybe you mean that it consumes the given iterator? I am aware of that, it's written in the function docstring too. But sometimes you don't need the elements of a given iterator, you just need to know how many

when format strings attack

2007-01-19 Thread [EMAIL PROTECTED]
http://www.ddj.com/184405774;jsessionid=BDDEMUGJOPXUMQSNDLQCKHSCJUNN2JVN I saw a warning from homeland security about this. I only comment on the because I am trying to use os.system('command1 arg') and it doesn't work but I do see examples with % that is borrowed from the c language. Seems

Re: Determining when a file is an Open Office Document

2007-01-19 Thread Steven D'Aprano
On Fri, 19 Jan 2007 12:22:04 +1100, Ben Finney wrote: tubby [EMAIL PROTECTED] writes: Silly question, but here goes... what's a good way to determine when a file is an Open Office document? I could look at the file extension, but it seems there would be a better way. Yes, the name of a

Standard streams

2007-01-19 Thread raghu
what is standard streams in case of python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard streams

2007-01-19 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], raghu wrote: what is standard streams in case of python? Do you mean `sys.stdin`, `sys.stdout` ans `sys.stderr`? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Why do I have to call del explicitly for com objects?

2007-01-19 Thread bg_ie
Hi, I'm creating objects in my python script belonging to a COM object which I dispatch using win32com.client.DispatchEx. Hence, dllhost.dll is the concerned process. The problem is that the objects destructor within the com object is not called if the object lives past a certain number of

Re: Iterator length

2007-01-19 Thread bearophileHUGS
Steven D'Aprano: s = aaabaabb from itertools import groupby print [(h,leniter(g)) for h,g in groupby(s)] s isn't an iterator. It's a sequence, a string, and an iterable, but not an iterator. If you look better you can see that I use the leniter() on g, not on s. g is the iterator

how to mimik a main() function to start a program with entry point?

2007-01-19 Thread krishnakant Mane
hello all. I have one simple query and may be that's to stupid to answer but I am not finding the answer any ways. I have a set of modules in my package and out if which one is my actual starting point to my entire program. say for example I have an entire database application ready and I want a

Re: variable scope

2007-01-19 Thread Bruno Desthuilliers
gonzlobo a écrit : ot Please keep this on clpy... /ot Sorry, but I don't understand. I *should* pass firstMsg to the function like I did (PID_MinMax(firstMsg)), correct? Yes. Then I should pass the variable back to the main loop by 'return firstMsg', correct? s/variable/value/ Yes, you

Re: How to find out if another process is using a file

2007-01-19 Thread Amit Khemka
Yes, that would work very neatly but I don't have any control over the writing process. I think the modification time route might be the best option, but thanks to all for their replies. Its not pythonic, but may be lsof on POSIX can be helpful: see:

Re: how to mimik a main() function to start a program with entry point?

2007-01-19 Thread sturlamolden
krishnakant Mane wrote: I have a set of modules in my package and out if which one is my actual starting point to my entire program. say for example I have an entire database application ready and I want a main (as in java or c) to initiate the program and may be bring up a login screen and

Re: how to mimik a main() function to start a program with entry point?

2007-01-19 Thread [EMAIL PROTECTED]
def main(): print Hello if __name__ == __main__: main() Simply verify __name__ and run any function from there. This will cause main() to be run if the script is run directly. I haven't used py2exe, so I'm not sure if it still applies. --Kevin krishnakant Mane wrote: hello all. I

Re: how to mimik a main() function to start a program with entry point?

2007-01-19 Thread Roland Puntaier
Hi, From a python module you could use subprocess and start the exe. Normally one must leave it to the OS to load a binary module, because there are certain things done during loading. Nevertheless the location of the entry point is coded in the binary file format (e.g. PE for windows or ELF

Re: Login Form

2007-01-19 Thread [EMAIL PROTECTED]
Ghirai wrote: Hello python-list, I need to make a login form, if possible without cookies. Can anyone point me in the right direction? Or are there any examples? Thanks. -- Best regards, Ghirai. You'd do pretty good using the 'cgi' module, which is documented at

PQueue and Python 2.5

2007-01-19 Thread Berteun Damman
Hello, Recently I was looking for a Priority Queue module, and I've found Pqueue by Andrew Snare [1]. When I use it with Python 2.4 everything works okay, at least on the two system I've tested it on (Debian based AMD 64) and OS PPC. However, when I use it with Python 2.5 - again on the same

Re: Would a Dutch speaker please check this wiki page please?

2007-01-19 Thread Hendrik van Rooyen
Martin P. Hellwig [EMAIL PROTECTED] wrote: Stef Mientki wrote: [EMAIL PROTECTED] wrote: Got a note about a new page on the Python Wiki: Wade == Wade McDaniel [EMAIL PROTECTED] writes: http://wiki.python.org/moin/Selcuk_Altun I suspect it's junk since it doesn't seem to

Re: How can I create a linked list in Python?

2007-01-19 Thread Hendrik van Rooyen
Jorgen Grahn [EMAIL PROTECTED] wrote: FWIW, I oppose the idea (paraphrased from further up the thread) that linked lists and other data structures are obsolete and dying concepts, obsoleted by Python and other modern languages. 99% of the time. a Python list is the right tool for the job,

Re: Wierd M2Crypto bug - phony peer did not return certificate error

2007-01-19 Thread Jean-Paul Calderone
On Fri, 12 Jan 2007 05:54:42 GMT, John Nagle [EMAIL PROTECTED] wrote: Heikki Toivonen wrote: [EMAIL PROTECTED] wrote: That's a problem for me. I need short timeouts; I'm accessing sites that might or might not have SSL support, and I need to quickly time out when there's no SSL server. You

Re: Why this script can work?

2007-01-19 Thread Gabriel Genellina
Jm lists [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] I'm not habitual for this usage of 'else',other languages seem don't support this syntax. i.g,writting the codes below by Perl would get an error: [[[censored example]]] If all languages had the same features, what

Re: PyMeld for html templates?

2007-01-19 Thread metaperl
Sean Schertell wrote: Of course I'm going to try them all but I wonder if anyone has any thoughts on PyMeld as a template system for churning out general websites? meld3 evolved from pymeld. I use meld3 - http://plope.com/software/meld3/ this whole style of templating is known as

Re: when format strings attack

2007-01-19 Thread Gabriel Genellina
[EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] http://www.ddj.com/184405774;jsessionid=BDDEMUGJOPXUMQSNDLQCKHSCJUNN2JVN I saw a warning from homeland security about this. I only comment on the because I am trying to use os.system('command1 arg') and it doesn't work but I

My first try using logger didn't work. Why?

2007-01-19 Thread CedricCicada
Greetings! I want to write messages into the Windows event log. I found sevicemanager, but the source is always Python Service, and I'd like to be a bit more descriptive. Poking around on the Internet revealed the existence of the logging module. It seems to have easily understood methods with

[ann] Appscript Installer 1.5 released

2007-01-19 Thread has
Announcing the release of Appscript Installer 1.5, containing all the latest appscript-related modules, documentation and tools: http://appscript.sourceforge.net/download.html Appscript enhances the Python scripting language (http://www.python.org) with robust, easy-to-use OS X application

Re: Iterator length

2007-01-19 Thread Steven D'Aprano
On Fri, 19 Jan 2007 05:04:01 -0800, bearophileHUGS wrote: Steven D'Aprano: s = aaabaabb from itertools import groupby print [(h,leniter(g)) for h,g in groupby(s)] s isn't an iterator. It's a sequence, a string, and an iterable, but not an iterator. If you look better you can

Re: when format strings attack

2007-01-19 Thread Nick Maclaren
In article [EMAIL PROTECTED], Gabriel Genellina [EMAIL PROTECTED] writes: | [EMAIL PROTECTED] escribió en el mensaje | news:[EMAIL PROTECTED] | | http://www.ddj.com/184405774;jsessionid=BDDEMUGJOPXUMQSNDLQCKHSCJUNN2JVN | | I saw a warning from homeland security about this. I only comment on

Re: My first try using logger didn't work. Why?

2007-01-19 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: Greetings! I want to write messages into the Windows event log. I found sevicemanager, but the source is always Python Service, and I'd like to be a bit more descriptive. Poking around on the Internet revealed the existence of the logging module. It seems to have

Re: Why do I have to call del explicitly for com objects?

2007-01-19 Thread Gabriel Genellina
[EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] I'm creating objects in my python script belonging to a COM object which I dispatch using win32com.client.DispatchEx. Hence, dllhost.dll is the concerned process. The problem is that the objects destructor within the com object

Re: PQueue and Python 2.5

2007-01-19 Thread Gabriel Genellina
Berteun Damman [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Recently I was looking for a Priority Queue module, and I've found Pqueue by Andrew Snare [1]. That appears to be rather ancient, from 1999. Is it a pure Python implementation or has some C code too? Python got in

Re: when format strings attack

2007-01-19 Thread Gabriel Genellina
Nick Maclaren [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] In article [EMAIL PROTECTED], Gabriel Genellina [EMAIL PROTECTED] writes: | | Pure Python programs are not affected, but a review of the C implementation | should be made to see if any (variant of) printf is used

Re: Match 2 words in a line of file

2007-01-19 Thread Daniel Klein
On 18 Jan 2007 18:54:59 -0800, Rickard Lindberg [EMAIL PROTECTED] wrote: I see two potential problems with the non regex solutions. 1) Consider a line: foo (bar). When you split it you will only get two strings, as split by default only splits the string on white space characters. Thus 'bar' in

Re: nsis and command-line argument

2007-01-19 Thread manouchk
manouchk wrote: Hi, is there a standart way to prepare a single exe with nsis that pass the command line to an exe created by py2exe on windows? py2exe allows to prepare an exe that get the command-line but needs some lib file so that it is not so elegant to ditribute. I tried a simple

Re: Is it possible to fasten the import of cgi?

2007-01-19 Thread Cecil Westerhof
BJörn Lindqvist wrote: On 1/18/07, Cecil Westerhof [EMAIL PROTECTED] wrote: I have a cgi-script dat uses the modules cgi, os, sys and time. Offcourse I can not time the time used to import time, but os and sys do not take more as a millisecond. My script itself takes 3 or 4 milliseconds. But

Re: Is it possible to fasten the import of cgi?

2007-01-19 Thread Cecil Westerhof
Tim Roberts wrote: Cecil Westerhof [EMAIL PROTECTED] wrote: I have a cgi-script dat uses the modules cgi, os, sys and time. Offcourse I can not time the time used to import time, but os and sys do not take more as a millisecond. My script itself takes 3 or 4 milliseconds. But importing cgi

Re: Is it possible to fasten the import of cgi?

2007-01-19 Thread Cecil Westerhof
Gabriel Genellina wrote: I'll try to explain better: the cgi *protocol* (I'm not talking about the cgi *module*) requires a *new* python process to be created on *each* request. Try to measure the time it takes to launch Python, that is, the time from when you type `python ENTER` on your

confused on python rpc with apache, is it possible?

2007-01-19 Thread krishnakant Mane
hello all. I will like to know if the following combination is possible. I have looked around on google and did not find any thing productive so bothering the list: sorry. I am developing a distributed application which will have 3 layers namely the thin client written in wxpython, an application

Re: Why do I have to call del explicitly for com objects?

2007-01-19 Thread bg_ie
Gabriel Genellina skrev: [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] I'm creating objects in my python script belonging to a COM object which I dispatch using win32com.client.DispatchEx. Hence, dllhost.dll is the concerned process. The problem is that the objects

Re: Asyncore select statement problem

2007-01-19 Thread JamesHoward
Thank you for the responses. I have learned considerably more about how Asyncore works because of it. The problem that I see is that Asyncore's poll function does not seem to be thread safe. From what I can tell, I am calling dispatcher.close() properly and the dispatchers are removed from

Re: confused on python rpc with apache, is it possible?

2007-01-19 Thread Diez B. Roggisch
krishnakant Mane wrote: hello all. I will like to know if the following combination is possible. I have looked around on google and did not find any thing productive so bothering the list: sorry. I am developing a distributed application which will have 3 layers namely the thin client

Re: More M2Crypto issues

2007-01-19 Thread John Nagle
Gabriel Genellina wrote: At Thursday 18/1/2007 04:41, John Nagle wrote: On a previous version of M2Crypto that line said: map()[self.ctx] = self, and that failed too (unhashable object, I think). I changed the class _ctxmap (the map() above returns an instance of it) to use str(key) in the

monitor the start and end of applications

2007-01-19 Thread awalter1
Hello, My purpose is to supervise (from a python program) the launch of some other programs (python or non python programs) as : I click on the button X and the pg X is launched ... I want also that my supervision be wake up when a pg has exited to check its status or something like that. I

Re: when format strings attack

2007-01-19 Thread John Zenger
Perhaps it is not as severe a security risk, but pure Python programs can run into similar problems if they don't check user input for % codes. Example: k = raw_input(Try to trick me: ) Try to trick me: How about %s this? j = User %s just entered: + k print j % John Traceback (most recent

Re: My first try using logger didn't work. Why?

2007-01-19 Thread CedricCicada
Beautiful! Thank you very much! One of the problems I was laboring under was that I did not know where to go to find the official documentation. Thanks for that link too! Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: when format strings attack

2007-01-19 Thread Steven D'Aprano
On Fri, 19 Jan 2007 03:51:08 -0800, [EMAIL PROTECTED] wrote: http://www.ddj.com/184405774;jsessionid=BDDEMUGJOPXUMQSNDLQCKHSCJUNN2JVN I saw a warning from homeland security about this. I only comment on the because I am trying to use os.system('command1 arg') and it doesn't work What do

Re: My first try using logger didn't work. Why?

2007-01-19 Thread CedricCicada
Vinay (or anybody else), Well, now that logging is working, how do I stop it from working? I'm developing in PythonWin. When I run my test script, I get one message. When I run it a second time, I get two, a third time gets me three, and so on. I feel like the Sorceror's Apprentice! Rob --

CHINESE TERRORISM 911 REPLAY Re: #Worldwide outcry follows China's sucessful test of a satellite killer

2007-01-19 Thread thermate
GO GET THE NEOCONS TO PUT SOME DEAD CHINESE STUDENTS IN A REMOTE PILOTED PLANES FLOWN INTO THE NEW WTC OWNED BY LARRY SILVERSTEIN WITH HEFTY INSURANCE BY SOME JAPANESE COMPANIES AND THEN DECLARE A WAR ON CHINESE TERROR . LAUGHING OUT LOUD 3027 Dead wrote:

Re: More M2Crypto issues

2007-01-19 Thread Heikki Toivonen
John Nagle wrote: I've been running M2Crypto successfully using Python 2.4 on Windows 2000, and now I'm trying to get it to work on Python 2.3.4 on Linux. Attempting to initialize a context results in Traceback (most recent call last): [...] map()[long(self.ctx)] = self

Re: My first try using logger didn't work. Why?

2007-01-19 Thread Gabriel Genellina
At Friday 19/1/2007 15:59, [EMAIL PROTECTED] wrote: One of the problems I was laboring under was that I did not know where to go to find the official documentation. Thanks for that link too! You already have it installed; look into your python install directory, under doc From inside the

Re: More M2Crypto issues

2007-01-19 Thread Heikki Toivonen
John Nagle wrote: Actually, at the moment I'm having an M2Crypto problem related to a SWIG/OpenSSL conflict. Older versions of OpenSSL have an include file that needs __i386__ defined, which is something GCC does based on what platform you're on. SWIG uses CPP, but doesn't set the

Re: when format strings attack

2007-01-19 Thread Gabriel Genellina
At Friday 19/1/2007 15:43, John Zenger wrote: Perhaps it is not as severe a security risk, but pure Python programs can run into similar problems if they don't check user input for % codes. Example: k = raw_input(Try to trick me: ) Try to trick me: How about %s this? j = User %s just

Re: when format strings attack

2007-01-19 Thread Steven D'Aprano
On Fri, 19 Jan 2007 10:43:53 -0800, John Zenger wrote: Perhaps it is not as severe a security risk, but pure Python programs can run into similar problems if they don't check user input for % codes. Please don't top-post. A: Because it messes up the order that we read things. Q: Why? A:

Re: Asyncore select statement problem

2007-01-19 Thread Gabriel Genellina
At Friday 19/1/2007 14:42, JamesHoward wrote: Thank you for the responses. I have learned considerably more about how Asyncore works because of it. The problem that I see is that Asyncore's poll function does not seem to be thread safe. From what I can tell, I am calling dispatcher.close()

Re: when format strings attack

2007-01-19 Thread Jeremy Sanders
Steven D'Aprano wrote: os.system('dir -l %s' % 'text.txt') Now, there is a security risk: you might set command1 yourself, and allow the user to set args. If command1 is an external application with a security hole, and the user provides arguments that trigger that bug, then naturally

Re: spidering script

2007-01-19 Thread Bernard
4 easy steps to get the links: 1. Download BeautifulSoup and import it in your script file. 2. Use urllib2 to download the html of the url. 3. mash the html using BeautifulSoup 4. [code] for tag in BeautifulSoupisedHTML.findAll('a'): print tag [/code] David Waizer a écrit : Hello..

Re: Iterator length

2007-01-19 Thread bearophileHUGS
Steven D'Aprano: since g is not an arbitrary iterator, one can easily do this: print [(h,len(list(g))) for h,g in groupby(s)] No need for a special function. If you look at my first post you can see that I have shown that solution too, but it creates a list that may be long, that may use a lot

war with china? a different approach?

2007-01-19 Thread thermate
Coz we have fools in the govt, the downfall of the US has only been accelerated !! The are morons who staged 9/11 controlled demolition to kill americans to start their idiotic war. Date: Sat, 21 Oct 2006 16:12:20 -0500 Subject: [nsmworld] war with china? a different approach? From: J. Knowles

ANN: Python Molecular Viewer - 1.4.4

2007-01-19 Thread sargis
We are pleased to announce the release of version 1.4.4 of our software tools including: Python Molecular Viewer (PMV), AutoDockTools (ADT) and VISION a visual-programming environment. Installers for binary distributions are available for LINUX, Mac OS X and Windows at:

Re: Determining when a file is an Open Office Document

2007-01-19 Thread Ross Ridge
tubby wrote: Now, If only I could something like that on PDF files :) PDF files should begin with %PDF- followed by a version number, eg. %PDF-1.4. The PDF Reference notes that Adobe Acrobat Reader is a bit more flexiable about what it will accept: 13. Acrobat viewers require only that the

OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Carroll, Barry
Greetings: Personally, I don't think top-posting is the most annoying newsgroup habit. I think it's making a big fuss about minor inconveniences. One of the nicest things about being human is the amazing flexibility of our brains. For example, if a block of text isn't arranged in the order

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Aahz
In article [EMAIL PROTECTED], Carroll, Barry [EMAIL PROTECTED] wrote: Personally, I don't think top-posting is the most annoying newsgroup habit. I think it's making a big fuss about minor inconveniences. =20 Thing is, nobody will ignore your posts for following standard Usenet conventions, but

Re: PyMeld for html templates?

2007-01-19 Thread Richie Hindle
[Sean] I wonder if anyone has any thoughts on PyMeld as a template system for churning out general websites? I'm doing that (but then I would be wouldn't I? 8-) http://www.mandant.net is an example - the content of each page comes from a file containing just the content, the layout and sidebar

How to comment code?

2007-01-19 Thread Martin P. Hellwig
Hi all, I've been toying with python for about two years now. Not every day, just when I encounter something in my job (sysadmin) repetitively dull. The amazing thing is that like any other language (natural or not) learning it more gives you power to express your thoughts better and create

Py 2.5 on Language Shootout

2007-01-19 Thread bearophileHUGS
The The Computer Language Shootout has just published results for Python 2.5 and Psyco 1.5.2. Comparing the old (Python 2.4) Gentoo Pentium 4 results (now not visible anymore) with the new results, I have seen that all the tests with Python 2.5 are faster than the ones with Python 2.4 (some

Re: My first try using logger didn't work. Why?

2007-01-19 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: Vinay (or anybody else), Well, now that logging is working, how do I stop it from working? I'm developing in PythonWin. When I run my test script, I get one message. When I run it a second time, I get two, a third time gets me three, and so on. I feel like the

RE: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Carroll, Barry
Hello again. First off, Aahz is absolutely right. It is my choice, just as it is his choice what to read and what to ignore. My reply was about the fuss, not the choice. Secondly, can someone point me to the Standard Usenet Convention that mandates against top-posting. This is not sarcasm; I

Re: How to comment code?

2007-01-19 Thread James Stroud
Martin P. Hellwig wrote: Hi all, I've been toying with python for about two years now. Not every day, just when I encounter something in my job (sysadmin) repetitively dull. The amazing thing is that like any other language (natural or not) learning it more gives you power to express your

RE: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Nick Maclaren
In article [EMAIL PROTECTED], Carroll, Barry [EMAIL PROTECTED] writes: | | Secondly, can someone point me to the Standard Usenet Convention that | mandates against top-posting. This is not sarcasm; I would really like | to see it. You see, I recently returned to Usenet after a LONG absence. |

Re: Determining when a file is an Open Office Document

2007-01-19 Thread Robert Marshall
On Fri, 19 Jan 2007, Steven D'Aprano wrote: On Fri, 19 Jan 2007 12:22:04 +1100, Ben Finney wrote: tubby [EMAIL PROTECTED] writes: Silly question, but here goes... what's a good way to determine when a file is an Open Office document? I could look at the file extension, but it seems there

Re: How to comment code?

2007-01-19 Thread Pavel Panchekha
I think that doc strings are the most important way in which you should be commenting on your code. Once the code works, you can elimainate most inline comments, leaving only doc string for everything and a few comments on some particularly confusing parts. Other than that, comments usually only

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Jerry Hill
On 1/19/07, Carroll, Barry [EMAIL PROTECTED] wrote: Secondly, can someone point me to the Standard Usenet Convention that mandates against top-posting. This is not sarcasm; I would really like to see it. For what (very little) it's worth, see RFC 1855. -- Jerry --

Re: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Aahz
In article [EMAIL PROTECTED], Carroll, Barry [EMAIL PROTECTED] wrote: Secondly, can someone point me to the Standard Usenet Convention that mandates against top-posting. This is not sarcasm; I would really like to see it. You see, I recently returned to Usenet after a LONG absence. When I was

Help with creating processes

2007-01-19 Thread Rod Person
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm trying to create a simple gui wrapper for the handbrake dvd ripper with python 2.4 on a FreeBSD system. My problem is this. I want to scan the dvd to see all the titles and chapters. The handbrake command for this is: handbrake -i

Re: Asyncore select statement problem

2007-01-19 Thread JamesHoward
Again, thank you for your help. With digging through the Asyncore.py source, I was able to find the poll2 function which is called when the function asyncore.loop(use_poll = True) is enabled. This function does not use a select call, but a poll call to do its looping. It works well for the

float comparison confusion

2007-01-19 Thread [EMAIL PROTECTED]
Type help, copyright, credits or license for more information. cmp(20.10, 20.9) -1 Why is cmp returning -1 instead of returning positive integer? -- http://mail.python.org/mailman/listinfo/python-list

Re: float comparison confusion

2007-01-19 Thread skip
chrolson Why is cmp returning -1 instead of returning positive integer? Last time I checked 20.1 was less than 20.9. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: OT Annoying Habits

2007-01-19 Thread Jorge Godoy
Carroll, Barry [EMAIL PROTECTED] writes: Secondly, can someone point me to the Standard Usenet Convention that mandates against top-posting. This is not sarcasm; I would really like You can read RFC 1855. Section 3.1.3 talks about newsgroups. Section 3.1.1 has general guidelines and it

Re: How to comment code?

2007-01-19 Thread gonzlobo
If it's hard to write, it should be hard to read! :) On 1/19/07, Martin P. Hellwig [EMAIL PROTECTED] wrote: Hi all, (snip) However since I'm learning more of python I've struggled with commenting, how should I've comment my code (snip) -- http://mail.python.org/mailman/listinfo/python-list

RE: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Gabriel Genellina
At Friday 19/1/2007 18:43, Carroll, Barry wrote: Secondly, can someone point me to the Standard Usenet Convention that mandates against top-posting. This is not sarcasm; I would really like to see it. There are some guidelines, like RFC 1855 (not a real standard, or enforced in any way):

Re: More M2Crypto issues

2007-01-19 Thread John Nagle
Heikki Toivonen wrote: John Nagle wrote: Actually, at the moment I'm having an M2Crypto problem related to a SWIG/OpenSSL conflict. Older versions of OpenSSL have an include file that needs __i386__ defined, which is something GCC does based on what platform you're on. SWIG uses CPP, but

  1   2   >