function call problem in class?

2007-11-13 Thread Davy
Hi all, I have write a simple class, I want the function two() to call private function __one(), but there is an error : NameError: global name '_simple__one' is not defined, how to work around it class simple: def __one(self): print "Hello" def two(self): __one()

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread Gabriel Genellina
En Tue, 13 Nov 2007 19:59:56 -0300, <[EMAIL PROTECTED]> escribió: > working on a smaller example. i could not get pyNode_root invoked yet > and > PyRun_String("import node\nprint node.root()\n", > Py_file_input, > exec, g_maindict); The globals argument should co

Re: webbrowser

2007-11-13 Thread Cameron Walsh
Antonio Ceballos wrote: > Hello, > > I am trying to open a URL on a new browser or new tab from an HTML page > created from a python cgi script. import cgitb; cgitb.enable() # Will save you hours of debugging. Prints error messages and exceptions to the client, wrapped in pretty html. On Apa

Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.

2007-11-13 Thread Andrii V. Mishkovskyi
2007/11/14, ChairmanOfTheBored <[EMAIL PROTECTED]>: > On Tue, 13 Nov 2007 16:18:58 +0100, Richard G Riley > <[EMAIL PROTECTED]> wrote: > > >Your ascii art, while pretty, convinces no one ... > > > It's pretty goddamned retarded, actually... as was the post itself. > -- > http://mail.python.org/mai

Re: current script path via execfile?

2007-11-13 Thread Gabriel Genellina
En Tue, 13 Nov 2007 13:42:04 -0300, Adam Pletcher <[EMAIL PROTECTED]> escribió: > I have an app with an embedded Python interpreter. In that interpreter, > I want to use "execfile" (or something similar) to execute a script from > disk. The script needs to somehow acquire the full path to itse

Re: cx_Oracle: Non-ASCII characters handling with different versions

2007-11-13 Thread Gabriel Genellina
En Tue, 13 Nov 2007 13:37:16 -0300, Benjamin Hell <[EMAIL PROTECTED]> escribió: > I have a problem with the cx_Oracle module (Oracle database access): > > On a computer with cx_Oracle version 4.1 (Python 2.4.3, Oracle 10g) > I can get query results consisting of strings including non-ASCII > cha

Re: urllib.unquote + unicode

2007-11-13 Thread Gabriel Genellina
En Tue, 13 Nov 2007 13:14:18 -0300, koara <[EMAIL PROTECTED]> escribió: > i am using urllib.unquote_plus to unquote a string. Sometimes i get a > strange string like for example "spolu%u017E%E1ci.cz" to unquote. Here > the problem is that some application decided to quote a non-ascii > character a

mpmath puzzle

2007-11-13 Thread Dick Moores
For 1234 ** 10.9, why the wrong result from mpmath.power()? #!/usr/bin/env python #coding=utf-8 from mpmath import * mpf.dps = 32 x = mpf(1234) y = mpf(10.9) print power(x,y) print "4.9583278648155041477415234438717e+33" # from Windows calculator """ ou

Re: persisting data within a module

2007-11-13 Thread Gabriel Genellina
En Tue, 13 Nov 2007 13:09:01 -0300, Peter J. Bismuti <[EMAIL PROTECTED]> escribió: > How is that state different depending on whether a module has been simply > imported (#2. some other block of code has __name__ == "__main__") and > the > script itself being run (#1. and having __name__=="__

Overclocking Guide

2007-11-13 Thread troy . john78
Correct Overclocking - The Goals First and foremost, we want to * improve overall system performance * system to be just as stable * keep our CPU alive!! The best way to improve system performance is to increase the bus speed. If you can't do that, either because your motherboard does

Re: Override method name and original method access

2007-11-13 Thread Gabriel Genellina
En Tue, 13 Nov 2007 17:14:07 -0300, Chris Mellon <[EMAIL PROTECTED]> escribió: > On Nov 13, 2007 3:00 AM, Gabriel Genellina <[EMAIL PROTECTED]> > wrote: >> You may prefer keeping your old-style classes and avoid using >> super, if you don't have multiple inheritance. Just call explicitely the

Re: Problem in Installing/using OpenOpt

2007-11-13 Thread Robert Kern
abcd efgh wrote: > Hi, > > I am facing some problem in installing the OpenOpt optimization toolbox. The place to ask would be the scipy-users mailing list. http://www.scipy.org/Mailing_Lists > What I have done is I downloaded the OpenOpt package and added the > folder containing scikits to th

Problem in Installing/using OpenOpt

2007-11-13 Thread abcd efgh
Hi, I am facing some problem in installing the OpenOpt optimization toolbox. What I have done is I downloaded the OpenOpt package and added the folder containing scikits to the PythonPath by: sys.path.append('C:\Documents and Settings\User\Desktop\openopt') but when i try following: from sciki

Re: Loop three lists at the same time?

2007-11-13 Thread kelvin.you
On 11 13 , 6 46 , Davy <[EMAIL PROTECTED]> wrote: > Hi all, > > I have three lists with the same length. Is there any method to loop > the three lists without a loop counter? > > Best regards, > Davy Maybe you just need this:-) >>> list1 = [1, 2, 3] >>> list2 = [4, 5, 6] >>> list3 = [7, 8, 9] >>

Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.

