Re: this worked before...' '.join([`x x` for x in range(1, 6)])

2008-05-19 Thread Marc 'BlackJack' Rintsch
On Mon, 19 May 2008 15:28:48 -0700, notnorwegian wrote: > ' '.join([`x x` for x in range(1, 6)]) > > anyone can tell me what im doing wrong? I doubt that this worked before because that's a syntax error: In [84]: ' '.join([`x x` for x in range(1, 6)]) -

Re: scaling problems

2008-05-19 Thread Arnaud Delobelle
James A. Donald <[EMAIL PROTECTED]> writes: > Ben Finney > The larger the program, the greater the likelihood of inadvertent name > collisions creating rare and irreproducible interactions between > different and supposedly independent parts of the program that each > work fine on their own, and

Re: test mult vars to same value, how to shorten expr?

2008-05-19 Thread Marc 'BlackJack' Rintsch
On Mon, 19 May 2008 20:36:45 -0700, notnorwegian wrote: > if i want o test: > if a == 5 and b ==5 and c==5 ... z==5 > > is there some synctactic suagr for this? > > rather than maiking one of my own i mean, something built-in like: > if a,b,c... z == 5: Since Python 2.5 there's `all()`: In [81

Re: Using StringVars in List of Dictionaries as tkInter variables for Scale and Label widgets

2008-05-19 Thread Peter Otten
seanacais wrote: > I had the Tkinter import as > > from Tkinter import * but I changed it to > > import Tkinter as tk > > and modified the creation of the root object to > > root=tk.Tk() > > I then had to change every instance of Menu, Label, > Button, and all Tkinter elements to be prefaced

Re: this worked before...' '.join([`x x` for x in range(1, 6)])

2008-05-19 Thread Arnaud Delobelle
John McMonagle <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: >> ' '.join([`x x` for x in range(1, 6)]) >> >> anyone can tell me what im doing wrong? >> -- >> http://mail.python.org/mailman/listinfo/python-list >> > > > ' '.join(['%s %s' % (str(x), str(x)) for x in range(1,6)]) > > or >

Re: Thread killing - I know I know!

2008-05-19 Thread Rhamphoryncus
On May 19, 11:31 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Mon, May 19, 2008 at 11:36 AM, Roger Heathcote > > Fair point, but for sub processes that need to be in close contact with the > > original app, or very small functions that you'd like 100s or 1000s of it > > seems like a kludge ha

Re: Compress a string

2008-05-19 Thread John Salerno
On Tue, 20 May 2008 00:09:14 -0400 John Salerno <[EMAIL PROTECTED]> wrote: > Not that you need help anymore, but I decided to give it a try. Not as > elegant as the one- and two-liners, but somewhat concise I guess. Whoops! Could be cleaner! :) def compress(s): new = [] for c in s:

regarding process preemption in linux

2008-05-19 Thread PARIMALA KALAVALA
Hello, I am presently working on linux. I wanted to know how to view the preemption of one process by another process. If we give TOP command we are not able to visualize it or do we need to write any different code to see it or is it possible to see it in the proc file system. Any help woul

Re: Write bits in file

2008-05-19 Thread Tim Roberts
Monica Leko <[EMAIL PROTECTED]> wrote: > >I have a specific format and I need binary representation. Does >Python have some built-in function which will, for instance, represent >number 15 in exactly 10 bits? For the record, I'd like to point out that even C cannot do this. You need to use shift

Re: Compress a string

2008-05-19 Thread John Salerno
On Sun, 18 May 2008 19:06:10 +0100 "Matt Porter" <[EMAIL PROTECTED]> wrote: > Hi guys, > > I'm trying to compress a string. > E.g: > "BBBC" -> "ABC" Not that you need help anymore, but I decided to give it a try. Not as elegant as the one- and two-liners, but somewhat concise I guess. de

Re: test mult vars to same value, how to shorten expr?

