Re: A Python 3000 Question

2007-11-01 Thread Steven D'Aprano
On Fri, 02 Nov 2007 03:40:59 +, Tim Roberts wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >>On Wed, 31 Oct 2007 22:48:12 -0700, Carl Banks wrote: >> I hope you're not serious that $# would make a good operator. >>> >>> If you happen to know where I borrowed it from, it would be

looping

2007-11-01 Thread Beema shafreen
hi everybody, I have a file: A_16_P21360207 304 A_14_P136880783 A_16_P21360209795 A_16_P21360210173 A_16_P036419591177 A_16_P036419601944 A_16_P03641962999 A_16_P036419633391 A_16_P415636493626 A_16_P03641964180 A_16_P415636551216 A_16_P03641965

Re: AOP and pep 246

2007-11-01 Thread Paddy
On Nov 1, 4:46 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 1 Nov., 16:18, "Rustom Mody" <[EMAIL PROTECTED]> wrote: > > > I am interested in AOP in python. From here one naturally (or > > google-ly) reaches peak. > > But peak seems to be discontinued. > > Whereas pep-246 on adaptors seems to b

RE: posting to a form with no form name

2007-11-01 Thread Ryan Ginstrom
> On Behalf Of [EMAIL PROTECTED] > posting to a form with no form name or it's just that i cant > find the form name. > can anyone explain how to either post to a form with no name > or, find the name of the form..here my current output, but i > dont see a form name, also, there is only 1 form o

Re: PyQt with embedded python in Qt App

2007-11-01 Thread Bart.
Friday 02 of November 2007 01:06:58 Diez B. Roggisch napisał(a): > > So how to pass this object into embeded python interpreter (executed > > script)? Anyone know any example? > > You don't pass it, you _retrieve_ it in the embedded interpreter by > invoking the code given to you. > Know any examp

Re: python at command prompt

2007-11-01 Thread Ton van Vliet
On Thu, 01 Nov 2007 09:17:00 -0700, [EMAIL PROTECTED] wrote: >Hi, >I am python newbie and the command prompt is having an issue with >python. I installed python 2.4.4 onto my windows machine, opened a >command prompt window, and typed python to start the interactive mode. >Got the following error.

posting to a form with no form name

2007-11-01 Thread [EMAIL PROTECTED]
posting to a form with no form name or it's just that i cant find the form name. can anyone explain how to either post to a form with no name or, find the name of the form..here my current output, but i dont see a form name, also, there is only 1 form on the page https://somesite.com/login.html ap

Re: Use of while(1) with app.mainLoop of wxpython

2007-11-01 Thread Godson Gera
On 11/2/07, tarun <[EMAIL PROTECTED]> wrote: > > Dear All, > > I've have created a GUI (using wxPython widgets) where in I've a message > log window (A TextCtrl window). I've a router.dll that helps me putting in > message onto a channel. In my script that generates the GUI, I want to > continuousl

Re: Is there a usenet library for Python?

2007-11-01 Thread Just Another Victim of the Ambient Morality
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2007-10-30, Just Another Victim of the Ambient Morality > <[EMAIL PROTECTED]> wrote: > >> Is there a Python library to communicate with a usenet server? > > Which protocol are you interested in, NNTP (for reading/po

Is pyparsing really a recursive descent parser?

2007-11-01 Thread Just Another Victim of the Ambient Morality
Is pyparsing really a recursive descent parser? I ask this because there are grammars it can't parse that my recursive descent parser would parse, should I have written one. For instance: from pyparsing import * grammar = OneOrMore(Word(alphas)) + Literal('end') grammar.parseString('Firs

Re: looping

2007-11-01 Thread Gabriel Genellina
En Fri, 02 Nov 2007 02:03:09 -0300, Beema shafreen <[EMAIL PROTECTED]> escribió: > hi everbody, > i have a file , > A_16_P418510561730 > A_16_P03796992165 > A_16_P21640222360 > A_16_P21640223240 > A_16_P03796998205 > column 2 of my file has values 1730, 165,360.

Re: os.readlink returning value

2007-11-01 Thread Tim Roberts
Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > >I was reading os.readlink doc which says: > >readlink( path) > >Return a string representing the path to which the symbolic link >points. The result may be either an absolute or relative pathname; if >it is relative, it may be converted to an absolute

Re: Strange problem when using re module with threads

2007-11-01 Thread Gabriel Genellina
En Thu, 01 Nov 2007 17:01:36 -0300, Wei Lee Woon <[EMAIL PROTECTED]> escribió: > I've been getting a rather strange problem with the following > multithreaded > code (reduced to the minimum which still results in the problem): > > import threading > import re > > class hey(threading.Thread): >

Re: Iterable Flattener with Depth.

2007-11-01 Thread praddy
On Nov 1, 5:03 pm, [EMAIL PROTECTED] wrote: > Pradeep Jindal: > > > Any comments? > > Something with similar functionality (plus another 20 utility > functions/classes or so) has probably to go into the std lib... :-) > > Bye, > bearophile Same Here! - Pradeep -- http://mail.python.org/mailman/