2007-11-13 Thread Don Bowey
On 11/13/07 8:04 PM, in article [EMAIL PROTECTED], "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: > On Tue, 13 Nov 2007 17:43:01 -0800, Don Bowey <[EMAIL PROTECTED]> wrote: > >> On 11/13/07 5:05 PM, in article [EMAIL PROTECTED], >> "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: >> >>> On Tue,

Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.

2007-11-13 Thread Don Bowey
On 11/13/07 8:03 PM, in article [EMAIL PROTECTED], "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: > On Tue, 13 Nov 2007 17:40:30 -0800, Don Bowey <[EMAIL PROTECTED]> wrote: > >> On 11/13/07 5:03 PM, in article [EMAIL PROTECTED], >> "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: >> >>> On Tue,

Re: Override method name and original method access

2007-11-13 Thread Donn Ingle
Chris Mellon wrote: > The use of super() > (and new style classes) should be the default implementation, To get some clarity on this subject, how do I make sure my classes are "new"? I've got the idea that my hierarchy must start from a base-class that explicitly derives from Object and not . I'

Re: referencing a subhash for generalized ngram counting

2007-11-13 Thread Scott David Daniels
braver wrote: > ... > The real-life motivation for this is n-gram counting. Say you want to > maintain a hash for bigrams. For each two subsequent words a, b in a > text, you do > bigram_count[a][b] += 1 This application is easily handed with tuples as keys. bigrams = {} src = iter(so

Re: Using Python To Change The World :)

2007-11-13 Thread Guilherme Polo
2007/11/14, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hello, I'm a teen trying to do my part in improving the world, and me > and my pal came up with some concepts to improve the transportation > system. > > I have googled up and down for examples of using python to create a > city street but I can

Using Python To Change The World :)

2007-11-13 Thread dominiquevalentine
Hello, I'm a teen trying to do my part in improving the world, and me and my pal came up with some concepts to improve the transportation system. I have googled up and down for examples of using python to create a city street but I can not find any. my objective is to replicate a section of los a

Re: Arrays

2007-11-13 Thread [EMAIL PROTECTED]
Modules contain objects. When you want to import a specific set of objects contained in a module into the local namespace, you use: from import For example: from math import sqrt from math import sin, cos If you want to import everything from a module, use: from import * For example:

Re: Populating a dictionary, fast [SOLVED]

2007-11-13 Thread Istvan Albert
On Nov 13, 11:27 am, Francesc Altet <[EMAIL PROTECTED]> wrote: > Another possibility is using an indexed column in a table in a DB. > Lookups there should be much faster than using a dictionary as well. I would agree with others who state that for a simple key based lookup nothing beats a diction

Re: how to know if folder contents have changed

2007-11-13 Thread [EMAIL PROTECTED]
On Nov 12, 11:27 am, "Martin Marcher" <[EMAIL PROTECTED]> wrote: > 2007/11/12, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > Why not use the file creation/modification timestamps? > > because you'd have to > > a) create a thread that pulls all the time for changes or Given that it would only involv

Schiefer worked by day as an information security consultant, and in this position he defrauded the DUTCH Internet advertising company Simpel Internet, who signed him up as a consultant

2007-11-13 Thread thermate
LA Botnet Hacker Reaches Guilty Plea Deal by Alice Turner 10:46, November 10th 2007 LA Botnet Hacker Reaches Guilty Plea Deal Los Angeles hacker John Schiefer agreed to plead guilty to fraud and illegal wiretap charges carrying a maximum sentence of 60 years in federal prison and a 1.75 mil

??? John Kenneth Schiefer, a hacker damaged 250000 computers causing immense loss and anguish to the owners, but will get off the hook due to membership in the jewish khazar ashkenazi tribe which blac

