Re: MapReduce, Distributed Computing, and Ruby

2006-08-27 Thread raviteja . bhupatiraju
BG Simp wrote: > Interesting concept; a drop dead simple distributed library in Ruby. > Anything similar in Python? > http://tech.rufy.com/2006/08/mapreduce-for-ruby-ridiculously-easy.html Consider bugging this guy to release the code. http://agentmine.com/blog/2005/11/30/mapreduce-in-python http:

Re: Learning Python - Have Question.

2006-08-27 Thread Tal Einat
iapain wrote: > > I'm just learning Python, and I have a question about os.path.join(dirpath, > > name) and its use. Simply put, I haven't figured out how to use it. > > First thing you have to remember while using python is "everything is > an object". os.join.path concatenates one or more path

Re: random writing access to a file in Python

2006-08-27 Thread Claudio Grondi
Paul Rubin wrote: > Claudio Grondi <[EMAIL PROTECTED]> writes: > >>Does it mean, that in case of very large files: >> the size of available memory for the sorting operation (making it >>possible to work on larger chunks of data in memory) has less impact >>on the actual sorting speed than >> t

avoiding file corruption

2006-08-27 Thread Amir Michail
Hi, Trying to open a file for writing that is already open for writing should result in an exception. It's all too easy to accidentally open a shelve for writing twice and this can lead to hard to track down database corruption errors. Amir -- http://mail.python.org/mailman/listinfo/python-lis

Re: Avoiding if..elsif statements

2006-08-27 Thread Tal Einat
Fredrik Lundh wrote: > "unexpected" <[EMAIL PROTECTED]> wrote: > > > However, I'm passing in a few variables, so I can't just take it > > out-though every single function would be passing the same variables. > > > > so something.func() is actually > > something.func(string, list) > > > > How would

Re: avoiding file corruption

2006-08-27 Thread Paolo Pantaleo
27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: > Hi, > > Trying to open a file for writing that is already open for writing > should result in an exception. > > It's all too easy to accidentally open a shelve for writing twice and > this can lead to hard to track down database corru

Re: Python daemon process

2006-08-27 Thread Paolo Pantaleo
2006/8/26, Thomas Dybdahl Ahle <[EMAIL PROTECTED]>: > Hi, I'm writing a program, using popen4(gnuchess), > The problem is, that gnuchess keeps running after program exit. > > I know about the atexit module, but in java, you could make a process a > daemon process, and it would only run as long as t

How to let a loop run for a while before checking for break condition?

2006-08-27 Thread Claudio Grondi
Sometimes it is known in advance, that the time spent in a loop will be in order of minutes or even hours, so it makes sense to optimize each element in the loop to make it run faster. One of instructions which can sure be optimized away is the check for the break condition, at least within the

unpaking sequences of unknown length

2006-08-27 Thread Anthra Norell
Hi, I keep working around a little problem with unpacking in cases in which I don't know how many elements I get. Consider this: def tabulate_lists (*arbitray_number_of_lists): table = zip (arbitray_number_of_lists) for record in table: # etc ...

Re: avoiding file corruption

2006-08-27 Thread Amir Michail
Paolo Pantaleo wrote: > 27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: > > Hi, > > > > Trying to open a file for writing that is already open for writing > > should result in an exception. > > > > It's all too easy to accidentally open a shelve for writing twice and > > this can le

Re: marshal and unmarshal

2006-08-27 Thread Fredrik Lundh
leo wrote: > 'c\x00\x00\x00\x00\x01\x00... > > ", line 2> > > Question: > 1. why unmarshal data is > ", line 2> because that's what compile returns, of course. marshal.dumps takes a Python object and turns it into a string; marshal.loa

Re: Avoiding if..elsif statements

2006-08-27 Thread Fredrik Lundh
Tal Einat wrote: > This will work great if all of your functions recieve the same > argument(s). I assumed "every single function would be passing the same variables" meant exactly that, of course. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and STL efficiency

2006-08-27 Thread [EMAIL PROTECTED]
C++ -- #include #include #include #include #include #include using namespace std; int main() { DWORD ticks = ::GetTickCount(); const string s1("What do you know"); const string s2("So long..."); const stri