Re: AOP and pep 246

2007-11-01 Thread Kay Schluehr
On Nov 2, 5:00 am, "Rustom Mody" <[EMAIL PROTECTED]> wrote: > On 11/1/07, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > AOP was a research that gone nowhere - at least not in its orginal AspectJ > > form: > > declaring aspect code that targets business code, weaving the aspect code > > into the

Configuration Management

2007-11-01 Thread [EMAIL PROTECTED]
I have found an excellent resource on understanding Windows Application concepts and exam 070-306. http://technical-talk.com/mc/mcsd/mcsd306.asp -- http://mail.python.org/mailman/listinfo/python-list

Re: AOP and pep 246

2007-11-01 Thread Michele Simionato
On Nov 2, 5:00 am, "Rustom Mody" <[EMAIL PROTECTED]> wrote: > > Seehttp://www.python.org/dev/peps/pep-3119 > > Thanks Michele. But there are a couple of questions on this: > > a. Does one have to use python 3000 for this? I expect ABC's to be backported to Python 2.6, but it is probably possible t

Re: PyCheck for a classes defined in python and user data in PyObject_HEAD

2007-11-01 Thread Gabriel Genellina
En Thu, 01 Nov 2007 22:13:35 -0300, <[EMAIL PROTECTED]> escribió: > On Nov 1, 4:14 pm, [EMAIL PROTECTED] wrote: >> q#1: >> in C I want to check if a given PyObject is a xml.dom.minidom.Node (or >> a derivative). >> how do i extract a PyTypeObject for such a class? > > nevermind, i found an instanc

Use of while(1) with app.mainLoop of wxpython

2007-11-01 Thread tarun
Dear All, I've have created a GUI (using wxPython widgets) where in I've a message log window (A TextCtrl window). I've a router.dll that helps me putting in message onto a channel. In my script that generates the GUI, I want to continuously poll the channel and populate the messages from the chan

looping

2007-11-01 Thread Beema shafreen
hi everbody, i have a file , A_16_P418510561730 A_16_P03796992165 A_16_P21640222360 A_16_P21640223240 A_16_P03796993168 A_16_P418510591094 A_16_P216402251035 A_16_P03796994154 A_16_P216402261422 A_16_P216402271262 A_16_P41851063107 A_16_P0379699

Re: os.readlink returning value

2007-11-01 Thread Gabriel Genellina
En Thu, 01 Nov 2007 22:51:14 -0300, Giampaolo Rodola' <[EMAIL PROTECTED]> escribió: > I was reading os.readlink doc which says: > > readlink( path) > > Return a string representing the path to which the symbolic link > points. The result may be either an absolute or relative pathname; if > it is

Re: choose from a list

2007-11-01 Thread sandipm
one more way of connecting to sql. MySQLdb.connect(client_flag=65536131072,cursorclass=cursors.DictCursor,host=HOST,port=3306,user=USER,passwd=PASSWD,db=DbName) cursor = conn.cursor() in your case, only list of dictiories will be returned but when query/stored procedure returns more than one

Re: AOP and pep 246

2007-11-01 Thread Paul Rubin
"Rustom Mody" <[EMAIL PROTECTED]> writes: > On 11/1/07, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > AOP was a research that gone nowhere - at least not in its orginal > > AspectJ form: declaring aspect code that targets business code... > My own guess is that AOP via higher order functions and meta

Re: AOP and pep 246

2007-11-01 Thread Rustom Mody
On 11/1/07, Kay Schluehr <[EMAIL PROTECTED]> wrote: > AOP was a research that gone nowhere - at least not in its orginal AspectJ > form: > declaring aspect code that targets business code, weaving the aspect code > into the > business app using a code generator. There was much excitement about

Re: why did these companies choose Tcl over Python

2007-11-01 Thread Tim Roberts
chewie54 <[EMAIL PROTECTED]> wrote: > >I would like to use Python and C and wxWidgets for my EDA CAD program. >I want to put most of the program core in an Python extension and >GUI in wxWidgets. > >I do need to get publishing quality vector graphics outputs from this >program so one of my concern

