Re: global interpreter lock

2005-08-26 Thread [EMAIL PROTECTED]
Mike Meyer wrote: > Bryan Olson <[EMAIL PROTECTED]> writes: > > The issue here is whether to confuse reality with what one might > > wish reality to be. > > Let's see. Reality is that writing correct programs is hard. Writing > correct programs that use concurr

Re: minimalist regular expression

2005-08-26 Thread [EMAIL PROTECTED]
Whenever I ask a match in a string for(a{3,}b and match for (a{1,}, the first is implicit second: ab is implicit in a.*;automatically -- http://mail.python.org/mailman/listinfo/python-list

fontifying a pattern in a Tkinter Text widget

2005-08-27 Thread [EMAIL PROTECTED]
Hi, I'm writing a program which needs to change various format features of a specific pattern ("remote_user" for example) withing a Text widget. This pattern could potentially be anywhere within the widget. I'm unsure of how to implement the various tag methods, so a little push in the right direc

using common lisp with python.

2005-08-28 Thread [EMAIL PROTECTED]
is there a way to embed common lisp programs in python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Lossless Number Conversion

2005-08-28 Thread [EMAIL PROTECTED]
Chris Spencer wrote: > Is there any library for Python that implements a kind of universal > number object. Something that, if you divide two integers, generates a > ratio instead of a float, or if you take the square root of a negative, > generates a complex number instead of raising an exception

Re: trictionary?

2005-08-28 Thread [EMAIL PROTECTED]
Steven Bethard wrote: > Adam Tomjack wrote: > > Steven Bethard wrote: > > ... > >> Using a two element list to store a pair of counts has a bad code > >> smell to me. > > ... > > > > Why is that? > > Note that "code smell"[1] doesn't mean that something is actually wrong, > just that it might be.

Re: Question

2005-08-29 Thread [EMAIL PROTECTED]
Much more useful stuff for beginners is here: http://wiki.python.org/moin/BeginnersGuide -- http://mail.python.org/mailman/listinfo/python-list

Re: using common lisp with python.

2005-08-29 Thread [EMAIL PROTECTED]
basically, what I'm looking to do is use python as a bridge between C and Common Lisp to create a virtual city that contains Artificial life. -- http://mail.python.org/mailman/listinfo/python-list

Re: using common lisp with python.

2005-08-29 Thread [EMAIL PROTECTED]
Your best bet is probably to look into your LISP environment's FFI (Foreign Function Interface). Most LISP environments have some way to call C code directly. Insofar as going back the other way... that I'm a little more sketchy on. Guile (the Scheme compiler from GNU) is a strong contender, tho

Drag&Drop in wxListCtrl

2005-08-29 Thread [EMAIL PROTECTED]
Hi, I have to create a ListBox in which I have to move items up and down using DnD. How to create drag and drop call backs in wxListCtrl. I can see EVT_LIST_BEGIN_DRAG but I could not find any EVT_LIST_END_DRAG. So, how can I achieve DnD with ListCtrl? Thanks in advance for the suggestions. Reg

Re: trictionary?

2005-08-29 Thread [EMAIL PROTECTED]
Bengt Richter wrote: > On 28 Aug 2005 18:54:40 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > >Steven Bethard wrote: > >> Adam Tomjack wrote: > >> > Steven Bethard wrote: > >> > ... > >> >> Using a t

Re: Code run from IDLE but not via double-clicking on its *.py

2005-08-30 Thread [EMAIL PROTECTED]
n00m wrote: > When I double-click on "some.py" file console window appears just for a > moment and right after that it's closed. If this script is started from > inside of IDLE (F5 key) then it executes as it should be (e.g. > executing all its print statements). > > Any ideas? OS: Windows; Python

Embedding Matplotlib images into wxPython

2005-08-30 Thread [EMAIL PROTECTED]
I am trying to embed images into a wxPython app (created using Boa Constructor), but have not been able to do so. I know how to embed plots, but images seem to be a problem. I've tried using code analogous to the example given at the Matplotlib website to no avail. If anybody has been successful at

Re: telnet.read_until() from telnetlib

2005-08-30 Thread [EMAIL PROTECTED]
but the 'expect' gives you more details about the failure... read the documentation on telnet objects here: "http://docs.python.org/lib/telnet-objects.html";. It says this specifically: "If end of file is found and no text was read, raise EOFError. Otherwise, when nothing matches, return (-1, None,

Re: variable hell

2005-08-30 Thread [EMAIL PROTECTED]
Steve, can I quote you on that? "You can lead an idiot to idioms, but you can't make him think!" -- Steve Holden 2005 -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding Matplotlib images into wxPython

2005-08-30 Thread [EMAIL PROTECTED]
Well, to answer my own question, the problem turned out to be that I was using the 'wx' backend and not the 'wxagg' one. Attempting to use the former typically resulted in a not implemented error upon the call to imshow. I was working from an older set of matplotlib example files which didn't inclu

Question about threading.Lock().aquire(waitflag)

2005-08-30 Thread [EMAIL PROTECTED]
It's not clear to me from the Python docs whether waitflag is treated as a boolean or as a number. Running on Windows, I get two different behaviors from the following calls to acquire: aLock = threading.Lock() ... # Thread 0 # This one often succeeds aLock.acquire(1) ... #

ANN: Python GUI Editor...

2005-08-31 Thread [EMAIL PROTECTED]
I named this tool - FarPy GUIE, and is available at: http://farpy.holev.com/ This is a quote from the site: "GUIE (GUI Editor) provides a simple WYSIWYG GUI editor for wxPython. The program was made in C# and saves the GUI that was created to a XML format I called GUIML. This GUIML is a pretty st

Re: global interpreter lock

2005-08-31 Thread [EMAIL PROTECTED]
phil hunt wrote: > Some times concurrency is the best (or only) way to do a job. Other > times, it's more trouble than its worth. A good programmer will know > which is which, and will not use an overly complex solution for the > project he is writing. Also, a good programmer won't conflate concur

Re: command line arguments

2005-08-31 Thread [EMAIL PROTECTED]
_option("-u", "--url", action="store", dest="url", help = "enter an url") py> py>(options, args) = parser.parse_args() py>if not options.name and not options.url: py> parser.error('specify both name and url') py>

Re: Calling ftp commands from python

2005-08-31 Thread [EMAIL PROTECTED]
Your best bet would be to use "pexpect" module. Code may look something like: import pexpect import sys child = pexpect.spawn ('ftp ftp.site.com') child.expect ('Name .*: ') child.sendline ('username') child.expect ('Password:') child.sendline ('password') child.expect ('ftp> ') child.sendline ('

Re: telnet.read_until() from telnetlib

2005-09-01 Thread [EMAIL PROTECTED]
then you are using a regex expression that is a wildcard match, and that is non-deterministic. -- http://mail.python.org/mailman/listinfo/python-list

plotting with gnuplot.py

2005-09-02 Thread [EMAIL PROTECTED]
Hi, I've been having some problems trying some basic plotting commands with gnuplot.py. My setup is the Python 2.3 Enthought edition and my script looks as: from scipy import * from scipy import gplt import scipy.io.array_import #import Gnuplot filename = ('Default.PL1') data = scipy.io.array_im

Re: using common lisp with python.

2005-09-03 Thread [EMAIL PROTECTED]
Thank you all for the advice, I think I'll be writing my lisp code in python. -- http://mail.python.org/mailman/listinfo/python-list

Re: plotting with gnuplot.py

2005-09-03 Thread [EMAIL PROTECTED]
Thanks for the response Varun, I guess I still not sure the distingtion betweein gnuplot.py and its implentation in scipy. -- http://mail.python.org/mailman/listinfo/python-list

Re: plotting with gnuplot.py

2005-09-03 Thread [EMAIL PROTECTED]
Still having some issues plotting: In attempting as explained above: import Gnuplot,Numeric filename = ('Default.PL1') data = scipy.io.array_import.read_array(filename) y = data[:,1] x = data[:,0] z = data[:,2] //I think u need to take the transpose of this column before plotting.. x=Numeric.t

Assigning 'nochage' to a variable.

2005-09-04 Thread [EMAIL PROTECTED]
Has anyone else felt a desire for a 'nochange' value resembling the 'Z'-state of a electronic tri-state output? var1 = 17 var1 = func1() # func1() returns 'nochange' this time print var1 # prints 17 It would be equivalent to: var1 = 17 var2, bool1 = func1() if bool1: var1 = var2

Re: Assigning 'nochage' to a variable.

2005-09-05 Thread [EMAIL PROTECTED]
Thanks for the suggestions, although I'll probably continue to use: var1 = 17 var1 = func1(var1) print var1 and have func1 return the input value if no change is required. It's *almost* as nice as if there was a Nochange value available.. BR /CF -- http://mail.python.org/mailman/listinfo/py

Re: Assigning 'nochage' to a variable.

2005-09-05 Thread [EMAIL PROTECTED]
Oh, right I see you also thought of that. (Sorry, didnt read your entire mail.) -- http://mail.python.org/mailman/listinfo/python-list

Re: Pervasive Database Connection

2005-09-06 Thread [EMAIL PROTECTED]
Use the pervasive client. You'll need the SDK to actually access any data though. -- http://mail.python.org/mailman/listinfo/python-list

Re: killing thread after timeout

2005-09-06 Thread [EMAIL PROTECTED]
You'll need a watchdog thread that handles the other threads. The watchdog thread just builds a table of when threads were started, and after a certain # of seconds, expires those threads and kills them. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pervasive Database Connection

2005-09-06 Thread [EMAIL PROTECTED]
http://www.pervasive.com/developerzone/access_methods/oledbado.asp -- http://mail.python.org/mailman/listinfo/python-list

Re: Ode to python

2005-09-06 Thread [EMAIL PROTECTED]
Python the programming language is reviled for its indentage. Although it's the norm, to code in free form makes sources no better than garbage. -- http://mail.python.org/mailman/listinfo/python-list

multi pointer slider(scale)

2005-09-07 Thread [EMAIL PROTECTED]
HI, I am new to python graphics. I want to have a scale(tkinter) or slider(wxpython), on which I can have more than one pointers. Using it I want to have single slider for different parameters of an entity. Can anyone help me to look for it OR make it. Thanks in adwance. -- http://mail.python.org

Re: bug in numarray?

2005-09-07 Thread [EMAIL PROTECTED]
python 2.4.1 numarray 1.3.1 works ok here. I'd try numarray 1.3.1 and see if it is unique to your version. Also, if you built it yourself, you might make sure you have sane CFLAGS. [EMAIL PROTECTED] ~ $ python Python 2.4.1 (#1, Sep 3 2005, 16:55:52) [GCC 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.

Re: List of integers & L.I.S.

2005-09-07 Thread [EMAIL PROTECTED]
I coded a solution that can compute the ordering numbers for random.shuffle(range(1, 101)) in 2.5 seconds (typical, Win 2K Pro, Pentium 4 2.40GHz 785Meg RAM) Are you sure that this is not a homework problem? -- http://mail.python.org/mailman/listinfo/python-list

Re: record sound to numarray/list

2005-09-08 Thread [EMAIL PROTECTED]
No there is not. Hey, you could write one though. -- http://mail.python.org/mailman/listinfo/python-list

Re: pretty windows installer for py scripts

2005-09-08 Thread [EMAIL PROTECTED]
I second that. NSIS works better than MSI, Inno, or even InstallShield. I highly recommend it. Of course, a second choice is Inno, third is MSI, and last resort is InstallShield. Another option is to make an installer using "AutoIT" but that can get kind of tricky. -- http://mail.python.org/mailm

Re: List of integers & L.I.S.

2005-09-08 Thread [EMAIL PROTECTED]
> ... and let me reveal the secret: > http://spoj.sphere.pl/problems /SUPPER/ your question is different than the question on this website. also, what do you consider to be the correct output for this permutation? (according to your original question) [4, 5, 1, 2, 3, 6, 7, 8] Manuel -- http:/

Re: List of integers & L.I.S.

2005-09-08 Thread [EMAIL PROTECTED]
So, this has no real world use, aside from posting it on a website. Thanks for wasting our time. You are making up an arbitrary problem and asking for a solution, simply because you want to look at the solutions, not because your problem needs to be solved. Clearly, this is a waste of time. -- ht

Re: popen in thread on QNX

2005-09-08 Thread [EMAIL PROTECTED]
spawn() works on QNX, fork() does not. -- http://mail.python.org/mailman/listinfo/python-list

Re: List of integers & L.I.S.

2005-09-08 Thread [EMAIL PROTECTED]
Working on this allowed me to avoid some _real_ (boring) work at my job. So clearly it served a very useful purpose! ;) Manuel -- http://mail.python.org/mailman/listinfo/python-list

Re: List of integers & L.I.S.

2005-09-08 Thread [EMAIL PROTECTED]
> That's easy to follow, although their use of a Van Emde-Boas set as a > given hides the most challenging part (the "efficient data structure" > part). The "efficient data structure" is the easy part. Obviously, it is a dict of lists. ...or is it a list of dicts?... ...or is it a tuple of gene

Re: Yielding a chain of values

2005-09-09 Thread [EMAIL PROTECTED]
>>unless you are going many levels deep (and that's usually a design smell of some kind) No, its not a bug. its a feature! See the discussion in the recursive generator thread below: http://groups.google.com/group/comp.lang.python/browse_frm/thread/4c749ec4fc5447fb/36f2b915eba66eac?q=recursive+ge

Re: Grouping lists

2005-09-09 Thread [EMAIL PROTECTED]
I wasn't sure of what itertools.groupby() is good for. But it serves your purpose. >>> lst = [1,1,1,1,3,5,1,1,1,1,7,7,7] >>> >>> import itertools >>> i = 0 >>> groups = [] >>> for k, g in itertools.groupby(lst): ... l = len(list(g)) ... if l == 1: ... groups.append(i) ... else:

Re: Yielding a chain of values

2005-09-09 Thread [EMAIL PROTECTED]
I'm not really worry that much over O(n^2) performace (especially having optimized some O(n^3) SQL operations :-o !) The things is this really should be an O(n) operation. Having a yield all statement or expression is useful in its own right and also potentially a way to optimized away the O(n^2)

How to handle very large MIME Messages with the email package?

2005-09-10 Thread [EMAIL PROTECTED]
Looking at the email package, it seems all the MIMExxx classes takes string but not file object as the payload. I need to handle very large MIME messages say up to 100M. And possibly many of them. Is email package sufficient. If not is it possible to extend it? Looking at a previous thread it seem

Re: Unusual Python Sighting

2005-09-10 Thread [EMAIL PROTECTED]
Scott David Daniels wrote: > In article: > http://humorix.org/articles/2005/08/notice/ > > ... 6. The use of semantically significant whitespace in Python® > programs might be protected by intellectual property laws in > five (5) countries, > &g

read from label

2005-09-12 Thread [EMAIL PROTECTED]
HI, It may be a very elementry question, but I need to know that how can I get text of a label. -- http://mail.python.org/mailman/listinfo/python-list

Sorting Unix mailboxes

2005-09-13 Thread [EMAIL PROTECTED]
= None: break print Envelope.getallmatchingheaders("from")[0] Match=AddressRE.search( Envelope.getallmatchingheaders("from")[0]) if Match: Set=Match.groups() if "[EMAIL PROTECTED]&quo

Re: ezPyCrypto

2005-09-14 Thread [EMAIL PROTECTED]
Why do you want to encrypt just the numbers? -- http://mail.python.org/mailman/listinfo/python-list

Re: complex data types?

2005-09-17 Thread [EMAIL PROTECTED]
richard wrote: > I'd like to have an array in which the elements are various data types. > How do I do this in Python? > > For example: > > array[0].artist = 'genesis' > array[0].album = 'foxtrot' > array[0].songs = ['watcher', 'time table', 'friday'] > array[1].artist = 'beatles' > array[1].album

Re: complex data types?

2005-09-17 Thread [EMAIL PROTECTED]
That is a great example Gustavo... One way that Richard's error of array[0] equaling array[1] could be introduced would be by accidentally appending the 'music' class object onto his list, rather than creating a new instance of music each time. Changing the code: array.append(music()) array.appen

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: 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

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: threads/sockets quick question.

2005-09-19 Thread [EMAIL PROTECTED]
The problem may be something to do with using "threading" as identifier name. It is name of a module and definitely what you want it done anyway. You are better off having another variable as counter (with a different name). Raghu. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to program efficient pattern searches in a list of float numbers?

2005-09-19 Thread [EMAIL PROTECTED]
I am not interested in doing your homework. -- http://mail.python.org/mailman/listinfo/python-list

Alternatives to Stackless Python?

2005-09-20 Thread [EMAIL PROTECTED]
After recently getting excited about the possibilities that stackless python has to offer (http://harkal.sylphis3d.com/2005/08/10/multithreaded-game-scripting-with-stackless-python/) and then discovering that the most recent version of stackless available on stackless.com was for python 2.2 I am wo

spe stani collapse all method?

2005-09-21 Thread [EMAIL PROTECTED]
hello, I wonder if anyone used spe stani, I'm looking for how to collapse all code fold, but can't find. pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: unusual exponential formatting puzzle

2005-09-21 Thread [EMAIL PROTECTED]
Neal Becker wrote: > Like a puzzle? I need to interface python output to some strange old > program. It wants to see numbers formatted as: > > e.g.: 0.23456789E01 > > That is, the leading digit is always 0, instead of the first significant > digit. It is fixed width. I can almost get it with '

Re: unusual exponential formatting puzzle

2005-09-21 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Neal Becker wrote: > > Like a puzzle? I need to interface python output to some strange old > > program. It wants to see numbers formatted as: > > > > e.g.: 0.23456789E01 > > > > That is, the leading digit is always 0, instead

Noobie Starting New Project

2005-09-21 Thread [EMAIL PROTECTED]
I've have an idea for a personal project. I want to access my car's OBD-II port via serial to query engine paramters and represent them on my PC monitor. The various methods to represent them would be any of the following: analog gauge (speedometer), digital readout, and X Y Plots/Charts (HP vs RPM

Re: How to show percentage

2005-09-22 Thread [EMAIL PROTECTED]
Traditionally, one part of the expression has to be a float for the result to be a float (this is a holdover from C). So 100/3.0 will give you the result you want. Alternatively, you can put "from __future__ import division" at the top of your script, and then 100/3 will return a float. http://www

SOS Win - How to save metafile as Bitmap ?

2005-02-07 Thread [EMAIL PROTECTED]
Hi ! My problem is that: I have a program that copy pictures from Notes NSF file. The format is METAFILE or METAFILEPICT. I can save these pictures with this code: import win32api import win32con import win32gui ... mode=0 if mode==0: import win32clipboard, win32con win32clipboard.OpenClipboard

Re: Dumb glob question

2005-02-07 Thread [EMAIL PROTECTED]
code like below willprint all files ending on 'par2', except tose not containong 'vol' from the 5th position. is that what you need? -import glob -for nuke in glob.glob(r"""c:\temp\*.par2"""): -try: -nuke.index('vol', 5) -print nuke -except ValueError, e: -print e -

python connect to server using SSH protocol

2005-02-08 Thread [EMAIL PROTECTED]
How can python connect to server which use SSH protocol? Is it easy since my python has to run third party vendor, write data, read data inside the server (supercomputer). Any suggestion? Sincerely Yours, Pujo Aji -- http://mail.python.org/mailman/listinfo/python-list

multi threading in multi processor (computer)

2005-02-09 Thread [EMAIL PROTECTED]
Hello, Is anyone has experiance in running python code to run multi thread parallel in multi processor. Is it possible ? Can python manage which cpu shoud do every thread? Sincerely Yours, Pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: multi threading in multi processor (computer)

2005-02-09 Thread [EMAIL PROTECTED]
Hello Pierre, That's a pity, since when we have to run parallel, with single processor is really not efficient. To use more computers I think is cheaper than to buy super computer in developt country. Sincerely Yours, pujo aji -- http://mail.python.org/mailman/listinfo/python-list

Re: two questions - no common theme

2005-02-09 Thread [EMAIL PROTECTED]
os.walk gives an object with all files in a tree, e.g. f = os.walk('c:\\temp') for i in f: print i -- http://mail.python.org/mailman/listinfo/python-list

Re: What's wrong with `is not None`?

2005-02-09 Thread [EMAIL PROTECTED]
btw, 'isnot' is not pronounced "is-not" but rather "i-snot". :-) S -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a safe marshaler?

2005-02-10 Thread [EMAIL PROTECTED]
Irmen de Jong wrote: > Pickle and marshal are not safe. They can do harmful > things if fed maliciously constructed data. > That is a pity, because marshal is fast. I think marshal could be fixed; the only unsafety I'm aware of is that it doesn't always act rationally when confronted with incorrec

Re: Seekable output from ClientForm?

2005-02-10 Thread [EMAIL PROTECTED]
Thanks a lot! Matej -- http://mail.python.org/mailman/listinfo/python-list

xmlrpc username/password failures

2005-02-12 Thread [EMAIL PROTECTED]
n import xmlrpclib from xmlrpclib import * test = Server('http://3tier:My&[EMAIL PROTECTED]/Forecast') print test.ReturnSimpleInt() Returns the following error: Traceback (most recent call last): File "./testCondon.py", line 8, in ? print test.ReturnSimpleInt() File

exec function

2005-02-12 Thread [EMAIL PROTECTED]
I'm a newbie to pthyon and I am creating an app with wxPython. I have 7 tables (more on the way... they are feed from a database) that need to be formatted in a certain way (DataTable() does this) and I am just looking for a cleaner way to pass all of the Grids (grid_1, grid_2, etc) through the sam

Re: help please

2005-02-12 Thread [EMAIL PROTECTED]
add just below the procedure declaration 'global t2' as you're referring to a global variable ... -- http://mail.python.org/mailman/listinfo/python-list

keep a local COM Server alive

2005-02-14 Thread [EMAIL PROTECTED]
I wrote a COM server in Python where all the clients use the same global object(test_obj). So far it works, but when the last client is closed the Python COM enviornment is closed and the global object is lost. How can I prevent that? I need that new clients use the same global object and not a new

keeping a COM server alive

2005-02-14 Thread [EMAIL PROTECTED]
I have implemented a local COM Server with win32com framework where all clients use the same global object (test_obj). So far it works, but when the last client is closed the gobal object is deleted because the pythonw.exe is closed. When I create a new client a new pythonw process is started. I ne

nested lists as arrays

2005-02-14 Thread [EMAIL PROTECTED]
Hi, why can't I do this: dummy = self.elements[toy][tox] self.elements[toy][tox] = self.elements[fromy][fromx] self.elements[fromy][fromx] = dummy after initialising my nested list like this: self.elements = [[0 for column in range(dim)] for row in range(dim) ]

PIG/IP Meeting (Python Interest Group In Princeton) Wed. Feb. 16.

2005-02-14 Thread [EMAIL PROTECTED]
, 2005 at the Lawrenceville Library (Room #2). We will be reviewing the Python Tutorial at http://www.python.org/doc/2.4/tut/tut.html and then open discussion about Python will be encouraged. Anyone interested in the Python language is invited to attend. Contact Jon Fox at [EMAIL PROTECTED] for

Re: nested lists as arrays

2005-02-14 Thread [EMAIL PROTECTED]
Diez B. Roggisch wrote: > [EMAIL PROTECTED] wrote: > > > Hi, > > > > why can't I do this: > > > > dummy = self.elements[toy][tox] > > > > self.elements[toy][tox] = self.elements[fromy][fromx] > > self.elements[from

Re: nested lists as arrays

2005-02-14 Thread [EMAIL PROTECTED]
Thanks for the code. What I want to do is this: I want to solve the block puzzle problem. The problem is as follows: You have a nxn Array of Numbers and one empty space. Now you there are up to four possible moves: up, right, down and left, so that each neighbour of the empty slot can be moved the

Re: nested lists as arrays

2005-02-14 Thread [EMAIL PROTECTED]
Allright. What difference in runtime and space would it make using dictionaries instead? Do you have a pointer for me concerning runtime of standard manipulations in Pythons? Thanks for tip. -- http://mail.python.org/mailman/listinfo/python-list

Re: nested lists as arrays

2005-02-14 Thread [EMAIL PROTECTED]
Allright. What difference in runtime and space would it make using dictionaries instead? Do you have a pointer for me concerning runtime of standard manipulations in Pythons? Thanks for the tip. -- http://mail.python.org/mailman/listinfo/python-list

Inheritance error in python 2.3.4???

2005-02-14 Thread [EMAIL PROTECTED]
In trying to construct a good object model in a recent project of mine, I ran across the following peculiarity in python 2.3.4 (haven't tried any newer versions): Say you have a base class that has an attribute and an accessor function for that attribute (just a simple get). Then you inherit that

Re: Inheritance error in python 2.3.4???

2005-02-14 Thread [EMAIL PROTECTED]
The problem is that I actually do need them to be private to the outside world... but not to subclasses. I guess what I actually need is something like "protected" in C++ but I don't think I'm going to get that luxury. I think what's happening in my example is

Re: Inheritance error in python 2.3.4???

2005-02-14 Thread [EMAIL PROTECTED]
Thanks guys for all your input! I really appreciate the prompt replies! As you can tell I'm having a bit of trouble throwing out old habits... I'm not new to loosely typed languages (I'm a big PHP fan) but learning a new object model has been a little tough... I'm trying to make my old ideas fit

Re: os.walk() usage

2005-02-15 Thread [EMAIL PROTECTED]
every object in os.walk() returns a 3-tuple, like below, it seems your code assumes it returns only a list of files. for d in os.walk('c:\\temp'): (dirpath, dirnames, filenames) = d print dirpath print dirnames print filenames -- http://mail.python.org/mailman/lis

Re: more os.walk() issues... probably user error

2005-02-16 Thread [EMAIL PROTECTED]
That's an easy one: fs_objects is not modified by your ode, so you get it back as created by os.walk -- http://mail.python.org/mailman/listinfo/python-list

Re: Font size

2005-02-16 Thread [EMAIL PROTECTED]
Adam wrote: > "Adam" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > "BOOGIEMAN" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > >> On Tue, 15 Feb 2005 21:22:43 GMT, Adam wrote: > >>

Re: keeping a COM server alive

2005-02-17 Thread [EMAIL PROTECTED]
Hi, thanks, I 'll post the problem in python-win32@python.org ... Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: send() argument 1 must be string or read-only buffer, not int

2005-02-17 Thread [EMAIL PROTECTED]
if you want to send the value '1000' over a socket connection in a socket object do something like sock.send(str(1000)) if socket is a socket.socket object. -- http://mail.python.org/mailman/listinfo/python-list

pyWrath project

2005-02-19 Thread [EMAIL PROTECTED]
and every man/woman/elf/alien/cyborg/whatelse who is capable to do some basic (sometimes advanced) Python tasks. Interested? Contact me at [EMAIL PROTECTED] or [EMAIL PROTECTED] Regards, BiFacial P. S. Sorry for crappy English. I am Russian, after all :) -- http://mail.python.org/mailman/listinfo

controlling a qbasic program on a windows98 or example of rs-232 commanded through python

2005-02-19 Thread [EMAIL PROTECTED]
Hello, Can python be installed on a win98 system ? if so, how do I control a qbasic program from python ? the qbasic program controls input to an RS-232 so I am enclined to follow the win98 system + qbasic route in order to be quick, or I guess the question could be, can I control a device throug

socket or xml error?

2005-02-19 Thread [EMAIL PROTECTED]
I got an error as following. The Server/cllient program was written by somebody else and supposed to be working before. Whenever I start a new client to load xml data from server, the program will fail as: File "ShowAllData.py", line 157, in ? main(sys.argv) File "ShowAllData.py", line 1

Error when display socekt content

2005-02-19 Thread [EMAIL PROTECTED]
Hello all, The displayed string looks like some wierd chars (unreadable to human being at all), when I tried to display the received message by socket. I read by this line: body = self.io.blockingRead (int(header.getFieldCN ('Content-Length'))) print "socket content: " + body I am new to pyth

Re: pyWrath project

2005-02-20 Thread [EMAIL PROTECTED]
As Felix pointed out, of course link should read http://sourceforge.net/projects/pywrath Sorry to everyone who tried to follow crappy link :) -- http://mail.python.org/mailman/listinfo/python-list

Re: [long] nested lists as arrays

2005-02-20 Thread [EMAIL PROTECTED]
great thanks -- http://mail.python.org/mailman/listinfo/python-list

subclassing Decimal

2005-02-21 Thread [EMAIL PROTECTED]
I was interested in playing around with Decimal and subclassing it. For example, if I wanted a special class to permit floats to be automatically converted to strings. from decimal import Decimal class MyDecimal(Decimal): def __init__(self, value): if isinstance(value

Re: subclassing Decimal

2005-02-21 Thread [EMAIL PROTECTED]
STeVe, Thanks for the response. Very clear. yea-though-I-walk-thru-the-valley-of-__new__-I-will-fear-no-super-ly y'rs, -Jeff -- http://mail.python.org/mailman/listinfo/python-list

<    4   5   6   7   8   9   10   11   12   13   >