Re: Replacement for lambda - 'def' as an expression?

2005-09-07 Thread Paul Rubin
Simo Melenius <[EMAIL PROTECTED]> writes: > But if you could do anonymous blocks, you could just write something > like: > > def generate_randomizer (n, m): > return def (x): > return pow (x, n, m) Yes, as it stands you can already say: def generate_randomizer(n, m): return l

dict and __cmp__() question

2005-09-07 Thread Alex
Entering >>> help(dict) Help on class dict in module __builtin__: class dict(object) | dict() -> new empty dictionary. | dict(mapping) -> new dictionary initialized from a mapping object's | (key, value) pairs. | dict(seq) -> new dictionary initialized as if via: | d = {} |

Re: Function returns a function

2005-09-07 Thread Gregory Bond
Paul Rubin wrote: > Aldo Cortesi <[EMAIL PROTECTED]> writes: Thanks to Paul and Aldo... one more question on the implementation. Why is the func_closure a tuple of Cells and not just a tuple of objects? Why the extra level of indirection? -- http://mail.python.org/mailman/listinfo/python-lis

Re: dict and __cmp__() question

2005-09-07 Thread Fredrik Lundh
"Alex" <[EMAIL PROTECTED]> wrote: > But what are those with double underscore? For instance __cmp__(...)? > > I tried D.cmp('a','b') make that cmp('a', 'b') methods that start and end with "__" are implementation hooks: http://docs.python.org/ref/specialnames.html __cmp__ is used

Re: ~ after script filename?

2005-09-07 Thread Fredrik Lundh
"presentt" <[EMAIL PROTECTED]> wrote: > Huh, no ~ on other files when I edit them, but at least I don't have to > worry about it. Thanks Aldo. according to http://www.gnome.org/projects/gedit/ gedit supports backup files, so to figure out how and when they're created, and how to control th

Re: assign dict by value to list

2005-09-07 Thread Bryan Olson
Phill Atwood wrote: [...] > So how do I add a dictionary into a list by value rather than > by reference? Is rec.items() what you want? It returns a list of (key, value) tuples. > The complete code is here: [...] Looks like you could use Python's ConfigParser module. http://docs.python

Re: dict and __cmp__() question

2005-09-07 Thread Bryan Olson
Alex wrote: > But what are those with double underscore? For instance __cmp__(...)? Those are these: http://docs.python.org/ref/specialnames.html -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

pymacs + dbus

2005-09-07 Thread pber
Hi all, I'm on trouble with pymacs and python binding of DBus 0.23. Emacs/Xemacs have their gnuclient(s) to make remote calls to, but I wanted to (try to) make some xemacs functions callable via dbus. Shortly: - pymacs loads some python classes that publish the method "pop_to_window" into a Sessi

Re: Generators and Decorators doing my head in ..