Re: ASN.1 encoder & decoder

2006-08-27 Thread etingof
> I looked at pyasn1. Unfortunately, it is not useful and provides a C > interface. Thanks, anyhow. pyasn1 is a pure-python implementation. C interface is not supported. > I figure that I will have to write my own, but am unsure of the best > approach. Nested lists and distionaries might be usefu

Re: CONSTRUCT - Module Attributes and Execution Environment

2006-08-27 Thread lazaridis_com
lazaridis_com wrote: > I would like to change the construct: > > if __name__ == '__main__': ... Is there a standard way / naming to wrap "__name__" and other similar attributes to an encapsulating class? Something like e.g.: if mod.name ... or if gbl.name ... - "gbl.newAttribute = value" wo

Re: CONSTRUCT - Module Attributes and Execution Environment

2006-08-27 Thread Fredrik Lundh
Larry Bates wrote: > 1) Don't call a class instance exec, it will mask the built-in > exec statement. "exec" is a reserved word, and cannot be masked: >>> exec = 10 File "", line 1 exec = 10 ^ SyntaxError: invalid syntax -- http://mail.python.org/mailman/listinfo/python-li

Re: unpaking sequences of unknown length

2006-08-27 Thread Diez B. Roggisch
>I keep working around a little problem with unpacking in cases in which I > don't know how many elements I get. Consider this: > > def tabulate_lists (*arbitray_number_of_lists): > table = zip (arbitray_number_of_lists) > for record in table: >#

Re: How to let a loop run for a while before checking for break condition?

2006-08-27 Thread Diez B. Roggisch
Claudio Grondi schrieb: > > Sometimes it is known in advance, that the time spent in a loop will be > in order of minutes or even hours, so it makes sense to optimize each > element in the loop to make it run faster. > One of instructions which can sure be optimized away is the check for > the

Re: avoiding file corruption

2006-08-27 Thread Diez B. Roggisch
Amir Michail schrieb: > Paolo Pantaleo wrote: >> 27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: >>> Hi, >>> >>> Trying to open a file for writing that is already open for writing >>> should result in an exception. >>> >>> It's all too easy to accidentally open a shelve for writing t

Re: A problem from a Vim user

2006-08-27 Thread Dasn
On Mon, Aug 07, 2006 at 10:59:01AM -0700, manuhack wrote: > When I use raw_input('Please type something.\n') in the python 2.4 > command line windows, it doesn't have any problem. However, when I run > the same command in vim 7 as :py raw_input('Please type something.\n'), > there is an EOFError:

Re: How to let a loop run for a while before checking for break condition?

2006-08-27 Thread Claudio Grondi
Diez B. Roggisch wrote: > Claudio Grondi schrieb: > >> >> Sometimes it is known in advance, that the time spent in a loop will >> be in order of minutes or even hours, so it makes sense to optimize >> each element in the loop to make it run faster. >> One of instructions which can sure be optimi

Re: unpaking sequences of unknown length

2006-08-27 Thread Diez B. Roggisch
>> Question: Is there an unpacking mechanism for cases in which I don't >> know--and don't need to know--how many elements I get, or an >> argument passing mechanism that is the inverse of the tuplifier (*args)? > > No. > > It looks a little bit as if you aren't aware of the symetry behind the *

Re: How to let a loop run for a while before checking for break condition?

2006-08-27 Thread Diez B. Roggisch
> The idea is to speed up a loop by using a timer interrupt interfering > with the loop, so that only after the timer interrupt would occur, the > loop will start to check its break condition in each iteration. > No checking of any kind in the loop should happen up to that time to > minimize the

Re: How to let a loop run for a while before checking for break condition?

2006-08-27 Thread Tal Einat
Diez B. Roggisch wrote: > > The idea is to speed up a loop by using a timer interrupt interfering > > with the loop, so that only after the timer interrupt would occur, the > > loop will start to check its break condition in each iteration. > > No checking of any kind in the loop should happen up

Re: Avoiding if..elsif statements

2006-08-27 Thread Tal Einat
Fredrik Lundh wrote: > Tal Einat wrote: > > > This will work great if all of your functions recieve the same > > argument(s). > > I assumed "every single function would be passing the same variables" > meant exactly that, of course. > > Right, as usual. I sort of missed that... ;) - Tal -- h