Re: marshal vs pickle

2007-11-01 Thread Paul Rubin
Aaron Watters <[EMAIL PROTECTED]> writes: > > >>> marshal.loads('RKp,U\xf7`\xef\xe77\xc1\xea\xd8\xec\xbe\\') > > Segmentation fault > >... > I'll grant you the above as a denial of service attack. ... > Can you give me an example > where someone can erase the filesystem using marshal.load? Y

Re: A Python 3000 Question

2007-11-01 Thread Tim Roberts
Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Wed, 31 Oct 2007 22:48:12 -0700, Carl Banks wrote: > >>> I hope you're not serious that $# would make a good operator. >> >> If you happen to know where I borrowed it from, it would be pretty >> evident that I wasn't being serious. > >Ooh, now I'm cu

Re: Need some help...

2007-11-01 Thread Gabriel Genellina
En Thu, 01 Nov 2007 20:12:52 -0300, Ricardo Aráoz <[EMAIL PROTECTED]> escribió: >> def sumToOneDigit(num) : >>> if num < 10 : >>> return num >>> else : >>> return sumToOneDigit(sum(int(i) for i in str(num))) >>> def sumToOneDigit(num): return num % 9 or

Adding GNU Readline after installation?

2007-11-01 Thread [EMAIL PROTECTED]
I compiled Python from source on a bunch of my development machines without enabling the readline modules. Is it possible to add readline support after installation? I really just want to get my "up arrow" history working... -- http://mail.python.org/mailman/listinfo/python-list

Re: raw_input() and utf-8 formatted chars

2007-11-01 Thread 7stud
On Oct 13, 12:42 pm, MRAB <[EMAIL PROTECTED]> wrote: > You can > decode that into the actual UTF-8 string with decode("string_escape"): > > s = raw_input('Enter: ') #A\xcc\x88 > s = s.decode("string_escape") > Ahh. Thanks for that. >On Oct 12, 2:43 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECT

os.readlink returning value

