Re: Embeding python with mingw on win32 and python 2.4.4

2008-01-28 Thread mani
It's me answering my self. I found the solution in http://groups.google.com/group/comp.lang.python/browse_thread/thread/4d80df2e53dfa127/de87533c05d8021c?lnk=gst&q=Py_Initialize+undefined+reference#de87533c05d8021c It was the problem of gcc arguments order. -- http://mail.python.org/mailman/lis

Re: Python self-evaluating strings

2008-01-28 Thread Arnaud Delobelle
On Jan 29, 3:48 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | I found > this:http://groups.google.com/group/comp.lang.python/browse_thread/thread/... > > Exactly the one I meant. > > | It contains a lambda-solu

Do You Want a GSM Mobile with Amazing Features? Please click here

2008-01-28 Thread Farooq
www.enmac.com.hk GSM Mobile Phones, Digital iPods, Digital Clocks, Digital Pens, Digital Quran. Enjoy these products with Islamic Features (Complete Holy Quran with Text and Audio, Tafaseer books, Ahadees Books, Daily Supplications, Universal Qibla Direction, Prayer Timing and much more) visit our

Re: Problems installing Python on server

2008-01-28 Thread Devraj
Also be careful and setup all the paths that is required for compiling various Python modules etc. On Jan 29, 8:28 am, Yansky <[EMAIL PROTECTED]> wrote: > I asked my hosting company if they would upgrade Python on my server > to the latest version. They responded with: > > "Sorry no. We tend to st

Where do glade files go?

2008-01-28 Thread Devraj
Hi everyone, I am writing an application using Python/GTK/Hildon/Glade. I will be creating a debian package as the final distribution mechanism for the package. What would be the ideal place to put glade files that my application uses on the target system? Thanks. -- http://mail.python.org/mailm

Re: wx.EVT_RIGHT_UP strangeness?

2008-01-28 Thread sigpoggy
Thanks, I'm using wxPython 2.8.7.1 on OS X 10.4.11 with MacPython 2.5 No doubt it's a Mac thing, I'll take it to the wxPython users. On Jan 28, 6:36 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Jan 26, 1:30 pm, [EMAIL PROTECTED] wrote: > > > > > I am playing with wxPython 2.8.7.1 on OS X 10

Re: A question about osyco

2008-01-28 Thread iu2
On Jan 29, 1:48 am, [EMAIL PROTECTED] wrote: > Marc 'BlackJack' Rintsch: > > > Try calling the iterative one twice and measure the time of the second > > call.  IIRC psyco needs at least one call to analyze the function, so the > > first call is not speed up. > > That's how Java HotSpot works, but

Is netstat in python is enough for getting ip address of all system connected in network

2008-01-28 Thread Manikandan R
hai everybody, I am working in python 2.4. I am in need to get the ip address of all the devices connected in the network. Is its possible in python, can anyone help me please. If its possible, can U give me the code. Mani. -- http://mail.python.org/mailman/listinfo/python-list

Re: ISO with timezone

2008-01-28 Thread Nicholas F. Fabry
Hello, nik. On Jan 28, 2008, at 21:03, nik wrote: > Hi, > > How does one express the time in ISO format with the timezone > designator? > > what I want is -MM-DDThh:mm:ss.sTZD > >> From the documentation I see: from datetime import tzinfo, timedelta, datetime class TZ(tzinfo): > ...

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-28 Thread Terry Reedy
"André" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |Here's a version that |1. does not require new syntax |2. does not *necessarily* override the "_" prefix convention 'self_' is way too bulky and intrusive. Putting '_' at the end of the word is nearly as easy to detect and co

Re: Python Standardization: Wikipedia entry

2008-01-28 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Paddy" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > |I would value the opinion of fellow Pythoneers who have also > | contributed to Wikipedia, on the issue of "Is Python Standardized". > > Depends en

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-28 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I don't like the name convention. _name already has a perfectly good | convention: it's a private name, don't mess with it. That includes in | function/method signatures. With your convention, _foo is public. Since l

Re: Python self-evaluating strings