Re: unpaking sequences of unknown length

2006-08-27 Thread Gerard Flanagan
Anthra Norell wrote: > Hi, > >I keep working around a little problem with unpacking in cases in which I > don't know how many elements I get. Consider this: > > def tabulate_lists (*arbitray_number_of_lists): > table = zip (arbitray_number_of_lists) > for record

Re: avoiding file corruption

2006-08-27 Thread Paddy
Amir Michail wrote: > Hi, > > Trying to open a file for writing that is already open for writing > should result in an exception. > > It's all too easy to accidentally open a shelve for writing twice and > this can lead to hard to track down database corruption errors. > > Amir I've never done th

Re: MapReduce, Distributed Computing, and Ruby

2006-08-27 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] .rufy.com/2006/08/mapreduce-for-ruby-ridiculously-easy.html > > Consider bugging this guy to release the code. > http://agentmine.com/blog/2005/11/30/mapreduce-in-python WARNING This site downloaded IExplore trojan VBS/Psyme. VirusScan

Re: How to let a loop run for a while before checking for break condition?

2006-08-27 Thread Fredrik Lundh
Diez B. Roggisch wrote: > A while loop has a condition. period. The only thing to change that is > to introduce a uncoditioned loop, and use self-modifying code to make it > a while-loop after that timer interrupt of yours. or use a timer interrupt to interrupt the loop: import signal, time d

Re: avoiding file corruption

2006-08-27 Thread Amir Michail
Diez B. Roggisch wrote: > Amir Michail schrieb: > > Paolo Pantaleo wrote: > >> 27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: > >>> Hi, > >>> > >>> Trying to open a file for writing that is already open for writing > >>> should result in an exception. > >>> > >>> It's all too easy t

Re: How to let a loop run for a while before checking for break condition?

2006-08-27 Thread Claudio Grondi
Diez B. Roggisch wrote: >> The idea is to speed up a loop by using a timer interrupt interfering >> with the loop, so that only after the timer interrupt would occur, the >> loop will start to check its break condition in each iteration. >> No checking of any kind in the loop should happen up to

creating multiply arguments for a method.

2006-08-27 Thread noro
Hi all, I use a method that accept multiply arguments ("plot(*args)"). so plot([1,2,3,4]) is accepted and plot([1,2,3,4],[5,6,7,8]) is also accepted. the problem is that i know the number of arguments only at runtime. Let say that during runtime i need to pass 4 arguments, each is a list, creatin

Re: creating multiply arguments for a method.

2006-08-27 Thread Fredrik Lundh
noro wrote: > Let say that during runtime i need to pass 4 arguments, each is a list, > creating a set of lists and passing it to the method wont word since > the interpartor thinks it is only 1 argument the contain a reference to > a "list of lists", instede of number of arguments, each is a list

Re: How to let a loop run for a while before checking for break condition?

2006-08-27 Thread Claudio Grondi
Fredrik Lundh wrote: > Diez B. Roggisch wrote: > >> A while loop has a condition. period. The only thing to change that is >> to introduce a uncoditioned loop, and use self-modifying code to make >> it a while-loop after that timer interrupt of yours. > > > or use a timer interrupt to interrup

Weekly Python Patch/Bug Summary

2006-08-27 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 407 open ( +3) / 3393 closed (+17) / 3800 total (+20) Bugs: 888 open (+28) / 6145 closed (+14) / 7033 total (+42) RFE : 232 open ( +3) / 236 closed ( +1) / 468 total ( +4) New / Reopened Patches __ most miss

Re: avoiding file corruption

2006-08-27 Thread Diez B. Roggisch
Amir Michail schrieb: > Diez B. Roggisch wrote: >> Amir Michail schrieb: >>> Paolo Pantaleo wrote: 27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: > Hi, > > Trying to open a file for writing that is already open for writing > should result in an exception. >

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
Amir Michail wrote: > Trying to open a file for writing that is already open for writing > should result in an exception. > > It's all too easy to accidentally open a shelve for writing twice and > this can lead to hard to track down database corruption errors. The right solution is file locking.

