Re: new python debugger

2005-08-11 Thread Neil Hodgson
Nir: > Winpdb is still a BETA despite the version number which is 1.0.1 > so I will appreciate feedback on bugs, unexpected behavior, or > suggestions. Value tips when you hover over variables in the editor would be useful. A hovering user can be detected with the wxEVT_STC_DWELLSTART notif

client server question

2005-08-11 Thread John
I have a simple script that runs a server where one client can connect. I would like to make it so that many clients can connect to one server on the same port. Where can I find how to do this? Thanks, --j -- http://mail.python.org/mailman/listinfo/python-list

newbie q: Visualizing py-classes in UML automatically

2005-08-11 Thread pyragine_sraige
Hi "Py's", is there anyone who has written a kind of converter (?) for visualizing python-classes with "poseidon for uml"? I couldn't find a plug-in-hint(?) on the HP; or am I looking wrong? A good hint to another free tool would be also nice. (I only want to see if I am totally wrong with self

Re: Unicode regular expressions -- buggy?

2005-08-11 Thread Fredrik Lundh
Christopher Subich wrote: > I don't think the python regular expression module correctly handles > combining marks; it gives inconsistent results between equivalent forms > of some regular expressions: > Is this a limitation-by-design, or a bug? limitation by design. if you want correct results

Re: performance of recursive generator