2005-09-07 Thread Michele Simionato
I usually point out my decorator module (http://www.phyast.pitt.edu/~micheles/python/decorator.zip) to simplify decorator usage. In this case you would use it as follows: from decorator import decorator @decorator # convert logFunctionCalls into a decorator def logFunctionCalls(function, *args, *

Reading in external file - error checking and line numbers...

2005-09-07 Thread Hugh Macdonald
I'm writing a tool at the moment that reads in an external file (which can use any Python syntax) At the moment, I'm reading the file in using: scriptLines = open(baseRippleScript).read() exec scriptLines However, if I raise an exception in my main code, in a function that is cal

Re: Reading in external file - error checking and line numbers...

2005-09-07 Thread Fredrik Lundh
Hugh Macdonald wrote: > I'm writing a tool at the moment that reads in an external file (which > can use any Python syntax) > > At the moment, I'm reading the file in using: > > scriptLines = open(baseRippleScript).read() > exec scriptLines > > However, if I raise an exception in my main code, in

multi pointer slider(scale)

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

determine if os.system() is done

2005-09-07 Thread Xah Lee
suppose i'm calling two system processes, one to unzip, and one to “tail” to get the last line. How can i determine when the first process is done? Example: subprocess.Popen([r"/sw/bin/gzip","-d","access_log.4.gz"]); last_line=subprocess.Popen([r"/usr/bin/tail","-n 1","access_log.4"], stdout=sub

Re: Reading in external file - error checking and line numbers...

2005-09-07 Thread Hugh Macdonald
Thankyou! That was much easier than I expected. One more thing on a similar note. When raising exceptions, is it possible to remove a few items from the top of the stack trace? My stack trace is looking something like: File "ripple", line 160, in ? File "ripple", line 94, in executeR

Re: Replacement for lambda - 'def' as an expression?

2005-09-07 Thread Tom Anderson
On Tue, 6 Sep 2005, talin at acm dot org wrote: > add = def( a, b ): > return a + b +1 This is so obviously the right syntax for closures in python that i really can't believe we're still arguing about it. > What about passing an anonymous function as an argument, which is the > most common

Is there anything "better" than impalib/poplib?

2005-09-07 Thread Alessandro Bottoni
Is there any module or interface that allow the programmer to access a imap4/pop3 server in a more pythonic (or Object Oriented) way than the usual imaplib and popolib? I mean: is there any module that would allow me to query the server for specific messages (and fetch them) in a way similar to a

Re: ~ after script filename?

2005-09-07 Thread Benjamin Niemann
presentt wrote: > Hello all, > > I just wrote a really simple script and named it helloworld.py. Inside > was only: > > #!/usr/bin/env > print "Hello, world" > > I used chmod to set the permissions, and ran it to see what happened (I > just started learning Python, if you couldn't guess) > >

PEP-able? Expressional conditions

2005-09-07 Thread Kay Schluehr
One of the main reasons Pythons anonymous function lambda is considered to be "broken" is Pythons disability to put statements into expressions and support full functionality. Many attempts to improve lambdas syntax had also been attempts to break the expression/statement distinction in one or the

Re: determine if os.system() is done

2005-09-07 Thread Alessandro Bottoni
Xah Lee wrote: > of course, i can try workarounds something like os.system("gzip -d > thiss.gz && tail thiss"), but i wish to know if there's non-hack way to > determine when a system process is done. Well, if you use a function of the "popen" family, you get some kind of return value from the su

Re: Python versus Perl

2005-09-07 Thread Michael Sparks
Dieter Vanderelst wrote: > Dear all, > > I'm currently comparing Python versus Perl to use in a project that > involved a lot of text processing. I'm trying to determine what the > most efficient language would be for our purposes. I have to admit > that, although I'm very familiar with Python, I

Re: determine if os.system() is done

2005-09-07 Thread Thomas Bellman
"Xah Lee" <[EMAIL PROTECTED]> writes: > suppose i'm calling two system processes, one to unzip, and one to > tail to get the last line. How can i determine when the first > process is done? > Example: > subprocess.Popen([r"/sw/bin/gzip","-d","access_log.4.gz"]); > last_line=subprocess.Popen([r"

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-07 Thread Adriaan Renting
>>> I'm in the US and have no EU papers. Still feasible? Unless you and your employer know the to talk the talk and walk the walk, it's probably going to be hard. I work at a place in the Netherlands where about 50% of the employees are from abroad, with large numbers from places like the USA,

Re: determine if os.system() is done

2005-09-07 Thread Fredrik Lundh
Thomas Bellman wrote: > Have you tried reading the manual for the subprocess module? han har försökt, men hans tourette tog överhanden: http://mail.python.org/pipermail/python-list/2005-September/297642.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-07 Thread Paul Rubin
"Adriaan Renting" <[EMAIL PROTECTED]> writes: > Not to discourage you, working abroad can realy be a nice thing to > do, but expect a lot of paperwork, and a lot of contradicting > answers. The basic thing is, that most european goventments aren't > set up to deal with expats, most immigrants are e

Re: determine if os.system() is done

2005-09-07 Thread Jeremy Jones
Thomas Bellman wrote: >"Xah Lee" <[EMAIL PROTECTED]> writes: > > > >>suppose i'm calling two system processes, one to unzip, and one to >>tail to get the last line. How can i determine when the first >>process is done? >> >> > > > >>Example: >> >> > > > >>subprocess.Popen([r"/sw/bin/

Re: determine if os.system() is done

2005-09-07 Thread Martin Franklin
Xah Lee wrote: > suppose i'm calling two system processes, one to unzip, and one to > “tail” to get the last line. How can i determine when the first > process is done? > > Example: > > subprocess.Popen([r"/sw/bin/gzip","-d","access_log.4.gz"]); > > last_line=subprocess.Popen([r"/usr/bin/tail","

Re: determine if os.system() is done

2005-09-07 Thread Nainto
Yeah, I agree. The Python documentation just merey describes what arguements a function can take not as much how to use the actual function. -- http://mail.python.org/mailman/listinfo/python-list

Re: determine if os.system() is done

2005-09-07 Thread Fredrik Lundh
"Nainto" <[EMAIL PROTECTED]> wrote: > Yeah, I agree. The Python documentation just merey describes what > arguements a function can take not as much how to use the actual > function. yeah, that's a really relevant criticism when we're talking about a module that contains one function and one class

Re: determine if os.system() is done

2005-09-07 Thread Lars Gustäbel
[Fredrik Lundh] > han har försökt, men hans tourette tog överhanden: IMHO it's more likely an Asperger's syndrome. http://en.wikipedia.org/wiki/Asperger_Syndrome -- Lars Gustäbel [EMAIL PROTECTED] Any sufficiently advanced technology is indistinguishable from magic. (Arthur C. Clarke) -- http

Re: Problems with Python for Windows extensions

2005-09-07 Thread KK
Hello, I guess you could reproduce my problem, Kartic. I have tried the one u suggested, but sadly it didn't work for me. I think the COM of pywin is quite tricky, or it might be a bug. I have some friends who also had experience of weird behaviors of pywin32, which makes me skeptical of using it i

Re: dual processor

2005-09-07 Thread Robin Becker
Paul Rubin wrote: > Jeremy Jones <[EMAIL PROTECTED]> writes: > >>to pass data around between processes. Or an idea I've been tinkering >>with lately is to use a BSD DB between processes as a queue just like >>Queue.Queue in the standard library does between threads. Or you >>could use Pyro betwe

Re: __dict__ of object, Was: Regular Expression IGNORECASE differentfor findall and split?

2005-09-07 Thread Chris
Fredrik Lundh wrote: > Chris <[EMAIL PROTECTED]> wrote: > > >>but more of a basic question following, I was doing the following before: >> >>method = 'split' # came from somewhere else of course >>result = re.__dict__[method].(REGEX, TXT) >> >>precompiling the regex >> >>r = compile(REGEX) >> >>d

Open source Web testing tool - cPAMIE 1.6b released

2005-09-07 Thread calfdog
I am pleased to announce version cPAMIE 1.6 the Web automation tool for Internet explorer. If your looking for a fast way, easy to learn way to drive your browser check out PAMIE. Is PAMIE right for you?, depends on your needs and complexity of the web application. Pamie can take care of the basi

Re: Ode to python

2005-09-07 Thread Luis M. Gonzalez
I guess we all say foolishness when we're in love... -- http://mail.python.org/mailman/listinfo/python-list

Re: Installation question

2005-09-07 Thread malv
I can't give you an exact answer, but maybe this helps a bit: I tried running both Python 2.3 and 2.4 (both 32) with Qt3 on two other distros. It never really worked and gave me lots of problems. It certainly "messed up" a few things here and there. I never managed to get things straightened out. I

Re: documentation error

2005-09-07 Thread Terry Hancock
On Sunday 04 September 2005 01:30 pm, Reinhold Birkenfeld wrote: > tiissa wrote: > > bill wrote: > >>>From 3.2 in the Reference Manual "The Standard Type Hierarchy": > >> > >> "Integers > >> These represent elements from the mathematical set of whole > >> numbers." > >> > >> The generally rec

Re: Python compiled?

2005-09-07 Thread Terry Hancock
On Tuesday 06 September 2005 11:32 am, Jorgen Grahn wrote: > I hope people are less hesitant to install "interpreted" applications today > than they were ten years ago. > > I also believe it's better to convince the end user to install Python before > installing the application[1], rather than to

Re: Assigning 'nochage' to a variable.

2005-09-07 Thread Terry Hancock
On Sunday 04 September 2005 06:34 pm, Terry Reedy wrote: > > resembling the 'Z'-state of a electronic tri-state output? > > Not familiar with that. "Tri-state" logic gate outputs can do one of three things: 1) They can drive the voltage to 0.0 "0" 2) They can drive the voltage to VCC "1" 3)