2008-01-28 Thread Terry Reedy
"Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I found this: http://groups.google.com/group/comp.lang.python/browse_thread/thread/a1316cb4e216eba4/0cda739385abd03c?lnk=gst&q=Self-Reproducing+Program#0cda739385abd03c Exactly the one I meant. | It contains a lamb

Re: Python Standardization: Wikipedia entry

2008-01-28 Thread Terry Reedy
"Paddy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I would value the opinion of fellow Pythoneers who have also | contributed to Wikipedia, on the issue of "Is Python Standardized". Depends entirely on the operative meaning of standardized. Formal standards body? Obviously no

LEELO NO TE ARREPENTIRAS

2008-01-28 Thread aida
Léelo, no te arrepentirásPOR FAVOR ANTES DE ELIMINAR ESTE MENSAJE, LEAN PRIMEROY TOMEN LA DECISIÓN DESPUÉS.ESTO TE PUEDE AYUDAR A PAGAR TUS DEUDAS O TUS ESTUDIOSHola amigos:Esto es lo me pasó días atrás, mientras navegaba por estas páginas de noticias, así como usted lo está haciendo ahora. Se me a

ISO with timezone

2008-01-28 Thread nik
Hi, How does one express the time in ISO format with the timezone designator? what I want is -MM-DDThh:mm:ss.sTZD >From the documentation I see: >>> from datetime import tzinfo, timedelta, datetime >>> class TZ(tzinfo): ... def utcoffset(self, dt): return timedelta(minutes=-399) ... >>>

Re: Executing other python code

2008-01-28 Thread Rolf van de Krol
AFAIK this can't be done with just python. You can use the C API of Python to achieve this. I don't know the details of that, but I guess you will need this (http://docs.python.org/api/api.html). Rolf Tim Rau wrote: > I'm working on a game, and I'd like players to be able to define thier > ship

Executing other python code

2008-01-28 Thread Tim Rau
I'm working on a game, and I'd like players to be able to define thier ships with scripts. Naturally, I don't want to give them the entire program as thier romping ground. I would like to invoke a seperate interpreter for these files, and give it a limited subset of the functions in my game. What i

Re: post variable

2008-01-28 Thread Gabriel Genellina
En Mon, 28 Jan 2008 19:32:45 -0200, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > 1. yes i've tried that technique but its annoying, the user can easily > stop the redirection and not "elegant". > > 2. yes i'm aware of that, however what i've mentioned above is just an > example, it's actual

Re: file write question

2008-01-28 Thread Robb Lane (SL name)
H - I am not familiar with flush(), will look into it. But an interesting note: I repeatedly and often start long running processes (one running right now: on about it's 14th hour), writing to open files, with few problems (on Mac OS X). Although of course I can't look at the results until the file

Re: A question about osyco

2008-01-28 Thread bearophileHUGS
Marc 'BlackJack' Rintsch: > Try calling the iterative one twice and measure the time of the second > call. IIRC psyco needs at least one call to analyze the function, so the > first call is not speed up. That's how Java HotSpot works, but Psyco is very different from HotSpot, and I think you are

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-28 Thread Arnaud Delobelle
On Jan 28, 10:27 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > I've modified my little decorator (see Test1, Test2, Test3 for > > usage). I'll post it later on the cookbook if there seems to be no > > bugs and noone raises valid point against it:) > > One other area that was mentioned obliquely: p

Re: Python Genetic Algorithm

2008-01-28 Thread Wildemar Wildenburger
Blubaugh, David A. wrote: > Have you ever worked with Gene Expression Programming > No. Why? /W -- http://mail.python.org/mailman/listinfo/python-list

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-28 Thread Tim Chase
> I've modified my little decorator (see Test1, Test2, Test3 for > usage). I'll post it later on the cookbook if there seems to be no > bugs and noone raises valid point against it:) One other area that was mentioned obliquely: preservation of docstrings (and other function attributes) I could

Re: post variable

2008-01-28 Thread [EMAIL PROTECTED]
On 28 jan, 22:32, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > 1. yes i've tried that technique but its annoying, the user can easily > stop the redirection and not "elegant". It's a very canonical technique with HTTP (at least after a successful POST). But I suspect you're not doing it the ri

Re: Just for fun: Countdown numbers game solver

2008-01-28 Thread Arnaud Delobelle
On Jan 28, 9:31 pm, [EMAIL PROTECTED] wrote: > I also had a go at this problem for a bit of python practice, about 6 > months ago. I tried a few optimizations and my experience was that > with only 6 seeds, a hash table was very effective. So effective, in > fact, that it made all other optimizat

Re: Problems installing Python on server

2008-01-28 Thread [EMAIL PROTECTED]
On 28 jan, 22:28, Yansky <[EMAIL PROTECTED]> wrote: > I asked my hosting company if they would upgrade Python on my server > to the latest version. They responded with: > > "Sorry no. We tend to stick with what comes packaged with the unix > distribution to ease maintenance issues. > > There is not

Re: Just for fun: Countdown numbers game solver

2008-01-28 Thread david . hotham
I see I don't have as many columns as I'd expected. Here's a reformatted listing. from time import time from bisect import insort from sys import argv #- # Hash table is a global variable #-

Re: PYS file

2008-01-28 Thread Diez B. Roggisch
Gabriel Genellina schrieb: > On 28 ene, 13:05, azrael <[EMAIL PROTECTED]> wrote: > >> A I Understood correctly, pyc files are compiled py scripts. Is it >> possible to decomplite them. >> I guess it's possible, but how hard is it. > > You want to get back the Python source? Look for the "decompyl

Re: post variable

2008-01-28 Thread [EMAIL PROTECTED]
1. yes i've tried that technique but its annoying, the user can easily stop the redirection and not "elegant". 2. yes i'm aware of that, however what i've mentioned above is just an example, it's actually way more serious. guess i'll have to bare with it. -- http://mail.python.org/mailman/listin

Re: Just for fun: Countdown numbers game solver

2008-01-28 Thread david . hotham
I also had a go at this problem for a bit of python practice, about 6 months ago. I tried a few optimizations and my experience was that with only 6 seeds, a hash table was very effective. So effective, in fact, that it made all other optimizations more or less pointless. Code below. Arguments

Problems installing Python on server

2008-01-28 Thread Yansky
I asked my hosting company if they would upgrade Python on my server to the latest version. They responded with: "Sorry no. We tend to stick with what comes packaged with the unix distribution to ease maintenance issues. There is nothing stopping you from running your own version of python from w

Re: translating Python to Assembler

2008-01-28 Thread Grant Edwards
On 2008-01-28, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: >> No, it doesn't output corresponding machine code (that's what >> some Java JIT implementations do, but I'm not aware of any >> Python implementations that do that). The virtual machine >> interpreter just does

Re: post variable

2008-01-28 Thread Hrvoje Niksic
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > so the output is always the POST retrieven at first. So the page > keeps on printing the POST variable retrieven at first even thought > i might have reloaded the page 1000 times. Is there any way to > "empty" the POST variable, so that at reload n

Re: translating Python to Assembler

2008-01-28 Thread Bjoern Schliessmann
Grant Edwards wrote: > No, it doesn't output corresponding machine code (that's what > some Java JIT implementations do, but I'm not aware of any > Python implementations that do that). The virtual machine > interpreter just does the action specified by the bytecode. By "outputs corresponding mac

RE: Python Genetic Algorithm

2008-01-28 Thread Blubaugh, David A.
Sir, Have you ever worked with Gene Expression Programming David Blubaugh -Original Message- From: Wildemar Wildenburger [mailto:[EMAIL PROTECTED] Sent: Monday, January 28, 2008 7:24 AM To: python-list@python.org Subject: Re: Python Genetic Algorithm Steven D'Aprano wrote:

Re: optional static typing for Python

2008-01-28 Thread Arnaud Delobelle
On Jan 28, 4:31 pm, John Nagle <[EMAIL PROTECTED]> wrote: > Arnaud Delobelle wrote: [...] > > Note that annotations do not provide explicit typing, AFAIK: > > > def f(x:int) -> int: return x*2 > > > is stricly equivalent to > > > def f(x): return x*2 > > f.__annotations__ = {'x':int, 'return':int}

Re: regular expression negate a word (not character)

2008-01-28 Thread Dr.Ruud
Greg Bacon schreef: > #! /usr/bin/perl > > use warnings; > use strict; > > use constant { > MATCH=> 1, > NO_MATCH => 0, > }; > > my @tests = ( > [ "winter tire",=> MATCH ], > [ "tire", => MATCH ], > [ "retire", => MATCH ],

Re: read and readline hanging

2008-01-28 Thread Olivier Lefevre
>> But in python eventually stdout.readline() hangs. This is a real >> nuisance: why can't it just return None? > > Because that would be quite annoying because most of the time people want > blocking behavior. Just an afterthought: do people prefer the blocking behaviour because blocking until

[Q] Is there a way to minimize a Tkinter application to the system tray?

2008-01-28 Thread Thomas Ploch
Hello folks, I already found some answers on the net, which said that the Tk library that Tkinter wraps does not offer functionality to minimize an application to the system tray. But I hope there are some wizards in here that might tell me that how it (possibly) could be done. Thomas -- ht

Re: read and readline hanging

2008-01-28 Thread Olivier Lefevre
pexpect looks promising, thanks. -- O.L. -- http://mail.python.org/mailman/listinfo/python-list

Re: read and readline hanging

2008-01-28 Thread Olivier Lefevre
>> Yes, that has since occurred to me. I need to echo some magic string >> after each command to know that I reached the end of the answer to >> the previous command. In interactive mode the prompt fulfills that >> role. > > And hope that that "magic string" does not occur somewhere within > the r

Re: read and readline hanging

2008-01-28 Thread Olivier Lefevre
> The buffering behavior at the interactive prompt is very often different > from connections via pipes. I hadn't thought of that. I will ask on the Octave list. Thanks, -- O.L. -- http://mail.python.org/mailman/listinfo/python-list

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-28 Thread Arnaud Delobelle
On Jan 28, 4:08 pm, "André" <[EMAIL PROTECTED]> wrote: [...] > If I may suggest, I would extend this so that autoassign's signature > would be as follows: > > autoassign(all=True, include_only=None, exclude=None) > > Either one of include_only or exclude could be a list of function to > which the a

Re: Serving images

2008-01-28 Thread Gabriel Genellina
On 28 ene, 07:43, Jumping Arne <[EMAIL PROTECTED]> wrote: > Before I've just placed the images on a server where the script didn't need > to bother about it. Now I'm considering to let the script handle the images > also, that is serve them to the browser when requested. I've tried two > different

Re: PYS file

2008-01-28 Thread Gabriel Genellina
On 28 ene, 13:05, azrael <[EMAIL PROTECTED]> wrote: > A I Understood correctly, pyc files are compiled py scripts. Is it > possible to decomplite them. > I guess it's possible, but how hard is it. You want to get back the Python source? Look for the "decompyle" package. The last published release

Re: regular expression negate a word (not character)

2008-01-28 Thread Greg Bacon
The code below at least passes your tests. Hope it helps, Greg #! /usr/bin/perl use warnings; use strict; use constant { MATCH=> 1, NO_MATCH => 0, }; my @tests = ( [ "winter tire",=> MATCH ], [ "tire", => MATCH ], [ "retire",

Re: post variable

2008-01-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > sorry for creating a new post but this is totally different from the > previous one. > > Here is the problem (which is very hard to explain, so i will use a > paradigm): i submit a form and the post variable is being sent to the > page test.py. then the test.py retriev

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-28 Thread Arnaud Delobelle
On Jan 28, 4:30 am, Tim Chase <[EMAIL PROTECTED]> wrote: > I've seen some folks import inspect/functools, but from my > testing, the __init__ method in question has a .func_code object > that already has the varnames in it. in py3k f.func_code gives way to f.__code__, this is why inspect may be pr

Re: Question on importing wxPython

2008-01-28 Thread Mike Driscoll
On Jan 28, 12:06 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > python-2.3.5 > wx-2.6 > > I just bought the wxPython In Action book and I see that all the examples > say to > import wx > All of our pre-existing code was horribly doing a > from wxPython import * > > I changed all the code so that

post variable

2008-01-28 Thread [EMAIL PROTECTED]
sorry for creating a new post but this is totally different from the previous one. Here is the problem (which is very hard to explain, so i will use a paradigm): i submit a form and the post variable is being sent to the page test.py. then the test.py retrieves the POST and print it to the page. n

Re: validate string is valid maths

2008-01-28 Thread Gabriel Genellina
impor tOn 28 ene, 14:31, [EMAIL PROTECTED] wrote: > What would be the 'sensible' way of transforming the string, for example > changing '3++8' into 3+8 > or '3++--*-9' into '3+-9' such that eval(string) will always return a > number? '3++8' is already a valid expresion, like '3++---9' >

Re: extending Python - passing nested lists

2008-01-28 Thread Christian Meesters
Mark Dickinson wrote: > Well, it's pretty clear: you misspelt "length" as "lenght". :) Well, that's not it ;-). (Damn copy & paste plague ...) > > PySequence_Fast doesn't return an array: it returns a PyObject---in > this case, a PyObject corresponding to a Python tuple. That's it. Thanks. Thi

Embeding python with mingw on win32 and python 2.4.4

2008-01-28 Thread mani
Hi I'm bringing up an old story once more! I'm on win32 (winxp sp2) python 2.4.4. mingw gcc version is 3.4.5. msys is in c:\msys. mingw is in c:\mingw and python is in c:\pyton24. there are also python24.lib and libpython24.a in c:\python24\libs. when I try to compile this sample code [1] from msy

Embeding python with mingw on win32 and python 2.4.4

2008-01-28 Thread mani
Hi I'm bringing up an old story once more! I'm on win32 (winxp sp2) python 2.4.4. mingw gcc version is 3.4.5. msys is in c:\msys. mingw is in c:\mingw and python is in c:\pyton24. there is also python24.lib and libpython24.a in c:\python24\libs. when I try to compile this sample code [1] from with

Re: extending Python - passing nested lists

2008-01-28 Thread Mark Dickinson
On Jan 28, 10:10 am, Christian Meesters <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to write a C-extension function for an application of mine. For > this I need to pass a nested list (like: [[a, b, c], [d, e, f], ...], where > all letters are floats) to the C-function. Now, with the code I h

Re: referer url

2008-01-28 Thread [EMAIL PROTECTED]
Thanks for that! i found the variable in "ALL_HTTP" and it's working now. Thanks again.. -- http://mail.python.org/mailman/listinfo/python-list

Python-URL! - weekly Python news and links (Jan 28)

2008-01-28 Thread Gabriel Genellina
QOTW: "The nice thing with Pyrex is that you can use the Python interpreter, or not use it, more or less depending on your way to declare things and your way to code. So, in a way, you have full control over the compromise between speed and facility. The temptation is always strong to use Python

Question on importing wxPython

2008-01-28 Thread Steven W. Orr
python-2.3.5 wx-2.6 I just bought the wxPython In Action book and I see that all the examples say to import wx All of our pre-existing code was horribly doing a from wxPython import * I changed all the code so that it was doing an import wx and found that everything was broken. In particular, r

Re: problem with gethostbyaddr with intranet addresses on MAC

2008-01-28 Thread Sion Arrowsmith
shailesh <[EMAIL PROTECTED]> wrote: >Python 2.4.4 (#1, Oct 18 2006, 10:34:39) >[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin >Type "help", "copyright", "credits" or "license" for more information. from socket import * x = gethostbyname('google.com') x >'64.233.167.99'

Re: sharing objects between classes

2008-01-28 Thread gherzig
> Diez B. Roggisch a écrit : >> Gerardo Herzig wrote: >> >>> Hi all. Im wondering the way to share a database connection between >>> some >>> classes: >>> >>> So far, i came up with a simple class schema, where each class means >>> each different relation, i mean i have the follow classes >>> >>> c

Re: Encryption Recommendation

2008-01-28 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > Usually, one doesn't store clear-text passwords. Instead, use a > hash-algorithm like md5 or crypt (the former is in the standard lib, don't > know of the other out of my head) and hash the password, and store that > hash. Rather, use the HMAC modul

RE: Encryption Recommendation