2005-08-11 Thread Matt Hammond
> Is it an inherent issue in the use of recursive generator? Is there any > compiler optimization possible? Hi, I could be misunderstanding it myself, but I think the short answer to your question is that its an inherent limitation. > def inorder(t): > if t: > for x in inorder(

Re: performance of recursive generator

2005-08-11 Thread Duncan Booth
aurora wrote: > Note that there are 4 calls to inorder() and 10 yield. Indeed the > complexity of traversing this kind of tree would be O(n^2)! > > There will be 4 calls to inorder() and 4 call to foo(), give a > reasonable O(n) performance. > > Is it an inherent issue in the use of recur

Re: Memory leak in PyImport_ReloadModule - URGENT

2005-08-11 Thread Michael Hudson
[EMAIL PROTECTED] writes: > Having recently upgraded to Python 2.4, I am having a large memory > leak with the following code built with VC++ 6.0: > > PyObject *pName, *pModule; > > Py_Initialize(); > pName = PyString_FromString(argv[1]); > >

Re: What are modules really for?

2005-08-11 Thread Neil Benn
Tito wrote: > > >>> >>> >>If I want to change one class and replace the file on the install then I >>need to put a whole bunch of classes on - increasing the change of >>making a mistake. >> >> > >Sorry, I don't understand the previous sentence. What is meant by >"replace on the inst

Re: MainThread blocks all others

2005-08-11 Thread Nodir Gulyamov
Dennis, I am really appreciated you comments. Thanks you very much. And let me a little bit explain idea of program. I should did it earlier. Instead of empty loops i already tried to use time.sleep() firstly, but effect was same, all other threads do not working too and as experiment i tried

Re: Pre-PEP Proposal: Codetags

2005-08-11 Thread Fuzzyman
I'm sure Martin's comment is basically correct. *However* - you could take your proposal forward by developing a set of tools (e.g. documentation tools) that use your proposal. That way people have a working implementation to use. e.g. Tools to generate HTML TODO lists from source code It would t

zipfile library - problem..

2005-08-11 Thread Renzo
Hi, I'm working to create a backup function for a software; in particular, from a directory with 12300 files (Jpg, medium size = 250KB / total size = 2.90GB), i have to create a zip file. I've decided to use the standard "zipfile" library to do that. This is the code: zipName = path.join(config

Re: What are modules really for?

2005-08-11 Thread bruno modulix
Neil Benn wrote: (snip) >> > Suppose you have a logistics tracking system available on every install > in your company - there are 55 installs throughout the company. You > wish to push through a patch because of a problem. If you have one > class per file you can push that class through onto the

read function in python serial

2005-08-11 Thread sinan .
hi i`m developing a program that reads the serial device. i like the readline() function, but readline() depends on \n character, i want a similar function that waits for a specific character or string that i gave like [ETX] (hex03) how can i do this ? thank you. -- http://mail.python.org/mailman/

set of sets

2005-08-11 Thread Paolino
I thought rewriting __hash__ should be enough to avoid mutables problem but: class H(set): def __hash__(self) return id(self) s=H() f=set() f.add(s) f.remove(s) the add succeeds the remove fails eventually not calling hash(s). Thanks for help Paolino

Re: set of sets

2005-08-11 Thread Matteo Dell'Amico
Paolino wrote: > I thought rewriting __hash__ should be enough to avoid mutables problem > but: > > class H(set): > def __hash__(self) > return id(self) > > s=H() > > f=set() > > f.add(s) > f.remove(s) > > the add succeeds > the remove fails eventually not calling hash(s). Why don't yo

Regular expression to match a #

2005-08-11 Thread Tom Deco
Hi, I'm trying to use a regular expression to match a string containing a # (basically i'm looking for #include ...) I don't seem to manage to write a regular expression that matches this. My (probably to naive) approach is: p = re.compile(r'\b#include\b) I also tried p = re.compile(r'\b\#includ

Re: set of sets

2005-08-11 Thread Paolino
Matteo Dell'Amico wrote: > Paolino wrote: > >>I thought rewriting __hash__ should be enough to avoid mutables problem >>but: >> >>class H(set): >> def __hash__(self) >>return id(self) >> >>s=H() >> >>f=set() >> >>f.add(s) >>f.remove(s) >> >>the add succeeds >>the remove fails eventually not

Re: new python debugger

2005-08-11 Thread Franz Steinhaeusler
On 10 Aug 2005 23:10:57 -0700, [EMAIL PROTECTED] wrote: Hello Nir, >Thanks for the compliments. > >I really believe Winpdb is not just another Python debugger, and that >it will be a real step forward in the quality of Python debuggers once >it matures. Yes, looks very promising ;) > >Also, don'

Re: new python debugger

2005-08-11 Thread Franz Steinhaeusler
On Thu, 11 Aug 2005 13:09:08 +0200, Franz Steinhaeusler <[EMAIL PROTECTED]> wrote: >> >>Winpdb is still a BETA despite the version number which is 1.0.1 >>so I will appreciate feedback on bugs, unexpected behavior, or >>suggestions. List of current breakpoints (VC Alt-F9), where you can quickly s

Re: regex help

2005-08-11 Thread John Machin
jeff sacksteder wrote: > Regex questions seem to be rather resistant to googling. > > My regex currently looks like - 'FOO:.*\n\n' > > The chunk of text I am attempting to locate is a line beginning with > "FOO:", followed by an unknown number of lines, terminating with a > blank line. Clearly th

Re: Regular expression to match a #

2005-08-11 Thread Dan
> My (probably to naive) approach is: p = re.compile(r'\b#include\b) I think your problem is the \b at the beginning. \b matches a word break (defined as \w\W or \W\w). There would only be a word break before the # if the preceding character were a \w (that is, [A-Za-z0-9_], and maybe some other c

Re: regex help

2005-08-11 Thread gene tani
when *I* google http://www.awaretek.com/tutorials.html#regular http://en.wikibooks.org/wiki/Programming:Python_Strings http://www.regexlib.com/Default.aspx http://docs.python.org/lib/module-re.html http://diveintopython.org/regular_expressions/index.html#re.intro http://www.amk.ca/python/howto/r

Re: "Compile time" checking?

2005-08-11 Thread Fabio Zadrozny
Just as a note... Pylint is integrated within pydev (http://pydev.sf.net) Cheers, Fabio Qopit wrote: >>Why not just find out, by trying to compile it? :-) >> >> > >This will likely certify me as a python newbie, but... how do you mean? > How do you compile a .py file? > >If you mean to .pyc

How to quit a Windows GUI program gracefully with Python under Cygwin?

2005-08-11 Thread KB
Hi, I want to write a Python script that controls and automates a Windows GUI computation program. My problem is that I do not know how to quit the Windows GUI program gracefully with a command (program's or Python) in Cygwin. 'kill' or CTRL-C command in Cygwin does not finish it gracefully, mea

Re: Regular expression to match a #

2005-08-11 Thread Tom Deco
Thanks, That did the trick... -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression to match a #

2005-08-11 Thread Duncan Booth
Dan wrote: >> My (probably to naive) approach is: p = re.compile(r'\b#include\b) > > I think your problem is the \b at the beginning. \b matches a word break > (defined as \w\W or \W\w). There would only be a word break before the # > if the preceding character were a \w (that is, [A-Za-z0-9_], a

Re: new python debugger

2005-08-11 Thread nir1408
Thanks for the valuable input. I will look into it. In the mean time, until I implement your suggestions, here are some workarounds for the problems you experienced. 1. In the "Open Source" dialog, instead of typing the full path of the script you wish to load, try typing just its name (e.g. 'foo

Re: interpreter frame

2005-08-11 Thread Peter Hansen
Leo wrote: > Good try, but that doesn't seem to work either. Maybe I should have > emphasized that what I really want is the line of code, as opposed to > the entire frame. Ah, it wasn't clear from your first post that you were specifically interested in a line you entered at the *interactive pr

Re: Regular expression to match a #

2005-08-11 Thread John Machin
Tom Deco wrote: > Hi, > > I'm trying to use a regular expression to match a string containing a # > (basically i'm looking for #include ...) > > I don't seem to manage to write a regular expression that matches this. > > My (probably to naive) approach is: p = re.compile(r'\b#include\b) > I also

Re: what's the exactly newsgroup url of python-list?

2005-08-11 Thread Fredrik Lundh
Ben Finney wrote: > news:comp.lang.python> is a URL to a Usenet newsgroup, as > evidenced by the 'news:' schema part. If your web browser is > configured properly to invoke a newsreader (such as Thunderbird) for > 'news:' URLs, your newsrreader will then attempt to get the > comp.lang.newsgroup fr

Re: PEP 328, absolute/relative import

2005-08-11 Thread Peter Hansen
Ben Finney wrote: > Aahz <[EMAIL PROTECTED]> wrote: >>Ben Finney <[EMAIL PROTECTED]> wrote: >>>So, under PEP 328 rules, the original poster's current-directory >>>module could only be imported (a) if the current directory was in >>>sys.path, or (b) if the code specified a relative import. The >>>a

Re: Creating Palm OS programs with python?

2005-08-11 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > QUick question: > > Is it possible to create a palm os program to use on a PDA with > python? Practically speaking, no. I did find it relatively easy to install and learn enough of Plua to write a useful app for my old Palm V, however, and Lua isn't so far from Pytho

Re: signals (again)

2005-08-11 Thread Michael Hudson
"bill" <[EMAIL PROTECTED]> writes: > I see this (or similar) question occasionally looking back through the > archive, but haven't yet seen a definitive answer, so I'm going to ask > it again. > > Consider the following: > > while True: > do_something_to_files_in_directory(fd) > fcntl(fd,

Re: read function in python serial

2005-08-11 Thread Fredrik Lundh
"sinan ." <[EMAIL PROTECTED]> wrote: > hi i`m developing a program that reads the serial device. i like the > readline() function, but readline() depends on \n character, i want a > similar function that waits for a specific character or string that i > gave like [ETX] (hex03) how can i do this ?

Re: Regular expression to match a #

2005-08-11 Thread John Machin
Duncan Booth wrote: > Dan wrote: > > >>>My (probably to naive) approach is: p = re.compile(r'\b#include\b) >> >>I think your problem is the \b at the beginning. \b matches a word break >>(defined as \w\W or \W\w). There would only be a word break before the # >>if the preceding character were a \

Re: client server question

2005-08-11 Thread Peter Hansen
John wrote: > I have a simple script that runs a server where one client can connect. > I would like to make it so that many clients can connect to one server > on the same port. Where can I find how to do this? Start by reading http://www.catb.org/~esr/faqs/smart-questions.html to learn how to a

Re: read function in python serial

2005-08-11 Thread Peter Hansen
sinan . wrote: > hi i`m developing a program that reads the serial device. i like the > readline() function, but readline() depends on \n character, i want a > similar function that waits for a specific character or string that i > gave like [ETX] (hex03) how can i do this ? > thank you. def seria

Re: What are modules really for?

2005-08-11 Thread Magnus Lycka
N.Davis wrote: > Functions existing in a module? Surely if "everything is an object" (OK > thats Java-talk but supposedly Python will eventually follow this too) int too? ;) Actaully, I think Python and Java are fairly much on equal footing here, with Java possibly being slightly behind rather

Re: Regular expression to match a #

2005-08-11 Thread Jeff Schwab
John Machin wrote: > Search for r'^something' can never be better/faster than match for > r'something', and with a dopey implementation of search [which Python's > re is NOT] it could be much worse. So please don't tell newbies to > search for r'^something'. How else would you match the beginn

Re: set of sets

2005-08-11 Thread Paolo Veronelli
Matteo Dell'Amico wrote: > Paolino wrote: > >>I thought rewriting __hash__ should be enough to avoid mutables problem >>but: >> >>class H(set): >> def __hash__(self) >>return id(self) >> >>s=H() >> >>f=set() >> >>f.add(s) >>f.remove(s) >> >>the add succeeds >>the remove fails eventually not

Re: set of sets

2005-08-11 Thread Robert Kern
Paolino wrote: > Matteo Dell'Amico wrote: >>Why don't you just use "frozenset"? > > This is what I'm doing, but the problem remains IMO. > Anyway with frozenset I have to override __new__ instead of __init__ to > make the initialization which is an operation not described in the > frozenset do

Re: What are modules really for?

2005-08-11 Thread Brian Quinlan
N.Davis wrote: > Functions existing in a module? Surely if "everything is an object" > (OK thats Java-talk but supposedly Python will eventually follow this > too) There is a difference between everything being an object and everything being an instance of a class. In Python, every runtime ent

Re: client server question

2005-08-11 Thread Chris Curvey
import threading import logging ## class Reader(threading.Thread): def __init__(self, clientsock): threading.Thread.__init__(self) self.logger = logging.getLogger("Reader") #---

Re: Creating Palm OS programs with python?

2005-08-11 Thread rdsteph
Hello Peter, There are some links to Python on Palm web resources at my http://www.awaretek.com/pymo.html";>Python for Mobile Devices page. The only mobile device I have personnally run Python on is the Zaurus, which works great. I will try to post links to just the Python on Palm resources below

Re: What are modules really for?

2005-08-11 Thread bruno modulix
Magnus Lycka wrote: > N.Davis wrote: > >> Functions existing in a module? Surely if "everything is an object" >> (OK thats Java-talk but supposedly Python will eventually follow this >> too) > > > int too? ;) Yes, int too. >>> i = 42 >>> i.__class__ >>> i.__class__.__name__ 'int' >>> dir(i)

Re: new python debugger

2005-08-11 Thread Franz Steinhaeusler
On 11 Aug 2005 05:19:31 -0700, [EMAIL PROTECTED] wrote: >Thanks for the valuable input. I will look into it. You're welcome. > >In the mean time, until I implement your suggestions, here are some >workarounds for the problems you experienced. >[...] Really, you want to implement? cool ;) If you

Re: set of sets

2005-08-11 Thread Paolo Veronelli
Paolino wrote: > I thought rewriting __hash__ should be enough to avoid mutables problem but: > > class H(set): >def __hash__(self) > return id(self) > > s=H() > > f=set() > > f.add(s) > f.remove(s) > > the add succeeds > the remove fails eventually not calling hash(s). > Yes this i

Re: set of sets

2005-08-11 Thread Matteo Dell'Amico
Paolo Veronelli wrote: > And mostly with sets remove operation expense should be sublinear or am > I wrong? > Is this fast as with lists? It's faster then with lists... in sets, as with dicts, remove is on average O(1). > Obviously if I use the ids as hash value nothing is guaranted about the >

Re: Creating Palm OS programs with python?

2005-08-11 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > There are some links to Python on Palm web resources at my href="http://www.awaretek.com/pymo.html";>Python for Mobile Devices > page. It's nice to see there are still traces of activity but, unfortunately, all those links show is that there's no way to write a real P

Re: What is Python?!

2005-08-11 Thread Grant Edwards
On 2005-08-11, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 11 Aug 2005 15:51:45 +1200, Evil Bastard <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> To me, the term is archic. What 'scripting language' means to me is: >> 1. insufficient facilities for general purp

Re: Pre-PEP Proposal: Codetags

2005-08-11 Thread Aahz
In article <[EMAIL PROTECTED]>, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: >Micah Elliott wrote: >> >> I also have this living as a wiki >> if people would like to add comments there. I might try to capture there >> feedback from this

Re: what's the exactly newsgroup url of python-list?

2005-08-11 Thread Grant Edwards
On 2005-08-11, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > >> news:comp.lang.python> is a URL to a Usenet newsgroup, as >> evidenced by the 'news:' schema part. If your web browser is >> configured properly to invoke a newsreader (such as Thunderbird) for >> 'news:' URLs, your ne

net view /domain

2005-08-11 Thread usenet
Hi! Is there a module I can use for "net view /domain" so list all available domains and workgroups in a windows-network? I'm looking for something like win32net.NetServerEnum, because I don't really want to do this by "popen". Kind regards Dirk -- http://mail.python.org/mailman/listinfo/python

RE: net view /domain

2005-08-11 Thread Tim Golden
[EMAIL PROTECTED] | Hi! | | Is there a module I can use for "net view /domain" so list all | available domains and workgroups in a windows-network? I'm looking for | something like win32net.NetServerEnum, because I don't really want to | do this by "popen". I think this will do it. (The WinNT obj

Re: Pre-PEP Proposal: Codetags

2005-08-11 Thread A.M. Kuchling
On Thu, 11 Aug 2005 08:47:37 +0200, Martin v. Löwis <[EMAIL PROTECTED]> wrote: > I think you somewhat misunderstood the purpose of the PEP process. > This is meant primarily for enhancements to Python (the language > and its library), ... PEP 0 disagrees: PEP stands for Python Enhan

Re: help in algorithm

2005-08-11 Thread Tom Anderson
On Wed, 10 Aug 2005, Paolino wrote: > I have a self organizing net which aim is clustering words. Let's think > the clustering is about their 2-grams set. Words then are instances of > this class. > > class clusterable(str): > def __abs__(self):# the set of q-grams (to be calculated only once)

len(sys.argv) in (3,4)

2005-08-11 Thread Daniel Schüle
Hello I wrote a simple module, which is also supposed to be used as standalone program after considering how to avoid multiple if's I came up with this idea if __name__ == "__main__": if len(sys.argv) not in (3,4): print "usage: prog arg1 argv2 [-x]" # etc ... while develeoping

Re: zipfile library - problem..

2005-08-11 Thread Renzo
Renzo ha scritto: I've seen that the error is a known bug: "zipfile still has 2GB boundary bug" so I've used the module TarFile instead ZipFile, and now the script works perfectly. Thanks to Deelan and Manlio Perillo (i.c.l.p

Python DLL creation in MSVS.net

2005-08-11 Thread mitt
Hi. Trying to create dll's to interface python scripts to CHAI3D http://www.chai3d.org/ "Computer Haptics & Active Interfaces for 3D VR worlds". Any hint or docs that could be of use? Currently using the book "mit Python programieren" from dpunkt.verlag. -- Sven-Erik Tiberg -- Lulea Univ. of Te

Writing a small battleship game server in Python

2005-08-11 Thread Michael Goettsche
Hi there, for a project in our computer science lessons at school we decided to write a client/server based battleship like game [1]. I know this game could be written without a server, but the whole project is for educational purposes. Being the initiator of this project, I thought I would wr

Re: Regular expression to match a #

2005-08-11 Thread Duncan Booth
John Machin wrote: >> Alternatively for C style #includes search for r'^\s*#\s*include\b'. > > Search for r'^something' can never be better/faster than match for > r'something', and with a dopey implementation of search [which > Python's re is NOT] it could be much worse. So please don't tell >

Re: len(sys.argv) in (3,4)

2005-08-11 Thread bruno modulix
Daniel Schüle wrote: > Hello > > I wrote a simple module, which is also supposed to be used as standalone > program > after considering how to avoid multiple if's I came up with this idea > > if __name__ == "__main__": > if len(sys.argv) not in (3,4): > print "usage: prog arg1 argv2

Re: wxPython and threads again

2005-08-11 Thread David E. Konerding DSD staff
On 2005-08-10, Bryan Olson <[EMAIL PROTECTED]> wrote: > > The easiest approach, though, is to use the threadedselectreactor in > Twisted (you need > > to check the HEAD branch out with subversion, because that reactor > isn't included in any releases). > > With threadedselectreactor, it's easy to

Re: "Compile time" checking?

2005-08-11 Thread phil hunt
On 10 Aug 2005 18:32:54 -0700, Qopit <[EMAIL PROTECTED]> wrote: > >> if debug: print "v=%s" % (v,) > >Not that important, but I assume the first one was supposed to be: > > if debug: print "v=", s > >right? No, I'm trying to print (v) not (s). -- Email: zen19725 at zen dot co dot uk -- http

Re: "Compile time" checking?

2005-08-11 Thread phil hunt
On Thu, 11 Aug 2005 02:35:40 GMT, Bengt Richter <[EMAIL PROTECTED]> wrote: >On Wed, 10 Aug 2005 20:39:03 +0100, [EMAIL PROTECTED] (phil hunt) wrote: >[...] >> >>I've not personally had problems with the wrong number of argumnets >>to a function call -- they get caught at run-time and are easy >>e

Re: What is Python?!

2005-08-11 Thread phil hunt
On Thu, 11 Aug 2005 15:51:45 +1200, Evil Bastard <[EMAIL PROTECTED]> wrote: > >I guess a language could be called a 'scripting language' if: > - the source code can be executed directly, and/or > - source need not be converted to a separate file in a > non-human-readable format before it can be e

Re: Writing a small battleship game server in Python

2005-08-11 Thread Brian Quinlan
Michael Goettsche wrote: > What would be a good, but still easy way to write such a server? You could use SimpleXMLRPCServer. A client call sequence could like this: >>> s = xmlrpclib.Server('http://...') >>> token = s.join_game() # blocks until another player joins >>> s.send_board( ... ['.

Re: wxPython and threads again

2005-08-11 Thread David E. Konerding DSD staff
On 2005-08-10, Peter Hansen <[EMAIL PROTECTED]> wrote: > David E. Konerding DSD staff wrote: >> Further, calling wx from a thread other than the one running the event > > loop is deep voodoo and should typically be avoided. > > "Typically"? Let's just say "always" and maybe use the phrase "certai

Re: zipfile library - problem..

2005-08-11 Thread Bryan Olson
Renzo wrote: > Renzo ha scritto: > > I've seen that the error is a known bug: > > "zipfile still has 2GB boundary bug" > > > so I've used the module TarFile instead ZipFile, and now the script > works perfectly. Thanks;

Re: What is Python?!

2005-08-11 Thread Reinhold Birkenfeld
Evil Bastard wrote: > bruno modulix wrote: >> You can tell buy the most common use. bash is a scripting language, >> javascript is a scripting language, perl is a scripting language, php is >> a scripting language, Python is *not* a scripting language !-) > > Perhaps a better definition - the term

Using PyThreadState_SetAsyncExc with PyEval_CallObject

2005-08-11 Thread [EMAIL PROTECTED]
I am attempting to raise an exception in a thread currently calling PyEval_CallObject from another thread using PyThreadState_SetAsyncExc. The PyEval_CallObject is currently calling of a function with looks like def fun() : import time count = 0 while 1: count = count + 1 time.sleep(

Re: epyDoc Questions

2005-08-11 Thread Colin J. Williams
Neil Benn wrote: > Hello, > > I can;t find a epyDoc specific mailing list, so I'll try here - > if you know of a epyDoc mailing list then please let me know (google is > not my friend, I can only find an announce, devel and commit list from > 'epydoc mailing list'). > epyDoc gives nic

Re: len(sys.argv) in (3,4)

2005-08-11 Thread Daniel Dittmar
Daniel Schüle wrote: > if __name__ == "__main__": > if len(sys.argv) not in (3,4): > print "usage: prog arg1 argv2 [-x]" > # etc ... > > while develeoping I had my interpeter running and reloaded module > now since I am ready, I wanted to run it from cmd windows shell > but it alwa

Re: Writing a small battleship game server in Python

2005-08-11 Thread Dan
> The server should accept connections from new players and be able to handle > multiple games concurrently. Multiple threads would be the way to go for a real application. But if you want to avoid the complexity involved in threading and synchronization in this exercize, you can avoid threads by

thread limit in python

2005-08-11 Thread danieldsmith
hello all, i have run into a problem where i cannot start more than 1021 threads in a python program, no matter what my ulimit or kernel settings are. my program crashes with 'thread.error: can't start new thread' when it tries to start the 1021st thread. in addition to tweaking my ulimit setting

Re: Writing a small battleship game server in Python

2005-08-11 Thread googlenews
Why not using directly SOAP ? A minimalistic 'Hello world' client looks like : from SOAPpy import SOAPProxy server= SOAPProxy("http://localhost:8080";) print server.Hello("world") and the server side like : from SOAPpy import SOAPServer def Hello(name): print "Wishing

Re: Regular expression to match a #

2005-08-11 Thread Aahz
In article <[EMAIL PROTECTED]>, John Machin <[EMAIL PROTECTED]> wrote: > >Search for r'^something' can never be better/faster than match for >r'something', and with a dopey implementation of search [which Python's >re is NOT] it could be much worse. So please don't tell newbies to >search for r

Re: Spreadsheet with Python scripting and database interface?

2005-08-11 Thread Florian Diesch
Wolfgang Keller <[EMAIL PROTECTED]> wrote: > I'm looking for a spreadsheet application (MacOS X prefered, but > Windows, Linux ar available as well) with support for Python scripting > (third-party "plug-ins" are ok) and a database interface. > > Applications that I know of (that they exist) are: >

[ANN] Dabo Runtime for Windows 0.4 Released

2005-08-11 Thread Ed Leafe
We've just updated the Dabo Runtime for Windows. This allows someone who is running Windows to try out Dabo without having to install any prerequisites, not even Python itself. It includes the latest version of the Dabo framework, as well as the demo apps and the (still-under-construction) visu

Supressing argument renaming in the Qt Designer -> pyuic workflow

2005-08-11 Thread Madhusudan Singh
Hi Some of the functions I defined inside Qt Designer need to have some values passed to them. For instance : Code : void Form3::runningplot(n,plottitle,xname,x,y1name,y1,y2name,y2) is translated by pyuic to Python code : def runningplot(self,a0,a1,a2,a3,a4,a5,a6,a7): Now, while I understa

Re: Spreadsheet with Python scripting and database interface?

2005-08-11 Thread Carsten Haese
On Fri, 2005-07-29 at 04:21, Wolfgang Keller wrote: > Hello, > > I'm looking for a spreadsheet application (MacOS X prefered, but > Windows, Linux ar available as well) with support for Python scripting > (third-party "plug-ins" are ok) and a database interface. > > Applications that I know of (t

Re: "Ordered" dicts

2005-08-11 Thread Colin J. Williams
Delaney, Timothy (Tim) wrote: > Martin Miller wrote: > > >>To avoid continued reinvention of this wheel, I'd also vote to have >>this functionality be at least included in a standard module, if not >>built-in. > > > This has been discussed on python-dev (I proposed it actually). The > final con

python2.4/site-packages

2005-08-11 Thread Srinivasan TK
All, I have been successful in build/install of python2.4 on AIX. Now ,Is it mandatory that I build the third-party packages ( python2.4/site-packages) .If so is there a list that needs to be built and installed . Please advise. __

Re: performance of recursive generator

2005-08-11 Thread Terry Reedy
"aurora" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I love generator and I use it a lot. Lately I've been writing some > recursive generator to traverse tree structures. After taking closer look > I have some concern on its performance. When the stacked yields become a measurea

Re: about coding

2005-08-11 Thread Paul Watson
cantabile wrote: > Hi, being a newbie in Python, I'm a bit lost with the '-*- coding : -*-' > directive. > > I'm using an accented characters language. Some of them are correctly > displayed while one doesn't. I've written : > -*- coding: utf-8 -*- > > Is this wrong ? > > Where can I find a pr

Re: help in algorithm

2005-08-11 Thread Bengt Richter
On Wed, 10 Aug 2005 16:51:55 +0200, Paolino <[EMAIL PROTECTED]> wrote: >I have a self organizing net which aim is clustering words. >Let's think the clustering is about their 2-grams set. >Words then are instances of this class. > >class clusterable(str): > def __abs__(self):# the set of q-gram

command line reports

2005-08-11 Thread Darren Dale
Is there a module somewhere that intelligently deals with reports to the command line? I would like to report the progress of some pretty lengthy simulations, and currently I have the new reports written on a new line rather rather than overwriting the previous report. Thanks, Darren -- http://ma

Re: PEP 328, absolute/relative import

2005-08-11 Thread Bengt Richter
On Thu, 11 Aug 2005 08:25:26 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: >Ben Finney wrote: >> Aahz <[EMAIL PROTECTED]> wrote: >>>Ben Finney <[EMAIL PROTECTED]> wrote: So, under PEP 328 rules, the original poster's current-directory module could only be imported (a) if the current dire

Re: Pre-PEP Proposal: Codetags

2005-08-11 Thread Terry Reedy
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Both elements seem to be missing your document: it does not propose > changes to the Python language; instead, it proposes a specific > way of writing comments (ie. something that is not relevant to the > Python int

Re: wxPython and threads again

2005-08-11 Thread Peter Hansen
David E. Konerding DSD staff wrote: > http://wxwidgets.org/manuals/2.6.1/wx_threadfunctions.html#threadfunctions > > This strongly suggests you can arbitrarily grab the wx GUI lock and call GUI > functions from any thread. It's still voodoo. But we're adults here, and > practicing > voodoo isn'

Re: python2.4/site-packages

2005-08-11 Thread Michael Hoffman
Srinivasan TK wrote: > Now ,Is it mandatory that I build the third-party > packages ( python2.4/site-packages) . Only if you want to use them. Really, no. > If so is there a > list that needs to be built and installed . There is a list of them packages which you MAY install but may also choose

Re: interpreter frame

2005-08-11 Thread Fernando Perez
Peter Hansen wrote: > Leo wrote: >> Good try, but that doesn't seem to work either. Maybe I should have >> emphasized that what I really want is the line of code, as opposed to >> the entire frame. > > Ah, it wasn't clear from your first post that you were specifically > interested in a line you

Re: command line reports

2005-08-11 Thread Michael Hoffman
Darren Dale wrote: > Is there a module somewhere that intelligently deals with reports to the > command line? I would like to report the progress of some pretty lengthy > simulations, and currently I have the new reports written on a new line > rather rather than overwriting the previous report. I

need help with python syntax

2005-08-11 Thread yaffa
dear python gurus, quick question on syntax. i have a line of code like this for incident in bs('tr', {'bgcolor' : '#ee'}): what i want it to do is look for 'bgcolor' : '#ee' or 'bgcolor' : 'white' and then do a whole bunch of stuff. i've tried this: for incident in bs('tr', {'bgco

Re: PEP 328, absolute/relative import

2005-08-11 Thread Peter Hansen
Bengt Richter wrote: > Will/should an __init__.py in the current directory be required, > to control what happens (and lessen the probability of accidental > collision from a random working directory)? I don't think so. That would simply shift the possibility of mysterious behaviour from the iss

Re: Python supports LSP, does it?

2005-08-11 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 11 Aug 2005 01:19:19 +0100 > phil hunt wrote: > >> According to Wikipedia, the Liskov substitution principle is: >> >> Let q(x) be a property provable about objects x of type T. Then >> q(y) should be true for objects y of

Re: command line reports

2005-08-11 Thread Peter Hansen
Darren Dale wrote: > Is there a module somewhere that intelligently deals with reports to the > command line? I would like to report the progress of some pretty lengthy > simulations, and currently I have the new reports written on a new line > rather rather than overwriting the previous report. Y

Re: thread limit in python

2005-08-11 Thread danieldsmith
also, on the same box a similar C program (posted below) has no problem starting 5000+ threads. #include #include #include #include void * run (void *arg) { sleep(1000); } int main(int argc, char *argv[]) { int j; pthread_t tid; int num_threads = atoi(argv[1]); for (j=0; j

Re: thread limit in python

2005-08-11 Thread danieldsmith
disregard the C example. wasn't checking the return code of pthread_create. the C program breaks in the same place, when creating the 1021st thread. -- http://mail.python.org/mailman/listinfo/python-list

Re: len(sys.argv) in (3,4)

2005-08-11 Thread Daniel Schüle
I just tried the same code at home and it worked fine it has to do with windows .. some settings or whatever (python 2.4.1 installed on both) maybe someone have experienced the same problem and had more luck in solving the puzzle -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >