Help installing Python Constraints

2005-09-18 Thread Levi Self
Hi Can someone help me figure out how to install Python Constraints on Windows? I have Python 2.4 Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Brute force sudoku cracker

2005-09-18 Thread Gregory Bond
My current solver does 1 level of backtracking (i.e. constant space, and bounded time) only, and it has been able to solve every puzzle I've thrown at it. It's based on the usual logic and book-keeping for the most part. (It also explains how it comes up with each answer step as it goes, wh

Re: Possible bug in "metaclass resolution order" ?

2005-09-18 Thread Bengt Richter
On Sat, 17 Sep 2005 12:41:09 -0300, Pedro Werneck <[EMAIL PROTECTED]> wrote: >On 17 Sep 2005 02:04:39 -0700 >"Simon Percivall" <[EMAIL PROTECTED]> wrote: > >> Have you read the "Metaclasses" part of "Unifying types and classes in >> Python 2.2"? (http://www.python.org/2.2.3/descrintro.html#metacla

Re: How am I doing?

2005-09-18 Thread Mike Meyer
Jason <[EMAIL PROTECTED]> writes: > Please don't laugh, this is my FIRST Python script where I haven't > looked at the manual for help... > > import string > import random > > class hiScores: > hiScores=['1Alpha','07500Beta','05000Gamma','02500Delta','0Epsilon'] > > def showScores(se

threads/sockets quick question.

2005-09-18 Thread ed
this script should create individual threads to scan a range of IP addresses, but it doesnt, it simple ... does nothing. it doesnt hang over anything, the thread is not being executed, any ideas anyone? -- import socket import threading import traceback MAX_THREADS = 50 class scanThrea

Re: win32com.client.GetActiveObject()

2005-09-18 Thread Roger Upole
Basically, this means the application doesn't register itself with the Running Object Table. There's not much you can do about it, except maybe petition whoever makes ITunes. Roger "David Nicolson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I have been successfu

Re: Example of signaling and creating a python daemon

2005-09-18 Thread Jon Monteleone
What I dont understand about daemonizing a python script is whether or not it requires the daemon creation, ie the signal handling and forking of the process, to be part of the daemon code or is this code in a separate program that acts like a wrapper to turn a python program into a daemon. The

Re: Why is map() preferable in this case?

2005-09-18 Thread Devan L
Ray wrote: > Hello, > > I'm just reading the latest edition of Python Cookbook, where it says > in Recipe 4.2: > > "when the op you wanna perform on each item is to call a function on > the item and use the function's result, use L1 = map(f, L), rather than > L1 = (f(x) for x in L)" > > What is wro

win32com.client.GetActiveObject()

2005-09-18 Thread David Nicolson
Hi, I have been successfully using iTunes' COM interface with Python using either of the following lines successfully: iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application") iTunes = win32com.client.Dispatch("iTunes.Application") The only problem is that it will launch iTunes i

Why is map() preferable in this case?

2005-09-18 Thread Ray
Hello, I'm just reading the latest edition of Python Cookbook, where it says in Recipe 4.2: "when the op you wanna perform on each item is to call a function on the item and use the function's result, use L1 = map(f, L), rather than L1 = (f(x) for x in L)" What is wrong with the generator expres

Re: Question About Logic In Python

2005-09-18 Thread [EMAIL PROTECTED]
James H. wrote: > Greetings! I'm new to Python and am struggling a little with "and" and > "or" logic in Python. Since Python always ends up returning a value > and this is a little different from C, the language I understand best > (i.e. C returns non-zero as true, and zero as false), is there

Re: How am I doing?

2005-09-18 Thread Jason
George Sakkis wrote: > "Jason" <[EMAIL PROTECTED]> wrote: > >> Please don't laugh, this is my FIRST Python script where I haven't >> looked at the manual for help... > > Sooner or later you should ;) > >> import string > > Don't need it it modern python; use string methods instead. > >> import

Re: Creating a list of Mondays for a year

2005-09-18 Thread George Sakkis
"Peter Hansen" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > "Chris" <[EMAIL PROTECTED]> wrote: > >>Is there a way to make python create a list of Mondays for a given year? > > > > Get the dateutil package (https://moin.conectiva.com.br/DateUtil): > > > > import dateutil.rrule as rrule > >

RE: Roguelike programmers needed

2005-09-18 Thread Delaney, Timothy (Tim)
Mike Meyer wrote: > And *portable*. I was delighted to discover a port of the original > rogue to the Palm. Then shocked to realize that my (old, obsolete) > Palm had four times as much RAM as the 11/70 I originally ran Rogue > on. And probably an equal overabundance of mips. I actually started o

Re: How am I doing?

2005-09-18 Thread George Sakkis
"Jason" <[EMAIL PROTECTED]> wrote: > Please don't laugh, this is my FIRST Python script where I haven't > looked at the manual for help... Sooner or later you should ;) > import string Don't need it it modern python; use string methods instead. > import random > > class hiScores: The common c

Re: Question About Logic In Python

2005-09-18 Thread Dan Bishop
James H. wrote: > Greetings! I'm new to Python and am struggling a little with "and" and > "or" logic in Python. Since Python always ends up returning a value > and this is a little different from C, the language I understand best > (i.e. C returns non-zero as true, and zero as false), is there a

Re: Creating a list of Mondays for a year

2005-09-18 Thread Paul Rubin
Chris <[EMAIL PROTECTED]> writes: > Is there a way to make python create a list of Mondays for a given year? > mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', > '1/31/2005','2/7/2005', ... ] This is pretty inefficient but it's conceptually the simplest: def mondays(year): from ca

Re: Creating a list of Mondays for a year

2005-09-18 Thread Peter Hansen
George Sakkis wrote: > "Chris" <[EMAIL PROTECTED]> wrote: >>Is there a way to make python create a list of Mondays for a given year? > > Get the dateutil package (https://moin.conectiva.com.br/DateUtil): > > import dateutil.rrule as rrule > from datetime import date > > mondays2005 = tuple(rrule

Question About Logic In Python

2005-09-18 Thread James H.
Greetings! I'm new to Python and am struggling a little with "and" and "or" logic in Python. Since Python always ends up returning a value and this is a little different from C, the language I understand best (i.e. C returns non-zero as true, and zero as false), is there anything I should be awar

Re: Possible bug in "metaclass resolution order" ?

2005-09-18 Thread Pedro Werneck
On 18 Sep 2005 12:58:22 -0700 "Simon Percivall" <[EMAIL PROTECTED]> wrote: > I definitely think that it's the intended behaviour: the example shows > how and why it works; and I definitely agree that it should be > documented better. Yes. I finally understood the decision and now I agree it's not

Announce: open 0.2 - a unix application launcherr

2005-09-18 Thread Mike Meyer
"open" is designed to provide Unix users with a single tool for dealing with the multitude of applications that deal with data files. Without open - or something like it - every time a user wants to look at a file, they have to figure out what type the file is and which application on their path ca

Re: Roguelike programmers needed

2005-09-18 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Don't be fooled by their apparent simplicity! What most roguelikes lack > in graphics they make up for in game play. These suckers are addictive. > You have been warned! And *portable*. I was delighted to discover a port of the original rogue to the Palm. Then shocked t

How am I doing?

2005-09-18 Thread Jason
Please don't laugh, this is my FIRST Python script where I haven't looked at the manual for help... import string import random class hiScores: hiScores=['1Alpha','07500Beta','05000Gamma','02500Delta','0Epsilon'] def showScores(self): for entry in self.hiScores:

Re: Creating a list of Mondays for a year

2005-09-18 Thread [EMAIL PROTECTED]
Consider also dateutil written by Gustavo Niemeyer and found at: https://moin.conectiva.com.br/DateUtil >>> from dateutil.rrule import * >>> list(rrule(WEEKLY, byweekday=MO, dtstart=date(2005,1,1), >>> until=date(2005,12,31))) The library may be a little intimidating at first it is worth learnin

Synchronous/Asynchrnous Audio play with pymedia

2005-09-18 Thread Ron Provost
Hello, I'm developing a piece of software to assist illiteraate adults to learn to read. I'm trying to figure out how, if possible, to make audio playback asynchrnous but still controllable. I'm using python 2.4 with pymedia on XP. I started out with the example in the tutorials section of t

Re: Creating a list of Mondays for a year

2005-09-18 Thread George Sakkis
"Chris" <[EMAIL PROTECTED]> wrote: > Is there a way to make python create a list of Mondays for a given year? > > For example, > > mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', > '1/31/2005','2/7/2005', ... ] Get the dateutil package (https://moin.conectiva.com.br/DateUtil): impor

Re: Roguelike programmers needed

2005-09-18 Thread Michael Sparks
Robert Kern wrote: > Thomas Jollans wrote: >> what exactly is RPG/roguelike etc ? (what debian package provides an >> example?) > > Google is your friend. Often a fair answer, but I'd suggest that the question was fair, especially given the OP was seeking help :-) After all, I read the subject

tuples and mysqldb tables

2005-09-18 Thread Ed Hotchkiss
I have used fetchall() to insert the values from a table into a tuple. anywhere from 0 - ? many rows could be in this tuple, so it is a row within a row. How do I use a loops to iterate through the nested tuple, and assign the tuples integers and strings to variables, ugh :P   The Tables data is l

Re: Python Doc Problem Example: os.path.split

2005-09-18 Thread George Sakkis
Another epileptic seizure on the keyboard. Apart from clue deficit disorder, this guy seems to suffer from some serious anger management problems...*plonk* "Xah Lee" <[EMAIL PROTECTED]> wrote: > Python Doc Problem Example > > Quote from: > http://docs.python.org/lib/module-os.path.html >

Re: Roguelike programmers needed

2005-09-18 Thread en.karpachov
On Sun, 18 Sep 2005 17:28:30 +0100 Thomas Jollans wrote: > what exactly is RPG/roguelike etc ? (what debian package provides an > example?) apt-cache search roguelike -- jk -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a list of Mondays for a year

2005-09-18 Thread Peter Hansen
Chris wrote: > Is there a way to make python create a list of Mondays for a given year? > > For example, > > mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', > '1/31/2005','2/7/2005', ... ] from datetime import date, timedelta def mondays(year): '''generate all days that are Mo

Re: Python Doc Problem Example: os.path.split

2005-09-18 Thread Julian Fondren
> Please don't feed the trolls. > In other words, if everybody ignores this loser, he might crawl back under > the rock he came from. Well, comp.lang.python people would do better to accept the suggested rewrite and ignore at the rest at their discretion. -- http://mail.python.org/mailman/listi

[no subject]

2005-09-18 Thread Ed Hotchkiss
Let us say that I am trying to create a very small and simple private network/connection between several scripts on different machines, to communicate instructions/data/files etc. to each other over the net. Is SSL the best method? Any recommendations of something to get started with? Thanks in adv

Best Encryption for Python Client/Server

2005-09-18 Thread Ed Hotchkiss
Let us say that I am trying to create a very small and simple private network/connection between several scripts on different machines, to communicate instructions/data/files etc. to each other over the net. Is SSL the best method? Any recommendations of something to get started with? Thanks in adv

Best Encryption for Python Client/Server

2005-09-18 Thread Ed Hotchkiss
Let us say that I am trying to create a very small and simple private network/connection between several scripts on different machines, to communicate instructions/data/files etc. to each other over the net. Is SSL the best method? Any recommendations of something to get started with? Thanks in adv

Re: Creating a list of Mondays for a year

2005-09-18 Thread skip
Chris> Is there a way to make python create a list of Mondays for a Chris> given year? For example, Chris> mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', Chris> '1/31/2005','2/7/2005', ... ] How about: import datetime oneday = datetime.timedelta(days=1)

Re: Shed Skin under Windows and OSX

2005-09-18 Thread Mark Dufour
> *** success: small factorization program by Rohit Krishna Kumar 124 > *** no failures, yay! > > > :) > > Well done. So what was causing that crash in test '__class__ and > __name__ attributes' after all? Well, I did something like this: class_ c(..); class_ *cp = &c; class list { list()

Creating a list of Mondays for a year

2005-09-18 Thread Chris
Is there a way to make python create a list of Mondays for a given year? For example, mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', '1/31/2005','2/7/2005', ... ] -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible bug in "metaclass resolution order" ?

2005-09-18 Thread Simon Percivall
I definitely think that it's the intended behaviour: the example shows how and why it works; and I definitely agree that it should be documented better. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Doc Problem Example: os.path.split

2005-09-18 Thread Bruno Desthuilliers
Laszlo Zsolt Nagy a écrit : > >> is the doc writer, trying to write the doc with some austereness, but >> is confused about the behavior of split, or confused about expressing >> it? Did his pretension fucked him up? >> >> > Dear Xah Lee, > > The Python community is very sorry because we have a

Re: Possible bug in "metaclass resolution order" ?

2005-09-18 Thread Pedro Werneck
On 18 Sep 2005 10:33:11 -0700 "Simon Percivall" <[EMAIL PROTECTED]> wrote: > Isn't that exactly what you are doing? Yes, and that example has the same inconsistency. >>> class X(type): pass ... >>> class D2(C3, C2): __metaclass__ = X ... Traceback (most recent call last): File "", line 1, i

Re: How to obtain a 'interactive session' of a script?

2005-09-18 Thread Bo Peng
Fredrik Lundh wrote: > replacing sys.stdin with something that isn't a TTY will fix this. This works like magic! Thank you! Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: Roguelike programmers needed

2005-09-18 Thread rpgnethack
Robert Kern wrote: > > Google is your friend. > True, that :-) But what the heck. The average roguelike is a hack 'n' slash computer game based on tabletop roleplaying games, most often Dungeons and Dragons. The graphics in most roguelikes have stayed the same since the 70's (i.e. ASCII text

Re: How does f=open('mytext.txt', 'w+') work?

2005-09-18 Thread Alex
Thanks Steven, very good explaination. f.seek(0) does the trick! Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible bug in "metaclass resolution order" ?

2005-09-18 Thread Simon Percivall
If you have read the document I referred you to, did you also read the example where classes M1, M2, M3 and M4 were defined? A quote from the discussion of that example: "For class D, the explicit metaclass M1 is not a subclass of the base metaclasses (M2, M3), but choosing M3 satisfies the constr

Re: How does f=open('mytext.txt', 'w+') work?

2005-09-18 Thread Alex
Yes the problem seems to be exactly that. I'm moving around the file pointer. This piece of code works. Observe the only thing I've added is f.seek(0) >>> f=open('mytext.txt', 'w+') >>> f.write('My name is Bob') >>> f.seek(0) >>> s=f.read() >>> print s My name is Bob >>> f.close() I've found this

Re: Python game coding

2005-09-18 Thread Alessandro Bottoni
Diez B. Roggisch wrote: > Diez B. Roggisch wrote: >> >>> Very interesting! >>> BTW: I wonder if and when someone will use stackless python or pygame >>> as a >>> basis for developing a _visual_ development environment for 2D >>> games/multimedia like Macromedia Director. It would be a killer app.

Re: Python 2.5 alpha

2005-09-18 Thread Fredrik Lundh
"D Hering" wrote: > I just installed 2.5a0 what part of aahz's "There is no Python 2.5 alpha" did you not understand? > in an alternative directory (make altinstall) which > build and tested out fine. I'm gonna now attempt to compile the module > packages mentioned above. I'll report how it turn

Re: Postgres PL/Python

2005-09-18 Thread Ksenia Marasanova
Thanks to all, especially to Stuart, for very informative answers. It's clear to me now that there is no need in my case to use functions / stored procedures (yes, with typical MVC app I meant a webapp on the same server with database, administered by the same persons). However it can be a useful

Re: How to obtain a 'interactive session' of a script?

2005-09-18 Thread Fredrik Lundh
Bo Peng wrote: > This method works fine with only one minor problem. It would stop > (waiting for user input) at help(str) command. I will have to find a way > to feed the program with'q' etc. replacing sys.stdin with something that isn't a TTY will fix this. here's one way to do it: class

Re: How does f=open('mytext.txt', 'w+') work?

2005-09-18 Thread Ksenia Marasanova
18 Sep 2005 09:11:51 -0700, Alex <[EMAIL PROTECTED]>: > Rossum's tutorial on Python states: it's "Van Rossum's" :) "van" in a part of the last name, you can't just cut it away in Dutch :) -- Ksenia -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 alpha

2005-09-18 Thread D.Hering
So far so good. Numeric-24.0b2, numarray-1.3.3, pytables-1.1.1 (gonna wait alittle on the scipy install) all built. Tests passed except one trivial test in numarray but does function: 1 items had failures: 1 of 1205 in cache pass ***Test Failed*** 1 failures. File "/usr/local/lib/python2.5/site

Re: How does f=open('mytext.txt', 'w+') work?

2005-09-18 Thread Steven D'Aprano
On Sun, 18 Sep 2005 09:11:51 -0700, Alex wrote: > Rossum's tutorial on Python states: > "open() returns a file object, and is most commonly used with two > arguments: 'open(filename, mode)' > mode 'r+' opens the file for both reading and writing." > > Here's a little session in Python's interacti

Re: How does f=open('mytext.txt', 'w+') work?

2005-09-18 Thread Fredrik Lundh
"Alex" wrote: > If I open the file mytext.txt in Notepad I see something that begins > with > > "My name is Bob VwMÚ¸x¶ Ð" > > and goes on for approximately 4082 characters. > > What's happening?? you're moving the file pointer around in a new file, and you're getting junk (from the stdio fil

Re: ordering results by column

2005-09-18 Thread leonardburton
I guess google did something funny to me. I was trying to post this to Cake PHP group. Thanks, Leonard -- http://mail.python.org/mailman/listinfo/python-list

ordering results by column

2005-09-18 Thread leonardburton
Hi, I posted this ticket https://trac.cakephp.org/ticket/212 and didn't get a meaningful answer. How can I order the data by a certain column in an index page? Thanks, Leonard -- http://mail.python.org/mailman/listinfo/python-list

Re: How to obtain a 'interactive session' of a script?

2005-09-18 Thread Fredrik Lundh
Bo Peng wrote: >> import code >> >> SCRIPT = [line.rstrip() for line in open("myscript.py")] >> >> script = "" >> prompt = ">>>" >> >> for line in SCRIPT: >> print prompt, line >> script = script + line + "\n" >> co = code.compile_command(script, "", "exec") >> if co: >> #

Re: How does f=open('mytext.txt', 'w+') work?

2005-09-18 Thread Thomas Jollans
I have no idea what is happening, but to the subject line: I guess it's a plain wrapper around fopen fron -- http://mail.python.org/mailman/listinfo/python-list

Re: Roguelike programmers needed

2005-09-18 Thread Robert Kern
Thomas Jollans wrote: > what exactly is RPG/roguelike etc ? (what debian package provides an > example?) Google is your friend. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.pyt

Re: Why do Pythoneers reinvent the wheel?

2005-09-18 Thread Mike Meyer
Jorgen Grahn <[EMAIL PROTECTED]> writes: > On Sat, 10 Sep 2005 20:24:32 -0400, François Pinard <[EMAIL PROTECTED]> wrote: > Yeah. I've often wished for some overview or guide that translates the > current buzzwords to old concepts I'm familiar with. For example, I'm sure > you can capture the core

Concurrent access behind an asynchronous server

2005-09-18 Thread Pierre Quentel
Sorry if the question seems naive, but is there a risk of concurrent accesses to a database if it is accessed only by scripts called by requests to an asynchronous server ? I have the same question for a server built on the non-threaded version of SocketServer.TCPServer A+ Pierre -- http://ma

Re: Shed Skin under Windows and OSX

2005-09-18 Thread A.B., Khalid
Mark Dufour wrote: > > By the way, I read in your blog that you would be releasing a windows > > intaller soon. > > Have you, or anyone else, managed to do it? > > I just finished making a 20 MB (!) package for Windows XP (I'm not > sure which older versions of Windows it will run on.) It includes

Re: Roguelike programmers needed

2005-09-18 Thread Thomas Jollans
what exactly is RPG/roguelike etc ? (what debian package provides an example?) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to obtain a 'interactive session' of a script?

2005-09-18 Thread Bo Peng
[EMAIL PROTECTED] wrote: > The 'code' module contains 'Utilities needed to emulate Python's interactive > interpreter.'. By subclassing code.InteractiveConsole and replacing the > raw_input method with one which reads from a file, I think you can get what > you > want. This method works fine wit

Re: Python:C++ interfacing. Tool selection recommendations

2005-09-18 Thread Mike Meyer
> (I wonder, by the way, if it's a good idea to provide a very rich interface > between an application and embedded Python. I have no experience in the > area, but intuition tells me that simplicity and minimalism is important. So long as you distinguish between minimalist and the bare minimum. M

Re: Possible bug in "metaclass resolution order" ?

2005-09-18 Thread Pedro Werneck
On 18 Sep 2005 00:39:31 -0700 "Michele Simionato" <[EMAIL PROTECTED]> wrote: > Remember that given a class C, its metaclass is given by C.__class__, > not by > C.__metaclass__, despite the name. Of course. Seems you think I'm arguing that C.__class__ and __metaclass__ should always be the same. T

How does f=open('mytext.txt', 'w+') work?

2005-09-18 Thread Alex
Rossum's tutorial on Python states: "open() returns a file object, and is most commonly used with two arguments: 'open(filename, mode)' mode 'r+' opens the file for both reading and writing." Here's a little session in Python's interactive window >>> f=open('mytext.txt','w+') >>> f.write('My name

Re: How to obtain a 'interactive session' of a script?

2005-09-18 Thread Bo Peng
Thank you for the suggestions and code! > import code > > SCRIPT = [line.rstrip() for line in open("myscript.py")] > > script = "" > prompt = ">>>" > > for line in SCRIPT: > print prompt, line > script = script + line + "\n" > co = code.compile_command(script, "", "exec") > if

Re: Python Doc Problem Example: os.path.split

2005-09-18 Thread Matija Papec
X-Ftn-To: Xah Lee "Xah Lee" <[EMAIL PROTECTED]> wrote: >Python Doc Problem Example what makes you sure that this problem would be interesting for groups beside c.l.python? are you begging to be converted to a true religion? :-) -- Matija -- http://mail.python.org/mailman/listinfo/python-list

Re: How to obtain a 'interactive session' of a script?

2005-09-18 Thread jepler
The 'code' module contains 'Utilities needed to emulate Python's interactive interpreter.'. By subclassing code.InteractiveConsole and replacing the raw_input method with one which reads from a file, I think you can get what you want. The example below the classes uses StringIO so that it can be

Re: How to obtain a 'interactive session' of a script?

2005-09-18 Thread Fredrik Lundh
Bo Peng wrote: > I have a long list of commands in the form of a script and would like to > obtain a log file as if I enter the commands one by one. (The output > will be used in a tutorial.) What would be the best way to do it? Copy > and paste is not acceptable since I make frequent changes tot

How to obtain a 'interactive session' of a script?

2005-09-18 Thread Bo Peng
Dear list, I have a long list of commands in the form of a script and would like to obtain a log file as if I enter the commands one by one. (The output will be used in a tutorial.) What would be the best way to do it? Copy and paste is not acceptable since I make frequent changes tot he scri

Re: reading files with error

2005-09-18 Thread jepler
On Sun, Sep 18, 2005 at 02:15:00PM +1000, Maurice Ling wrote: > Sorry but what are SEEK_END and SEEK_SET? Oops, that's what I get for snipping a part of a larger program. SEEK_SET = 0 SEEK_END = 2 Jeff pgpC1OTox5VvO.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/pyt

Re: Python 2.5 alpha

2005-09-18 Thread D.Hering
Hi Aahz, Yes thank you. To clarify the cvs dist README listed Python version 2.5 alpha 0. I should have realized before posting that replacing was a bad idea and another "slot-ed" version could be installed (package manager already has 2.3.5 & 2.4.1). I just installed 2.5a0 in an alternative direct

Re: complex data types?

2005-09-18 Thread richard
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > At the same time, if array[0].songs equals array[1] songs, you are > probably initializing both array[0] and array[1] with the same object. > Since array[0] and array[1] both refer to the same object, a change to > one wil

Re: complex data types?

2005-09-18 Thread richard
Gustavo Picon <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Sat, 2005-09-17 at 23:34 -0500, Gustavo Picon wrote: >> Maybe something like this? >> >> class music(object): >> def __init__(self): >> self.lst = {} >> def __setattr__(self, name, value): >> self.__d

Re: FTP status problems. (Again)

2005-09-18 Thread Nainto
It works! Thanks so much for your help! -- http://mail.python.org/mailman/listinfo/python-list

C#3.0 and lambdas

2005-09-18 Thread bearophileHUGS
On Slashdot there is a discussion about the future C#3.0: http://developers.slashdot.org/developers/05/09/18/0545217.shtml?tid=109&tid=8 http://msdn.microsoft.com/vcsharp/future/ There are many differences, but it looks a bit more like Python: http://download.microsoft.com/download/9/5/0/9503e33e

Re: Brute force sudoku cracker

2005-09-18 Thread Anton Vredegoor
Diez B. Roggisch wrote: > As everyone posts his, I'll do the same :) It uses some constraint based > solving techniques - but not too complicated ones. When stuck, it > backtracks. So far it never failed me, but I haven't tested it too > thouroughly. Thanks to all for sharing. I like to program su

Re: Putting a lock on file.

2005-09-18 Thread Steven D'Aprano
On Sat, 17 Sep 2005 23:58:58 -0700, Harlin Seritt wrote: > I have a file that a few different running scripts will need to access. > Most likely this won't be a problem but if it is, what do I need to do > to make sure scripts don't crash because the input file is in use? > Would it be best to run

Re: Brute force sudoku cracker

2005-09-18 Thread [EMAIL PROTECTED]
Had the same reaction as everyone when I saw theses puzzles a month or so ago, so here is my solution... the solve function is recursive, so it can also solve the 'deadlock set' (example3). find_cell looks for an empty cell with the most filled cells in it's row and column, so the search tree doesn

Re: Why do Pythoneers reinvent the wheel?

2005-09-18 Thread Jorgen Grahn
On 14 Sep 2005 07:03:28 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Stefano Masini wrote: > >> There are a few ares where everybody seems to be implementing their >> own stuff over and over: logging, file handling, ordered dictionaries, >> data serialization, and maybe a few more. >> I do

Re: Python Doc Problem Example: os.path.split

2005-09-18 Thread Laszlo Zsolt Nagy
>is the doc writer, trying to write the doc with some austereness, but >is confused about the behavior of split, or confused about expressing >it? Did his pretension fucked him up? > > Dear Xah Lee, The Python community is very sorry because we have a very bad documentation. You are right. Th

Re: Python Doc Problem Example: os.path.split

2005-09-18 Thread Steven D'Aprano
On Sun, 18 Sep 2005 03:46:03 -0700, Xah Lee wibbled: > Can anyone tell me what this verbiage is trying to fucking say? Please don't feed the trolls. In other words, if everybody ignores this loser, he might crawl back under the rock he came from. -- Steven. -- http://mail.python.org/mailman/

Python Doc Problem Example: os.path.split

2005-09-18 Thread Xah Lee
Python Doc Problem Example Quote from: http://docs.python.org/lib/module-os.path.html -- split( path) Split the pathname path into a pair, (head, tail) where tail is the last pathname component and head is everything leading up to that. The tail part will never contain a slash

Re: [Python-Dev] python optimization

2005-09-18 Thread Diez B. Roggisch
Neal Becker wrote: > One possible way to improve the situation is, that if we really believe > python cannot easily support such optimizations because the code is too > "dynamic", is to allow manual annotation of functions. For example, gcc > has allowed such annotations using __attribute__ for qu

Re: Brute force sudoku cracker

2005-09-18 Thread Diez B. Roggisch
As everyone posts his, I'll do the same :) It uses some constraint based solving techniques - but not too complicated ones. When stuck, it backtracks. So far it never failed me, but I haven't tested it too thouroughly. Diez import copy def condense(vals): if len(vals) == 0: retur

Re: Python game coding

2005-09-18 Thread Diez B. Roggisch
Diez B. Roggisch wrote: > >> Very interesting! >> BTW: I wonder if and when someone will use stackless python or pygame >> as a >> basis for developing a _visual_ development environment for 2D >> games/multimedia like Macromedia Director. It would be a killer app. > > > Blender. It currently d

Re: Python game coding

2005-09-18 Thread Diez B. Roggisch
> Very interesting! > > BTW: I wonder if and when someone will use stackless python or pygame as a > basis for developing a _visual_ development environment for 2D > games/multimedia like Macromedia Director. It would be a killer app. Blender. It currently doesn't use stacklass AFAIK, but that

Re: Python game coding

2005-09-18 Thread Alessandro Bottoni
Lucas Raab wrote: > Saw this on Slashdot > (http://developers.slashdot.org/article.pl?sid=05/09/17/182207&from=rss) > and thought some people might be interested in it. Direct link to the > article is > http://harkal.sylphis3d.com/2005/08/10/multithreaded-game-scripting-with-stackless-python/ >

Re: Putting a lock on file.

2005-09-18 Thread tiissa
Harlin Seritt wrote: > I have a file that a few different running scripts will need to access. [...] > This may seem nice on paper but I hate to run a while for an > indeterminate amount of time. Is there anything else that can be done > that would be better? On posix systems, there is a fcntl mod

Re: Possible bug in "metaclass resolution order" ?

2005-09-18 Thread Michele Simionato
Pedro Werneck wrote: >>> class M_A(type): pass ... >>> class A: __metaclass__ = M_A ... >>> class M_B(M_A): pass ... >>> class B(A): __metaclass__ = M_B ... >>> class C(B): __metaclass__ = M_A ... >>> C.__class__ >>> C.__metaclass__ > Is this supposed to happen ? Yes, or at least I fee

Re: Python 2.5 alpha

2005-09-18 Thread Thomas Jollans
D.Hering wrote: > under gentoo linux 2.6. that does not exist. gentoo labels installers 2005.0 etc, but I have never heard of version numbers. do you mean gentoo with linux 2.6 ? -- http://mail.python.org/mailman/listinfo/python-list

Putting a lock on file.

2005-09-18 Thread Harlin Seritt
I have a file that a few different running scripts will need to access. Most likely this won't be a problem but if it is, what do I need to do to make sure scripts don't crash because the input file is in use? Would it be best to run a loop like the following: flag = 0 while not flag: try:

Re: pinging from within python

2005-09-18 Thread Harlin Seritt
You can do the following: import os data = os.popen('ping machineName').read() if 'request timed out' in data or 'unknown host' in data: Ping Failed Code else: Ping Returned Something Good Code This is the quickest and really most effective way to get it done IMO. Harlin Seritt Inte