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

2005-09-19 Thread malv
Simple case: In this list, how to find all occurences of intervals of n adjacent indexes having at least one list-member with a value between given limits. Visualizing the list as a two-dimensional curve, this is like horizontally dragging a given rectangle over the curve and finding the x coordina

Re: Brute force sudoku cracker

2005-09-19 Thread Antoon Pardon
Op 2005-09-16, [EMAIL PROTECTED] schreef <[EMAIL PROTECTED]>: > > Bas ha escrito: > >> Hi group, >> >> I came across some of these online sudoku games and thought after >> playing a game or two that I'd better waste my time writing a solver >> than play the game itself any longer. I managed to writ

Re: Brute force sudoku cracker

2005-09-19 Thread Antoon Pardon
Op 2005-09-17, Tom Anderson schreef <[EMAIL PROTECTED]>: > On Fri, 16 Sep 2005, Bas wrote: > >> -any ideas how to easily incorporate advanced solving strategies? >> solve(problem1) and solve(problem2) give solutions, but solve(problem3) >> gets stuck... > > the only way to solve arbitrary sudoku

Re: Help installing Python Constraints

2005-09-19 Thread Fredrik Lundh
Levi Self wrote: > Can someone help me figure out how to install Python Constraints on Windows? > I have Python 2.4 it seems to have a standard setup file, which means that you can install in the same way as you'd install any other source kit: 1) unpack the source archive to some temporary direc

Re: threads/sockets quick question.

2005-09-19 Thread Bryan Olson
ed wrote: > 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? It's because of the bugs. Nothing happens because threading < MAX_THREADS

Re: Software bugs aren't inevitable

2005-09-19 Thread Michael Sparks
Giles Brown wrote: > Michael Sparks wrote: >> The problem that these sorts of approaches don't address is the simple >> fact that simple creating a formal spec and implementing it, even if >> you manage to create a way of automating the test suite from the spec >> *doesn't guarantee that it will do

Re: Brute force sudoku cracker

2005-09-19 Thread Gerard Flanagan
Anton Vredegoor wrote: > I like to program sudoku and review such > code. Some non-Python examples: APL (The Horror! The Horror!...): http://www.vector.org.uk/archive/v214/sudoku.htm and my own effort with Excel/C# (very humble - needs work): http://exmachinis.net/code/cs/2005/08/4.h

Re: threads/sockets quick question.

2005-09-19 Thread Ed Hotchkiss
  Well, I fixed those problems, now what I have is this: but i am getting errors with the global variables or something ... am i supposed to use this class and def together differently? I just don't seem to understand ... -edward import socketimport threadingimport traceback class scanThread(thr

Re: threads/sockets quick question.

2005-09-19 Thread ed
import socket import threading import traceback class scanThread(threading.Thread): def run(self): try: ss = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ss.connect((ip, port_counter)) print "%s | %d OPEN" % (ip, port_counter) ss.cl

Re: How am I doing?

2005-09-19 Thread JMH
Thanks for that Mike. I do remember reading about the __main__ in an online tutorial and remember thinking "That's handy!". Totally forgot about that in my own little code so thanks for reminding me. -- http://mail.python.org/mailman/listinfo/python-list

Re: threads/sockets quick question.

2005-09-19 Thread Fredrik Lundh
Bryan Olson wrote: > Next, you never create any instances of scanThread. one would think that the "scanThread()" part of scanThread().start() would do exactly that. -- http://mail.python.org/mailman/listinfo/python-list

Ann: New SQL topic in Tutorial

2005-09-19 Thread Alan Gauld
I've added the fist in a series of planned new topics to my online tutorial. It's on using databases and covers SQLite and the Python DB API. Since I'm no expert on either topic (an Oracle and Interbase user from C++) any feedback is welcomed. http://www.freenetpages.co.uk/hp/alan.gauld/tutdbms.h

Re: C#3.0 and lambdas

