Re: dynamically generating temporary files through python/cgi (ot)

2007-11-01 Thread Hendrik van Rooyen
Miss Pfeffe wrote: >How do you make a python out of a banana?! You kiss it just long enough - else it turns into a frog, so be careful! -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Jython?

2007-11-01 Thread Ant
On Nov 1, 6:54 am, [EMAIL PROTECTED] wrote: ... > I would like to know more about Python and Jython? > What is the difference between both of them? > What is the future for Jython and which are the areas where it is > used? Jython is an implementation of Python for the Java VM. Currently it stands

Re: XML DOM, but in chunks

2007-11-01 Thread Stefan Behnel
Tommy Nordgren wrote: >> On 31 okt 2007, at 21.24, Sean Davis wrote: >> >>> I have some very large XML files that are basically recordsets. I >>> would like to access each record, one-at-a-time, and I particularly >>> like the ElementTree library for accessing the data. Is there a way >>> to have

Re: What is Jython?

2007-11-01 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hello .. > > I would like to know more about Python and Jython? > What is the difference between both of them? > What is the future for Jython and which are the areas where it is > used? Bad google day? http://www.jython.org/ """ What is Jython? Jython, lest y

Re: XML document causes pickle to go into infinite recursion

2007-11-01 Thread Stefan Behnel
Orest Kozyar wrote: > I'm working on a CGI script that pulls XML data from a public database > (Medline) and caches this data using shelveleto minimize load on the > database. In general, the script works quite well, but keeps crashing > every time I try to pickle a particular XML document. Below

attaching someconfusing results in webbrowser.open on gnulinux

2007-11-01 Thread krishnakant Mane
hello all, I had mentioned previously that I can't open html files in python. I have my username as krishna and there is a documents folder. so 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 pa

Re: XML document causes pickle to go into infinite recursion

2007-11-01 Thread Stefan Behnel
Orest Kozyar 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 caching, for example, as would mod_python and a lot of

Re: permuting over nested dicts?

2007-11-01 Thread Anand
On Oct 31, 10:21 pm, Christian Meesters <[EMAIL PROTECTED]> wrote: > Hoi, > > I have the following data structure (of variable size actually, to make > things simple, just that one): > d = {'a': {'x':[1,2,3], 'y':[4,5,6]}, > 'b': {'x':[7,8,9], 'y':[10,11,12]}} > This can be read as a dict of p

Any free python module acts like "Image Processing Toolbox" in matlab?

2007-11-01 Thread oyster
as the title says, and thanx. for example, that is the help on cpselect(input, base) starts the Control Point Selection Tool ( www.mathworks.com/access/helpdesk/help/toolbox/images/cpselect.html) -- http://mail.python.org/mailman/listinfo/python-list

Re: setting variables in outer functions

2007-11-01 Thread Hrvoje Niksic
Duncan Booth <[EMAIL PROTECTED]> writes: > In real life code methods are used to implement callbacks When I said "closures are used ...", I wasn't trying to be preachy about how I think callbacks should be implemented, just explaining the use (and usefulness) of *closures*. I'm not saying closur

Re: attaching someconfusing results in webbrowser.open on gnulinux

2007-11-01 Thread D.Hering
krishnakant Mane wrote: > hello all, > I had mentioned previously that I can't open html files in python. > I have my username as krishna and there is a documents folder. > so when I give webbrowser.open("file:///home/krishna/documents/tut.html") > on python prompt I get true as return value but w

Re: Method needed for skipping lines

2007-11-01 Thread Gustaf
Yu-Xi Lim wrote: > David Mertz's Text Processing in Python might give you some more > efficient (and interesting) ways of approaching the problem. > > http://gnosis.cx/TPiP/ Thank you for the link. Looks like a great resource. Gustaf -- http://mail.python.org/mailman/listinfo/python-list

Re: setting variables in outer functions

2007-11-01 Thread Duncan Booth
Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > In real-life code, closures are used to implement callbacks with > automatic access to their lexical environment without the need for the > bogus additional "void *" argument one so often sees in C callbacks, > and without communication through global var

Re: permuting over nested dicts?