2008-01-28 Thread Andreas Tawn
>> I'm still using Python 2.4. In my code, I want to encrypt a password >> and at another point decrypt it. What is the standard way of doing >> encryption in python? Is it the Pycrypto module? > >Usually, one doesn't store clear-text passwords. Instead, use a >hash-algorithm like md5 or crypt (

RE: Get Available Functions

2008-01-28 Thread Robert Rawlins - Think Blue
Thanks for that Tim, I'll have a play around with these functions later today and see what happens, hopefully it'll shed some light on this API for me. Thanks mate, I appreciate it. Rob -Original Message- From: Tim Chase [mailto:[EMAIL PROTECTED] Sent: 28 January 2008 17:02 To: Robert

Re: validate string is valid maths

2008-01-28 Thread marek . rocki
I decided to play with it a little bit, but take a different approach than Steven. This seems actually one of the problems where regexp might be a good solution. import re re_signednumber = r'([-+]?\d+)' re_expression = '%s(?:([-+/*])[-+/*]*?%s)*' % (re_signednumber, re_signednumber) for test_cas

Re: optional static typing for Python

2008-01-28 Thread Marc 'BlackJack' Rintsch
On Mon, 28 Jan 2008 08:31:43 -0800, John Nagle wrote: > Unenforced static typing is somewhat pointless. If that > goes in, it should be enforced by implementations. Luckily we don't get static typing. We get annotations which *can* be used for type hints, checked by additional code. Can be

Re: A question about osyco

2008-01-28 Thread Marc 'BlackJack' Rintsch
On Mon, 28 Jan 2008 05:31:41 -0800, iu2 wrote: > I wrote two version of a fib functions, a recursive one and an > iterative one. > Psyco improved a lot the recursive function time, but didn't affect at > all the iterative function. > > Why? Try calling the iterative one twice and measure the tim

Re: SMTP Sending Mail Problem

2008-01-28 Thread the_ricka
I added a longer text file with vocabulary typically used in our office and the email sent successfully. The crazy thing is I had already checked all the spam filters and queues in Exchange, and the older messages seem to have disappeared. Sorry for the post, I thought I was going crazy for a bi

Re: referer url

2008-01-28 Thread Tim Chase
> 1) CGI so i'm doing it right. that's helpful to know > 2) this is impossible as i'm doing the exact same thing with another > language and it utterly works. Just making sure...same browser/setup/configuration, different language? > 3) the same as above kinda figured...most servers give you

Re: Get Available Functions

2008-01-28 Thread Christian Heimes
Tim Chase wrote: > I've had a couple cases where the underlying module was written > in C (mod_python in particular...don't know if it still has this > problem) where dir() wouldn't actually tell you about the object, > but for most cases, dir() will get you pointed in the right > dir-ection. :

Re: validate string is valid maths