2005-09-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > 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/ "The extensions enable construction of compositional APIs that have equal exp

Python and Unix Commands

2005-09-19 Thread timdoyle05
Hi, I have a question relating to how Unix commands can be issued from Python programs. Im am currently writing a large test script in python and I need this script to call three other separate Python scripts, where each one executes in it own thread of control. I would like to use a Unix c

Re: IDE, widget library

2005-09-19 Thread Christophe
Alessandro Bottoni a écrit : > Try wxPython (Based on wxWidgets). Really "free" (LGPL'ed = MIT license) on > all platforms, well-engineered, documented and supported, native look&feel > on all platform. Need anything else? ;-) Some people have that weird notion that GTK is native look and feel on

Re: threads/sockets quick question.

2005-09-19 Thread Piet van Oostrum
> Bryan Olson <[EMAIL PROTECTED]> (BO) wrote: >BO> ed wrote: >>> 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? >BO> It's because

Re: Python and Unix Commands

2005-09-19 Thread Adriaan Renting
Depending on what you axactly want there are a lot of ways to do this. There is the subProcess module, there is the pty module, there is os.system, there is the popen module, and my personal favorite is Pexpect (pexpect.sourceforge.org). Read the documentation of these modules is my first suggest

How to write this iterator?

2005-09-19 Thread severa
Given a list of iterators, I'd like to have a new one that would cyclically walk over the list calling the next() method of the iterators (removing any iterator which is exhausted). It should also support adding a new iterator to the list; it should be added in front of the current position (so

execfile eats memory

2005-09-19 Thread Enrique Palomo Jiménez
On friday i wrote a this message: [...] I'm writing an application who needs to handle a lot of information of several files. So, i think the better way is design a batch process to catch that information in a dictionary and write it in a file. So, after that when a user wants to retrieve somethi

Re: What XML lib to use?

2005-09-19 Thread Giovanni Bajo
Fredrik Lundh wrote: > Edvard Majakari wrote: > >> Using a SAX / full-compliant DOM parser could be good for learning >> things, though. As I said, depends a lot. > > since there are no *sane* reasons to use SAX or DOM in Python, that's > mainly a job security issue... One sane reason is that El

Twist and perversion. Was: Software bugs aren't inevitable

2005-09-19 Thread Jerzy Karczmarczuk
Terry Hancock wrote: /a few statements which seem to be there - apparently - just for the sake of quarreling/ > The FP camp (apparently) wants to advance the claim that FP will *always* > reduce bugs. I find that very hard to believe. Good. Now go, and talk to some FP people before accusing the

Re: threads/sockets quick question.

2005-09-19 Thread Piet van Oostrum
> "ed" <[EMAIL PROTECTED]> (E) wrote: > import socket > import threading > import traceback > def scan(ip, thebegin, theend): > global ip > global thebegin > global theend Making parameters global is a bad idea (I think). Moreover, thebegin and theend aren't used in s

Re: Python and Unix Commands

2005-09-19 Thread Alan Gauld
> I have a question relating to how Unix commands can be issued > from > Python programs. There are numerous methods including the commands module that you have already discovered, the os.system() call and the various os.popen/os.execXX calls. Also Python 2.4 has introduced the subprocess modu

Re: Synchronous/Asynchrnous Audio play with pymedia

2005-09-19 Thread sven
At 01:22 19.09.2005, Ron Provost wrote: >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. there's a pymedia

Re: Possible bug in "metaclass resolution order" ?

2005-09-19 Thread Pedro Werneck
On Mon, 19 Sep 2005 05:22:09 GMT [EMAIL PROTECTED] (Bengt Richter) wrote: > > And the something returned, whatever it is, if no checking is > triggered by normal use, gets bound to the class name, e.g., Yes... this is the intended behaviour. In fact, the issue is already solved and is really jus

Re: p2exe using wine/cxoffice

2005-09-19 Thread Christophe
Tim Roberts a écrit : > James Stroud <[EMAIL PROTECTED]> wrote: > >>I think the motivation is to ween people off of M$ products altogether, > > > Well, CrossOver Office doesn't really do that. You're still running > Microsoft Office. > > >>...to get >>them used to working an a unix environm

Re: Question About Logic In Python

2005-09-19 Thread sven
At 02:20 19.09.2005, 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 f

Re: execfile eats memory

2005-09-19 Thread Fredrik Lundh
Enrique Palomo Jiménez wrote: > The information will be used no more than 3-4 days a > month and install databases is not allowed. > [...] > Someone suggest me the pickle module. I'll try it and it > works, but pickle dumps is slower than writing the file > with pythonic syntax. (26 seconds vs 6)

Searching for a working example of a curses application that resizes in xterm

2005-09-19 Thread schwerdy
Hi together, can someone provide an example of a curses application that works in a xterm that can be resized? I could not find any working example yet... Thanks in advance, Sebastian 'Schwerdy' Schwerdhöfer -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Unix Commands

2005-09-19 Thread Piet van Oostrum
> "timdoyle05" <[EMAIL PROTECTED]> (T) wrote: >T> Hi, >T>I have a question relating to how Unix commands can be issued from >T> Python programs. Im am currently writing a large test script in python >T> and I need this script to call three other separate Python scripts, >T> where each o

Re: How to write this iterator?

2005-09-19 Thread Paul Rubin
Hmm, here's an approach using the .throw() operation from PEP 342. It's obviously untested, since that feature is not currently part of Python, probably incorrect, and maybe just insane. I renamed "append" to "insert_iterator" since "append" usually means put something at the end, not in the middl

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

2005-09-19 Thread adsheehan
Thanks to all for your postings. Seems like a spread of opinions here. I guess SWIG, SIP & BOOST are all valid options which I need to vaidate in turn Alan -- http://mail.python.org/mailman/listinfo/python-list

slip python p2p program, developers wanted

2005-09-19 Thread vpr
Hi All Wanted, python coders to hack my p2p program posted at http://prdownloads.sourceforge.net/slip-p2p/slip_beta_0.3.zip?download slip is a simple P2P program that allows peers on a local area network to exchange files and messages. It was written to simplify file transfers by removing the nee

Re: How to write this iterator?

2005-09-19 Thread Paul Rubin
Paul Rubin writes: > Hmm, here's an approach using the .throw() operation from PEP 342. > It's obviously untested, since that feature is not currently part of > Python, probably incorrect, and maybe just insane. Pardon the unintentional "shift/reduce conflict" above. I

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

2005-09-19 Thread Xah Lee
Addendum: I was working on a program where i needed to split a path into dirname, corename, and suffix. I came to this page and took me a while to understand what split() is about. There are other path related functions splitext(), splitdrive(), basename(), dirname(). User has to scan the whole p

Re: threads/sockets quick question.

2005-09-19 Thread antred
This may be a really stupid question, but are you actually CALLING your scan() function anywhere? -- http://mail.python.org/mailman/listinfo/python-list

Re: threads/sockets quick question.

2005-09-19 Thread antred
Ah shoot, never mind, I'm an idiot. =0 -- http://mail.python.org/mailman/listinfo/python-list

Re: threads/sockets quick question.

2005-09-19 Thread antred
maybe try this while threading.activeCount() < MAX_THREADS: # instead of while threading < MAX_THREADS: -- http://mail.python.org/mailman/listinfo/python-list

Re: How to write this iterator?

2005-09-19 Thread Daniel Dittmar
[EMAIL PROTECTED] wrote: > Given a list of iterators, I'd like to have a new one that would > cyclically walk over the list calling the next() method of the iterators > (removing any iterator which is exhausted). It should also support adding > a new iterator to the list; it should be added in f

Re: Creating a list of Mondays for a year

2005-09-19 Thread Chris
Thanks to everyone for your help! That fit the need perfectly. In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > 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

Re: How to write this iterator?

2005-09-19 Thread severa
Sorry, my description was not very good, I meant something behaving as: >>>example=Liter("abc","12345","XY") >>>for x in example: print x, a 1 X b 2 Y c 3 4 5 or for that append() method, >>>example=Liter("abc", "12345") >>>for i in range(3): print example.next(), a 1 b >>>example.append("XY"

Re: threads/sockets quick question.

2005-09-19 Thread Bryan Olson
Fredrik Lundh wrote: > Bryan Olson wrote: > >>Next, you never create any instances of scanThread. > > > one would think that the "scanThread()" part of > > scanThread().start() > > would do exactly that. And one would be correct. I hereby retract that assertion of my post. -- --B

Re: C#3.0 and lambdas

2005-09-19 Thread Wolfgang Langner
Hello, > "Is anyone truly attached to nested tuple function parameters; 'def > fxn((a,b)): print a,b'? /.../ > > Would anyone really throw a huge fit if they went away? I am willing > to write a PEP for their removal in 2.6 with a deprecation in 2.5 if > people are up for it

Re: Creating a list of Mondays for a year

2005-09-19 Thread Charles Krug
On Mon, 19 Sep 2005 12:10:04 GMT, Chris <[EMAIL PROTECTED]> wrote: > Thanks to everyone for your help! > > That fit the need perfectly. > > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] says... >> Is there a way to make python create a list of Mondays for a given year? >> >> For example,

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

2005-09-19 Thread Charles Krug
On 19 Sep 2005 00:02:34 -0700, malv <[EMAIL PROTECTED]> wrote: > Simple case: > In this list, how to find all occurences of intervals of n adjacent > indexes having at least one list-member with a value between given > limits. > Visualizing the list as a two-dimensional curve, this is like > horizo

Announce: libgmail 0.1.2 - security upgrade

2005-09-19 Thread stasz
Hello, The latest release of libgmail fixes a critical security bug. Users are recommended to upgrade as soon as possible. You can download version 0.1.2 here: http://sourceforge.net/project/showfiles.php?group_id=113492&package_id=122807 What's libgmail? The libgmail project is a pure Python bi

Re: threads/sockets quick question.

2005-09-19 Thread n00m
import socket import thread def scan(ip, port): try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((ip, port)) s.close() print '%s | %d OPEN \nscanned: %d' % (ip, port, port) except: pass ip = 'localhost' for port in range(50, 5000

Re: C#3.0 and lambdas

2005-09-19 Thread Christophe
Wolfgang Langner a écrit : > Hello, > >> "Is anyone truly attached to nested tuple function parameters; 'def >> fxn((a,b)): print a,b'? /.../ >> >> Would anyone really throw a huge fit if they went away? I am willing >> to write a PEP for their removal in 2.6 with a deprecation i

Re: C#3.0 and lambdas

2005-09-19 Thread Roel Schroeven
Fredrik Lundh schreef: > meanwhile, over in python-dev land: > > "Is anyone truly attached to nested tuple function parameters; 'def > fxn((a,b)): print a,b'? /.../ > > Would anyone really throw a huge fit if they went away? I am willing > to write a PEP for their removal in 2.6

Re: Question About Logic In Python

2005-09-19 Thread Steven D'Aprano
On Mon, 19 Sep 2005 12:16:15 +0200, sven wrote: > to make sure that an operation yields a boolean value wrap a bool() > around an expression. > None, 0 and objects which's len is 0 yield False. > so you can also do stuff like that: Are there actually any usage cases for *needing* a Boolean value

Re: Twist and perversion. Was: Software bugs aren't inevitable

2005-09-19 Thread Steven D'Aprano
This conversation is rapidly approaching flame-war territory. Just a few comments before I hope we can put this to bed. On Mon, 19 Sep 2005 11:39:35 +0200, Jerzy Karczmarczuk wrote: > Now go, and talk to some FP people before accusing them of being *so* > sectarian. Your supposition that they cla

InformixDB-1.5 released

2005-09-19 Thread Carsten Haese
Hi Everybody: I have released a new version, version 1.5, of InformixDB, the DB-API module for connecting to IBM Informix database engines. Download at http://sourceforge.net/projects/informixdb . Notable changes since version 1.4: * Further steps towards DB-API 2 compliance: added recommended

Re: tuples and mysqldb tables

2005-09-19 Thread Python
I believe that the current version of MySQLdb supports: for row in cursor: id, protocol, name, description = row fall back on: for row in cursor.fetchall(): if the first suggestion fails. I'm not sure that this is clear from the DBI documentation. On Sun, 2005-09-18 at 17:53 -0400, Ed H

Re: C#3.0 and lambdas

2005-09-19 Thread Steven D'Aprano
On Mon, 19 Sep 2005 10:31:48 +0200, Fredrik Lundh wrote: > meanwhile, over in python-dev land: > > "Is anyone truly attached to nested tuple function parameters; 'def > fxn((a,b)): print a,b'? /.../ > > Would anyone really throw a huge fit if they went away? I am willing > to w

Free seminar on domain-specific modeling

2005-09-19 Thread Martijn Iseger
Domain-specific modeling makes software development 5-10 times faster than approaches based on UML or MDA. It accelerates development and reduces complexity by automatically generating full code from higher-abstraction design models. Learn from speakers Juha-Pekka Tolvanen, Jack Greenfield, Stev

Re: C#3.0 and lambdas

2005-09-19 Thread Max M
Steven D'Aprano wrote: > On Mon, 19 Sep 2005 10:31:48 +0200, Fredrik Lundh wrote: > > How many items should you pass in the tuple? If it takes variable > arguments, then that works, but if you always expect a fixed number, then > > def func((x, y)) > > is more explicit. > > The only problem I h

Pygresql classic vs DB-API interface

2005-09-19 Thread Steve Bergman
I am relatively new to python and am developing an application using mod_python/pygresql/postgresql. Being attracted to the idea of database portability, I started out using the DB-API 2.0 compliant pgdb module. However, I am finding it to be pretty clunky compared to the classic pg interface.

Re: C#3.0 and lambdas

2005-09-19 Thread Christophe
Max M a écrit : > Steven D'Aprano wrote: > >> On Mon, 19 Sep 2005 10:31:48 +0200, Fredrik Lundh wrote: >> >> How many items should you pass in the tuple? If it takes variable >> arguments, then that works, but if you always expect a fixed number, then >> >> def func((x, y)) >> >> is more explicit.

Re: C#3.0 and lambdas

2005-09-19 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > "Is anyone truly attached to nested tuple function parameters; 'def > fxn((a,b)): print a,b'? /.../ > > Would anyone really throw a huge fit if they went away? I am willing > to write a PEP for their removal in 2.6 with a deprecation

Removing Warning Messages .............

2005-09-19 Thread chand
Hi., In my api.py file 'g_opt_list' is defined globally g_opt_list =[[],[],[],[],[],[],[]] when I run the py file, I am getting the Following Error SyntaxWarning: name 'g_opt_list' is used prior to global declaration SyntaxWarning: name 'layers' is used prior to global declaration Please let me

Re: threads/sockets quick question.

2005-09-19 Thread Simon Percivall
Why do you check if the module threading is less than 50? (this is why nothing happens, it's always false). >From where do you get port_counter in method run() of scanThread? (this would make every call to run() raise an exception. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python game coding

2005-09-19 Thread TPJ
OT: > BTW: I wonder if and when someone will use stackless python (...) And what is this stackless python? I have visited it's homepage, but I wasn't able to find any answer. (Well, I have found out, that stackles python is python's implementation that doesn't use C stack, but it tells me nothing

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

2005-09-19 Thread Paul McGuire
Have you tried coding even the brute-force naive search? It is far easier to improve an algorithm when you have someplace relatively concrete to start from. Plus, the naive approach is most likely to return a correct result, so that you can regression test your exotic interval-skipping, second-de

Re: Searching for a working example of a curses application that resizes in xterm

2005-09-19 Thread Thomas Guettler
Am Mon, 19 Sep 2005 03:40:38 -0700 schrieb schwerdy: > Hi together, > > can someone provide an example of a curses application that works in a > xterm that can be resized? > > I could not find any working example yet... Hi, You should find this in the C source of "mutt" or "less". HTH, Thom

Re: Removing Warning Messages .............

2005-09-19 Thread Fredrik Lundh
"chand" <[EMAIL PROTECTED]> wrote: > SyntaxWarning: name 'g_opt_list' is used prior to global declaration > SyntaxWarning: name 'layers' is used prior to global declaration those messages are preceeded by a line number, which tells you where to look for the problem. when I run your snippet, I on

are variables local only to try/except blocks?

2005-09-19 Thread BarrySearle
# Is this valid (or is excp local to try/except)? try: try: doSomething1 excp = 0 except: excp = 1 #endTry if (_excp_): doSomething1 # is excp defined here? excp = 0 except: excp = 1 #endTry if (excp): doSomething2 # is excp defined here? # valid,

Re: are variables local only to try/except blocks?

2005-09-19 Thread Fredrik Lundh
BarrySearle wrote: > # Is this valid yes. > (or is excp local to try/except)? no. try/except doesn't introduce a new scope. > try: >try: > doSomething1 > excp = 0 >except: > excp = 1 >#endTry >if (_excp_): doSomething1 # is excp defined here? yes (but _excp_

Re: C#3.0 and lambdas

2005-09-19 Thread Steven Bethard
Paul Rubin wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> writes: > >>"Is anyone truly attached to nested tuple function parameters; >>'def fxn((a,b)): print a,b'? /.../ >> >>Would anyone really throw a huge fit if they went away? I am willing >>to write a PEP for their removal in

Ide RAD for linux?

2005-09-19 Thread LaGuna
Suse 9.3 Ide RAD for linux? Tanks -- http://mail.python.org/mailman/listinfo/python-list

Re: C#3.0 and lambdas

2005-09-19 Thread Steven Bethard
Steven D'Aprano wrote: > Consider this: > > def func(some_tuple): > > How many items should you pass in the tuple? If it takes variable > arguments, then that works, but if you always expect a fixed number, then > > def func((x, y)) > > is more explicit. > > The only problem I have is that onc

style question: anything wrong with super(type(self), self).f() ?

2005-09-19 Thread Adam Monsen
Is there anything wrong with using something like super(type(self), self).f() to avoid having to hardcode a type? For example: class A(object): def f(self): print "in A.f()" class B(A): def f(self): super(type(self), self).f() obj = A() obj.f() # prints "in A.f()" By "w

Re: threads/sockets quick question.

2005-09-19 Thread dowskimania
ed wrote: > 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? [SNIP] > while threading < MAX_THREADS: > scanThre

Re: time.strptime() for different languages

2005-09-19 Thread Adam Monsen
Brett Cannon fixed this bug last week. Thanks, Brett! -- Adam Monsen http://adammonsen.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python game coding

2005-09-19 Thread Diez B. Roggisch
TPJ wrote: > OT: > > >>BTW: I wonder if and when someone will use stackless python (...) > > > And what is this stackless python? I have visited it's homepage, but I > wasn't able to find any answer. (Well, I have found out, that stackles > python is python's implementation that doesn't use C s

Re: Ide RAD for linux?

2005-09-19 Thread Steve Bergman
LaGuna wrote: >Suse 9.3 > >Ide RAD for linux? > > > 'Idle' is shipped with current versions of python. There is also PyDev,which is a plugin for Eclipse. I found Eclipse to be rather top-heavy and went back to Idle. -Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: C#3.0 and lambdas

2005-09-19 Thread Diez B. Roggisch
> meanwhile, over in python-dev land: > > "Is anyone truly attached to nested tuple function parameters; 'def > fxn((a,b)): print a,b'? /.../ > > Would anyone really throw a huge fit if they went away? I am willing > to write a PEP for their removal in 2.6 with a deprecation in

Re: Searching for a working example of a curses application that resizesin xterm

2005-09-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > can someone provide an example of a curses application that works in a > xterm that can be resized? googling for "python sigwinch curses" brings up a considerable number of related stuff, including http://dbforums.com/archive/97/2002/07/4/439799 and http://groups.goo

Python in XCode - autoindent?

2005-09-19 Thread Jeffrey E. Forcier
Hoping at least some of you use XCode... In futzing with PyObjC and Cocoa programming on my Mac, I've come to know XCode a little better, and am considering switching to it from my existing editor (TextMate). However, it appears to lack your typical auto-indenting that I'm sure most of you also fi

Two questions on PyDev for Eclipse

2005-09-19 Thread Kenneth McDonald
The first is general; what are users' experience with PyDev for Eclipse. It looks pretty good to me right now, but I've only started playing with it. Converting to Eclipse is a major effort, and if there are problems which would prevent pydev from being useful right now, I'd certainly appre

Re: Searching for a working example of a curses application that resizes in xterm

2005-09-19 Thread Grant Edwards
On 2005-09-19, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > can someone provide an example of a curses application that works in a > xterm that can be resized? I'm afraid I can't post the entire program, but what you need to do is to catch the WINCH signal and set a flag which is checked by you

Re: style question: anything wrong with super(type(self), self).f() ?

2005-09-19 Thread Tom Anderson
On Mon, 19 Sep 2005, Adam Monsen wrote: > Is there anything wrong with using something like super(type(self), > self).f() to avoid having to hardcode a type? What happens when that method gets called by an overriding method in a derived class? > For example: > > class A(object): >def f(sel

Validating XML parsers

2005-09-19 Thread Dale Strickland-Clark
A few days ago there was a discussion about which XML parser to use with Python. However, the discussion didn't cover validating parsers, at least, not w3.org XML Schemas. I looked into all the parsers that came up in the discussion but found no mention of w3.org schemas. It seems there are a few

Re: End or Identify (EOI) character ?

2005-09-19 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Madhusudan Singh" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hi > > > > I was wondering how does one detect the above character. It is returned > > by > > an instrument I am controlling via GPIB.

Organising a python project

2005-09-19 Thread baoilleach
Dear all, Can anyone point me to a resource that describes the best way of organising a python project? My project (gausssum.sf.net) is based around a class, and has a GUI that allows 'easy-access' to the methods of the class. What is the best or typical directory structure that allows the easy cr

Re: Ide RAD for linux?

2005-09-19 Thread Diez B. Roggisch
LaGuna wrote: > Suse 9.3 > > Ide RAD for linux? Eric3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Validating XML parsers

2005-09-19 Thread Robert Kern
Dale Strickland-Clark wrote: > A few days ago there was a discussion about which XML parser to use with > Python. > However, the discussion didn't cover validating parsers, at least, not > w3.org XML Schemas. > > I looked into all the parsers that came up in the discussion but found no > mention o

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

2005-09-19 Thread Diez B. Roggisch
> > split(path) > returns a pair (dirname,filename), where dirname is the part of path > up to the last slash, and filename is the rest of the string after the > last slash. Bullshit. Slash isn't always the path component delimiter. Get a clue on what you're talking about before suggesting

Re: threads/sockets quick question.

2005-09-19 Thread Ed Hotchkiss
Let's say that I avoid the complexities of using classes, and that I avoid using anything to count the threads...   import socketimport threading def scan(ip, port):    try:    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)    s.connect((ip, port))    s.close()    print '%s |

Re: End or Identify (EOI) character ?

2005-09-19 Thread Torsten Bronger
Hallöchen! Donn Cave <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >> "Madhusudan Singh" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>> I was wondering how does one detect the above character. It is >>> returned

[OT]Scipy plotting problems

2005-09-19 Thread Ruben Charles
Hi, I'm using Scipy on Debian Gnu/Linux. (python2.3-scipy) in a program that have to show plots but while i'm testing capabilities of the three possible options (gplt, plt an xplt) a couple of questions comes up.

functional or object-oriented?

2005-09-19 Thread beza1e1
I see myself shifting more and more over to the functional kind of coding. Could be related to the Haskell, we had to learn in CS. Now i was wondering, how other people use Python? With functional i mean my files mostly consist of functions and only rarely i use "class". The library modules seem t

Re: Free seminar on domain-specific modeling

2005-09-19 Thread Gerrit Holl
Martijn Iseger wrote: > Domain-specific modeling makes software development 5-10 times faster than > approaches based on UML or MDA. > It accelerates development and reduces complexity by automatically generating > full code from higher-abstraction design models. > Learn from speakers Juha-Pekka

Re: functional or object-oriented?

2005-09-19 Thread Steve Bergman
beza1e1 wrote: >I see myself shifting more and more over to the functional kind of >coding. Could be related to the Haskell, we had to learn in CS. Now i >was wondering, how other people use Python? > >With functional i mean my files mostly consist of functions and only >rarely i use "class". The

ANN: PyInstaller 1.0 - build single-file distributions for your Python programs

2005-09-19 Thread Giovanni Bajo
Hello, PyInstaller 1.0 is out: http://pyinstaller.hpcf.upr.edu/pyinstaller Despite its version number, this is a very stable relase, as we are working off the well-known McMillan's Installer, which was discontinued some years ago. Feature highlights: * Packaging of Python programs into standard

Re: functional or object-oriented?

2005-09-19 Thread Diez B. Roggisch
> With functional i mean my files mostly consist of functions and only > rarely i use "class". The library modules seem to be mostly written the > object-way on the other hand. Which is not what functional programming is about. The style you describe is more often referred to as procedural progra

very high-level IO functions?

2005-09-19 Thread York
Hi, R language has very high-level IO functions, its read.table can read a total .csv file and recogonize the types of each column. write.table can do the reverse. R's MySQL interface has high-level functions, too, e.g. dbWriteTable can automatically build a MySQL table and write a tabl

Re: Announce: open 0.2 - a unix application launcherr

2005-09-19 Thread beza1e1
I recently found 'gnome-open', which does this. It chooses the Gnome default for the filetype. Like you clicked on it in nautilus. OS X also has this 'open' command and i like it. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: very high-level IO functions?

2005-09-19 Thread Caleb Hattingh
York Short answer: yes We use python and R at work, and in general you will find python syntax a little cleaner for functionality they have in common. R is better for some of the more hard-wired stats stuff, though. On Mon, 19 Sep 2005 20:04:37 +0200, York <[EMAIL PROTECTED]> wrote: > Hi,

Re: C#3.0 and lambdas

2005-09-19 Thread Michael Ekstrand
On Monday 19 September 2005 08:18, Roel Schroeven wrote: > def drawline((x1, y1), (x2, y2)): > # draw a line from x1, y1 to x2, y2 > foo(x1, y1) > bar(x2, y2) Yow! I did not know you could even do this. My vote would be +1 for keeping them in the language... they look far too useful

Re: Roguelike programmers needed

2005-09-19 Thread beza1e1
I was hacking on something similar. It could be called a collaborative story-telling adventure game or something. My idea was to parse natural language text not "commands". The game manages locations and objects. This is for story-telling roleplay. No stats, levels or monsters (at least no self act

  1   2   >