Re: How to let a loop run for a while before checking for break condition?

2006-08-27 Thread Diez B. Roggisch
Fredrik Lundh schrieb: > Diez B. Roggisch wrote: > >> A while loop has a condition. period. The only thing to change that is >> to introduce a uncoditioned loop, and use self-modifying code to make >> it a while-loop after that timer interrupt of yours. > > or use a timer interrupt to interrupt

Re: avoiding file corruption

2006-08-27 Thread Grant Edwards
On 2006-08-27, Amir Michail <[EMAIL PROTECTED]> wrote: > Trying to open a file for writing that is already open for writing > should result in an exception. MS Windows seems to do something similar, and it pisses me off no end. Trying to open a file and read it while somebody else has it open f

Re: Weekly Python Patch/Bug Summary

2006-08-27 Thread Fredrik Lundh
Kurt B. Kaiser wrote: > Patch / Bug Summary > ___ > > Patches : 407 open ( +3) / 3393 closed (+17) / 3800 total (+20) > Bugs: 888 open (+28) / 6145 closed (+14) / 7033 total (+42) > RFE : 232 open ( +3) / 236 closed ( +1) / 468 total ( +4) could this script per

Re: avoiding file corruption

2006-08-27 Thread Tim Scheidemantle
Amir Michail wrote: > Hi, > > Trying to open a file for writing that is already open for writing > should result in an exception. Look at fcntl module, I use it in a class to control access from within my processes. I don't think this functionality should be inherent to python though. Keep in mind

Re: avoiding file corruption

2006-08-27 Thread Amir Michail
Grant Edwards wrote: > On 2006-08-27, Amir Michail <[EMAIL PROTECTED]> wrote: > > > Trying to open a file for writing that is already open for writing > > should result in an exception. > > MS Windows seems to do something similar, and it pisses me off > no end. Trying to open a file and read it

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
Paddy wrote: > I've never done this in anger so feel free to mock (a little :-). > > I'd have a fixed field at the beginning of the field that can hold the > hostname process number, and access time of a writing process, togeher > with a sentinal value that means "no process has access to the file

Re: creating multiply arguments for a method.

2006-08-27 Thread John Roth
noro wrote: > Hi all, > > I use a method that accept multiply arguments ("plot(*args)"). > so plot([1,2,3,4]) is accepted and plot([1,2,3,4],[5,6,7,8]) is also > accepted. > > the problem is that i know the number of arguments only at runtime. > Let say that during runtime i need to pass 4 argumen

Re: How to let a loop run for a while before checking for break condition?

2006-08-27 Thread Fredrik Lundh
Diez B. Roggisch wrote: > No doubt that changing the flag asynchronously is a gain by delegating > the timing code to the OS. Yet the while loop still has a condition - > you could as well set a flag in the signal handler an do it like this: if the OP is obsessed with performance, why are you

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
Grant Edwards wrote: > Amir Michail wrote: > >> Trying to open a file for writing that is already open for writing >> should result in an exception. > > MS Windows seems to do something similar, and it pisses me off > no end. Trying to open a file and read it while somebody else > has it open f

Defining constant strings

2006-08-27 Thread Hans
Hi,   I want to define a couple of constant strings, like in C: #define mystring "This is my string" or using a const char construction.   Is this really not possible in Python?   Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: How to let a loop run for a while before checking for break condition?

2006-08-27 Thread Diez B. Roggisch
Fredrik Lundh schrieb: > Diez B. Roggisch wrote: > > > No doubt that changing the flag asynchronously is a gain by delegating > > the timing code to the OS. Yet the while loop still has a condition - > > you could as well set a flag in the signal handler an do it like this: > > if the OP is ob

Firewire comms using Python?

2006-08-27 Thread Fraggle69
Hi, Does anyone have any idea of how I can use Python to get images from my firewire camera?? I am using python under winXP pro Cheers Fraggle -- http://mail.python.org/mailman/listinfo/python-list

Re: avoiding file corruption

2006-08-27 Thread Grant Edwards
On 2006-08-27, Amir Michail <[EMAIL PROTECTED]> wrote: > How often do you need to open a file multiple times for writing? Not very often, but I don't think it should be illegal. That's probably a result of being a 25 year user of Unix where it's assumed that the user knows what he's doing. > A

Re: Defining constant strings

2006-08-27 Thread Tal Einat
Hans wrote: > Hi, > > I want to define a couple of constant strings, like in C: > #define mystring "This is my string" > or using a const char construction. > > Is this really not possible in Python? > > Hans It is really not possible. The Pythonic way (as far as I have come to know it) is to st

Re: Defining constant strings

2006-08-27 Thread Tal Einat
Hans wrote: > Hi, > > I want to define a couple of constant strings, like in C: > #define mystring "This is my string" > or using a const char construction. > > Is this really not possible in Python? > > Hans One last note: If you truly insist on having constant variables, you could write a class

Re: Weekly Python Patch/Bug Summary

2006-08-27 Thread Georg Brandl
Fredrik Lundh wrote: > Kurt B. Kaiser wrote: > >> Patch / Bug Summary >> ___ >> >> Patches : 407 open ( +3) / 3393 closed (+17) / 3800 total (+20) >> Bugs: 888 open (+28) / 6145 closed (+14) / 7033 total (+42) >> RFE : 232 open ( +3) / 236 closed ( +1) / 468 tot

Re: Defining constant strings

2006-08-27 Thread Peter Otten
Hans wrote: > I want to define a couple of constant strings, like in C: > #define mystring "This is my string" > or using a const char construction. > > Is this really not possible in Python? No, this is not really not possible in Python: $ ls preprocess.pyp $ cat preprocess.pyp #define MYSTRIN

Re: Defining constant strings

2006-08-27 Thread danielx
I would really like to highlight something Tal has already said: Python strings are immutable. That means if you construct a string object, you don't have to worry about someone else going in and changing that object. What might happen, however, is that someone might reassign a variable you have wh

[ANN] StandOut 3.0.0 Released

2006-08-27 Thread Fuzzyman
There is a new release of `StandOut `_, the flexible output object. This version is a complete rewrite, with a *full* set of `unit tests `_. *standout* is a mod

Re: random writing access to a file in Python

2006-08-27 Thread Paul Rubin
Claudio Grondi <[EMAIL PROTECTED]> writes: > The Windows XP SP 2 '/> sort' (sorting of four Gigs of 20 byte records > took 12 CPU and 18 usual hours) has, from what I could observe on the > task manager, done the job in only two runs of 'copying' : That is terrible; on a reasonably fast machine th

Re: Learning Python

2006-08-27 Thread [EMAIL PROTECTED]
Tal Einat wrote: > Duncan Booth wrote: > > JAG CHAN wrote: > > > > > Whenever I try to open IDLE, my zone firewall tells me pythonw.exe is > > > trying to access the trusted zone. > > > Whenever I try to open new IDLE window I get the following message: > > > "IDLE's subprocess didn't make connect

Re: avoiding file corruption

2006-08-27 Thread Duncan Booth
Dennis Lee Bieber wrote: > On Sun, 27 Aug 2006 14:41:05 -, Grant Edwards <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> >> MS Windows seems to do something similar, and it pisses me off >> no end. Trying to open a file and read it while somebody else >> has it open

Re: Very weird behavior that's driving me crazy

2006-08-27 Thread Bruno Desthuilliers
Pupeno a écrit : (snip) > > and then I have another module called SensorSingleton that emulates the > hard-to-code-on-python singleton (snip) What do you mean "hard to code on python singleton" ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python - Have Question.

2006-08-27 Thread AlbaClause
Tal Einat wrote: > iapain wrote: >> First thing you have to remember while using python is "everything is >> an object". os.join.path concatenates one or more path for example >> os.path.join("c:", "myfolder") represent a path relative to current dir >> on c: drive. >> > > Actually, os.path.join

Re: trouble understanding inheritance...

2006-08-27 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : (snip) > class BaseClass(): > def foo(self): > return "foo" > > class Foo(BaseClass): > def foo(self): > return self.__class__.foo() # call the parent class method Err... May I suggest that you re-read the Fine Manual ? -- http://mail.python.org/

multi-thread tutor

2006-08-27 Thread fegge
would u like to recommand some to me/.? -- http://mail.python.org/mailman/listinfo/python-list

Re: Help in using introspection to simplify repetitive code

2006-08-27 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > As you mention, wether the methods take arguments or not is something > to have into account. > And they do take arguments, and a variable number of them, so AFAIK > hooking with __getattr__ or __getattribute__ will not work, as you can > only get the method name with

Conway's Life Implementation

2006-08-27 Thread Putty
Hi. I was going to write an implementation of John Conway's Life game using Python and Tk, but I soon found that Tk just didn't cut the mustard for memory usage, management, and the like for such a project, so I've found my best GUI bet for my project is wxPython and not pygame. Anybody have any

Re: Job Jar

2006-08-27 Thread Bruno Desthuilliers
D a écrit : > Hello, I apologize in advance for the vague description, but as of now > I only have an idea of what I'd like to do, and need some guidance as > to if it is feasible, and where to begin. Basically, I'd like to > create a web-based "job jar", that users in my office can access in > or

Pros/Cons of Turbogears/Rails?

2006-08-27 Thread kenneth . m . mcdonald
First, I don't intend this to be a flame war, please. Python and Ruby are the only two languages I'd willingly work in (at least amongst common languages), and TurboGears and Rails seem roughly equivalent. I'm much more knowledgable about Python, but that's a minor issue--I've been intending to le

Re: callable to disappear?

2006-08-27 Thread Bruno Desthuilliers
Georg Brandl a écrit : > Antoon Pardon wrote: > >> I have been reading http://www.python.org/dev/peps/pep-3100/ >> en there is written: >> >> To be removed: >> ... >> >> callable(): just call the object and catch the exception >> ... > > > >> Is there a chance this will be

Re: Conway's Life Implementation

2006-08-27 Thread [EMAIL PROTECTED]
Putty wrote: > Hi. I was going to write an implementation of John Conway's Life game > using Python and Tk, but I soon found that Tk just didn't cut the > mustard for memory usage, management, and the like for such a project, > so I've found my best GUI bet for my project is wxPython and not > py

IDLE on Mac OS X

2006-08-27 Thread Furbybrain
I'm running 10.3.9 and I've just installed Python 2.4. IDLE won't start- it bounces in the dock once or twice then goes away. I'm new to Python, and I'm trying to learn. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: random writing access to a file in Python

2006-08-27 Thread Claudio Grondi
Paul Rubin wrote: > Claudio Grondi <[EMAIL PROTECTED]> writes: > >>The Windows XP SP 2 '/> sort' (sorting of four Gigs of 20 byte records >>took 12 CPU and 18 usual hours) has, from what I could observe on the >>task manager, done the job in only two runs of 'copying' : > > > That is terrible; o

Re: multi-thread tutor

2006-08-27 Thread UrsusMaximus
fegge wrote: > would u like to recommand some to me/.? see http://www.awaretek.com/tutorials.html#thread -- http://mail.python.org/mailman/listinfo/python-list

Re: Conway's Life Implementation

2006-08-27 Thread Putty
Do you think it would be reasonable to use wxGrid to make the game area? [EMAIL PROTECTED] wrote: > Putty wrote: > > Hi. I was going to write an implementation of John Conway's Life game > > using Python and Tk, but I soon found that Tk just didn't cut the > > mustard for memory usage, management

Re: Pros/Cons of Turbogears/Rails?

2006-08-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > + Built-in Rubydoc system would make documenting the > system easier. (IMHO, developers almost always > underestimate the need for good documentation that > is written along withe the system.) Is there a > Python doc system that has received Guido's blessing > yet? afai

Re: Conway's Life Implementation

2006-08-27 Thread [EMAIL PROTECTED]
Putty wrote: > Do you think it would be reasonable to use wxGrid to make the game > area? > > [EMAIL PROTECTED] wrote: > > Putty wrote: > > > Hi. I was going to write an implementation of John Conway's Life game > > > using Python and Tk, but I soon found that Tk just didn't cut the > > > mustard

Re: IDLE on Mac OS X