2008-05-19 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: if i want o test: if a == 5 and b ==5 and c==5 ... z==5 is there some synctactic suagr for this? rather than maiking one of my own i mean, something built-in like: if a,b,c... z == 5: How about: if 5 == a == b == c == ... z: ... --Scott David Daniels [EM

Re: scaling problems

2008-05-19 Thread James A. Donald
On Mon, 19 May 2008 21:04:28 -0400, "David Stanek" <[EMAIL PROTECTED]> wrote: > What is the difference if you have a process with 10 threads or 10 > separate processes running in parallel? Apache is a good example of a > server that may be configured to use multiple processes to handle > requests.

Re: scaling problems

2008-05-19 Thread James A. Donald
> > 2. It is not clear to me how a python web application scales. Python > > is inherently single threaded, so one will need lots of python > > processes on lots of computers, with the database software handling > > parallel accesses to the same or related data. One could organize it > > as one

Re: scaling problems

2008-05-19 Thread James A. Donald
> > 1. Looks to me that python will not scale to very large programs, > > partly because of the lack of static typing, but mostly because there > > is no distinction between creating a new variable and utilizing an > > existing variable, Ben Finney > This seems quite a non sequitur. How do you s

Re: Python and Flaming Thunder

2008-05-19 Thread Dan Upton
On Mon, May 19, 2008 at 11:20 PM, Dave Parker <[EMAIL PROTECTED]> wrote: > > For another example, I've always preferred languages that are English- > like because it's easier to return to your code after several years > and still know what you were doing (and it's easier for someone else > to maint

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread John Salerno
On Sun, 18 May 2008 23:08:11 -0700 (PDT) [EMAIL PROTECTED] wrote: > Every now and then, however, I do build some interface (mostly GUI), > such as a monitor, notification mechanism, etc. But I never feel like > I'm losing focus on the actual problem; maybe because I develop the > core program firs

Re: Write bits in file

2008-05-19 Thread Scott David Daniels
Monica Leko wrote: On May 18, 2:20 pm, Ken Starks <[EMAIL PROTECTED]> wrote: You want your file considered as a sequence of bits rather than a sequence of 8-bit bytes, do you? Yes. is the 10-bit bit-pattern to be stored at an arbitrary bit-position in the file Yes. I need arbitrary, 8bits,

Re: Python and Flaming Thunder

2008-05-19 Thread John Salerno
On Mon, 19 May 2008 20:20:28 -0700 (PDT) Dave Parker <[EMAIL PROTECTED]> wrote: > To whit: you pointed out the awkwardness in Python of having to > declare a for-loop variable when you only wanted to loop a specific > number of times and didn't need the variable. Well, I wasn't so much trying to

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-19 Thread John Salerno
On Mon, 19 May 2008 20:34:22 -0700 (PDT) [EMAIL PROTECTED] wrote: > i am confused. > > x=5 > y=5 > > x==y -> True > x is y -> True > > shouldnt x is y return False since they shouldnt(dont?) point to the > same place in memory, they just store an equal value? > For some immutable values (such

test mult vars to same value, how to shorten expr?

2008-05-19 Thread notnorwegian
if i want o test: if a == 5 and b ==5 and c==5 ... z==5 is there some synctactic suagr for this? rather than maiking one of my own i mean, something built-in like: if a,b,c... z == 5: -- http://mail.python.org/mailman/listinfo/python-list

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-19 Thread notnorwegian
i am confused. x=5 y=5 x==y -> True x is y -> True shouldnt x is y return False since they shouldnt(dont?) point to the same place in memory, they just store an equal value? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Flaming Thunder

2008-05-19 Thread Dave Parker
On May 14, 7:59 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Would it be valid to say: > > x = "concrete" > > or to say: > > if command (is) set to "quit" > > ?? I like the idea of: If command is set to "quit" ... I've added it to my list of things to think about, and possibly implement. --

Re: Python and Flaming Thunder

2008-05-19 Thread Dave Parker
On May 13, 11:42 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > Well, python will definitely never have a name that sounds like > a slang term for happens after you get food poisioning at a > Thai restaurant... :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Flaming Thunder

2008-05-19 Thread Dave Parker
> > I <[EMAIL PROTECTED]> wrote: > > Plus, me getting paid to work on Flaming Thunder is far more > > motivating than me not getting paid to work on Python. > On May 14, 8:30 pm, John Salerno <[EMAIL PROTECTED]> wrote: > That's truly disappointing. I guess I could have stated that better. Flamin

Re: pop langs website ranking

2008-05-19 Thread Ben Bullock
In comp.lang.perl.misc [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > In February, i spent few hours researching the popularity of some > computer language websites. One way to do such research is for you to publish the actual number of hits on your website. It's also easy to analyze logfile data

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-19 Thread Asun Friere
On May 20, 6:58 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 19 mai, 22:29, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > (snip) > > > The main > > concept here: identity [usually] implies equality, > > I really enjoyed the "usually" disclaimer !-) Well you have to be careful in case so

Re: Is using range() in for loops really Pythonic?

2008-05-19 Thread Dave Parker
Your point about for-loops was applicable not only to Python, but to many other programming languages. So in response, I've added two new for-loop variations to Flaming Thunder. The two new variations are for-forever-do and for-expression-times-do. For-forever allows you to explicitly create infi

Re: scaling problems

2008-05-19 Thread Carl Banks
On May 19, 8:47 pm, James A. Donald <[EMAIL PROTECTED]> wrote: > 1. Looks to me that python will not scale to very large programs, > partly because of the lack of static typing, but mostly because there > is no distinction between creating a new variable and utilizing an > existing variable, so th

Re: Using Python for programming algorithms

2008-05-19 Thread Henrique Dante de Almeida
On May 19, 5:25 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > There's at least one (possibly incomplete) C interpreter. FWIW, it > would not be harder (and possibly simpler) to write a byte-code+VM > based C implementation than it is to write CPython, Jython or You may (right now, readily,

Re: scaling problems

2008-05-19 Thread Ben Finney
James A. Donald <[EMAIL PROTECTED]> writes: > I am just getting into python, and know little about it Welcome to Python, and this forum. > and am posting to ask on what beaches the salt water crocodiles hang > out. Heh. You want to avoid them, or hang out with them? :-) > 1. Looks to me that

Re: Using Python for programming algorithms

2008-05-19 Thread Henrique Dante de Almeida
On May 19, 5:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 19 mai, 17:53, Henrique Dante de Almeida <[EMAIL PROTECTED]> wrote: > > (snip) > > >  Yes, I was actually referring to statically typed JIT-compiled > > languages. Sorry about that, blame the beers that entered my digestive > >

Re: Using Python for programming algorithms

2008-05-19 Thread Henrique Dante de Almeida
On May 19, 5:35 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >  The situation would be simpler if there were good well-known toolkits > > for optimization in python (like numpy for matrix operations), but > > that's not the case. > > There's at least Psyco (if you're willing and able to res

Re: scaling problems

2008-05-19 Thread David Stanek
On Mon, May 19, 2008 at 8:47 PM, James A. Donald <[EMAIL PROTECTED]> wrote: > I am just getting into python, and know little about it, and am > posting to ask on what beaches the salt water crocodiles hang out. > > 1. Looks to me that python will not scale to very large programs, > partly because

Re: scaling problems

2008-05-19 Thread Reid Priedhorsky
On Tue, 20 May 2008 10:47:50 +1000, James A. Donald wrote: > > 1. Looks to me that python will not scale to very large programs, > partly because of the lack of static typing, but mostly because there > is no distinction between creating a new variable and utilizing an > existing variable, so the

Re: Newbie: Keep TCP socket open

2008-05-19 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Alan Wright" <[EMAIL PROTECTED]> wrote: > Thanks for the feedback. > > Using the socket in a list is great > > However, as i imagined, I now get a limit of around 1500 conns before the > system crashes out, also i have noticed, that the ports loop back to 1025

Safely updating master state in SocketServer with ForkingMixIn

2008-05-19 Thread Reid Priedhorsky
Dear all, I have a TCP server written using SocketServer with ForkingMixIn. Servicing connections is CPU-bound and can take several seconds. I now need a way to safely tell the master process to update its state (by groveling in a PostgreSQL database, potentially for several seconds). How can I d

scaling problems

2008-05-19 Thread James A. Donald
I am just getting into python, and know little about it, and am posting to ask on what beaches the salt water crocodiles hang out. 1. Looks to me that python will not scale to very large programs, partly because of the lack of static typing, but mostly because there is no distinction between crea

Re: Thread killing - I know I know!

2008-05-19 Thread blaine
On May 19, 8:16 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 19 May 2008 20:07:06 -0300, Paul Rubin > <"http://phr.cx"@NOSPAM.invalid> escribió: > > > blaine <[EMAIL PROTECTED]> writes: > >> How is it that you recommend killing a pure python thread? > > Make the thread cooperate. It

Re: Using Python for programming algorithms

2008-05-19 Thread Henrique Dante de Almeida
On May 19, 3:07 pm, Vicent Giner <[EMAIL PROTECTED]> wrote: > > Yes, of course, but that should mean that I have to do it better, in > the programming step (I would have to re-program or re-implement my > algorithm). And I think the problem would be the same in any other > language, wouldn't it?

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-19 Thread Gabriel Genellina
En Mon, 19 May 2008 17:58:48 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: On 19 mai, 22:29, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: (snip) The main concept here: identity [usually] implies equality, I really enjoyed the "usually" disclaimer !-) In some *rare* cases, identity

Re: Thread killing - I know I know!

2008-05-19 Thread Gabriel Genellina
En Mon, 19 May 2008 20:07:06 -0300, Paul Rubin <"http://phr.cx"@NOSPAM.invalid> escribió: blaine <[EMAIL PROTECTED]> writes: How is it that you recommend killing a pure python thread? Make the thread cooperate. It should periodically check some variable or condition, and cleanly exit when

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Michael Torrie
Michael Torrie wrote: > And of course Python is perfect in this area. A great example is found > here: ahem, http://www.dabeaz.com/generators/Generators.pdf -- http://mail.python.org/mailman/listinfo/python-list

killing children spawned by pexpect

2008-05-19 Thread loorthu
I am noticing that pexpect kills any child that it is spawned when the parent is terminated using SIGINT (e.g Ctrl-C on the shell), but not when it is killed by SIGKILL (e.g 'kill -9' on the parent process). Here is a quick demo (tried on Linux 2.6.9 kernel): #!/usr/local/bin/python import pexpe

Re: Newbie: Keep TCP socket open

2008-05-19 Thread Ghirai
On Mon, 19 May 2008 23:50:50 +0100 "Alan Wright" <[EMAIL PROTECTED]> wrote: > Ghirai, > Scapy does the same, only it sends RST and not FIN, so still no help > > send(IP(dst="10.1.1.2")/TCP(dport=5,flags="S")) > > Only have windows at the moment sadly. > > Alan > Are you sure there's no f

Re: this worked before...' '.join([`x x` for x in range(1, 6)])

2008-05-19 Thread John McMonagle
[EMAIL PROTECTED] wrote: > ' '.join([`x x` for x in range(1, 6)]) > > anyone can tell me what im doing wrong? > -- > http://mail.python.org/mailman/listinfo/python-list > ' '.join(['%s %s' % (str(x), str(x)) for x in range(1,6)]) or ' '.join([str(x)+' '+str(x) for x in range(1,6)]) outputs

Mac OS distultils probelm

2008-05-19 Thread Timo
Hello there, I'm working on a python extension module that I'm trying to install using the distutils setup tools and I am running into a strange linker problem. Here is the situation: I have a bunch of code (swig-wrapped C+ + in this instance) that I want to compile into a module. The compilation

Re: Classmethods are evil

2008-05-19 Thread Raymond Hettinger
On May 16, 9:01 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > After re-reading "Python is not Java" I finally came to conclusion that > classmethods in Python are a very Bad Thing. Sounds like a serious case of mis-learning. Class methods are the preferred way to implement alternate constructo

Python-URL! - weekly Python news and links (May 19)

2008-05-19 Thread Gabriel Genellina
QOTW: "IIRC the idea was so that managers could write programs in English. It failed because nobody could write a parser that would handle something like 'The bottom line is that the stakeholder group requires the situation going forward to be such as to facilitate the variable known as x to provi

Re: Thread killing - I know I know!

2008-05-19 Thread Paul Rubin
blaine <[EMAIL PROTECTED]> writes: > How is it that you recommend killing a pure python thread? And also, > when i use the 'threading' module am I creating a process, or a (gasp) > thread? A thread. > (Is this an obvious question - and if so, how does one create > a 'process'?) os.fork() -- http

Re: unittest, how to recursively run tests?

2008-05-19 Thread Ben Finney
[EMAIL PROTECTED] writes: > Does anyone know of a good way to execute all unit tests present in a > project from the project root dir? > Ideally I'd like a mechanism that does not require the tests/files to > be manually listed in the source (e.g. via the suite mechanism). nose: A discovery-based

unittest, how to recursively run tests?

2008-05-19 Thread fredbasset1000
Hi All, Does anyone know of a good way to execute all unit tests present in a project from the project root dir? Ideally I'd like a mechanism that does not require the tests/files to be manually listed in the source (e.g. via the suite mechanism). Thanks all, Fred -- http://mail.python.org/mailma

Re: Serious Problem with Timezone

2008-05-19 Thread Jason Scheirer
On May 19, 3:02 pm, T-u-N-i-X <[EMAIL PROTECTED]> wrote: > Hey There, > > I'm a django developer and working on a project right now.. Last week > I just discovered a new problem in Python.. Here's what I do.. > > [01:00] ([EMAIL PROTECTED] ~)$ date > Sal May 20 01:00:10 EEST 2008 > [01:00] ([EMAIL

Re: Separate output for log file and stdout

2008-05-19 Thread Kam-Hung Soh
On Tue, 20 May 2008 06:58:28 +1000, <[EMAIL PROTECTED]> wrote: On May 16, 6:37 pm, Ben Finney <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] writes: > I've recently jumped big time into python and I'm working on a > software program for testing automation. Welcome, to both fields :-) Thanks!

Re: Newbie: Keep TCP socket open

2008-05-19 Thread Alan Wright
Ghirai, Scapy does the same, only it sends RST and not FIN, so still no help send(IP(dst="10.1.1.2")/TCP(dport=5,flags="S")) Only have windows at the moment sadly. Alan "Ghirai" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Mon, 19 May 2008 20:25:57 +0100 > "Alan Wright

this worked before...' '.join([`x x` for x in range(1, 6)])

2008-05-19 Thread notnorwegian
' '.join([`x x` for x in range(1, 6)]) anyone can tell me what im doing wrong? -- http://mail.python.org/mailman/listinfo/python-list

Serious Problem with Timezone

2008-05-19 Thread T-u-N-i-X
Hey There, I'm a django developer and working on a project right now.. Last week I just discovered a new problem in Python.. Here's what I do.. [01:00] ([EMAIL PROTECTED] ~)$ date Sal May 20 01:00:10 EEST 2008 [01:00] ([EMAIL PROTECTED] ~)$ python Python 2.5.2 (r252:60911, Feb 23 2008, 21:20:32)

Re: Newbie: Keep TCP socket open

2008-05-19 Thread Ghirai
On Mon, 19 May 2008 20:25:57 +0100 "Alan Wright" <[EMAIL PROTECTED]> wrote: > Thanks for the feedback. > > Using the socket in a list is great > > However, as i imagined, I now get a limit of around 1500 conns before > the system crashes out, also i have noticed, that the ports loop back > to 10

Re: python confusion possibly related to pickle

2008-05-19 Thread Dennis
Derek Martin wrote: On Sun, May 18, 2008 at 08:28:34PM +0100, Dennis wrote: The problem that's got me annoyed is that after getting said error I close the shell window, open a new one, run the python interpreter and type "import pickle" and get the error that the script I'd run earlier caused. W

Re: explain this function to me, lambda confusion

2008-05-19 Thread Arnaud Delobelle
Paul McGuire <[EMAIL PROTECTED]> writes: > On May 19, 11:04 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> Paul McGuire <[EMAIL PROTECTED]> writes: >> >> [...] >> >> Could you use it as a decoratore instead? >> >> integer = Word("0123456789") >> >> @integer.setParseAction >> def parse_integer(

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-19 Thread Christian Heimes
Luis Zarrabeitia schrieb: > Personally, I like to use "is" with singletons. I find it easier to type and > read "if param is None" than "if param == None", but some python developers > dislike the first one because of the "dark magic" involved in knowing that > None is a singleton. Testing for

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-19 Thread [EMAIL PROTECTED]
On 19 mai, 22:29, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: (snip) > The main > concept here: identity [usually] implies equality, I really enjoyed the "usually" disclaimer !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Separate output for log file and stdout

2008-05-19 Thread amit . uttam
On May 16, 6:37 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > I've recently jumped big time into python and I'm working on a > > software program for testing automation. > > Welcome, to both fields :-) > Thanks! I am having a great time learning and coding in python. It

Re: Classmethods are evil

2008-05-19 Thread [EMAIL PROTECTED]
On 17 mai, 11:50, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On Sat, 17 May 2008 02:33:13 -0300, Gabriel Genellina wrote: > > En Sat, 17 May 2008 01:01:50 -0300, Ivan Illarionov > > <[EMAIL PROTECTED]> escribió: > > >> After re-reading "Python is not Java" I finally came to conclusion that > >> c

Re: Using Python for programming algorithms

2008-05-19 Thread [EMAIL PROTECTED]
On 19 mai, 17:53, Henrique Dante de Almeida <[EMAIL PROTECTED]> wrote: (snip) > Yes, I was actually referring to statically typed JIT-compiled > languages. Sorry about that, blame the beers that entered my digestive > system that night. :-P for beer in beers: if beer.entered_henrique_digestiv

Re: arrays

2008-05-19 Thread Robert Kern
Gary Herron wrote: 1. Why have you flooded this news group with three identical copies of a question under three different subject? This is a (mild) bit of abuse of the newsgroup. One copy with a reasonable subject line is enough. If you look at the dates, they are a few days old. I imagine

Re: Using Python for programming algorithms

2008-05-19 Thread [EMAIL PROTECTED]
On 19 mai, 20:07, Vicent Giner <[EMAIL PROTECTED]> wrote: > On May 19, 6:11 pm, Henrique Dante de Almeida <[EMAIL PROTECTED]> > wrote: > (snip) > > The situation would be simpler if there were good well-known toolkits > > for optimization in python (like numpy for matrix operations), but > > that'

Re: Using Python for programming algorithms

2008-05-19 Thread [EMAIL PROTECTED]
On 19 mai, 18:11, Henrique Dante de Almeida <[EMAIL PROTECTED]> wrote: > On May 19, 7:03 am, Bruno Desthuilliers > > > [EMAIL PROTECTED]> wrote: > > Vicent Giner a écrit : > > > > Hello. > > > > I am new to Python. It seems a very interesting language to me. Its > > > simplicity is very attractive

Re: Using Python for programming algorithms

2008-05-19 Thread [EMAIL PROTECTED]
On 19 mai, 15:30, Roel Schroeven <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers schreef: > > > 1/ being interpreted or compiled (for whatever definition of these > > terms) is not a property of a language, but a property of an > > implementation of a language. > > > 2/ actually, all known Python

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-19 Thread Luis Zarrabeitia
On Monday 19 May 2008 03:39:36 pm destroy wrote: > I'm wondering what is the canonical usage of the keywords 'is' and > 'not' when you're writing conditionals and loops. The one I've been > following is completely arbitrary--I use the symbols '==', '!=' for > numerical comparisons and the words

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Michael Torrie
sturlamolden wrote: > Back in the 'old days' of Unix, programs tended not to be small, could > only do one thing, and did it well. They had no gui, and all > interaction came from command line options. The programs were invoked > from the command line, and input and output were piped from one > pr

MDP: A Simple Feed Forward Network

2008-05-19 Thread blaine
Hey everyone, I was hoping to see some people out on the python list that are familiar with MDP (Modular Toolkit for Data Processing - http://mdp-toolkit.sourceforge.net/)? I am wanting to develop a very simple feed forward network. This network would consist of a few input neurons, some hidd

Re: Compress a string

2008-05-19 Thread Bjoern Schliessmann
inhahe wrote: > i see lots of neat one-liner solutions but just for the sake of > argument: > > def compress_str(str): > new_str = "" > lc = "" > for c in str: > if c != lc: new_str.append(c) > return new_str Please test before posting. >>> compress_str("

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-19 Thread Marc 'BlackJack' Rintsch
On Mon, 19 May 2008 12:39:36 -0700, destroy wrote: > I'm wondering what is the canonical usage of the keywords 'is' and > 'not' when you're writing conditionals and loops. The one I've been > following is completely arbitrary--I use the symbols '==', '!=' for > numerical comparisons and the wo

Re: Thread output with ncurses

2008-05-19 Thread Bjoern Schliessmann
blaine wrote: > The idea would be that the application simply has three 'windows' > or 'pads' and each thread would output to their respective one. I don't know much about ncurses, but I suggest you better use multiple processes (subprocess module). Regards, Björn -- BOFH excuse #434: Plea

conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-19 Thread destroooooy
I'm wondering what is the canonical usage of the keywords 'is' and 'not' when you're writing conditionals and loops. The one I've been following is completely arbitrary--I use the symbols '==', '!=' for numerical comparisons and the words 'is', 'not' for everything else. Thanks in advance! -- http

Re: explain this function to me, lambda confusion

2008-05-19 Thread Paul McGuire
On May 19, 11:04 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Paul McGuire <[EMAIL PROTECTED]> writes: > > [...] > > Could you use it as a decoratore instead? > > integer = Word("0123456789") > > @integer.setParseAction > def parse_integer(tokens): >     return int(tokens[0]) > > I could make

Re: Newbie: Keep TCP socket open

2008-05-19 Thread Alan Wright
Thanks for the feedback. Using the socket in a list is great However, as i imagined, I now get a limit of around 1500 conns before the system crashes out, also i have noticed, that the ports loop back to 1025 when they hit 5000. Any ideas on how to make the list/socket get to around 50K TIA

Re: Using Python for programming algorithms

2008-05-19 Thread Jaap Spies
Vicent Giner wrote: Thank you very much for all the answers I've got. As far as I have understood, Python can be a good alternative, or, at least, a reasonable choice. I intend to design new algorithms for a kind of Optimization problems, and then I have to implement them and show/prove that th

Re: Using Python for programming algorithms

2008-05-19 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Roel Schroeven <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers schreef: > > 1/ being interpreted or compiled (for whatever definition of these > > terms) is not a property of a language, but a property of an > > implementation of a language. > > > > 2/ actually

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Stef Mientki
John Salerno wrote: Hey all. Just thought I'd ask a general question for my own interest. Every time I think of something I might do in Python, it usually involves creating a GUI interface, so I was wondering what kind of work you all do with Python that does *not* involve any GUI work. This c

Re: Thread killing - I know I know!

2008-05-19 Thread blaine
How is it that you recommend killing a pure python thread? And also, when i use the 'threading' module am I creating a process, or a (gasp) thread? (Is this an obvious question - and if so, how does one create a 'process'?) Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Using StringVars in List of Dictionaries as tkInter variables for Scale and Label widgets

2008-05-19 Thread seanacais
On May 19, 2:11 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > > There's some magic going on behind the scene which means that you have to > create a Tkinter.Tk instance before you can start churning out StringVars: > > >>> import Tkinter as tk > >>> v = tk.StringVar() > > Traceback (most recent call

Re: ftplib returns EOFError

2008-05-19 Thread Francesco Bochicchio
On Mon, 19 May 2008 13:27:23 +0100, Jon Bowlas wrote: > Hi All, > > I've written a little method to connect to an ftpserver which works well, > however when I send a file using this ftp connection oddly I _sometimes_ get > returned an EOFError from ftplib.getline even though my file is actually >

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Dan Upton
On Sun, May 18, 2008 at 6:20 PM, John Salerno <[EMAIL PROTECTED]> wrote: > Hey all. Just thought I'd ask a general question for my own interest. Every > time I think of something I might do in Python, it usually involves creating > a GUI interface, so I was wondering what kind of work you all do

Re: Newbie: Keep TCP socket open

2008-05-19 Thread Irmen de Jong
Alan Wright wrote: while (num1<=10) : s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(10.0) s.connect(("10.1.1.69", 50008)) # SMTP print s.recv(1024) + '\n', num1=num1+1 #s.close() sys.exit(1) I think the following is happening: Reusing the 's' object for every ne

Thread output with ncurses

2008-05-19 Thread blaine
Hey everyone, I currently have three independent applications that all 'do something' and output to the console when events are triggered. I'd like to combine these all into a single ncurses application. The idea would be that the application simply has three 'windows' or 'pads' and each thread

Re: TPCServer and xdrlib

2008-05-19 Thread Irmen de Jong
Laszlo Nagy wrote: It is possible to change the serialization used by Pyro http://pyro.sourceforge.net/manual/9-security.html#pickle to the the 'gnosis' XML Pickler. As I said earlier, I would not use XML. Just an example - I need to be able to transfer image files, word and excel docu

sre_parse.py - over-view or explanation needed

2008-05-19 Thread korean_dave
What does sre_parse.py (Secret Labs' Regular Expression Engine) do? I see this referred to in some errors when i call the source() function (e.g. source(findFile("scripts","thisonehere.py")) ) The error then refers to name "ImportWarning" not defined?? (<--that might be a proprietary warning, as

Re: Using StringVars in List of Dictionaries as tkInter variables for Scale and Label widgets

2008-05-19 Thread Peter Otten
seanacais wrote: > I'm trying to build an unknown number of repeating gui elements > dynamically so I need to store the variables in a list of > dictionaries. I understand that Scale "variable" name needs to be a > StringVar but I cannot figure out how to initialize the dictionary. > > I've t

Re: Using Python for programming algorithms

2008-05-19 Thread Vicent Giner
On May 19, 6:11 pm, Henrique Dante de Almeida <[EMAIL PROTECTED]> wrote: > On May 19, 7:03 am, Bruno Desthuilliers > I'm pretty sure about that: when the algorithms take 4 hours to test > a single execution, you value processor time. Yes, of course, but that should mean that I have to do it be

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Daniel Fetchinson
> > Hey all. Just thought I'd ask a general question for my own interest. >> Every time I think of something I might do in Python, it usually >> involves creating a GUI interface, so I was wondering what kind of >> work you all do with Python that does *not* involve any GUI work. >> This could be

Re: Using Python for programming algorithms

2008-05-19 Thread Vicent Giner
Thank you very much for all the answers I've got. As far as I have understood, Python can be a good alternative, or, at least, a reasonable choice. I intend to design new algorithms for a kind of Optimization problems, and then I have to implement them and show/prove that they are good enough, in

Python and Plone Boot Camps in Chapel Hill, NC

2008-05-19 Thread Chris Calloway
Triangle (NC) Zope and Python Users Group (TriZPUG) is proud to open registration for our fourth annual ultra-low cost Plone and Python training camps, BootCampArama 2008: http://trizpug.org/boot-camp/2008/ Registration is now open for: PyCamp: Python Boot Camp, August 4 - 8 Plone Boot Camp:

Re: python script to windows exe

2008-05-19 Thread David C. Ullrich
On Mon, 19 May 2008 02:59:22 -0700 (PDT), sandeep <[EMAIL PROTECTED]> wrote: > >hi >the py code that i have written is here.when i run this code i wont >get any errors it just works fine for me.but when i created the exe i >start getting an error in my 'getMailContent' function. The error >descrip

Using StringVars in List of Dictionaries as tkInter variables for Scale and Label widgets

2008-05-19 Thread seanacais
I'm trying to build an unknown number of repeating gui elements dynamically so I need to store the variables in a list of dictionaries. I understand that Scale "variable" name needs to be a StringVar but I cannot figure out how to initialize the dictionary. I've tried the following code ps =

Re: Thread killing - I know I know!

2008-05-19 Thread Chris Mellon
On Mon, May 19, 2008 at 11:36 AM, Roger Heathcote <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> >> On May 16, 11:40 am, Roger Heathcote <[EMAIL PROTECTED]> >> wrote: >>> >>> Despite many peoples insistence that allowing for the arbitrary killing >>> of threads is a cardinal sin and altho

Re: addendum Re: working with images (PIL ?)

2008-05-19 Thread Ken Starks
I would still be concerned that you are checking against the percentage of the 768 bins returned by the histogram method. Two pixels of widely different colour end up in the same bin, so long as just ONE of the Red, Green, or Blue components is equal. So, for example, colours (2, 27, 200) and (20

Re: PyGreSQL installation

2008-05-19 Thread D'Arcy J.M. Cain
On Mon, 19 May 2008 18:00:30 +0200 <[EMAIL PROTECTED]> wrote: > Hi there, > > I'm trying to install PyGreSQL for python 2.4. I assume that you got the installer from http://www.PyGreSQL.org/. If so, please join the PyGreSQL list (see above URL) and explain the problem there. It's my module but I

Re: Thread killing - I know I know!

2008-05-19 Thread Roger Heathcote
[EMAIL PROTECTED] wrote: On May 16, 11:40 am, Roger Heathcote <[EMAIL PROTECTED]> wrote: Despite many peoples insistence that allowing for the arbitrary killing of threads is a cardinal sin and although I have no particular threading problem to crack right now I remain interest in the taboo that

Re: Dbase / foxpro files

2008-05-19 Thread Ethan Furman
Johny wrote: Thanks for your reply.Is it possible to delete a record by using the module? Thanks L> -- http://mail.python.org/mailman/listinfo/python-list It is possible with mine. To clarify an earlier post, my module is for dBase III and VFP 6.0 files only (those were the only two I neede

  1   2   >