2007-11-01 Thread Anand
On Nov 1, 2:12 pm, Anand <[EMAIL PROTECTED]> wrote: > On Oct 31, 10:21 pm, Christian Meesters <[EMAIL PROTECTED]> wrote: > > > > > Hoi, > > > I have the following data structure (of variable size actually, to make > > things simple, just that one): > > d = {'a': {'x':[1,2,3], 'y':[4,5,6]}, > >

Iterable Flattener with Depth.

2007-11-01 Thread Pradeep Jindal
Hi, 5 minute solution to one of my requirements. I wanted to flatten iterables upto a specific depth. To be true, didn't search for it on the internet prior to writing this one. def flatten_iter(my_iter, depth=None): """my_iter can be a iterable except string containing nested it

Re: permuting over nested dicts?

2007-11-01 Thread Ant
On Nov 1, 9:12 am, Anand <[EMAIL PROTECTED]> wrote: ... > This code works for dictionaries of any nested level. At least up to the max recursion depth. -- Ant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Method needed for skipping lines

2007-11-01 Thread Gustaf
Bruno Desthuilliers wrote: > Here's a straightforward solution: Thank you. I learned several things from that. :-) Gustaf -- http://mail.python.org/mailman/listinfo/python-list

Re: permuting over nested dicts?

2007-11-01 Thread Christian Meesters
Thanks everyone, I knew there must be a snippet somewhere, just couldn't find one! (Just for the sake of completeness: Order doesn't matter and I hope that with my data I won't reach the recursion depth limit.) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary help

2007-11-01 Thread wes weston
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 > is I need to list out several components, but not all, and

Re: setting variables in outer functions

2007-11-01 Thread Dustan
On Oct 31, 5:59 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Oct 31, 2007 5:49 PM, Dustan <[EMAIL PROTECTED]> wrote: [snip] I'm not going to respond to any of this, but I'm just going to say: I'm not claiming that the use of closures is common. I'm just claiming that it can be useful. I have

Re: What is Jython?

2007-11-01 Thread Ze'ev
On Nov 1, 10:37 am, Ant <[EMAIL PROTECTED]> wrote: > On Nov 1, 6:54 am, [EMAIL PROTECTED] wrote: > ... > > > I would like to know more about Python and Jython? > > What is the difference between both of them? > > What is the future for Jython and which are the areas where it is > > used? > > Jython

Which persistence is for me?

2007-11-01 Thread Neal Becker
I need to organize the results of some experiments. Seems some sort of database is in order. I just took a look at DBAPI and the new sqlite interface in python2.5. I have no experience with sql. I am repulsed by e.g.: c.execute("""insert into stocks values ('2006-01-05','BUY','RHAT',1

Re: marshal vs pickle

2007-11-01 Thread Aaron Watters
On Nov 1, 12:04 am, Paul Rubin wrote: > Raymond Hettinger <[EMAIL PROTECTED]> writes: > > ''' This is not a general "persistence" module. For general > > persistence and transfer of Python objects through RPC calls, see > > the modules :mod:`pickle` and :mod:`shelve`. >

Re: Which persistence is for me?

2007-11-01 Thread Jean-Paul Calderone
On Thu, 01 Nov 2007 07:47:25 -0400, Neal Becker <[EMAIL PROTECTED]> wrote: >I need to organize the results of some experiments. Seems some sort of >database is in order. > >I just took a look at DBAPI and the new sqlite interface in python2.5. I >have no experience with sql. I am repulsed by e.g

Re: Iterable Flattener with Depth.

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

Re: Which persistence is for me?

2007-11-01 Thread Amit Khemka
On 11/1/07, Neal Becker <[EMAIL PROTECTED]> wrote: > I need to organize the results of some experiments. Seems some sort of > database is in order. > > I just took a look at DBAPI and the new sqlite interface in python2.5. I > have no experience with sql. I am repulsed by e.g.: > c.execute("""in

Re: attaching someconfusing results in webbrowser.open on gnulinux

2007-11-01 Thread J. Cliff Dyer
krishnakant Mane wrote: > hello all, > I had mentioned previously that I can't open html files in python. > I have my username as krishna and there is a documents folder. > so when I give webbrowser.open("file:///home/krishna/documents/tut.html") > on python prompt I get true as return value but we

Re: Which persistence is for me?

2007-11-01 Thread Joe Riopel
This might be worth a look: http://www.sqlalchemy.org/docs/04/ormtutorial.html -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe (or other exe builder) on Vista system for Vista/XP install targets.

2007-11-01 Thread kyosohma
On Oct 31, 7:08 am, Michael <[EMAIL PROTECTED]> wrote: > I'm trying to build a exe on a vista system using py2exe. It will > deploy to vista and XP systems. If it matters, the application uses > pyserial, as well. I have VS Studio 2005 installed on this laptop as > well. I've found this so far that

Re: What is Jython?

2007-11-01 Thread Ant
On Nov 1, 11:37 am, Ze'ev <[EMAIL PROTECTED]> wrote: ... > ...> Jython is currently significantly slower than Python. > > ... > Not according to this > :http://blogs.warwick.ac.uk/dwatkins/entry/benchmarking_parallel_pytho... Well I'm damned - I thought that I'd be writing about this being a para

Re: Which persistence is for me?

2007-11-01 Thread Giles Brown
On 1 Nov, 11:47, Neal Becker <[EMAIL PROTECTED]> wrote: > I need to organize the results of some experiments. Seems some sort of > database is in order. > > I just took a look at DBAPI and the new sqlite interface in python2.5. I > have no experience with sql. I am repulsed by e.g.: > c.execute(

PyQt with embedded python in Qt App

2007-11-01 Thread cgrebeld
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 how would I use that from the python side? -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Jython?

2007-11-01 Thread Ant
On Nov 1, 1:23 pm, Ant <[EMAIL PROTECTED]> wrote: > On Nov 1, 11:37 am, Ze'ev <[EMAIL PROTECTED]> wrote: > ... > > > ...> Jython is currently significantly slower than Python. > > > ... > > Not according to this > > :http://blogs.warwick.ac.uk/dwatkins/entry/benchmarking_parallel_pytho... >... > S

source example including the python shell in a wxPython application

2007-11-01 Thread chewie54
Is there an python example that shows how to include a python shell in a wxPython application. I have looked the wxPython demo but I was wondering if there are any others that might be helpful in seeing how to connect the shell into the app and allow scripting so that the shell knows all about th

Re: python in academics?

2007-11-01 Thread Cameron Walsh
sandipm wrote: > seeing posts from students on group. I am curious to know, Do they > teach python in academic courses in universities? > Sydney University teaches user interface design, some data mining and some natural language processing in Python. Software development is still largely a Jav

Re: Which persistence is for me?

2007-11-01 Thread Neal Becker
Neal Becker wrote: > I need to organize the results of some experiments. Seems some sort of > database is in order. > > I just took a look at DBAPI and the new sqlite interface in python2.5. I > have no experience with sql. I am repulsed by e.g.: > c.execute("""insert into stocks > v

Re: source example including the python shell in a wxPython application

2007-11-01 Thread Chris Mellon
On Nov 1, 2007 8:48 AM, chewie54 <[EMAIL PROTECTED]> wrote: > Is there an python example that shows how to include a python shell in > a wxPython application. > > I have looked the wxPython demo but I was wondering if there are any > others that might be helpful in seeing how to connect the shell

C extension question

2007-11-01 Thread chris . cenotti
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.py: (mgrid,xgrid,ygrid,zgrid,ngrids) = IP.CreateGridCel

Re: PyQt with embedded python in Qt App

2007-11-01 Thread Phil Thompson
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 how would I use > that from the python side? QtGui.QApplication.instan

Re: ANN: O'Reilly e-book, "Getting Started with Pyparsing"

2007-11-01 Thread Paul McGuire
On Nov 1, 1:25 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > Several chapter excerpts are available online, including this > chapter on the Zen of Pyparsing:http://preview.tinyurl.com/yp4v48 > Here is a better link: http://my.safaribooksonline.com/9780596514235/what_makes_pyparsing_so_special --

Re: marshal vs pickle

2007-11-01 Thread Aaron Watters
On Oct 31, 6:10 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > On Oct 31, 12:27 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > > Makes more sense to use cPickle and be done with it. > > FWIW, I've updated the docs to be absolutely clear on the subject: > > ''' > This is not a general "persisten

just a crazy question

2007-11-01 Thread Robert LaMarca
Hi all.. Was planning to use Python (maybe C later) to mock parallel processing project.. About to put together a set of computers for this.. Wondered if anyone had any knowledge or ideas about using a playstation running linux? My first impressions are that it is interesting.. for $400, one

Re: A Python 3000 Question

2007-11-01 Thread Steven D'Aprano
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 curious. -- Steven. -- http://mail.python.org/mail

Re: setting variables in outer functions

2007-11-01 Thread Neil Cerutti
On 2007-11-01, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Duncan Booth <[EMAIL PROTECTED]> writes: > >> In real life code methods are used to implement callbacks > > When I said "closures are used ...", I wasn't trying to be > preachy about how I think callbacks should be implemented, just > explai

Re: urllib.getproxies and PAC

2007-11-01 Thread Duncan Booth
gooli <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using urllib to get html pages from the web but my computer is > behind a proxy. > > The proxy is automatically configured in Internet Explorer via a > proxy.pac file (http://en.wikipedia.org/wiki/Proxy_auto-config). > >>From what I can see in the

Re: permuting over nested dicts?

2007-11-01 Thread Boris Borcic
Christian Meesters wrote: > Hoi, > > I have the following data structure (of variable size actually, to make > things simple, just that one): > d = {'a': {'x':[1,2,3], 'y':[4,5,6]}, > 'b': {'x':[7,8,9], 'y':[10,11,12]}} > This can be read as a dict of possibilities: The entities 'a' and 'b' h

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

urllib.getproxies and PAC

2007-11-01 Thread gooli
Hi, I'm using urllib to get html pages from the web but my computer is behind a proxy. The proxy is automatically configured in Internet Explorer via a proxy.pac file (http://en.wikipedia.org/wiki/Proxy_auto-config). >From what I can see in the urllib source it only handles proxies that are manu

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

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

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 >

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1   2   >