BayPIGgies: DATE CHANGE September 15, 7:30pm (Google)

2005-09-07 Thread Aahz
DATE CHANGE: The next meeting of BayPIGgies will be Thurs, September 15 at 7:30pm at Google. We still don't have a room at Google; Paul Marxhausen has accepted the task of pinging people, but we may need to switch to Ironport if we don't get a room by Tuesday. Agenda has not been finalized -- we

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-07 Thread Fred Pacquier
"Adriaan Renting" <[EMAIL PROTECTED]> said : > And about the French language: Try to find some french radio broadcast > on the internet or something like that, and see if you can understand > it. I find reading/writing/speaking French is o.k., but understanding > native speakers can be very hard.

encryption with python

2005-09-07 Thread jlocc
Hi! I was wondering if someone can recommend a good encryption algorithm written in python. My goal is to combine two different numbers and encrypt them to create a new number that cann't be traced back to the originals. It would be great if there exists a library already written to do this, and

Re: PEP-able? Expressional conditions

2005-09-07 Thread Terry Hancock
On Wednesday 07 September 2005 05:29 am, Kay Schluehr wrote: > Instead of pushing statements into expressions one can try to do it the > other way round and model expressions with the functionality of > statements. > Alternative syntax proposals: > > (a) (COND1,EXPR1) || (COND2,EXPR2) > (b)