2006-08-27 Thread Bill Hale
In article <[EMAIL PROTECTED]>, Furbybrain <[EMAIL PROTECTED]> wrote: > I'm running 10.3.9 and I've just installed Python 2.4. IDLE won't start- > it bounces in the dock once or twice then goes away. > I'm new to Python, and I'm trying to learn. Thanks. You might want to open the console window

newbe question about removing items from one file to another file

2006-08-27 Thread [EMAIL PROTECTED]
def simplecsdtoorc(filename): file = open(filename,"r") alllines = file.read_until("") pattern1 = re.compile(">orcfilename, line I am pretty sure my code isn't close to what I want. I need to be able to skip html like commands from to and to key on another word in adition to to end

Persistent Session in CGI

2006-08-27 Thread keegan . csmith
Hi, I have started a new small web project, and was wondering if there are any good guides on how to do Persistent Sessions and Authentication using python and CGI. I don't really want too use Zope, because It's probably overkill for my tiny project. -- http://mail.python.org/mailman/listinfo/py

Re: Persistent Session in CGI

2006-08-27 Thread Andre Meyer
Karrigell is a very easy-to-use pure-Python web framework. It has examples of session management.http://karrigell.sourceforge.net/regardsAndre On 27 Aug 2006 14:48:05 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:Hi,I have started a new small web project, and was wondering if there are any go

Re: IDLE on Mac OS X

2006-08-27 Thread Kevin Walzer
Furbybrain wrote: > I'm running 10.3.9 and I've just installed Python 2.4. IDLE won't start- > it bounces in the dock once or twice then goes away. > I'm new to Python, and I'm trying to learn. Thanks. You need to install Tcl/Tk--it doesn't come with 10.3 by default. Get a Panther-compatible versio

Re: random writing access to a file in Python

2006-08-27 Thread Paul Rubin
Claudio Grondi <[EMAIL PROTECTED]> writes: > >>The Windows XP SP 2 '/> sort' (sorting of four Gigs of 20 byte records > >>took 12 CPU and 18 usual hours) > Ok, I see - the misunderstanding is, that there were 4.294.967.296 > records each 20 bytes long, what makes the actual file 85.899.345.920

Re: Persistent Session in CGI

2006-08-27 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I have started a new small web project, and was wondering if there are > any good guides on how to do Persistent Sessions and Authentication > using python and CGI. I don't really want too use Zope, because It's > probably overkill for my tiny project. The simplest thin

import function from user defined modules

2006-08-27 Thread groves
Can anybody give me an example of how to import a function of module X in module y. And please if yu can use classes(Object oriented approach) would be great. The problem is that I have created a text on canvas, and now I want that whenever a user right clicks on it, the option COMMAND should invo

import function from user defined modules

2006-08-27 Thread groves
Can anybody give me an example of how to import a function of module X in module y. And please if yu can use classes(Object oriented approach) would be great. The problem is that I have created a text on canvas, and now I want that whenever a user right clicks on it, the option COMMAND should invo

Re: Persistent Session in CGI

2006-08-27 Thread Fuzzyman
[EMAIL PROTECTED] wrote: > Hi, > > I have started a new small web project, and was wondering if there are > any good guides on how to do Persistent Sessions and Authentication > using python and CGI. I don't really want too use Zope, because It's > probably overkill for my tiny project. You could

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

2006-08-27 Thread PetDragon
Sounds like you need to use html parser, check it out in the documentation <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > def simplecsdtoorc(filename): >file = open(filename,"r") >alllines = file.read_until("") >pattern1 = re.compile("orcfilename = filename[-

A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-27 Thread [EMAIL PROTECTED]
Last year, i've posted a tutorial and commentary about Python and Perl's sort function. (http://xahlee.org/perl-python/sort_list.html) In that article, i discussed a technique known among juvenile Perlers as the Schwartzian Transform, which also manifests in Python as its “key” optional parameter.

Re: Pros/Cons of Turbogears/Rails?

2006-08-27 Thread Jonathan Ellis
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > P.S. If I wanted to provide an image by streaming the > > file data directly over the connection, rather than by > > referring to an image file, how would I do that? I'd > > like to build code that would allow images to be assembled > > into a sin

naive misuse?

2006-08-27 Thread johan2sson
The documentation for PyThreadState_SetAsyncExc says "To prevent naive misuse, you must write your own C extension to call this". Anyone care to list a few examples of such naive misuse? Johan -- http://mail.python.org/mailman/listinfo/python-list

Middle matching - any Python library functions (besides re)?

2006-08-27 Thread EP
Hi, I'm a bit green in this area and wonder to what extent there may be some existing Python tools (or if I have to scratch my head real hard for an appropriate algorithm... ) I'd hate to build an inferior solution to that someone has painstakingly built before me. I have some files which may ha

Re: Don't use __slots__ (was Re: performance of dictionary lookup vs. object attributes)

2006-08-27 Thread Jacob Hallen
In article <[EMAIL PROTECTED]>, Patrick Maupin <[EMAIL PROTECTED]> wrote: >I didn't actually sense any dander on your part, so it was probably a >bit unfortunate that I chose to respond to that particular message. I >do (rightly or wrongly) sense some dander on Aahz's part, and this was >the secon

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-27 Thread Tom Cole
Well you cross-posted this enough, including a Java group, and didn't even ask about us... What a pity. In Java, classes can implement the Comparable interface. This interface contains only one method, a compareTo(Object o) method, and it is defined to return a value < 0 if the Object is considere

Re: Conway's Life Implementation

2006-08-27 Thread Andrew Trevorrow
"Putty" <[EMAIL PROTECTED]> wrote: > Hi. I was going to write an implementation of John Conway's Life game > using Python and Tk, but I soon found that Tk just didn't cut the > mustard for memory usage, management, and the like for such a project, > so I've found my best GUI bet for my project is

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

2006-08-27 Thread [EMAIL PROTECTED]
PetDragon wrote: > Sounds like you need to use html parser, check it out in the > documentation > > > > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > def simplecsdtoorc(filename): > >file = open(filename,"r") > >alllines = file.read_until("") > >pattern1 = re.co

Re: Middle matching - any Python library functions (besides re)?

2006-08-27 Thread bearophileHUGS
If you want to avoid an O(n^2) algorithm, you may need to find a signature for each file. Then you use such signatures to compute hashes, and unique them with a dict (dict values may be the file names). Later you can weed out the few wrong collisions produced by the possibly approximated signature.

Re: Middle matching - any Python library functions (besides re)?

2006-08-27 Thread Paul Rubin
"EP" <[EMAIL PROTECTED]> writes: > Given that I am looking for matches of all files against all other > files (of similar length) is there a better bet than using re.search? > The initial application concerns files in the 1,000's, and I could use > a good solution for a number of files in the 100,0

Re: Pros/Cons of Turbogears/Rails?

2006-08-27 Thread fuzzylollipop
[EMAIL PROTECTED] wrote: Looks like you mixing comparisons. > Ruby: > + More mature system. More stable? More features? uh, no, Python predates Ruby by a good bit Rails might be "older" than Turbogears but it still JUST went 1.0 officially. It can't be called "mature' by any defintition. > + M

Re: Don't use __slots__ (was Re: performance of dictionary lookup vs. object attributes)

2006-08-27 Thread Patrick Maupin
Jacob Hallen wrote: > Patrick Maupin <[EMAIL PROTECTED]> wrote: > >Also, as I noted, I _do_ use them on occasion, so if there really _are_ > >potential pitfalls there, I would like to understand exactly what they > >are, so my ears perk up whenever I notice a __slots__ discussion, but > >so far I

Re: Python-list Digest, Vol 35, Issue 410

2006-08-27 Thread namam0205
Thank you Fredrik for answering.Actually the  "form.py"  was copied from an example inside one of the URL for non-programmer provided by python.org documentation site. I'm not familiar with the method to convert an MD5 token to it original state inside form.py. So, if I try to authenticate using re

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-27 Thread alf
Fredrik Lundh wrote: > "alf" <[EMAIL PROTECTED]> wrote: > > >>It turned out it is quite simple - I just install the python from >>python.org and all the libs needed. Then I take python2n.dll from >>c:\win*\system32 and move directly to PYTHONDIR. Then I can just tar/zip >>the PYTHON dir and distr

  1   2   >