2007-11-01 Thread Giampaolo Rodola'
I was reading os.readlink doc which says: readlink( path) Return a string representing the path to which the symbolic link points. The result may be either an absolute or relative pathname; if it is relative, it may be converted to an absolute pathname using os.path.join(os.path.dirname(path), re

Re: ValueError: invalid \x escape

2007-11-01 Thread J. Cliff Dyer
crybaby wrote: > I wrote a python code in linux text pad and copied to thumb drive and > try to ran the file by changing the path to windows: > > sys.path = sys.path + ['D:\Python24\Lib\site-packages\mycode] > > I get the following error: > > ValueError: invalid \x escape > > I am pretty sure this

trapping DLL import issues without blocking pop up window

2007-11-01 Thread alf
Hi, there is following issue: "import cx_Oracle" on windows pops up a nice 'DLL missing' window in case there indeed is no CLI.DLL (or something like that). Then the exception is raised. Catching the exception is obviously not a problem, but the popup practically blocks the application and

ValueError: invalid \x escape

2007-11-01 Thread crybaby
I wrote a python code in linux text pad and copied to thumb drive and try to ran the file by changing the path to windows: sys.path = sys.path + ['D:\Python24\Lib\site-packages\mycode] I get the following error: ValueError: invalid \x escape I am pretty sure this problem is due some kind of lin

Re: PyCheck for a classes defined in python and user data in PyObject_HEAD

2007-11-01 Thread sndive
On Nov 1, 4:14 pm, [EMAIL PROTECTED] wrote: > q#1: > in C I want to check if a given PyObject is a xml.dom.minidom.Node (or > a derivative). > how do i extract a PyTypeObject for such a class? nevermind, i found an instance object that will work for me as long as i figure out where is the document

Re: Is it possible to use a instance property as a default value ?

2007-11-01 Thread George Sakkis
On Nov 1, 4:55 pm, stef mientki <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > On Nov 1, 2007 3:18 PM, stef mientki <[EMAIL PROTECTED]> wrote: > > >> hello, > > >> I would like to use instance parameters as a default value, like this: > > >> class PlotCanvas(wx.Window): > >> def __init__(

Re: (MAC) CoreGraphics module???

2007-11-01 Thread Robert Kern
David C. Ullrich wrote: > Running OS X 10.4 "Tiger". Various references > by Apple and others say that there exists a > module that gives Quartz bindings, allowing > all sort of graphics things in Python. > > Sure enough, after installing Xcode I have > some sample scripts. They all start with >

Re: PyQt with embedded python in Qt App

2007-11-01 Thread Diez B. Roggisch
Bart. schrieb: > Thursday 01 of November 2007 23:32:02 Phil Thompson napisał(a): >> On Thursday 01 November 2007, Bart. wrote: >>> Thursday 01 of November 2007 15:13:55 Phil Thompson napisał(a): On Thursday 01 November 2007, cgrebeld wrote: > Is it possible for a Qt C++ application, which

(MAC) CoreGraphics module???

2007-11-01 Thread David C. Ullrich
Running OS X 10.4 "Tiger". Various references by Apple and others say that there exists a module that gives Quartz bindings, allowing all sort of graphics things in Python. Sure enough, after installing Xcode I have some sample scripts. They all start with from CoreGraphics import * (as do all t

Re: help on dictionary

2007-11-01 Thread Paul Hankin
On Nov 1, 11:21 pm, cesco <[EMAIL PROTECTED]> wrote: > Hi, > > I have a defaultdict which I have initialized as follows: > > def train(features): > model = collections.defaultdict(lambda: 1) > for f in features: > model[f] += 1 > return model > > def_dict = train(large_set_of_wo

Re: XML document causes pickle to go into infinite recursion

2007-11-01 Thread Paul Boddie
On 1 Nov, 22:25, Orest Kozyar <[EMAIL PROTECTED]> wrote: > > > I'm working on a CGI script that pulls XML data from a public database > > > Ah, I missed that bit on first read. Consider using something different than > > CGI here if you want to do caching. FCGI would allow you to do in-memory > > c

Re: to sum a list in a dictonary

2007-11-01 Thread Gabriel Genellina
En Thu, 01 Nov 2007 12:10:55 -0300, Beema shafreen <[EMAIL PROTECTED]> escribió: > dd = {} > dd2 ={} > probes = list(enumerate((i.split('\t')[2],i.split('\t')[3], > i.split('\t')[4])for > i in open('final_lenght_probe_span'))) Ouch... Can you actually understand what goes on the above line? It'

help on dictionary

2007-11-01 Thread cesco
Hi, I have a defaultdict which I have initialized as follows: def train(features): model = collections.defaultdict(lambda: 1) for f in features: model[f] += 1 return model def_dict = train(large_set_of_words) where large_set_of_words is the list of possible strings. I'd lik

Re: Need some help...

2007-11-01 Thread Ricardo Aráoz
Boris Borcic wrote: > Ricardo Aráoz wrote: >> Boris Borcic wrote: >>> [EMAIL PROTECTED] wrote: I want to create a program that I type in a word. for example... chaos each letter equals a number A=1 B=20 and so on. So Chaos w

Re: PyQt with embedded python in Qt App

2007-11-01 Thread Bart.
Thursday 01 of November 2007 23:32:02 Phil Thompson napisał(a): > On Thursday 01 November 2007, Bart. wrote: > > Thursday 01 of November 2007 15:13:55 Phil Thompson napisał(a): > > > On Thursday 01 November 2007, cgrebeld wrote: > > > > Is it possible for a Qt C++ application, which embeds the pyth

Re: setting and getting column in numpymatrix

2007-11-01 Thread Boris Borcic
[EMAIL PROTECTED] wrote: > hi > i am looking for an efficient way to get a specific column of a > numpy.matrix .. > also i want to set a column of the matrix with a given set of > values ..i couldn't find any methods for this in matrix doc..do i have > to write the functions from scratch? > >

Re: PyQt with embedded python in Qt App

2007-11-01 Thread Phil Thompson
On Thursday 01 November 2007, Bart. wrote: > Thursday 01 of November 2007 15:13:55 Phil Thompson napisał(a): > > On Thursday 01 November 2007, cgrebeld wrote: > > > Is it possible for a Qt C++ application, which embeds the python > > > interpreter, to import and use PyQt? There can be only one > >

Re: PyQt with embedded python in Qt App

2007-11-01 Thread Bart.
Thursday 01 of November 2007 15:13:55 Phil Thompson napisał(a): > On Thursday 01 November 2007, cgrebeld wrote: > > Is it possible for a Qt C++ application, which embeds the python > > interpreter, to import and use PyQt? There can be only one > > QApplication, which is created in the C++ side, so

PyCheck for a classes defined in python and user data in PyObject_HEAD

2007-11-01 Thread sndive
q#1: in C I want to check if a given PyObject is a xml.dom.minidom.Node (or a derivative). how do i extract a PyTypeObject for such a class? issue #2 I'm in a situation when i don't really need to extend python with any classes of my own but i do have extra luggage for the python data structures s

Re: marshal vs pickle

2007-11-01 Thread Jean-Paul Calderone
On Thu, 01 Nov 2007 21:15:06 -, Aaron Watters <[EMAIL PROTECTED]> wrote: >On Nov 1, 4:59 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On Thu, 01 Nov 2007 20:35:15 -, Aaron Watters <[EMAIL PROTECTED]> wrote: >> >On Nov 1, 2:15 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >> >> O

Re: XML document causes pickle to go into infinite recursion

2007-11-01 Thread Orest Kozyar
> > I'm working on a CGI script that pulls XML data from a public database > > Ah, I missed that bit on first read. Consider using something different than > CGI here if you want to do caching. FCGI would allow you to do in-memory > caching, for example, as would mod_python and a lot of other solut

Re: Syntax coloring in Python interpreter

2007-11-01 Thread Neil Cerutti
On 2007-11-01, Chris Mellon <[EMAIL PROTECTED]> wrote: > On Nov 1, 2007 3:01 PM, Neil Cerutti <[EMAIL PROTECTED]> wrote: >> On 2007-11-01, Lee Capps <[EMAIL PROTECTED]> wrote: >> > >> > On Nov 1, 2007, at 1:45 PM, braver wrote: >> >> Greetings -- as a long time user of both Python and Ruby >> >> in

Re: XML document causes pickle to go into infinite recursion

2007-11-01 Thread Orest Kozyar
> minidom creates a pretty complete tree data structure, with loads of backlinks > to parent elements etc. That's where your circular references come from. > > I don't know why you want to use pickle here (and not serialised XML or the > plain in-memory tree), but if memory consumption is an issue

Re: marshal vs pickle

2007-11-01 Thread Aaron Watters
On Nov 1, 4:59 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Thu, 01 Nov 2007 20:35:15 -, Aaron Watters <[EMAIL PROTECTED]> wrote: > >On Nov 1, 2:15 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > >> On Nov 1, 4:45 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > > >> > Marshal is mo

Re: How python writes text into another windows application

2007-11-01 Thread Meitham
Thank you all for your kind answers. I was going to use just shell.SendKeys("fu bar"), but as your answers suggested pywinauto is a ready framework that covers all I need. I wanted to play some politics with TNT, but I'm new in the company and my manager won't listen :). Meitham Wolfgang Draxing

Re: python at command prompt

2007-11-01 Thread Matimus
On Nov 1, 9:58 am, [EMAIL PROTECTED] wrote: > [snip] > > > Sounds like your path isn't set correctly. See the first section > > here[1] on "Finding python.exe" > > > -tkc > > > [1]http://www.imladris.com/Scripts/PythonForWindows.html > > Thanks Tim, > I set the pythonpath to where the python inter

Re: marshal vs pickle

2007-11-01 Thread Jean-Paul Calderone
On Thu, 01 Nov 2007 20:35:15 -, Aaron Watters <[EMAIL PROTECTED]> wrote: >On Nov 1, 2:15 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >> On Nov 1, 4:45 am, Aaron Watters <[EMAIL PROTECTED]> wrote: >> >> > Marshal is more secure than pickle >> >> "More" or "less" make little sense in a secur

Re: Is it possible to use a instance property as a default value ?

2007-11-01 Thread stef mientki
Chris Mellon wrote: > On Nov 1, 2007 3:18 PM, stef mientki <[EMAIL PROTECTED]> wrote: > >> hello, >> >> I would like to use instance parameters as a default value, like this: >> >> class PlotCanvas(wx.Window): >> def __init__(self) >> self.Buf_rp = 0 >> self.Buf_wp = 0 >> >>

Re: just a crazy question

2007-11-01 Thread Jonathan Gardner
On Nov 1, 7:16 am, Robert LaMarca <[EMAIL PROTECTED]> wrote: > So.. how is Python for memory management? ... > Terrible. If you have a memory-intensive application, use ASM (perhaps C), not Python (or any other high-level language for that matter.) > My plan is to try measuring the memory usage

Re: shelve.open() and error 22: invalid argument

2007-11-01 Thread Jonathan Gardner
On Nov 1, 1:08 pm, [EMAIL PROTECTED] wrote: > Hi everyone > > I've come across the following problem: on two different linux > machines, both running python 2.5 (r25:51908), I have the same file > 'd.dat'. The md5 checksums are the same. > > Now, on one machine the following code works > > >>> impo

Re: marshal vs pickle

2007-11-01 Thread Aaron Watters
On Nov 1, 2:15 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > On Nov 1, 4:45 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > Marshal is more secure than pickle > > "More" or "less" make little sense in a security context which > typically is an all or nothing affair. Neither module is desig

Re: Is it possible to use a instance property as a default value ?

2007-11-01 Thread Chris Mellon
On Nov 1, 2007 3:18 PM, stef mientki <[EMAIL PROTECTED]> wrote: > hello, > > I would like to use instance parameters as a default value, like this: > > class PlotCanvas(wx.Window): > def __init__(self) > self.Buf_rp = 0 > self.Buf_wp = 0 > > def Draw ( self, x1 = self.Buf_rp

Is it possible to use a instance property as a default value ?

2007-11-01 Thread stef mientki
hello, I would like to use instance parameters as a default value, like this: class PlotCanvas(wx.Window): def __init__(self) self.Buf_rp = 0 self.Buf_wp = 0 def Draw ( self, x1 = self.Buf_rp, x2 = self.Buf_wp ) : is something like this possible ? thanks, Stef Mientki -

Re: Syntax coloring in Python interpreter

2007-11-01 Thread Chris Mellon
On Nov 1, 2007 3:01 PM, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-11-01, Lee Capps <[EMAIL PROTECTED]> wrote: > > > > On Nov 1, 2007, at 1:45 PM, braver wrote: > >> Greetings -- as a long time user of both Python and Ruby > >> interpreters, I got used to the latter's syntax-coloring gem, >

shelve.open() and error 22: invalid argument

2007-11-01 Thread max . aginaga
Hi everyone I've come across the following problem: on two different linux machines, both running python 2.5 (r25:51908), I have the same file 'd.dat'. The md5 checksums are the same. Now, on one machine the following code works >>> import shelve >>> d=shelve.open('d.dat') >>> while on the othe

Re: Syntax coloring in Python interpreter

2007-11-01 Thread Neil Cerutti
On 2007-11-01, Lee Capps <[EMAIL PROTECTED]> wrote: > > On Nov 1, 2007, at 1:45 PM, braver wrote: >> Greetings -- as a long time user of both Python and Ruby >> interpreters, I got used to the latter's syntax-coloring gem, >> wirble, which colorizes Ruby syntax on the fly. Is there >> anything sim

Strange problem when using re module with threads

2007-11-01 Thread Wei Lee Woon
Dear all I've been getting a rather strange problem with the following multithreaded code (reduced to the minimum which still results in the problem): import threading import re class hey(threading.Thread): def run(self): print re.compile("\d+").search("hey95you").group(); thlist=[]

Re: python at command prompt

2007-11-01 Thread kyosohma
On Nov 1, 1:23 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > >> [1]http://www.imladris.com/Scripts/PythonForWindows.html > > > I set the pythonpath to where the python interpreter is located C: > > \Python24 > > However I still get the same error message. Is there something else > > that must be confi

Re: Dictionary help

2007-11-01 Thread Steve
On Thu, 01 Nov 2007 04:16:10 -0700, wes weston wrote: > Steve wrote: >> I'm currently working on a little database type program is which I'm >> using a dictionary to store the information. The key is a component a >> and the definition is a list of parts that make up the component. My >> problem i

setting and getting column in numpymatrix

2007-11-01 Thread [EMAIL PROTECTED]
hi i am looking for an efficient way to get a specific column of a numpy.matrix .. also i want to set a column of the matrix with a given set of values ..i couldn't find any methods for this in matrix doc..do i have to write the functions from scratch? TIA dn -- http://mail.python.org/mailma

Re: marshal vs pickle

2007-11-01 Thread Raymond Hettinger
On Nov 1, 4:45 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > Marshal is more secure than pickle "More" or "less" make little sense in a security context which typically is an all or nothing affair. Neither module is designed for security. From the docs for marshal: ''' Warning: The marshal mod

Re: python at command prompt

2007-11-01 Thread Tim Chase
>> [1]http://www.imladris.com/Scripts/PythonForWindows.html > > I set the pythonpath to where the python interpreter is located C: > \Python24 > However I still get the same error message. Is there something else > that must be configured? Make sure you're setting your PATH, not your PYTHONPATH v

Re: python at command prompt

2007-11-01 Thread Mark Elston
* [EMAIL PROTECTED] wrote (on 11/1/2007 9:58 AM): > [snip] >> Sounds like your path isn't set correctly. See the first section >> here[1] on "Finding python.exe" >> >> -tkc >> >> [1]http://www.imladris.com/Scripts/PythonForWindows.html > > Thanks Tim, > I set the pythonpath to where the python in

Re: Syntax coloring in Python interpreter

2007-11-01 Thread Lee Capps
On Nov 1, 2007, at 1:45 PM, braver wrote: > Greetings -- as a long time user of both Python and Ruby interpreters, > I got used to the latter's syntax-coloring gem, wirble, which > colorizes Ruby syntax on the fly. Is there anything similar for > Python? > I believe IPython can do this: http:/

Re: C extension question

2007-11-01 Thread Matimus
On Nov 1, 7:07 am, [EMAIL PROTECTED] wrote: > I am currently trying to port some Python and Python C extension code > to C#, and am having trouble understanding what is happening in a > piece of the code. > > The pertinent pieces of code are below, and my question follows the > snippets: > > in foo

Syntax coloring in Python interpreter

2007-11-01 Thread braver
Greetings -- as a long time user of both Python and Ruby interpreters, I got used to the latter's syntax-coloring gem, wirble, which colorizes Ruby syntax on the fly. Is there anything similar for Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: serving html from a python script in IE

2007-11-01 Thread bluegray
> If you take out the space between text/html and ; it works just fine. > > (In other words, there is no mime-type "text/html ") Thanks! That did it. What a difference a space makes ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: serving html from a python script in IE

2007-11-01 Thread J. Cliff Dyer
bluegray wrote: > I'm writing a script that outputs html. It works fine in Firefox, > however, IE wants to download the file instead of displaying the > output. I keep getting the file download dialog instead of the html > page. > > I am doing something like this: > > print 'Content-Type: text/html

Re: serving html from a python script in IE

2007-11-01 Thread Richard Brodie
"bluegray" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > print "Content-Type: application/xhtml+xml That's your problem. You can't use that Mime type because IE doesn't support XHMTL. No "appendix C" hair splitting comments, please. -- http://mail.python.org/mailman/listinfo

Re: AOP and pep 246

2007-11-01 Thread Michele Simionato
On Nov 1, 4:18 pm, "Rustom Mody" <[EMAIL PROTECTED]> wrote: > I am interested in AOP in python. From here one naturally (or > google-ly) reaches peak. > But peak seems to be discontinued. > Whereas pep-246 on adaptors seems to be rejected in favor of something else. > > What?? > > Can someone plea

Re: choose from a list

2007-11-01 Thread [EMAIL PROTECTED]
On Nov 1, 11:54 am, barronmo <[EMAIL PROTECTED]> wrote: > This is really remarkable. My previous experience with programming > was in VB for Applications; doing the same thing seemed much more > complicated. This little function is only about 15 lines of code and > it forms the basis for my entir

Re: python at command prompt

2007-11-01 Thread c3950ig
[snip] > Sounds like your path isn't set correctly. See the first section > here[1] on "Finding python.exe" > > -tkc > > [1]http://www.imladris.com/Scripts/PythonForWindows.html Thanks Tim, I set the pythonpath to where the python interpreter is located C: \Python24 However I still get the same e

Re: serving html from a python script in IE

2007-11-01 Thread bluegray
Yes, I have all the necessary shebang and imports. As I said, the script works fine in Firefox. It's something specific to IE that is the problem. The following is a test script that also causes IE to download instead of displaying the page. It works fine elsewhere. I also did some searching, and p

Re: choose from a list

2007-11-01 Thread barronmo
This is really remarkable. My previous experience with programming was in VB for Applications; doing the same thing seemed much more complicated. This little function is only about 15 lines of code and it forms the basis for my entire application. With a few simple modifications I'll be able to

Re: AOP and pep 246

2007-11-01 Thread Kay Schluehr
On 1 Nov., 16:18, "Rustom Mody" <[EMAIL PROTECTED]> wrote: > I am interested in AOP in python. From here one naturally (or > google-ly) reaches peak. > But peak seems to be discontinued. > Whereas pep-246 on adaptors seems to be rejected in favor of something else. > > What?? > > Can someone pleas

Re: How can I have one element list or tuple?

2007-11-01 Thread Steven D'Aprano
On Thu, 01 Nov 2007 09:21:40 -0700, nico wrote: > The following example returns a string type, but I need a tuple... var = ("Hello") print type(var) > > > I need that for a method parameter. > Thx It is the comma, not the brackets, that create tuples. The brackets are recommended fo

Re: How can I have one element list or tuple?

2007-11-01 Thread Neil Cerutti
On 2007-11-01, nico <[EMAIL PROTECTED]> wrote: > The following example returns a string type, but I need a tuple... var = ("Hello") print type(var) > > > I need that for a method parameter. var = "hello", -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: python at command prompt

2007-11-01 Thread Tim Chase
> D:\>python > 'python' is not recognized as an internal or external command, > operable program or batch file. [snip] > For some strange reason, python is not recognized at the command > prompt. Sounds like your path isn't set correctly. See the first section here[1] on "Finding python.exe" -t

How can I have one element list or tuple?

2007-11-01 Thread nico
The following example returns a string type, but I need a tuple... >>> var = ("Hello") >>> print type(var) I need that for a method parameter. Thx -- http://mail.python.org/mailman/listinfo/python-list

python at command prompt

2007-11-01 Thread c3950ig
Hi, I am python newbie and the command prompt is having an issue with python. I installed python 2.4.4 onto my windows machine, opened a command prompt window, and typed python to start the interactive mode. Got the following error. D:\>python 'python' is not recognized as an internal or external

Re: serving html from a python script in IE

2007-11-01 Thread kyosohma
On Nov 1, 9:52 am, bluegray <[EMAIL PROTECTED]> wrote: > I'm writing a script that outputs html. It works fine in Firefox, > however, IE wants to download the file instead of displaying the > output. I keep getting the file download dialog instead of the html > page. > > I am doing something like t

Re: attaching someconfusing results in webbrowser.open on gnulinux

2007-11-01 Thread Sion Arrowsmith
krishnakant Mane <[EMAIL PROTECTED]> wrote: > when I give webbrowser.open("file:///home/krishna/documents/tut.html") >on python prompt I get true as return value but web browser (firefox ) >opens with page not found. >and the address bar shows the following address which indeed is wrong. >file:///h

AOP and pep 246

2007-11-01 Thread Rustom Mody
I am interested in AOP in python. From here one naturally (or google-ly) reaches peak. But peak seems to be discontinued. Whereas pep-246 on adaptors seems to be rejected in favor of something else. What?? Can someone please throw some light on whats the current state of the art? -- http://mail

Re: to sum a list in a dictonary

2007-11-01 Thread Beema shafreen
hi everybody ,i have tried with the improving my code like this but i face the problem since i am not able to concatenate the str, lis.. but if i donot use none i wont get the respective list i require... is there any solution to this dd = {} dd2 ={} probes = list(enumerate((i.split('\t')[2]

Re: A Python 3000 Question

2007-11-01 Thread J. Cliff Dyer
Steven D'Aprano wrote: > On Wed, 31 Oct 2007 22:48:12 -0700, Carl Banks wrote: > > >>> I hope you're not serious that $# would make a good operator. >>> >> If you happen to know where I borrowed it from, it would be pretty >> evident that I wasn't being serious. >> > > Ooh, now I'm c

Re: Print a list to a string?

2007-11-01 Thread mrstephengross
> >>> import cStringIO > >>> s = cStringIO.StringIO() > >>> print >>s, [1, 2, 1.0/5, 'hello world'] > >>> s.getvalue() Thanks--this works perfectly! -_Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Need some help...

2007-11-01 Thread Boris Borcic
Ricardo Aráoz wrote: > Boris Borcic wrote: >> [EMAIL PROTECTED] wrote: >>> I want to create a program that I type in a word. >>> >>> for example... >>> >>> chaos >>> >>> each letter equals a number >>> >>> A=1 >>> B=20 >>> >>> and so on. >>> >>> So Chaos would be >>> >>> C=13 H=4 A=1 O=7 S=5 >

serving html from a python script in IE

2007-11-01 Thread bluegray
I'm writing a script that outputs html. It works fine in Firefox, however, IE wants to download the file instead of displaying the output. I keep getting the file download dialog instead of the html page. I am doing something like this: print 'Content-Type: text/html ; charset=utf-8\nCache-Contro

to sum a list in a dictonary

2007-11-01 Thread Beema shafreen
hi everybody, I need to sum a list in dictionary... my script, d = {} probes = list(enumerate((i.split('\t')[2],i.split('\t')[3], i.split('\t')[4])for i in open('final_lenght_probe_span'))) for idx, (probe_id, span, length) in probes: try : l = [span,l

Re: python in academics?

2007-11-01 Thread Charles Allen
sandipm: > seeing posts from students on group. I am curious to know, Do they > teach python in academic courses in universities? Bruce Sherwood and Ruth Chabay have an introductory physics text that uses python for getting students doing computer simulation and visualization very "early" compared

  1   2   >