question from beginner

2005-09-07 Thread dario
Hi, Im new on phyton programming. On my GPRS modem with embedded Phyton 1.5.2+ version, I have to receive a string from serial port and after send this one enclosed in an e-mail. All OK if the string is directly generated in the code. But it doesn't works if I wait for this inside a 'while' loop. T

Re: epydoc CLI and many files

2005-09-07 Thread Terry Hancock
On Monday 05 September 2005 08:10 am, Laszlo Zsolt Nagy wrote: > I have a problem under Windows. There's your problem. ;-) > I use the cli.py program included with > epydoc. I wrote a small program that lists all of my modules after the > cli. Something like this: > > cli.py --html --inheri

Re: Problems with Python for Windows extensions

2005-09-07 Thread Kartic
The Great 'KK' uttered these words on 9/7/2005 7:57 AM: > Hello, > I guess you could reproduce my problem, Kartic. I have tried the one u > suggested, but sadly it didn't work for me. I think the COM of pywin is > quite tricky, or it might be a bug. I have some friends who also had > experience of

Re: Ode to python

2005-09-07 Thread hans . eccentricity
Very good poem. Mind if forward it around?? I'll include ur email ID if u don't mind -- http://mail.python.org/mailman/listinfo/python-list

Re: encryption with python

2005-09-07 Thread Andreas Lobinger
Aloha, [EMAIL PROTECTED] wrote: > I was wondering if someone can recommend a good encryption algorithm > written in python. > It would be great if there exists a library already written to do this, > and if there is, can somebody please point me to it?? M2Crypto, interface to OpenSSL http://sand

Re: Is there anything "better" than impalib/poplib?

2005-09-07 Thread Thomas Guettler
Am Wed, 07 Sep 2005 10:14:45 + schrieb Alessandro Bottoni: > Is there any module or interface that allow the programmer to access a > imap4/pop3 server in a more pythonic (or Object Oriented) way than the > usual imaplib and popolib? > > I mean: is there any module that would allow me to que

Re: Python versus Perl

2005-09-07 Thread Terry Hancock
On Wednesday 07 September 2005 04:47 am, Michael Sparks wrote: > Dieter Vanderelst wrote: > > I'm currently comparing Python versus Perl to use in a project that > > involved a lot of text processing. I'm trying to determine what the > > most efficient language would be for our purposes. I have to

Re: infinite loop