2007-11-13 Thread thermate
??? John Kenneth Schiefer, a hacker damaged 25 computers causing immense loss and anguish to the owners, but will get off the hook due to membership in the jewish khazar ashkenazi tribe which blackmails all top politicians and controls the banks and the media ??? Just consider that every hacke

??? John Kenneth Schiefer, a hacker damaged 250000 computers causing immense loss and anguish to the owners, but will get off the hook due to membership in the jewish khazar ashkenazi tribe which blac

2007-11-13 Thread zionist . news2
??? John Kenneth Schiefer, a hacker damaged 25 computers causing immense loss and anguish to the owners, but will get off the hook due to membership in the jewish khazar ashkenazi tribe which blackmails all top politicians and controls the banks and the media ??? Just consider that every hacke

??? John Kenneth Schiefer, a hacker damaged 250000 computers causing immense loss and anguish to the owners, but will get off the hook due to membership in the jewish khazar ashkenazi tribe which blac

2007-11-13 Thread zionist . news2
??? John Kenneth Schiefer, a hacker damaged 25 computers causing immense loss and anguish to the owners, but will get off the hook due to membership in the jewish khazar ashkenazi tribe which blackmails all top politicians and controls the banks and the media ??? Just consider that every hacke

Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.

2007-11-13 Thread Don Bowey
On 11/13/07 5:05 PM, in article [EMAIL PROTECTED], "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: > On Tue, 13 Nov 2007 16:18:58 +0100, Richard G Riley > <[EMAIL PROTECTED]> wrote: > >> Your ascii art, while pretty, convinces no one ... > > > It's pretty goddamned retarded, actually... as was

Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.

2007-11-13 Thread Don Bowey
On 11/13/07 5:03 PM, in article [EMAIL PROTECTED], "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: > On Tue, 13 Nov 2007 13:37:13 +0100, Hendrik Maryns > <[EMAIL PROTECTED]> wrote: > >> ||__|| | Please do | >> / O O\__ NOT > > Do

cross-platform c questions

2007-11-13 Thread chewie54
Hi All, When writing a python c extension for needs to be compiled for Windows, Linux, and the Mac, what cross-platform differences need to be accounted for? Are there functions in the python api to deal with the differences? For example, byte ordering, how is that controlled? Thank

Re: Arrays

2007-11-13 Thread Gordon C
OK Steve, But why do we say "from array import array" and NOT "from math import math"? Why the difference in syntax? Gord "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 13 Nov 2007 11:26:28 -0500, Gordon C wrote: > >> OK, thanks to all. The key statement

Pythonic tee for subprocess module.

2007-11-13 Thread Joe Blow
I'd like to use the subprocess module to create a pipeline with a fork. For example, what if I wanted a "cat" process to send a file to both an "md5sum" process and a "gzip" process. In bash, I'd do something like this: > cat source_file | tee >(md5sum > source_file.md5sum) | gzip -c > > source

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread sndive
On Nov 13, 3:31 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Nov 13, 2007 3:18 PM, <[EMAIL PROTECTED]> wrote: > > > On Nov 9, 5:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > En Tue, 06 Nov 2007 23:25:17 -0300, <[EMAIL PROTECTED]> escribió: > > > > One should make a lot of assum

webbrowser

2007-11-13 Thread Antonio Ceballos
Hello, I am trying to open a URL on a new browser or new tab from an HTML page created from a python cgi script. On Apache in my localhost, it works, both with Internet Explorer and Firefox. However, when I upload the script to a remote server, it does not. A 500 Internal Server Error is displa

Re: Equivalent of TCL's "subst" ?

2007-11-13 Thread Larry Bates
gamename wrote: > Hi, > > In TCL, you can do things like: > set foobar "HI!" > set x foo > set y bar > subst $$x$y > HI! > > Is there a way to do this type of evaluation in python? > > TIA, > -T > myStore={} myStore['foobar']="HI!" x='foo' y='bar' print myStore[x+y] -Larry -- http://mail.py

Re: Arrays

2007-11-13 Thread Jorge Godoy
Steven D'Aprano wrote: > "The only intuitive interface is the nipple. After that, it's all > learned." -- Bruce Ediger on user interfaces. And after we learn its other "uses", not even the nipple is so easy... Who haven't heard (or said, if you're a woman) "Don't bite it like that, it hurts!"?

Re: Using python as primary language

2007-11-13 Thread Diez B. Roggisch
Russell E. Owen schrieb: > In article <[EMAIL PROTECTED]>, > Michel Albert <[EMAIL PROTECTED]> wrote: > >> In our company we are looking for one language to be used as default >> language. So far Python looks like a good choice (slacking behind >> Java). A few requirements that the language shoul

Re: Trouble with subprocess.call(...) and zsh script (OSError: [Errno 8] Exec format error)

2007-11-13 Thread Michael George Lerner
On Nov 11, 3:25 pm, Rob Wolfe <[EMAIL PROTECTED]> wrote: Hi Rob, > Michael GeorgeLerner<[EMAIL PROTECTED]> writes: > > > Hi, > > > (Python 2.5, OS X 10.4.10) > > I have a program called pdb2pqr on my system. It is installed so that > > "pdb2pqr" is in my path and looks like: > > > #\!/bin/zsh -f

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread sndive
On Nov 9, 7:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 06 Nov 2007 23:25:17 -0300, <[EMAIL PROTECTED]> escribió: > > > i naively created execution context: > > PyObject *execcontext = PyDict_New(); > > stuffed a handle in it: > > PyObject *ih = PyCObject_FromVoidPtr(han

Re: eclipse for developing and debugging python C or C++ extensions

2007-11-13 Thread Paul Rubin
chewie54 <[EMAIL PROTECTED]> writes: > If not, how do others develop and debug c or c++ python > extensions? I haven't had to do it very much, but simply running python under gdb in emacs is sort of tolerable. -- http://mail.python.org/mailman/listinfo/python-list

eclipse for developing and debugging python C or C++ extensions

2007-11-13 Thread chewie54
Hi All, Has anyone used eclipse to develop and debug c or c++ extensions for python? Is it possible to you PyDev and CDT with eclipes to get an integrated environment in which I could debug both Python and C using the debuggers in each plugin respectively? If not, how do others develop and debu

Re: Equivalent of TCL's "subst" ?

2007-11-13 Thread Steven Bethard
gamename wrote: > In TCL, you can do things like: > set foobar "HI!" > set x foo > set y bar > subst $$x$y > HI! > > Is there a way to do this type of evaluation in python? If this is at the outer-most scope, you can use globals():: >>> foobar = 'HI!' >>> x = 'foo' >>> y = 'bar'

Equivalent of TCL's "subst" ?

2007-11-13 Thread gamename
Hi, In TCL, you can do things like: set foobar "HI!" set x foo set y bar subst $$x$y HI! Is there a way to do this type of evaluation in python? TIA, -T -- http://mail.python.org/mailman/listinfo/python-list

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread sndive
On Nov 13, 3:31 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Nov 13, 2007 3:18 PM, <[EMAIL PROTECTED]> wrote: > > > On Nov 9, 5:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > En Tue, 06 Nov 2007 23:25:17 -0300, <[EMAIL PROTECTED]> escribió: > > > > One should make a lot of assum

Re: cmp and sorting non-symmetric types

2007-11-13 Thread Paul Rubin
Carl Banks <[EMAIL PROTECTED]> > resurrecting the __cmp__ operator. I didnd't realize __cmp__ was going. Are we really supposed to implement all the rich comparison methods to code an ordered class? Or is there some kind of library superclass we can inherit from that implements something like __

Re: NumPy Question - numpy.put in multi-dimensional array

2007-11-13 Thread Robert Kern
[EMAIL PROTECTED] wrote: > from numpy import * > > a = zeros((2,40), int) > > fields = {} > field = 10 > fields[field] = '30A', 5 > > iy = int(fields[field][1]) > ix = int(fields[field][0].rstrip('AB')) > > for i in range(2): > for j in range(iy): > #put(a,[39 - j],[1]) #1d >

Re: Populating a dictionary, fast [SOLVED]

2007-11-13 Thread Steven D'Aprano
On Tue, 13 Nov 2007 17:27:11 +0100, Francesc Altet wrote: > I don't know exactly why do you need a dictionary for keeping the data, > but in case you want ultra-fast access to values, there is no > replacement for keeping a sorted list of keys and a list with the > original indices to values, and

Re: NumPy Question - numpy.put in multi-dimensional array

2007-11-13 Thread [EMAIL PROTECTED]
On Nov 13, 1:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > from numpy import * > > a = zeros((2,40), int) > > fields = {} > field = 10 > fields[field] = '30A', 5 > > iy = int(fields[field][1]) > ix = int(fields[field][0].rstrip('AB')) > > for i in range(2): > for j in range(iy): > #

Re: why there is no pythonscript insine web browsers?

2007-11-13 Thread kyosohma
On Nov 12, 12:07 pm, Timuçin K z lay <[EMAIL PROTECTED]> wrote: > I'm an old programmer coming from a cobol background and started to > learn python. I'm using javasript for web based applications but after I > started to learn python, the javascript language started to seem ugly to > me. Now I'm w

Re: [OT] The Jew Spam on this list: Blocking the IP address of spammers

2007-11-13 Thread Ben Finney
"Peter J. Bismuti" <[EMAIL PROTECTED]> writes: > Why aren't these spammers having their IP addresses blocked (or > something like that)? People making these posts should not be > allowed to post ever again. Is there not someone administering this > mailing list? "This mailing list" is actually

Re: why there is no pythonscript insine web browsers?

2007-11-13 Thread cyberco
> > That is, why not just have a Python interpreter and some safe subset > > of the Python standard library run with the browser? I mean, aside > > It's not just the library (at a start you'd need to strip out > modules os, popen, and subprocess), but you'd also need to block out > exec, ev

Re: Information manager/organizer with tags question.

2007-11-13 Thread andrei . avk
On Nov 13, 12:42 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello, > > > [snip outline of an information editor] > > Maybe the Literary Machine? > http://sommestad.com/lm.htm> > > It is a bit weird at first, and Windows only (altough I have had it > running

Re: Using python as primary language

2007-11-13 Thread kyosohma
On Nov 13, 1:47 pm, "Russell E. Owen" <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Michel Albert <[EMAIL PROTECTED]> wrote: > > > > > In our company we are looking for one language to be used as default > > language. So far Python looks like a good choice (slacking behind > > Jav

Re: Arrays

2007-11-13 Thread Steven D'Aprano
On Tue, 13 Nov 2007 11:26:28 -0500, Gordon C wrote: > OK, thanks to all. The key statement is "from array import array" which > is not exactly intuitive! "The only intuitive interface is the nipple. After that, it's all learned." -- Bruce Ediger on user interfaces. Once you've been using Pyt

Re: Information manager/organizer with tags question.

2007-11-13 Thread andrei . avk
On Nov 13, 12:42 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello, > > > [snip outline of an information editor] > > Maybe the Literary Machine? > http://sommestad.com/lm.htm> > > It is a bit weird at first, and Windows only (altough I have had it > running

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread Chris Mellon
On Nov 13, 2007 3:18 PM, <[EMAIL PROTECTED]> wrote: > On Nov 9, 5:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > En Tue, 06 Nov 2007 23:25:17 -0300, <[EMAIL PROTECTED]> escribió: > > > One should make a lot of assumptions about your code because it's not > > complete. Please post a min

Re: New comer

2007-11-13 Thread BLeAm
On Nov 14, 1:21 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Nov 13, 11:37 am, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > Hi all, I'm new comer here > > Welcome to you! Are you new to programming in Python as well, or just > new to this newsgroup? > > If you are new to Python, you

Re: cmp and sorting non-symmetric types

2007-11-13 Thread Carl Banks
On Nov 13, 1:51 pm, "Adam Olsen" <[EMAIL PROTECTED]> wrote: > (I've had trouble getting response for collaboration on a PEP. > Perhaps I'm the only interested party?) > > Although py3k raises an exception for completely unsortable types, it > continues to silently do the wrong thing for non-symmetr

Re: private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

2007-11-13 Thread sndive
On Nov 9, 5:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 06 Nov 2007 23:25:17 -0300, <[EMAIL PROTECTED]> escribió: > > > i naively created execution context: > > PyObject *execcontext = PyDict_New(); > > stuffed a handle in it: > > PyObject *ih = PyCObject_FromVoidPtr(han

Re: [OT] The Jew Spam on this list: Blocking the IP address of spammers

2007-11-13 Thread Peter J. Bismuti
Why aren't these spammers having their IP addresses blocked (or something like that)? People making these posts should not be allowed to post ever again. Is there not someone administering this mailing list? > I agree! > > On Nov 13, 2007 1:26 PM, Martin Marcher <[EMAIL PROTECTED]> wrote: > >

Re: os walk() and threads problems (os.walk are thread safe?)

2007-11-13 Thread Marcus Alves Grando
I make one new version more equally to original version: --code-- #!/usr/bin/python import os, sys, time import glob, random, Queue import threading EXIT = False BRANDS = {} LOCK=threading.Lock() EV=threading.Event() POOL=Queue.Queue(0) NRO_THREADS=20 def walkerr(err): print err class

Re: cmp and sorting non-symmetric types

2007-11-13 Thread Raymond Hettinger
On Nov 13, 10:51 am, "Adam Olsen" <[EMAIL PROTECTED]> wrote: > Although py3k raises an exception for completely unsortable types, it > continues to silently do the wrong thing for non-symmetric types that > overload comparison operator with special meanings. > To solve this I propose a revived cmp

Re: Override method name and original method access

2007-11-13 Thread Chris Mellon
On Nov 13, 2007 3:00 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Tue, 13 Nov 2007 01:45:31 -0300, Donn Ingle <[EMAIL PROTECTED]> > escribió: > > >> You need to be a new-style class (that is, you must inherit from > >> object) for super() to work. > > Problem is that my classes inherit alr

Re: [OT] The Jew Spam on this list

2007-11-13 Thread James Matthews
I agree! On Nov 13, 2007 1:26 PM, Martin Marcher <[EMAIL PROTECTED]> wrote: > Hello, > > please do not respond to the "political" spam on this list anymore. > Rather report it as spam to your provider/anti-spam-measures or report > it to the listmasters (if you have the feeling that it helps, I g

Re: Using python as primary language

2007-11-13 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Michel Albert <[EMAIL PROTECTED]> wrote: > In our company we are looking for one language to be used as default > language. So far Python looks like a good choice (slacking behind > Java). A few requirements that the language should be able cope with > are: > > *

Re: os walk() and threads problems (os.walk are thread safe?)

2007-11-13 Thread Chris Mellon
On Nov 13, 2007 1:06 PM, Marcus Alves Grando <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > > Marcus Alves Grando wrote: > > > >> Diez B. Roggisch wrote: > >>> Marcus Alves Grando wrote: > >>> > Hello list, > > I have a strange problem with os.walk and threads in python scrip

Re: Populating a dictionary, fast [SOLVED]

2007-11-13 Thread Hrvoje Niksic
Francesc Altet <[EMAIL PROTECTED]> writes: > I don't know exactly why do you need a dictionary for keeping the > data, but in case you want ultra-fast access to values, there is no > replacement for keeping a sorted list of keys and a list with the > original indices to values, and the proper list

NumPy Question - numpy.put in multi-dimensional array

2007-11-13 Thread [EMAIL PROTECTED]
from numpy import * a = zeros((2,40), int) fields = {} field = 10 fields[field] = '30A', 5 iy = int(fields[field][1]) ix = int(fields[field][0].rstrip('AB')) for i in range(2): for j in range(iy): #put(a,[39 - j],[1]) #1d Can someone help me figure out how I would do it for m

Re: why no automatic conversion in string concatenation?

2007-11-13 Thread Chris Mellon
On Nov 13, 2007 1:09 PM, Michael Pelz Sherman <[EMAIL PROTECTED]> wrote: > Thanks Cliff. Not to belabor this point - clearly it's just something I'll > have to get used to - but isn't the choice of the "+" as the concatenation > operator part of the problem here? A more "explicit" choice would have

Re: Convert some Python code to C++

2007-11-13 Thread kyosohma
On Nov 13, 12:51 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-11-13, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > On Nov 13, 9:28 am, [EMAIL PROTECTED] wrote: > >> I am working on an implementation of the Longest Common > >> Subsequence problem (as I understand it, this problem c

Re: why no automatic conversion in string concatenation?

2007-11-13 Thread Michael Pelz Sherman
Thanks Cliff. Not to belabor this point - clearly it's just something I'll have to get used to - but isn't the choice of the "+" as the concatenation operator part of the problem here? A more "explicit" choice would have been an "append()" function, would it not? Or at least a non-ambiguous char

Re: os walk() and threads problems (os.walk are thread safe?)

2007-11-13 Thread Marcus Alves Grando
Diez B. Roggisch wrote: > Marcus Alves Grando wrote: > >> Diez B. Roggisch wrote: >>> Marcus Alves Grando wrote: >>> Hello list, I have a strange problem with os.walk and threads in python script. I have one script that create some threads and consume Queue. For every valu

Re: Convert some Python code to C++

2007-11-13 Thread Neil Cerutti
On 2007-11-13, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Nov 13, 9:28 am, [EMAIL PROTECTED] wrote: >> I am working on an implementation of the Longest Common >> Subsequence problem (as I understand it, this problem can be >> used in spell checking type activities) and have used this >> site

cmp and sorting non-symmetric types

2007-11-13 Thread Adam Olsen
(I've had trouble getting response for collaboration on a PEP. Perhaps I'm the only interested party?) Although py3k raises an exception for completely unsortable types, it continues to silently do the wrong thing for non-symmetric types that overload comparison operator with special meanings. >>

Re: New comer

2007-11-13 Thread Paul McGuire
On Nov 13, 11:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi all, I'm new comer here Welcome to you! Are you new to programming in Python as well, or just new to this newsgroup? If you are new to Python, you will find a wealth of "getting started" help at the Python web site, www.pyt

Re: Win32.com

2007-11-13 Thread Colin J. Williams
goldtech wrote: > Given WinXP. I remove Pythonwin and it seems I lose win32.com. I > can't import win32.com Is win32.com bundled with Pythonwin? > Yes. Colin W. -- http://mail.python.org/mailman/listinfo/python-list

Re: module data member?

2007-11-13 Thread Diez B. Roggisch
Peter J. Bismuti schrieb: > This did the trick for the most part, but it still leaves a copy of the > variable A in the "non-module" global namespace (see output below). > > I want A declared global to the module (so as not to be local within the > functions of the module) but not visible outs

Re: Win32.com

2007-11-13 Thread Matimus
On Nov 13, 9:37 am, goldtech <[EMAIL PROTECTED]> wrote: > Given WinXP. I remove Pythonwin and it seems I lose win32.com. I > can't import win32.com Is win32.com bundled with Pythonwin? They are part of the same package. I'm not sure that there are any dependencies. It isn't `win32.com' though, i

Selamat malem

2007-11-13 Thread [EMAIL PROTECTED]
selamat malem -- http://mail.python.org/mailman/listinfo/python-list

Re: Information manager/organizer with tags question.

2007-11-13 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote: > Hello, > > [snip outline of an information editor] Maybe the Literary Machine? http://sommestad.com/lm.htm> It is a bit weird at first, and Windows only (altough I have had it running under wine once). But it is actually really well designed and very powerful. Or,

Re: why no automatic conversion in string concatenation?

2007-11-13 Thread J. Clifford Dyer
On Tue, Nov 13, 2007 at 07:15:06AM -0800, Michael Pelz Sherman wrote regarding why no automatic conversion in string concatenation?: > >As a Java & PHP developer, I find it kind of annoying that I have to >explicitly convert non-string variables to strings when concatenating >them, es

Re: AOP and pep 246

2007-11-13 Thread Kay Schluehr
On 13 Nov., 15:17, Steve <[EMAIL PROTECTED]> wrote: > > AOP was a research that gone nowhere - at least not in its orginal > > AspectJ form ... > > I think it might be worth pointing out, though, that there is still > significant interest in AOP in the Java community, in the form or > interest in t

New comer

2007-11-13 Thread [EMAIL PROTECTED]
Hi all, I'm new comer here -- http://mail.python.org/mailman/listinfo/python-list

Win32.com

2007-11-13 Thread goldtech
Given WinXP. I remove Pythonwin and it seems I lose win32.com. I can't import win32.com Is win32.com bundled with Pythonwin? -- http://mail.python.org/mailman/listinfo/python-list

Re: why there is no pythonscript insine web browsers?

2007-11-13 Thread Shane Geiger
At the last PyCon, Brett Cannon told me that he had already implemented the security architecture (or security template) for Python within Firefox. However, he did not go forward with the project because he would not be able to get a PhD from doing it. :-) Dennis Lee Bieber wrote: > On Tue,

Re: module data member?

2007-11-13 Thread Peter J. Bismuti
This did the trick for the most part, but it still leaves a copy of the variable A in the "non-module" global namespace (see output below). I want A declared global to the module (so as not to be local within the functions of the module) but not visible outside of the module namespace (like B

Re: Override method name and original method access

2007-11-13 Thread Donn Ingle
> One.add(self, otherstuff) Ah! Thanks - that makes more sense. Much appreciated. /d -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I interpret a file within the interactive interpreter

2007-11-13 Thread Diez B. Roggisch
Peter J. Bismuti wrote: > Still can't get the -m flat to work. Perhaps this feature is not in the > version I am using? Thanks. -m isn't the option you want. -i it is. And yes, -m appeared in later python versions - I'm not exactly sure which one grew it, might be 2.3 or even 2.4. But -i is old

RE: Populating a dictionary, fast [SOLVED]

2007-11-13 Thread Michael Bacarella
> Shouldn't this be: > > id2name[key >> 40][key & 0xff] = name Yes, exactly, I had done hex(pow(2,40)) when I meant hex(pow(2,40)-1) I sent my correction a few minutes afterwards but Mailman queued it for moderator approval (condition with replying to myself?) -- http://mail.pytho

Re: referencing a subhash for generalized ngram counting

2007-11-13 Thread braver
Here's a working version of the ngram counter with nested dict, wonder how it can be improved! lines = ["abra ca dabra", "abra ca shvabra", "abra movich roman", "abra ca dabra", "a bra cadadra"] ngrams = [x.split() for x in lines] N = 3 N1 = N-1 orig = {} for ng

Re: module data member?

2007-11-13 Thread Diez B. Roggisch
Peter J. Bismuti wrote: > How do you define a "module data member" (I want to understand out how > this works before making converting to a Class)? > > Right now I'm defining variables in a module that get put into the global > namespace. Instead I want to put them in a "module global" namespace

Re: how can I interpret a file within the interactive interpreter

2007-11-13 Thread Peter J. Bismuti
Still can't get the -m flat to work. Perhaps this feature is not in the version I am using? Thanks. -bash-3.00$ python -m test Unknown option: -m usage: python [option] ... [-c cmd | file | -] [arg] ... Try `python -h' for more information. -bash-3.00$ python Python 2.3.4 (#1, Jan 9 2007, 1

Re: Convert some Python code to C++

2007-11-13 Thread kyosohma
On Nov 13, 9:28 am, [EMAIL PROTECTED] wrote: > I am working on an implementation of the Longest Common Subsequence > problem (as I understand it, this problem can be used in spell > checking type activities) and have used this site to understand the > problem and its solution: > > http://en.wikiboo

module data member?

2007-11-13 Thread Peter J. Bismuti
How do you define a "module data member" (I want to understand out how this works before making converting to a Class)? Right now I'm defining variables in a module that get put into the global namespace. Instead I want to put them in a "module global" namespace that will be the same regardles

Re: Populating a dictionary, fast [SOLVED]

2007-11-13 Thread Paul McGuire
On Nov 12, 11:32 am, "Michael Bacarella" <[EMAIL PROTECTED]> wrote: > See end for solution. > > > >> (3) Are you sure you need all eight-million-plus items in the cache > > >> all at once? > > > > Yes. > > > I remain skeptical, but what do I know, I don't even know what you're > > doing with the da

Re: Populating a dictionary, fast [SOLVED]

2007-11-13 Thread Francesc Altet
A Monday 12 November 2007, Michael Bacarella escrigué: > As for the solution, after trying a half-dozen different integer > hashing functions > and hash table sizes (the brute force approach), on a total whim I > switched to a > model with two dictionary tiers and got whole orders of magnitude > be

Re: os walk() and threads problems (os.walk are thread safe?)

2007-11-13 Thread Diez B. Roggisch
Marcus Alves Grando wrote: > Diez B. Roggisch wrote: >> Marcus Alves Grando wrote: >> >>> Hello list, >>> >>> I have a strange problem with os.walk and threads in python script. I >>> have one script that create some threads and consume Queue. For every >>> value in Queue this script run os.walk(

Re: Arrays

2007-11-13 Thread Chris Mellon
On Nov 13, 2007 10:26 AM, Gordon C <[EMAIL PROTECTED]> wrote: > OK, thanks to all. The key statement is "from array import array" which is > not exactly intuitive! > Gord > It becomes intuitive when you learn Python, which is what you're reading the tutorial for, and it's why the tutorial shows yo

current script path via execfile?

2007-11-13 Thread Adam Pletcher
I have an app with an embedded Python interpreter. In that interpreter, I want to use "execfile" (or something similar) to execute a script from disk. The script needs to somehow acquire the full path to itself, but I can't work out how to do this. Since it's run with execfile in the embedded

cx_Oracle: Non-ASCII characters handling with different versions

2007-11-13 Thread Benjamin Hell
Hi! I have a problem with the cx_Oracle module (Oracle database access): On a computer with cx_Oracle version 4.1 (Python 2.4.3, Oracle 10g) I can get query results consisting of strings including non-ASCII characters, e.g. the code example below outputs "é 0xe9" (which is the correct ISO-8859-1

  1   2   >