2008-01-28 Thread Remco Gerlich
Hi, It seems that for every group of 2 or more +-/* signs, one of the following holds: - The group starts with '-', everything after it should be dropped, otherwise - The second character is '-', everything after it should be dropped, otherwise - Drop everything after the first. That should turn

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-28 Thread Bruno Desthuilliers
Paddy a écrit : (snip) > Is it not possible to write a function that queries its call stack > when run to find the name of all arguments and locals() of the level > above > so you could write: > > class test(object): > def __init__(self, x, y): > arg2inst() > > and automatically assign se

Re: translating Python to Assembler

2008-01-28 Thread Grant Edwards
>> The script is essentially gone. I'd like to know how to read >> the pyc files, but that's getting away from my point that >> there is a link between python scripts and assembler. At this >> point, I admit the code above is NOT assembler, but sooner or >> later it will be converted to machine cod

Re: sharing objects between classes

2008-01-28 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : > Gerardo Herzig wrote: > >> Hi all. Im wondering the way to share a database connection between some >> classes: >> >> So far, i came up with a simple class schema, where each class means >> each different relation, i mean i have the follow classes >> >> class Database(

Re: referer url

2008-01-28 Thread [EMAIL PROTECTED]
Thanks for the reply. 1) CGI so i'm doing it right. 2) this is impossible as i'm doing the exact same thing with another language and it utterly works. 3) the same as above 4) no.. this gets nerve breaking! -- http://mail.python.org/mailman/listinfo/python-list

Re: Get Available Functions

2008-01-28 Thread Tim Chase
> I'm working with a python module which isn't part of the core > Python API and it also isn't very documented or supported, is > there any way that I can easily dump/view the available > classes and methods within the package from within python? Most of the time, the dir(), type() and help() func

Re: SMTP Sending Mail Problem

2008-01-28 Thread Gabriel Genellina
On 28 ene, 14:15, the_ricka <[EMAIL PROTECTED]> wrote: > However, whenever I try to read more than one line from the file, the > email is not being delivered.  The only reason I know this is because > I tried just reading in the first line of the text file, and the email > sent fine.  Right now I

Re: referer url

2008-01-28 Thread Tim Chase
> I was wondering, if there is a way to retrieve the referer url with > python (web-based). > I tried this: > > import os > print os.getenv('HTTP_REFERER') > > but it's not working, even thought other http variables do function, > this one is always a None. This could be for any number of reason

Re: optional static typing for Python

2008-01-28 Thread Boris Borcic
Wish you'd opted out of typing all that static. BB Russ P. wrote: (...) > > What is that supposed to mean? > > Oh, I almost forgot. I'm supposed to sit here and be polite while > clueless dolts make wise cracks. Sorry, but I haven't yet mastered > that level of self-control. > > I would just l

referer url

2008-01-28 Thread [EMAIL PROTECTED]
Hello all! I was wondering, if there is a way to retrieve the referer url with python (web-based). I tried this: import os print os.getenv('HTTP_REFERER') but it's not working, even thought other http variables do function, this one is always a None. Thanks in advance. -- http://mail.python.or

Re: validate string is valid maths

2008-01-28 Thread Matthew_WARREN
Ok, I was thinking along the same lines myself, replacing ++ etc.. until no more replacements are made. I hadnt considered creating a table of pairs and replacements though, or realised that the same replace method would work in that case. handy :) The dictionary is unordered; would differences

Re: optional static typing for Python

2008-01-28 Thread John Nagle
Arnaud Delobelle wrote: > On Jan 27, 11:00 pm, "Russ P." <[EMAIL PROTECTED]> wrote: >> On Jan 27, 2:49 pm, "André" <[EMAIL PROTECTED]> wrote: >>> Perhaps this:http://www.python.org/dev/peps/pep-3107/mightbe >>> relevant? >>> André >> Thanks. If I read this correctly, this PEP is on track for Python

Get Available Functions

2008-01-28 Thread Robert Rawlins - Think Blue
Hello Guys, I'm working with a python module which isn't part of the core Python API and it also isn't very documented or supported, is there any way that I can easily dump/view the available classes and methods within the package from within python? Thanks guys, Rob -- http://mail.py

Re: Encryption Recommendation

2008-01-28 Thread Tim Chase
> Usually, one doesn't store clear-text passwords. Instead, use a > hash-algorithm like md5 or crypt (the former is in the standard lib, don't > know of the other out of my head) and hash the password, and store that > hash. Python offers md5, and SHA modules built-in. (yay, python!) http://d

SMTP Sending Mail Problem

2008-01-28 Thread the_ricka
Hi all, I'm fairly new to python, but very excited about it's potential. I'm trying to write a simple program that will accept input from a command line and send email. The parameters I used on the command line are for From address, To addresses, Subject and Body. For the body, I thought it woul

[no subject]

2008-01-28 Thread 7146031596
17146031598 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Genetic Algorithm

2008-01-28 Thread Max
On Jan 27, 7:25 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Just pass the class itself. For example: > > # Define a class. > class Parrot(object): > pass > > x = "Parrot" # x is the NAME of the class > y = Parrot # y is the CLASS itself > z = Parrot() # z is an INSTAN

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-28 Thread André
On Jan 28, 11:45 am, Steven Bethard <[EMAIL PROTECTED]> wrote: > Arnaud Delobelle wrote: > > Sligthly improved (not for performance! but signature-preserving and > > looks for default values) > > > from functools import wraps > > from inspect import getargspec > > from itertools import izip, chain

Re: [OT] "just like Java" (was :Re: translating Python to Assembler)

2008-01-28 Thread Bruno Desthuilliers
Jeroen Ruigrok van der Werven a écrit : > -On [20080125 14:07], Bruno Desthuilliers ([EMAIL PROTECTED]) wrote: >> I'm surprised you've not been flamed to death by now - last time I >> happened to write a pretty similar thing, I got a couple nut case >> accusing me of being a liar trying to spread

Re: validate string is valid maths

2008-01-28 Thread Christian Heimes
Steven D'Aprano wrote: > def rationalise_signs(s): > while "++" in s or "+-" in s or "-+" in s or "--" in s: > s = s.replace("++", "+") > s = s.replace("--", "+") > s = s.replace("+-", "-") > s = s.replace("-+", "-") > return s I assume it's faster to check

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-28 Thread Steven Bethard
Arnaud Delobelle wrote: > Sligthly improved (not for performance! but signature-preserving and > looks for default values) > > from functools import wraps > from inspect import getargspec > from itertools import izip, chain > > def autoassign(*names): > def decorator(f): > fargnames,

Re: "just like Java" (was :Re: translating Python to Assembler)

2008-01-28 Thread Bruno Desthuilliers
Paul Boddie a écrit : > On 25 Jan, 14:05, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> Christian Heimes a écrit : >> >>> No, that is not correct. Python code is compiled to Python byte code and >>> execute inside a virtual machine just like Java or C#. >> I'm surprised you've not been flamed t

Re: validate string is valid maths

2008-01-28 Thread Steven D'Aprano
On Mon, 28 Jan 2008 15:10:54 +, Matthew_WARREN wrote: > Hi pythoners. > > I am generating strings of length n, randomly from the symbols > > +-/*0123456789 > > What would be the 'sensible' way of transforming the string, for example > changing '3++8' into 3+8 That's easy: replace pairs

Re: sharing objects between classes

2008-01-28 Thread Diez B. Roggisch
Gerardo Herzig wrote: > Hi all. Im wondering the way to share a database connection between some > classes: > > So far, i came up with a simple class schema, where each class means > each different relation, i mean i have the follow classes > > class Database(object): > ## make the connection

Re: Encryption Recommendation

2008-01-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello - > > I'm still using Python 2.4. In my code, I want to encrypt a password > and at another point decrypt it. What is the standard way of doing > encryption in python? Is it the Pycrypto module? Usually, one doesn't store clear-text passwords. Instead, use a h

sharing objects between classes

2008-01-28 Thread Gerardo Herzig
Hi all. Im wondering the way to share a database connection between some classes: So far, i came up with a simple class schema, where each class means each different relation, i mean i have the follow classes class Database(object): ## make the connection self.conn = make_conn() class

Unicode Problem

2008-01-28 Thread Victor Subervi
Hi; New to unicode. Got this error: Traceback (most recent call last): File "", line 1, in File "", line 29, in tagWords File "/usr/local/lib/python2.5/codecs.py", line 303, in write data, consumed = self.encode(object, self.errors) UnicodeDecodeError: 'ascii' codec can't decode byte 0x

Encryption Recommendation

2008-01-28 Thread [EMAIL PROTECTED]
Hello - I'm still using Python 2.4. In my code, I want to encrypt a password and at another point decrypt it. What is the standard way of doing encryption in python? Is it the Pycrypto module? Roger -- http://mail.python.org/mailman/listinfo/python-list

extending Python - passing nested lists

2008-01-28 Thread Christian Meesters
Hi, I would like to write a C-extension function for an application of mine. For this I need to pass a nested list (like: [[a, b, c], [d, e, f], ...], where all letters are floats) to the C-function. Now, with the code I have the compiler is complaining: "subscripted value is neither array nor poi

validate string is valid maths

2008-01-28 Thread Matthew_WARREN
Hi pythoners. I am generating strings of length n, randomly from the symbols +-/*0123456789 What would be the 'sensible' way of transforming the string, for example changing '3++8' into 3+8 or '3++--*-9' into '3+-9' such that eval(string) will always return a number? in cases where multipl

  1   2   >