2005-09-07 Thread Carl Friedrich Bolz
Hi! LOPEZ GARCIA DE LOMANA, ADRIAN wrote: > Hi all, > > I have a question with some code I'm writting: > > > def main(): > > if option == 1: > > function_a() > > elif option == 2: > > function_b() > > else: > > raise 'option has to be either 1 or 2' >

Re: encryption with python

2005-09-07 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Hi! > > I was wondering if someone can recommend a good encryption algorithm > written in python. My goal is to combine two different numbers and > encrypt them to create a new number that cann't be traced back to the > originals. > > I

Re: py2exe 0.6.1 released

2005-09-07 Thread cmkl
I removed conditional imports from visual and after that I works like a charm. Now I've got a VPython application within a single 3 Mbyte exe-file (Python-2.3). That is really cool. Thanks Carl -- http://mail.python.org/mailman/listinfo/python-list

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-07 Thread Terry Hancock
On Tuesday 06 September 2005 03:34 am, Huron wrote: > > 1) whether there would be legal or procedural obstacles for a > > non-European wanting to work in Paris for a while; and > If you are a member of the EU (the netherlands ?), there no such problem on > our side. Only _you_ would have some paper

Re: 'isa' keyword

2005-09-07 Thread Terry Hancock
On Sunday 04 September 2005 07:25 am, Colin J. Williams wrote: > Rocco Moretti wrote: > > Terry Hancock wrote: > > > >> On Thursday 01 September 2005 07:28 am, Fuzzyman wrote: > >> > >>> What's the difference between this and ``isinstance`` ? > >> > >> > >> I must confess that an "isa" operator so

The right way to do i18n

2005-09-07 Thread Laszlo Zsolt Nagy
Hello, I wonder if there is a standard for making i18n in Python projects. I have several Python projects that are internationalized. I also have Python packages with i18n. But it is still not clean to me what is the recommended way to do it. Currently, I use a module called 'localization.p

python and ARCView GIS desktop

2005-09-07 Thread GISDude
hi all. I am a newbie, so be kind. I am using ARCView GIS 9.1 and python win. I am trying to develop a module using the GZIP module in my ARCView map session. What I am attempting to do (I think) is use the zip mod to zip up all the files in a .mxd document into one neat little zipped file, ready t

Re: anaconda.real in RH7.1

2005-09-07 Thread Allan Adler
Allan Adler <[EMAIL PROTECTED]> writes: > I'm trying to reinstall RedHat 7.1 Linux on a PC that was disabled when > I tried to upgrade from RH7.1 [] > The file anaconda.real is invoked with the line > exec /usr/bin/anaconda.real -T "$@" > I don't know what effect the -T "$@" has. Tiny progre

Re: encryption with python

2005-09-07 Thread Steve M
>My goal is to combine two different numbers and encrypt them to create a new number that cann't be traced back to the originals. Here's one: def encrypt(x, y): """Return a number that combines x and y but cannot be traced back to them.""" return x + y -- http://mail.python.org/mailman/l

py2exe 0.6.2 released

2005-09-07 Thread Thomas Heller
This is a bugfix release for py2exe 0.6.1. py2exe 0.6.2 released = py2exe is a Python distutils extension which converts python scripts into executable windows programs, able to run without requiring a python installation. Console and Windows (GUI) applications, windows NT se

Re: py2exe 0.6.1 released

2005-09-07 Thread Thomas Heller
"Giovanni Bajo" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: > >>> I tried it using the wx singlefile example, but unfortunately the >>> resulting executable segfaults at startup (using Python 2.3.3 on >>> Windows 2000, with latest wxWindows). >> >> Yes, I can reproduce that. I'm still usin

Re: py2exe 0.6.1 released

2005-09-07 Thread Thomas Heller
[EMAIL PROTECTED] (Bengt Richter) writes: > If you have a place in the program where output should never happen > except when you would want a console window to see it in, you can > call AllocConsole [1] safely even in multiple such places, just before > the printing, and the first such call will

Re: [Jython-users] ANN: PyDev 0.9.8.1 released

2005-09-07 Thread stri ker
I am a Mac OS X user running Tiger. The install was extremely easy and Eclipse seems to have some good features at first glance. For anyone interested after installing Eclipse you can download and install PyDev with the instructions on this page. They are for Windows, but other OS's should

