Re: webbrowser.open still gives problem with file://

2007-11-13 Thread Gabriel Genellina
En Mon, 12 Nov 2007 16:18:06 -0300, krishnakant Mane <[EMAIL PROTECTED]> escribió: > some days bac I posted a problem about webbrowser.open() not opening > the file on the local machine. > I get a few responses and I tryed working it out. > I also refered to the cookbook example posted on that t

Re: How to get a set of keys with largest values?

2007-11-13 Thread DouhetSukd
On Nov 12, 1:07 am, Davy <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a dictionary with n elements, and I want to get the m(m<=n) > keys with the largest values. > > For example, I have dic that includes n=4 elements, I want m=2 keys > have the largest values) > dic = {0:4,3:1,5:2,7:8} > So, the

Re: Define key in nlargest() of heapq?

2007-11-13 Thread Duncan Booth
Davy <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a dictionary with n elements, and I want to get the m(m<=n) > keys with the largest values. > > For example, I have dic that includes n=4 elements, I want m=2 keys > have the largest values) > dic = {0:4,3:1,5:2,7:8} > So, the the largest valu

Re: Override method name and original method access

2007-11-13 Thread Gabriel Genellina
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 already, from others I wrote. So, > should > I explicitly put (object) into the

RE: Populating a dictionary, fast [SOLVED]

2007-11-13 Thread Michael Bacarella
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 data once you have it :-) It's OK, I'd be skeptical too. ;) > $ cat /proc/cpui

Re: Looking for a good Python environment

2007-11-13 Thread Nir
On Nov 11, 11:39 pm, Paul Rubin wrote: > Russell Warren <[EMAIL PROTECTED]> writes: > > Wing now has multi-threaded debugging. > > Cool, is it windows-only? I'm using Linux. > > > A quick look at the current state of SPE shows that it now has multi- > > threaded debuggin

Re: templatetaizing exceptions

2007-11-13 Thread Gabriel Genellina
En Tue, 13 Nov 2007 01:09:12 -0300, alf <[EMAIL PROTECTED]> escribió: > I have a few places in the code where I use: > > try: > code_block > except A: > exception_handling > > > the code block is different each time while exception_handling the same. > > Wha

Re: why there is no pythonscript insine web browsers?