Re: Cleaning strings with Regular Expressions

2005-09-07 Thread sheffdog
Good Idea I'll try that! Thanks for your assistance. /\/\ -- http://mail.python.org/mailman/listinfo/python-list

Question about concatenation error

2005-09-07 Thread colonel
I am new to python and I am confused as to why when I try to concatenate 3 strings, it isn't working properly. Here is the code: -- import string import sys import re import urllib linkArray = [] srcArray =

Re: Question about concatenation error

2005-09-07 Thread colonel
On Wed, 07 Sep 2005 16:34:25 GMT, colonel <[EMAIL PROTECTED]> wrote: >I am new to python and I am confused as to why when I try to >concatenate 3 strings, it isn't working properly. > >Here is the code: > >--

List of integers & L.I.S.

2005-09-07 Thread n00m
Given a list of N arbitrarily permutated integers from set {1..N}. Need to find the ordering numbers of each integer in the LONGEST increasing sequence to which this number belongs. Sample: List: [4, 5, 6, 1, 2, 7, 3] Corresponding ordering numbers: [1, 2, 3, 1, 2, 4, 3] Details: e.g. number 7 b

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

2005-09-07 Thread n00m
> Code run from IDLE but not via double-clicking on its *.py It still does not work. Weird. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Py2exe-users] py2exe 0.6.2 released

2005-09-07 Thread Ray Schumacher
First, Thanks again for the update. At 08:55 AM 9/7/2005, Thomas Heller wrote: > This part of the code is distributed under the MPL 1.1, so this > license is now pulled in by py2exe. As I read it, it seems that I need to include an Exibit A http://www.mozilla.org/MPL/MPL-1.1.html#exhib

Re: anaconda.real in RH7.1

2005-09-07 Thread Steve Holden
Allan Adler wrote: > Allan Adler <[EMAIL PROTECTED]> writes: > > >>I'm trying to reinstall RedHat 7.1 Linux on a PC that was disabled when >>I tried to upgrade from RH7.1 [] >>The file anaconda.real is invoked with the line >>exec /usr/bin/anaconda.real -T "$@" >>I don't know what effect the

Re: Sockets: code works locally but fails over LAN

2005-09-07 Thread n00m
I was trying to test the send() vs sendall() like this: x=send(data) print len(data)-x > 0 ? (when the code fails) but I could not reproduce the failures anymore. As if the lan got "refreshed" after the first using of sendall() instead of send(). Btw, why we need send() if there is sendall()? -

Re: Possible improvement to slice opperations.

2005-09-07 Thread Ron Adam
Bengt Richter wrote: > Then the question is, do we need sugar for reversed(x.[a:b]) > or list(reversed(x.[a:b])) for the right hand side of a statement, > and do we want to to use both kinds of intervals in slice assignment? > (maybe and yes ;-) Yes, I think this is the better way to do it, as th

Re: Question about concatenation error

2005-09-07 Thread Steve Holden
colonel wrote: > On Wed, 07 Sep 2005 16:34:25 GMT, colonel <[EMAIL PROTECTED]> > wrote: > > >>I am new to python and I am confused as to why when I try to >>concatenate 3 strings, it isn't working properly. >> >>Here is the code: >> >>-

Re: improvements for the logging package

2005-09-07 Thread Trent Mick
[EMAIL PROTECTED] wrote] > Perhaps so, but the logging module seems like such an unpythonic beast to > me. How about cleaning it up (*) before we add more to it? Yes. I was also trying to encourage Rotem to get involved in other parts of the logging module/package later on in my email. :) > Stuf

Re: PEP-able? Expressional conditions

2005-09-07 Thread Kay Schluehr
Terry Hancock wrote: > On Wednesday 07 September 2005 05:29 am, Kay Schluehr wrote: > > Instead of pushing statements into expressions one can try to do it the > > other way round and model expressions with the functionality of > > statements. > > > Alternative syntax proposals: > > > > (a) (COND

Re: py2exe 0.6.2 released

2005-09-07 Thread Bugs
As a big test of Thomas's excellent work with py2exe, I tried to create a single-file executable of the wxPython demo (demo.py). The executable was built (5.3MB) but gets a C++ runtime error when I try to execute? Here's the log: Traceback (most recent call last): File "demo.py", line 4, in ?

Re: epydoc CLI and many files

2005-09-07 Thread Dave Benjamin
Terry Hancock wrote: > On Monday 05 September 2005 08:10 am, Laszlo Zsolt Nagy wrote: > >>The problem is that now I have so many modules that the shell (cmd.exe) >>cannot interpret this as a one command. > > In POSIX systems, the shell expands wildcards into multiple files on > the command line

Python CGI and Firefox vs IE

2005-09-07 Thread Jason
Hey y'all, this falls under the murky realm of HTML, CGI and Python...and IE. Python 2.4, using CGI to process a form. Basically I've got 3 buttons. Here's the HTML code: All Servers WKPEA1 WKNHA2 And the code that's messing things up: fields = cgi.FieldStorage() if fields.has_key('displa

Sniffer with RAW SOCKETS

2005-09-07 Thread billiejoex
Hi all. I'm trying to make a simple icmp sniffer by using SOCK_RAW. The code below works but ONLY if I first use the sendto() function. Does anybody knows why? Regards from socket import * import select def recv(): while 1: if s in select.select([s],[],[],99)[0]: reply = s.

distutils question

2005-09-07 Thread Joachim Dahl
I am trying to make a customized install script for an extension module using the distutils.ccompiler class. I want to embed an existing makefile for the C libraries into the Python setup script, but I am not sure what's the right way to do it... E.g., say I want to compile a project as: gcc -

Re: Python CGI and Firefox vs IE

2005-09-07 Thread Stephan Diehl
On Wed, 07 Sep 2005 10:50:15 -0700, Jason wrote: > Hey y'all, this falls under the murky realm of HTML, CGI and > Python...and IE. > > Python 2.4, using CGI to process a form. > > Basically I've got 3 buttons. Here's the HTML code: > > > All > Servers > type='submit'>WKPEA1 > type='submit'>

Re: Question about concatenation error

2005-09-07 Thread Terry Reedy
"colonel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > so can anyone tell me why "cleanlink" gets coverted to a list? > Is it during the slicing? Steve answered for you, but for next time, you could find out faster by either using the all-purpose debuging tool known as 'print'

Re: Python CGI and Firefox vs IE

2005-09-07 Thread infidel
> I see what's happening, but I'm at a loss to figure out what to do > about it. Any help would be appreciated. Try giving the buttons different name attributes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CGI and Firefox vs IE

2005-09-07 Thread Jason
IE... Have to come up with a workaround, go back to the old . I'm about the only one who uses firefox in our facility. Thanks for the reply and the link. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about concatenation error

2005-09-07 Thread Terry Hancock
On Wednesday 07 September 2005 11:34 am, colonel wrote: > I am new to python and I am confused as to why when I try to > concatenate 3 strings, it isn't working properly. > > Here is the code: I'm not taking the time to really study it, but at first glance, the code looks like it's probably much

Re: Sniffer with RAW SOCKETS

2005-09-07 Thread Grant Edwards
On 2005-09-07, billiejoex <[EMAIL PROTECTED]> wrote: > Hi all. I'm trying to make a simple icmp sniffer by using > SOCK_RAW. Just a suggestion: you'd probably be better off using the PCAP library. > The code below works but ONLY if I first use the sendto() > function. Does anybody knows why? 'F

Re: PEP-able? Expressional conditions

2005-09-07 Thread Terry Reedy
"Kay Schluehr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > No, as I explained it is not a ternary operator and it can't easily be > implemented using a Python function efficiently because Python does not > support lazy evaluation. By *carefully* using the flow-control operators

Re: ~ after script filename?

2005-09-07 Thread Steve Horsley
presentt wrote: > Hello all, > > I just wrote a really simple script and named it helloworld.py. Inside > was only: > > #!/usr/bin/env > print "Hello, world" > > I used chmod to set the permissions, and ran it to see what happened (I > just started learning Python, if you couldn't guess) > > T

Re: Ode to python

2005-09-07 Thread James Stroud
On Tuesday 06 September 2005 09:29 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > Python or C? C is simply a pawn. > > Venomous problem? Pythons squeeze and constrict, until the problem is > > gone. > > Don't quit your day job. I beg to differ, perhaps we see a spark of inspiration: > Abol

pickling objects in jython

2005-09-07 Thread Shahin Saadati
Hi, The following sample code is to pickle and unpickle an object. It works fine with CPython, but the unpickling fails in Jython and I receive an error stating that "A" is unsafe to unpickle (even though I believe I have the code to make "A" safe for unpickling). What do I do wrong and how can

Re: dual processor

2005-09-07 Thread Michael Sparks
Jorgen Grahn wrote: > On Tue, 06 Sep 2005 08:57:14 +0100, Michael Sparks <[EMAIL PROTECTED]> > wrote: ... >> Are you so sure? I suspect this is due to you being used to writing code >> that is designed for a single CPU system. What if you're basic model of >> system creation changed to include sys

Re: determine if os.system() is done

2005-09-07 Thread Steve Horsley
Xah Lee wrote: > suppose i'm calling two system processes, one to unzip, and one to > “tail” to get the last line. How can i determine when the first > process is done? > > Example: > > subprocess.Popen([r"/sw/bin/gzip","-d","access_log.4.gz"]); > > last_line=subprocess.Popen([r"/usr/bin/tail","

Improving Python docs (was Re: OpenSource documentation problems)

2005-09-07 Thread Aahz
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: >Aahz wrote: >> In article <[EMAIL PROTECTED]>, >> Steve Holden <[EMAIL PROTECTED]> wrote: >.> >>>Bear in mind that the PSF made its very first grants last year. The >>>reason none of those grants was awarded to a documenta

Re: encryption with python

2005-09-07 Thread ncf
Steve M wrote: > >My goal is to combine two different numbers and > encrypt them to create a new number that cann't be traced back to the > originals. > > Here's one: > def encrypt(x, y): > """Return a number that combines x and y but cannot be traced back > to them.""" > return x + y Or y

Re: Sockets: code works locally but fails over LAN

2005-09-07 Thread Bryan Olson
n00m wrote: > Btw, why we need send() if there is sendall()? Mostly because sendall() can block, even if you do all the select() and setblocking() magic. That's no problem in the threaded architecture we're using, but a deal-breaker for a single-threaded server. -- --Bryan -- http://mail.pytho

Re: encryption with python

2005-09-07 Thread James Stroud
This is either a very simple or a very open-ended question you have asked. Do you want to be able to recover the original numbers arbitrarily from the combination? What properties do you want the combination to have? Do you want to take the combination and a number and see if the number is in th

Re: determine if os.system() is done

2005-09-07 Thread Martin P. Hellwig
Lars Gustäbel wrote: > [Fredrik Lundh] > >>han har försökt, men hans tourette tog överhanden: > > > IMHO it's more likely an Asperger's syndrome. > > http://en.wikipedia.org/wiki/Asperger_Syndrome > I disagree, in his writings I found no evidence of autisme. Actually most of it can be classif

Re: ~ after script filename?

2005-09-07 Thread presentt
Oh okay. Thank you all. Now that you mention it, the ~ makes sense; I know M$ Word uses a ~ in the temp files that it autosaves periodically. And I think I've seen it with M$ Notepad too. Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP-able? Expressional conditions

2005-09-07 Thread Paul Rubin
Terry Hancock <[EMAIL PROTECTED]> writes: > def ternary(condition, true_result, false_result): > if condition: > return true_result > else: > return false_result > > Almost as good, and you don't have to talk curmudgeons into providing > it for you. Not the

Re: Yielding a chain of values

2005-09-07 Thread yairchu
dude - this business is so confusing that you actually have to *think* about it! but python is all about simplicity. with python, when I program - I don't think *about* it - I think it. or something - don't make me think about it. so how about a "reyield" or some other new keyword (cause reyield i

can i move attribute values from one class to another?

2005-09-07 Thread nephish
heres the deal. i am working on a threading gui. pygtk in one class (main) is all the gui stuff, but in another class that is a thread, i am reading serial input. what i want to be able to do is take what read in the thread and print it in a textview in the gui class. here is what i have: class

  1   2   >