2007-11-13 Thread Deli_Llama
One option would be to use jython in conjunction with something like the google web toolkit(gwt). that way you can write python code, it will be translated into java by jython (I believe that's how it works) and then gwt will translate the java into javascript. I haven't done this myself (and it s

Re: How to get a set of keys with largest values?

2007-11-13 Thread DouhetSukd
On Nov 12, 1:07 am, Davy <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a dictionary with n elements, and I want to get the m(m<=n) > keys with the largest values. > > For example, I have dic that includes n=4 elements, I want m=2 keys > have the largest values) > dic = {0:4,3:1,5:2,7:8} > So, the

Re: Binary search tree

2007-11-13 Thread Gabriel Genellina
En Mon, 12 Nov 2007 16:21:36 -0300, Scott SA <[EMAIL PROTECTED]> escribió: > I decided to test the speeds of the four methods: (but one should always check for correctness before checking speed) > def dict_example(urls): > d = {} > for url in urls: > if url in d: > d[

error :list out of range

2007-11-13 Thread Beema shafreen
hi everybody, I have written a code to check which is the lowest value in a list my list: ['94', 'A_16_P03647505', '-59', '42', 'A_16_P41573860', '-44', '513', 'A_16_P41573861', '-44', '66', 'A_16_P41573862', '-44', '327', 'A_16_P03647506', '-46', '77', 'A_16_P41573864', '-59',

Re: Arrays

2007-11-13 Thread Simon Brunning
On Nov 13, 2007 6:58 AM, John Machin <[EMAIL PROTECTED]> wrote: > Hey Bernard, read Gordon's message carefully; he's asking about > arrays, not lists. Chances are a list is exactly what the OP wants. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.bru

Re: templatetaizing exceptions

2007-11-13 Thread david
On Tue, 13 Nov 2007 06:17:26 -0300, Gabriel Genellina wrote: > > A function? > > try: > code_block > except A: > handle_exception() maybe >>> def handle(f, *args, **kw): ... try: ... return f(*args, **kw) ... except A: ...

Re: 2007.comp.lang.python

2007-11-13 Thread Kay Schluehr
Is this headline a demand for Ruby style DSLs in Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: why there is no pythonscript insine web browsers?

2007-11-13 Thread bramble
On Nov 13, 3:07 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 12 Nov 2007 20:07:38 +0200, Timuçin K?z?lay > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > python support? there is even a vbscript support inside MS-IE but there > > is no python support. it would

Re: Looking for a good Python environment

2007-11-13 Thread bramble
On Nov 10, 4:48 am, Paul Rudin <[EMAIL PROTECTED]> wrote: > jwelby <[EMAIL PROTECTED]> writes: > > > The main reason I have used Eclipse for larger, team based, projects > > is for the source control plug-ins. Eclipse has plug-in support for > > cvs and svn. PyScripter may have this too - perhaps I

Re: Binary search tree

2007-11-13 Thread Scott Sandeman-Allen
On 11/13/07, Terry Reedy ([EMAIL PROTECTED]) wrote: >"Scott SA" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >| On 11/12/07, Scott SA ([EMAIL PROTECTED]) wrote: >| I decided to test the speeds of the four methods: >| >|set_example >|s = set() >|for url in urls

Re: Looking for a good Python environment

2007-11-13 Thread cokofreedom
On Nov 13, 10:56 am, bramble <[EMAIL PROTECTED]> wrote: > On Nov 10, 4:48 am, Paul Rudin <[EMAIL PROTECTED]> wrote: > > > jwelby <[EMAIL PROTECTED]> writes: > > > > The main reason I have used Eclipse for larger, team based, projects > > > is for the source control plug-ins. Eclipse has plug-in sup

Re: error :list out of range

2007-11-13 Thread Gabriel Genellina
En Tue, 13 Nov 2007 06:23:02 -0300, Beema shafreen <[EMAIL PROTECTED]> escribió: > for k in range(0,len(res_value),3): > check = res_value[k:k+4] > if check[0] < check[4]: > print check > error: File "app.py", line 16, in > if check[0] < check[4]: > IndexErro

Re: Arrays

2007-11-13 Thread John Machin
On Nov 13, 8:36 pm, "Simon Brunning" <[EMAIL PROTECTED]> wrote: > On Nov 13, 2007 6:58 AM, John Machin <[EMAIL PROTECTED]> wrote: > > > Hey Bernard, read Gordon's message carefully; he's asking about > > arrays, not lists. > > Chances are a list is exactly what the OP wants. > Chances are a list i

Re: Issue with wxPython GUI

2007-11-13 Thread tarun
Hi Laszlo Nagy, Thanks a lot. But the issue over here is that how will the child thread acknowledge the main thread that it has completed its task. For this I'll have to set some flag in the child thread and poll for it in the main thread. This will create a problem. Any alternatives?? Thanks & R

Loop three lists at the same time?

2007-11-13 Thread Davy
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 -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop three lists at the same time?

2007-11-13 Thread J. Robertson
Davy 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 > Hello, the zip function? >>> list1 = [1,2,3] >>> list2 = [4,5,6] >>> list3 = [7,8,9] >>> for a,b,c in zip(list1,list2,list3): ...

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

2007-11-13 Thread invalid
You are comparing white collar criminals with Islamic terrorists who strap on explosive vests and blow themselves up inside the mosques of those who follow a slightly different version of Islam. The internet needs licensing so we can revoke yours. [EMAIL PROTECTED] wrote: >The Jews and Israel

Re: Loop three lists at the same time?

2007-11-13 Thread cokofreedom
On Nov 13, 11:46 am, 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 What exactly do you mean? Are you trying to loop them together with the same ´count´. "for loo

Directorio europeo de arte y diseño

2007-11-13 Thread marc
MARC3ART - GUÍA EUROPEA DE ARTE Y DISEÑO ofrece de manera ordenada, detallada y actualizada información sobre eventos artísticos-culturales y de diseño de interés para personas relacionadas con el medio. Ofrece de manera permanente calendario de exposiciones, concursos de arte, convocatorias y

Re: Loop three lists at the same time?

2007-11-13 Thread Gabriel Genellina
En Tue, 13 Nov 2007 07:46:09 -0300, Davy <[EMAIL PROTECTED]> escribió: > I have three lists with the same length. Is there any method to loop > the three lists without a loop counter? Try zip or itertools.izip: py> L1 = ['a','b','c'] py> L2 = [1, 2, 3] py> L3 = ['I', 'II', 'III'] py> from iterto

Re: why there is no pythonscript insine web browsers?

2007-11-13 Thread Diez B. Roggisch
bramble wrote: > On Nov 13, 3:07 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> On Mon, 12 Nov 2007 20:07:38 +0200, Timuçin K?z?lay >> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: >> >> > python support? there is even a vbscript support inside MS-IE but there >> > is no py

Re: Issue with wxPython GUI

2007-11-13 Thread Laszlo Nagy
tarun írta: > Hi Laszlo Nagy, > > Thanks a lot. > But the issue over here is that how will the child thread acknowledge > the main thread that it has completed its task. For this I'll have to > set some flag in the child thread and poll for it in the main thread. > This will create a problem.

Re: Issue with wxPython GUI

2007-11-13 Thread tarun
Thanks a lot Laszlo Nagy, I used the following and it worked. import time from threading import * import wx # Button definitions ID_START = wx.NewId() ID_STOP = wx.NewId() # Define notification event for thread completion EVT_RESULT_ID = wx.NewId() def EVT_RESULT(win, func): """Define Resu

[OT] The Jew Spam on this list

2007-11-13 Thread Martin Marcher
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 guess they're already on this issue). I understand that this might be a heated topic bu

Re: Distributed RVS, Darcs, tech love

2007-11-13 Thread Piet van Oostrum
> Lew <[EMAIL PROTECTED]> (L) wrote: >L> Evidence is that TeX development is dead. There is not yet firm evidence >L> that Tex is a "dead end" (or even what that means), and there has been none >L> (nor, I expect, is there any) that any of that reflects on Knuth's skill as >L> a programmer.

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

2007-11-13 Thread Robert J. Kolker
[EMAIL PROTECTED] wrote: > A Jew hacker in California admits distributing malware that let him > steal usernames and passwords for Paypal accounts. Just like all the Goy hackers who have done the same kind of wrongful deed. Bob Kolker -- http://mail.python.org/mailman/listinfo/python-list

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

2007-11-13 Thread Hendrik Maryns
___ /| /| | | ||__|| | Please do | / O O\__ NOT | / \ feed the| /

Re: templatetaizing exceptions

2007-11-13 Thread alf
david wrote: > On Tue, 13 Nov 2007 06:17:26 -0300, Gabriel Genellina wrote: > >> A function? >> >> try: >> code_block >> except A: >> handle_exception() > > maybe > def handle(f, *args, **kw): > ... try: > ... return f(*args, **kw) > ...

Re: Issue with wxPython GUI

2007-11-13 Thread kyosohma
On Nov 13, 6:18 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > tarun írta:> Hi Laszlo Nagy, > > > Thanks a lot. > > But the issue over here is that how will the child thread acknowledge > > the main thread that it has completed its task. For this I'll have to > > set some flag in the child thread and

Re: Issue with wxPython GUI

2007-11-13 Thread Laszlo Nagy
tarun wrote: > Thanks a lot Laszlo Nagy, > > I used the following and it worked. I thought this is a producer/consumer scenario, this is why I suggested the Queue class. But now I see that you only want to compute one value in your thread and stop it afterwards. In fact using a wx.PyEvent is m

Iterator for circulating a list

2007-11-13 Thread BJörn Lindqvist
L = somelist idx = 0 while True: item = L[idx] # Do something with item idx = (idx + 1) % len(L) wouldn't it be cool if there was an itertool like this: def circulate(L, begin = 0, step = 1): idx = begin while True: yield L[idx] idx = (idx + step) % len(L) f

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

2007-11-13 Thread Marcus Alves Grando
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() and printing root dir. But if i increase number of threads the result are inconsistent compared with o

Re: pyopenglcontext binaries for 2.5 on win32

2007-11-13 Thread kyosohma
On Nov 13, 12:03 am, gz <[EMAIL PROTECTED]> wrote: > no, I don't have them... I need them :) > > I'd like to thank Giovanni Bajo for providing binaries for the various > package dependencies, and geting me going with pyopengl. > > Unfortunately I only menaged to run a basic example, where there's n

Re: AOP and pep 246

2007-11-13 Thread Steve
> 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 the Spring Framework. See, for instance: http://www.onjava.com/

Re: Help needed!

2007-11-13 Thread kyosohma
On Nov 12, 5:16 pm, "SMALLp" <[EMAIL PROTECTED]> wrote: > I forgot, I'm using wxPython"SMALLp" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > I'm new in python and i got lost. > > > Ima building an aplication that add's 2 panels and menu bar to the window. > > So i made base

Re: pyopenglcontext binaries for 2.5 on win32

2007-11-13 Thread kyosohma
On Nov 13, 12:03 am, gz <[EMAIL PROTECTED]> wrote: > no, I don't have them... I need them :) > > I'd like to thank Giovanni Bajo for providing binaries for the various > package dependencies, and geting me going with pyopengl. > > Unfortunately I only menaged to run a basic example, where there's n

Re: Iterator for circulating a list

2007-11-13 Thread Carsten Haese
On Tue, 2007-11-13 at 15:12 +0100, BJörn Lindqvist wrote: > L = somelist > > idx = 0 > while True: > item = L[idx] > # Do something with item > idx = (idx + 1) % len(L) > > wouldn't it be cool if there was an itertool like this: > > def circulate(L, begin = 0, step = 1): > idx =

Re: Looking for a good Python environment

2007-11-13 Thread Chris Mellon
On Nov 13, 2007 3:56 AM, bramble <[EMAIL PROTECTED]> wrote: > On Nov 10, 4:48 am, Paul Rudin <[EMAIL PROTECTED]> wrote: > > jwelby <[EMAIL PROTECTED]> writes: > > > > > The main reason I have used Eclipse for larger, team based, projects > > > is for the source control plug-ins. Eclipse has plug-in

Re: Iterator for circulating a list

2007-11-13 Thread Hrvoje Niksic
"BJörn Lindqvist" <[EMAIL PROTECTED]> writes: > L = somelist > > idx = 0 > while True: > item = L[idx] > # Do something with item > idx = (idx + 1) % len(L) > > wouldn't it be cool if there was an itertool like this: > > def circulate(L, begin = 0, step = 1): > idx = begin > wh

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

2007-11-13 Thread Diez B. Roggisch
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() and printing root dir. But if i > increase number of threads the re

Re: Iterator for circulating a list

2007-11-13 Thread BJörn Lindqvist
On Nov 13, 2007 3:43 PM, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Tue, 2007-11-13 at 15:12 +0100, BJörn Lindqvist wrote: > > L = somelist > > > > idx = 0 > > while True: > > item = L[idx] > > # Do something with item > > idx = (idx + 1) % len(L) > For begin=0 and step=1, itertools.

why no automatic conversion in string concatenation?

2007-11-13 Thread Michael Pelz Sherman
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, especially when python is quite capable of doing the conversion automatically. i.e.: >>> myBool = True >>> print myBool True >>> print "myBool is " +

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

2007-11-13 Thread Richard G Riley
Hendrik Maryns <[EMAIL PROTECTED]> writes: > ___ > /| /| | | > ||__|| | Please do | > / O O\__ NOT | > /

best open source sample

2007-11-13 Thread Johnny
Hi, I'm new to Python and am looking for a really good/complete open source project to learn from. I'd like it to take input from the browser and query mysql. Suggestions? -- http://mail.python.org/mailman/listinfo/python-list

Convert some Python code to C++

2007-11-13 Thread meyousikmann
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.wikibooks.org/wiki/Algorithm_implementation/Strings/Longest_com

Re: persisting data within a module

2007-11-13 Thread Peter J. Bismuti
I'm not sure how to better state my question than to post my code. The question boils down to which namespace to variable in the module (in this case A) end up in depending on whether or not the module is simply imported by another module which acts as the driver (run.py is __main__), or when

bsddb : python, index, cursor and get

2007-11-13 Thread Pierre
Hello, I'm having problems to use the get method on a cursor with an index (secondary database). I've read Oracle's docs but there are mainly in C, JAVA and C++. So no python docs! actually, that's what I'm trying to do : ret = cursor.get(key='blabla', data='2007-10-30', flags=0, dlen=-1, doff=

how can I interpret a file within the interactive interpreter

2007-11-13 Thread Peter J. Bismuti
I want to interpret a file (or whatever you call it) and then keep the interactive interpreter alive so I can then continue to issue commands. How can this be done? I saw online a -m flag but it does not seem to work. Thanks -- Peter Bismuti Boeing -- http://mail.python.org/mailman/li

FALSE FLAG TACTIC TO SCARE CHRISTIANS AND THOSE WHO HAVE LITTLE KNOWLEDGE Re: Concept of God in Islam

2007-11-13 Thread zionist . news2
Here, a jew subterfuge false-flag posing as an Islamic spams the newsgroup with CUT AND PASTE job from some Islamic webpage TO SCARE THE CHRISTIAN FUNDAMENTALISTS and EUROPEANS (like those French) in an attempt to destroy 911 truth discussion by making them think that 911 truth victory = somethi

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

2007-11-13 Thread Diez B. Roggisch
Peter J. Bismuti wrote: > I want to interpret a file (or whatever you call it) and then keep the > interactive interpreter alive so I can then continue to issue commands. > > How can this be done? I saw online a -m flag but it does not seem to > work. Use the -i-flag. Diez -- http://mail.pyth

referencing a subhash for generalized ngram counting

2007-11-13 Thread braver
Greetings: I wonder how does one uses single-name variables to refer to nested sunhashes (subdictionaries). Here's an example: In [41]: orig = { 'abra':{'foo':7, 'bar':9}, 'ca':{}, 'dabra':{'baz': 4} } In [42]: orig Out[42]: {'abra': {'bar': 9, 'foo': 7}, 'ca': {}, 'dabra': {'baz': 4}} In [43]:

Re: persisting data within a module

2007-11-13 Thread Peter J. Bismuti
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__=="__main__")? Ultimately, what I want is for a module to remember (persist) the value of A, rega

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

2007-11-13 Thread Peter Otten
Peter J. Bismuti wrote: > I want to interpret a file (or whatever you call it) and then keep the > interactive interpreter alive so I can then continue to issue commands. That's what the -i option is for. > How can this be done? I saw online a -m flag but it does not seem to work. -m is us

urllib.unquote + unicode

2007-11-13 Thread koara
Hello all, 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 as %u directly, instead of using an encoding and quoting byte per

Re: best open source sample

2007-11-13 Thread kyosohma
On Nov 13, 9:20 am, Johnny <[EMAIL PROTECTED]> wrote: > Hi, I'm new to Python and am looking for a really good/complete open > source project to learn from. I'd like it to take input from the > browser and query mysql. Suggestions? Zope / Plone, Django, or Turbogears are all web frameworks tha

Re: referencing a subhash for generalized ngram counting

2007-11-13 Thread Marc 'BlackJack' Rintsch
On Tue, 13 Nov 2007 08:02:08 -0800, braver wrote: > Greetings: I wonder how does one uses single-name variables to refer > to nested sunhashes (subdictionaries). Here's an example: That's possible and you do it in your example. > In [41]: orig = { 'abra':{'foo':7, 'bar':9}, 'ca':{}, 'dabra':{'b

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: > >> 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() and printing root dir. But if i >>

Re: best open source sample

2007-11-13 Thread Johnny
On Nov 13, 9:14 am, [EMAIL PROTECTED] wrote: > On Nov 13, 9:20 am, Johnny <[EMAIL PROTECTED]> wrote: > > > Hi, I'm new to Python and am looking for a really good/complete open > > source project to learn from. I'd like it to take input from the > > browser and query mysql. Suggestions? > > Zope

Re: Arrays

2007-11-13 Thread Gordon C
OK, thanks to all. The key statement is "from array import array" which is not exactly intuitive! Gord "John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Bernard wrote: >> On 12 nov, 20:19, "Gordon C" <[EMAIL PROTECTED]> wrote: >> > Absolute newbie here. In spite of th

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

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

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

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: 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: 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

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: 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

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: 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: 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: 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: 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: 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: 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: 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,

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

New comer

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

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

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: 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,

Selamat malem

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

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

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 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: 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

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: 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

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: 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: 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 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

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: 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

  1   2   >