Re: problem with hot shot stats

2006-10-10 Thread Monu
But I couldn't find any way to get lineevents in cProfile On Oct 11, 3:49 am, "Klaas" <[EMAIL PROTECTED]> wrote: > Monu wrote: > > HI All, > > I am getting problem in usinghotshotprofiler. > > When Ihotshotwith lineevents=0, it works fine, > > but when I use lineevents=1, I get error in stats<> >

Re: Python component model

2006-10-10 Thread Kay Schluehr
Hendrik van Rooyen wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > Nick Vatamaniuc wrote: > > > > > At the same time one could claim that Python already has certain > > > policies that makes it seem as if it has a component model. > 8<---

Re: elementsoap with Python 2.5

2006-10-10 Thread Fredrik Lundh
Steven Bethard wrote: > I was trying to get elementsoap_ working with just xml.etree from Python > 2.5 (and no standalone elementtree installation). I think I got > everything working by changing the imports and copying in the > FancyTreeBuilder class (since only TreeBuilder and XMLTreeBuilder

Re: Difference between unindexable and unsubscriptable

2006-10-10 Thread Theerasak Photha
On 10/11/06, Ben Finney <[EMAIL PROTECTED]> wrote: > > I'm trying to learn about style conventions in Python. How would use > > of getattr compare? > > I'm having trouble knowing what you need explained. > > You have available to you an interactive Python interpreter, and the > documentation. Can

Re: sufficiently pythonic code for testing type of function

2006-10-10 Thread Theerasak Photha
On 10/11/06, Ben Finney <[EMAIL PROTECTED]> wrote: > "Theerasak Photha" <[EMAIL PROTECTED]> writes: > > > On 10/11/06, Ben Finney <[EMAIL PROTECTED]> wrote: > > > Why have you re-implemented (a less-functional version of) 'isinstance'? > > > > Ignorance, I think. But the issue is resolved now. Than

Re: sufficiently pythonic code for testing type of function

2006-10-10 Thread Theerasak Photha
On 10/11/06, Ben Finney <[EMAIL PROTECTED]> wrote: > "Theerasak Photha" <[EMAIL PROTECTED]> writes: > Far better is to take the objects passed, *use* them in the way that > you need to use them, and catch exceptions that get raised at the > point where there is enough context to handle them. This

Re: sufficiently pythonic code for testing type of function

2006-10-10 Thread Ben Finney
"Theerasak Photha" <[EMAIL PROTECTED]> writes: > On 10/11/06, Ben Finney <[EMAIL PROTECTED]> wrote: > > Why have you re-implemented (a less-functional version of) 'isinstance'? > > Ignorance, I think. But the issue is resolved now. Thank you. Hopefully it is also merely ignorance that leads you t

Re: How to find number of characters in a unicode string?

2006-10-10 Thread Theerasak Photha
On 10 Oct 2006 22:50:21 -0700, Leo Kislov <[EMAIL PROTECTED]> wrote: > If python ever provide this functionality it would be I guess > u"C\u0327".width() == 1. But it's not clear when unicode.org will > provide recommended fixed font character width information for *all* > characters. I recently s

Re: sufficiently pythonic code for testing type of function

2006-10-10 Thread Ben Finney
"Theerasak Photha" <[EMAIL PROTECTED]> writes: > I wrote this for someone else to take an object and list of types, > then check if obj is one of those types, raising an error otherwise. This is a way of programming known as "Look Before You Leap" (LBYL). It is most likely a mistake to do this in

Re: sufficiently pythonic code for testing type of function

2006-10-10 Thread John Machin
Theerasak Photha wrote: > I wrote this for someone else to take an object and list of types, > then check if obj is one of those types, raising an error otherwise. > > Is it enough to rely on side effects or absence thereof, or should I > put return True in here somewhere? > > def test_obj_type(obj

Re: Difference between unindexable and unsubscriptable

2006-10-10 Thread Ben Finney
"Theerasak Photha" <[EMAIL PROTECTED]> writes: > On 10/11/06, Ben Finney <[EMAIL PROTECTED]> wrote: > > Jackson <[EMAIL PROTECTED]> writes: > > > > > I would like to test if an object can accept: obj[0] > > > > Then do so. Use the object in the way you want to use it, and catch > > any exception

Re: How to find number of characters in a unicode string?

2006-10-10 Thread Leo Kislov
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Marc 'BlackJack' > Rintsch wrote: > > > In <[EMAIL PROTECTED]>, > > Preben Randhol wrote: > > > >> Is there a way to calculate in characters > >> and not in bytes to represent the characters. > > > > Decode the byte string and use `len()

Re: sufficiently pythonic code for testing type of function

2006-10-10 Thread Theerasak Photha
On 10/11/06, Ben Finney <[EMAIL PROTECTED]> wrote: > Why have you re-implemented (a less-functional version of) 'isinstance'? Ignorance, I think. But the issue is resolved now. Thank you. http://www.stanford.edu/~spqrsyc/crew/crew%20-%20ignorance.gif "It's amazing how much easier it is for a te

Re: Difference between unindexable and unsubscriptable

2006-10-10 Thread Theerasak Photha
On 10/11/06, Ben Finney <[EMAIL PROTECTED]> wrote: > Jackson <[EMAIL PROTECTED]> writes: > > > I would like to test if an object can accept: obj[0] > > Then do so. Use the object in the way you want to use it, and catch > any exceptions that you want to handle. I'm trying to learn about style co

Re: sufficiently pythonic code for testing type of function

2006-10-10 Thread Ben Finney
"Theerasak Photha" <[EMAIL PROTECTED]> writes: > I wrote this for someone else to take an object and list of types, > then check if obj is one of those types, raising an error otherwise. > > Is it enough to rely on side effects or absence thereof, or should I > put return True in here somewhere? >

Re: Difference between unindexable and unsubscriptable

2006-10-10 Thread Ben Finney
Jackson <[EMAIL PROTECTED]> writes: > I would like to test if an object can accept: obj[0] Then do so. Use the object in the way you want to use it, and catch any exceptions that you want to handle. > >>> from sets import Set > >>> Set([1,2])[0] > TypeError: unindexable object > > >>> 3[0]

Re: Difference between unindexable and unsubscriptable

2006-10-10 Thread Fredrik Lundh
Jackson wrote: > What is the difference between "object is unindexable" and "object is > unsubscriptable"? > > I would like to test if an object can accept: obj[0] > > >>> from sets import Set > >>> Set([1,2])[0] > TypeError: unindexable object > > >>> 3[0] > TypeError: unsubscriptable ob

Re: OT: Sarcasm and irony

2006-10-10 Thread [EMAIL PROTECTED]
Grant Edwards wrote: > On 2006-10-10, Steve Holden <[EMAIL PROTECTED]> wrote: > > >> probably point out that I am writing from Denmark and was thinking > >> specifically of a situation where a dane told me they were being > >> 'ironic' (when what they meant, obviously, was that they were being > >

Re: Everything is a distributed object

2006-10-10 Thread Martin Drautzburg
Steve Holden wrote: > Unfortunately the overhead of supporting distribution is way too high to > want to invoke it between two objects living in the same process. Well I was thinking along the lines of "object" and "proxy-object" where a proxy object is a handle to a remote object. Sending a pro

Re: OT: Sarcasm and irony

2006-10-10 Thread Ben Finney
Grant Edwards <[EMAIL PROTECTED]> writes: > Sarcasm is a form of irony. Irony is when what is meant is > different from the obvious literal meaning of the statement. Irony need not have anything to do with the meaning and intent of the speaker. Indeed, irony can occur when there is no communicat

Re: sufficiently pythonic code for testing type of function

2006-10-10 Thread Fredrik Lundh
Theerasak Photha wrote: > I wrote this for someone else to take an object and list of types, > then check if obj is one of those types, raising an error otherwise. note that a call to your function is pretty much equivalent to assert isinstance(obj, types) which has the additional advan

Re: Is a list static when it's a class member?

2006-10-10 Thread Fredrik Lundh
Tom Plunket wrote: >> if you want separate instances to use separate objects, make sure you >> create new objects for each new instance. see Tim's reply for how to >> do that. > > kath's response is probably better. so what's the practical difference between def __init__(self, name):

Re: Python component model

2006-10-10 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Nick Vatamaniuc wrote: > > > At the same time one could claim that Python already has certain > > policies that makes it seem as if it has a component model. 8< > implementing

sufficiently pythonic code for testing type of function

2006-10-10 Thread Theerasak Photha
I wrote this for someone else to take an object and list of types, then check if obj is one of those types, raising an error otherwise. Is it enough to rely on side effects or absence thereof, or should I put return True in here somewhere? def test_obj_type(obj, types): for type in types: i

Re: Problem compiling C++ code with python embedded

2006-10-10 Thread Martin v. Löwis
vduber6er schrieb: > g++ -Wall ibdws.cpp ../cgic205/cgic.c -oibdws.cgi -Lcgraph > -lcgraph -Icgraph/Cgraph/source -I../cgic205 -L../cgic205 > -I/usr/include/python2.2 -L/usr/lib > /python2.2/site-packages -lpython2.2 > > but i get the following error when i build now: > > /usr/bin/ld: can

Re: People's names (was Re: sqlite3 error)

2006-10-10 Thread Leo Kislov
John J. Lee wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > [...] > > > There would also need to be a flag field to indicate the canonical > > > ordering > > > for writing out the full name: e.g. family-name-first, given-names-first. > > > Do we need something else for the Vietnamese case? > >

Re: Can't get around "IndexError: list index out of range"

2006-10-10 Thread MonkeeSage
On Oct 10, 1:57 am, Steve Holden <[EMAIL PROTECTED]> wrote: > I think we'll just have to agree to differ in this repsecrt, as I don't > see your suggestions for extending the sequence API as particularly > helpful. No worries. :) On Oct 10, 11:22 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > s

Re: OT: Sarcasm and irony

2006-10-10 Thread Theerasak Photha
On 10/11/06, Grant Edwards <[EMAIL PROTECTED]> wrote: > Like Alanis Morisette said about the song "Isn't it Ironic": > What's ironic about the song is that it doesn't actually > contain any irony. OH!! IT'S TEH 'META-IRONY'!! ZOMG!!! -- Theerasak -- http://mail.python.org/mailman/listinfo/pytho

Re: Funky file contents when os.rename or os.remove are interrupted

2006-10-10 Thread Martin v. Löwis
Russell Warren schrieb: > Any insight from someone with knowledge of the internal operations of > os.remove and/or os.rename would be greatly appreciated, although I > expect the crux may be at the os level and not in python. Just to confirm what others have said: Python has nothing to do with tha

Difference between unindexable and unsubscriptable

2006-10-10 Thread Jackson
What is the difference between "object is unindexable" and "object is unsubscriptable"? I would like to test if an object can accept: obj[0] >>> from sets import Set >>> Set([1,2])[0] TypeError: unindexable object >>> 3[0] TypeError: unsubscriptable object It seems like each of these erro

Re: does raw_input() return unicode?

2006-10-10 Thread Martin v. Löwis
Theerasak Photha schrieb: > The other way around: would urwid use raw_input() or other Python > input functions anywhere? Since I still don't know what urwid is, I can't answer the question. It should be easy enough to grep its source code to find out whether it ever uses raw_input. > And what ca

Re: does raw_input() return unicode?

2006-10-10 Thread Leo Kislov
Duncan Booth wrote: > "Stuart McGraw" <[EMAIL PROTECTED]> wrote: > > > So, does raw_input() ever return unicode objects and if > > so, under what conditions? > > > It returns unicode if reading from sys.stdin returns unicode. > > Unfortunately, I can't tell you how to make sys.stdin return unicode

Re: does raw_input() return unicode?

2006-10-10 Thread Leo Kislov
Theerasak Photha wrote: > On 10/10/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Theerasak Photha schrieb: > > >> At the moment, it only returns unicode objects when invoked > > >> in the IDLE shell, and only if the character entered cannot > > >> be represented in the locale's charset. > >

Re: OT: Sarcasm and irony

2006-10-10 Thread Grant Edwards
On 2006-10-10, Steve Holden <[EMAIL PROTECTED]> wrote: >> probably point out that I am writing from Denmark and was thinking >> specifically of a situation where a dane told me they were being >> 'ironic' (when what they meant, obviously, was that they were being >> ironical), when I asked what th

Re: Subclassing built-in classes

2006-10-10 Thread Theerasak Photha
On 10/9/06, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Saturday 7/10/2006 04:35, hanumizzle wrote: > > > > >As the first post said "...couldn't python (in theory)...", I > > was discussing > > > >if it would be possible for python (in some future version) to manage the > > > >literals so tha

Get everything you need for a successful Marketing Campaign Today!

2006-10-10 Thread dinesh
Get everything you need for a successful Marketing Campaign Today! Marketing Software - Promotion Center - Guaranteed Visitors - Guaranteed Signups Solo Emails - 1 Million Opt In Leads - Banner ads - Website Submission and Lots More http://www.typeinternational.com/idevaffiliate/idevaffiliate.ph

Re: Python component model

2006-10-10 Thread Ilias Lazaridis
Robert Kern wrote: > Edward Diener No Spam wrote: ... > >> You'll definitely want to take a look at Enthought's Traits (disclaimer: > >> I work for Enthought). I'm supposed to be on vacation now, so I'm not > >> going to give you the full rundown of Traits and Traits UI, so I'm > >> simply going t

Get everything you need for a successful Marketing Campaign Today!

2006-10-10 Thread dinesh
Get everything you need for a successful Marketing Campaign Today! Marketing Software - Promotion Center - Guaranteed Visitors - Guaranteed Signups Solo Emails - 1 Million Opt In Leads - Banner ads - Website Submission and Lots More http://www.typeinternational.com/idevaffiliate/idevaffiliate.ph

Re: Python component model

2006-10-10 Thread Ilias Lazaridis
Peter Maas wrote: > Bruno Desthuilliers schrieb: > > Marc 'BlackJack' Rintsch wrote: > > (snip) > > Python itself is a RAD tool. > > > > +1 QOTW > > No, please stop self-assuring, self-pleasing QOTWs! This afternoon > I was in the local book warehouse and went to the computer book > departme

Re: Format a number as currency! I can't find any help on this simple problem.

2006-10-10 Thread Ben Finney
Richard Kessler <[EMAIL PROTECTED]> writes: > I am relatively new to Python. Love it, but I find things that I > can do easily in .NET and cannot find a way to do in Python. I need > to format a number as currency, for example 12343.56 to $12,343.56. > > In C# all I need to do is decimal x = 1234

Re: Python 2.5 "make install" bug?

2006-10-10 Thread Theerasak Photha
On 10/10/06, Yang Zhang <[EMAIL PROTECTED]> wrote: > All the site-packages/*.so files get copied to the directory specified > in my ~/.pydistutils.cfg instead of lib-dynload under the prefix dir, > then proceeds to chmod 755 all the files in that directory (including > ones that existed before inst

Re: Dive Into Java?

2006-10-10 Thread Theerasak Photha
On 10/10/06, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 10 Oct 2006 03:16:25 -0400, "Theerasak Photha" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > BTW, love the Anglo-Saxon nickname. > > > The usage started with an old AD&D character, then got po

Python 2.5 "make install" bug?

2006-10-10 Thread Yang Zhang
All the site-packages/*.so files get copied to the directory specified in my ~/.pydistutils.cfg instead of lib-dynload under the prefix dir, then proceeds to chmod 755 all the files in that directory (including ones that existed before install). Please advise. -- http://mail.python.org/mailman/lis

Re: Format a number as currency! I can't find any help on this simple problem.

2006-10-10 Thread Bernard
>>> import locale >>> locale.setlocale(locale.LC_ALL, 'English_United States.1252') 'English_United States.1252' >>> conv = locale.localeconv() >>> x = 1234567.8 >>> locale.format("%d", x, grouping=True) '1,234,567' >>> locale.format("%s%.*f", (conv['currency_symbol'], conv['int_frac_digits'], >>>

Re: operator overloading + - / * = etc...

2006-10-10 Thread Leif K-Brooks
Paul Rubin wrote: > The symbols on the left side of = signs are called variables even in > Haskell, where they don't "vary" (you can't change the value of a > variable once you have set it). FWIW, that's the original, mathematical meaning of the word 'variable'. They _do_ vary, but only when you

How to write Smart Python programs?

2006-10-10 Thread Raj
Hi, We just executed a project with Python using TG. The feedback was to use more python like programming rather than C style code executed in Python. The feedback is from a Python purist and for some reasons we cannot solicity his help. So we'd like to do is to scrub through the codebase and ide

Format a number as currency! I can't find any help on this simple problem.

2006-10-10 Thread Richard Kessler
I am relatively new to Python. Love it, but I find things that I can do easily in .NET and cannot find a way to do in Python. I need to format a number as currency, for example 12343.56 to $12,343.56. In C# all I need to do is decimal x = 12343.56 then x.ToString("$###,###.00"); I cannot find

elementsoap with Python 2.5

2006-10-10 Thread Steven Bethard
I was trying to get elementsoap_ working with just xml.etree from Python 2.5 (and no standalone elementtree installation). I think I got everything working by changing the imports and copying in the FancyTreeBuilder class (since only TreeBuilder and XMLTreeBuilder are in the xml.etree.ElementT

Re: 3D Vector Type Line-Drawing Program

2006-10-10 Thread Ron Adam
Scott David Daniels wrote: > James Stroud wrote: >>> I'm looking for a program to do line-drawings in 3d, with output to >>> postscript or svg or pdf, etc. I would like to describe a scene with >>> certain 1-3d elements oriented in 3d space with dashed or colored >>> lines and filled or transpar

Re: People's names

2006-10-10 Thread Theerasak Photha
On 10/10/06, Piet van Oostrum <[EMAIL PROTECTED]> wrote: > > Roel Schroeven <[EMAIL PROTECTED]> (RS) wrote: > > >RS> It's the same here in Belgium. Except that our Van is with a capital V in > >RS> most cases; if it's a lower v it either indicates nobility or a Dutch > >name. > > >RS> I don't

Re: OT: Sarcasm and irony

2006-10-10 Thread Theerasak Photha
On 10/10/06, Georg Brandl <[EMAIL PROTECTED]> wrote: > Let me tell you: There are times when I'm really glad that as a German, I'm > not supposed to possess any sense of humour at all. hehe. That's so not true. -- "Know thyself? If I knew my self, I would run." -- Goethe -- http://mail.python.o

Re: does raw_input() return unicode?

2006-10-10 Thread Theerasak Photha
On 10/10/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Theerasak Photha schrieb: > >> At the moment, it only returns unicode objects when invoked > >> in the IDLE shell, and only if the character entered cannot > >> be represented in the locale's charset. > > > > Why only IDLE? Does urwid or a

Re: How to share session with IE

2006-10-10 Thread Cameron Walsh
I just thought, your original question was whether or not it was possible to share your browser session with IE. Unless you do this explicitly, you may require a different login for your Python program and for your IE user. If the Python program does not get the same cookie as used by IE, or

Re: How to share session with IE

2006-10-10 Thread Cameron Walsh
John J. Lee wrote: > "Bernard" <[EMAIL PROTECTED]> writes: >> zdp wrote: > [...] >>> However, now I need to process some pages by a python program. When I >>> use urllib.urlopen(theurl), I can only get a page which told me I need >>> login. I think It's reasonable, becuase I wasn't in a loggined se

Re: Is a list static when it's a class member?

2006-10-10 Thread Tom Plunket
Fredrik Lundh wrote: > if you want separate instances to use separate objects, make sure you > create new objects for each new instance. see Tim's reply for how to > do that. kath's response is probably better. In Python, you don't define the instance members in the class scope like the OP has

Re: C++ to Python?

2006-10-10 Thread Tom Plunket
Roman Yakovenko wrote: > you want to find some kind of "translator" > > C++ code: >std::cout << 1; > translator output: >print 1 > > Am I right? If so, I am pretty sure that such "translator" does not > exist - too complex. ...however such a "refactor" is easy for a human to do. What t

Re: (semi-troll): Is Jython development dead?

2006-10-10 Thread Ray
Steve Menard wrote: > Keep in mind that Ruby and Python are close enough in style, that any > improvements those guys make will also benifit Jython. This is perhaps true in the long run, in the sense that it may make it easier for someone to implement Jython because those guys will make the JVM mo

Re: 3D Vector Type Line-Drawing Program

2006-10-10 Thread Mike C. Fletcher
James Stroud wrote: > James Stroud wrote: > >> Hello All, >> >> I'm looking for a program to do line-drawings in 3d, with output to >> postscript or svg or pdf, etc. I would like to describe a scene with >> certain 1-3d elements oriented in 3d space with dashed or colored lines >> and filled

Re: Is a list static when it's a class member?

2006-10-10 Thread Ben Finney
"glue" <[EMAIL PROTECTED]> writes: > I have a class with a list member and the list seems to behave like > it's static while other class members don't. It's not "static"; rather, it's a class attribute, by virtue of being bound when the class is defined. Those are shared by all instances of the c

Re: OT: Sarcasm and irony

2006-10-10 Thread Ben Finney
Georg Brandl <[EMAIL PROTECTED]> writes: > Let me tell you: There are times when I'm really glad that as a > German, I'm not supposed to possess any sense of humour at all. +1 QOTW -- \ "I doubt, therefore I might be." -- Anonymous | `\

Problem compiling C++ code with python embedded

2006-10-10 Thread vduber6er
Hello, I just recently switched my code from one server to another and now having some problems compiling my code. I was able to compile fine with my last server now but this current one is giving me problems. My build file is as follows g++ -Wall ibdws.cpp ../cgic205/cgic.c -oibdws.cgi -Lcgrap

Re: default variable in python $_

2006-10-10 Thread bearophileHUGS
rh0dium: > This is where $_ in perl is awesome - There must be a default variable > in python right? A default variable may add bugs to your code, and newbies of the language may see it coming from air, so Python avoids such things. The only Python "default variable" I know of is the _ that when u

Re: Python component model

2006-10-10 Thread Peter Maas
Bruno Desthuilliers schrieb: > Marc 'BlackJack' Rintsch wrote: > (snip) > Python itself is a RAD tool. > > +1 QOTW No, please stop self-assuring, self-pleasing QOTWs! This afternoon I was in the local book warehouse and went to the computer book department. They had banned 2-3 Python books

Re: MP3 files and Python...

2006-10-10 Thread Max Erickson
Karlo Lozovina <[EMAIL PROTECTED]> wrote: > I'm looking for a Python lib which can read and _write_ ID3v1 and > ID3v2 tags, and as well read as much as possible data from MP3 > file (size, bitrate, samplerate, etc...). > > MP3 reproduction is of no importance... > Try mutagen: http://www.sacre

Re: (semi-troll): Is Jython development dead?

2006-10-10 Thread Steve Menard
"Walter S. Leipold" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John Roth ([EMAIL PROTECTED]) wrote: >> I've had a couple of inquiries about Jython support >> in PyFIT, and I've had to say that it simply isn't >> supported. The latest point release requires Python >> 2.3, and 2.

Re: Adding Worksheets to an Excel Workbook

2006-10-10 Thread greg.rb
# here is a simple script: from win32com.client import Dispatch xlApp = Dispatch("Excel.Application") xlApp.Visible=1 #show me excel xlApp.Workbooks.Add() #add a workbook for r in range(1,5): #put data into spreadsheet row/column xlApp.Cells(r,r).Value=r for r in range(1,5): #read data from

Re: [ANN] argparse 0.1 - Command-line parsing library

2006-10-10 Thread Steven Bethard
Steven Bethard wrote: > Announcing argparse 0.1 > --- > > argparse home: > http://argparse.python-hosting.com/ > > argparse at PyPI: > http://www.python.org/pypi/argparse/0.1.0 > > argparse module download: > http://argparse.python-hosting.com/file/trunk/argparse.py?format

Re: does raw_input() return unicode?

2006-10-10 Thread Stuart McGraw
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Stuart McGraw schrieb: > > So, does raw_input() ever return unicode objects and if > > so, under what conditions? > > At the moment, it only returns unicode objects when invoked > in the IDLE shell, and only if the cha

Re: problem with hot shot stats

2006-10-10 Thread Klaas
Monu wrote: > HI All, > I am getting problem in using hotshot profiler. > When I hotshot with lineevents=0, it works fine, > but when I use lineevents=1, I get error in stats <> > Can anybody help to figure out the problem please? hotshot has never reached production-ready stability, imo. Use th

Re: OT: Sarcasm and irony

2006-10-10 Thread Brian van den Broek
bryan rasmussen said unto the world upon 10/10/06 08:25 AM: > As was noted in my original statement the weak form of irony such as > understood by Danes and I suppose by Americans as well, since that is > what Steve was originally complaining about, is descended from the > concept of Dramatic Ir

Re: Adding Worksheets to an Excel Workbook

2006-10-10 Thread Mark Elston
I expect this doesn't help him much. I get the impression he is looking more for a recipe. Just doing a Google search of python + excel I got the following which make some good starting points: http://www.markcarter.me.uk/computing/python/excel.html http://mail.python.org/pipermail/python-list/2

MP3 files and Python...

2006-10-10 Thread Karlo Lozovina
I'm looking for a Python lib which can read and _write_ ID3v1 and ID3v2 tags, and as well read as much as possible data from MP3 file (size, bitrate, samplerate, etc...). MP3 reproduction is of no importance... -- ___Karlo Lozovina - Mosor | | |

Re: default variable in python $_

2006-10-10 Thread Georg Brandl
rh0dium wrote: > Hi all, > > So I have this simple little routine.. say like this.. > > > def foo() >return {"a":"b", "b":"c"} > > if foo(): >print "Have foo" > > > Now I want the dictionary item a (ie. b) > > How can I do it the above way or do I still have to go like this.. > > d

Re: A problem about File path encode

2006-10-10 Thread Gabriel G
At Tuesday 10/10/2006 11:32, Kevien Lee wrote: I agree with the problem caue of the the escape character,but when i folllow these meth,it still didn't work. Explain "didn't work". A full traceback would be useful. It is so strang that the code work on another computer (OS is WinXP),but throw

Motions.

2006-10-10 Thread Dr. Pastor
Hi: I would like to track the motions of small birds in short (20-30sec) .avi films. What tool-set/programs would be wise to use? Thanks for any guidance. == Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News== http://www.newsfeeds.com The #1 Newsgroup Service in the Wor

default variable in python $_

2006-10-10 Thread rh0dium
Hi all, So I have this simple little routine.. say like this.. def foo() return {"a":"b", "b":"c"} if foo(): print "Have foo" Now I want the dictionary item a (ie. b) How can I do it the above way or do I still have to go like this.. def foo() return {"a":"b", "b":"c"} z = foo()

Re: Python component model

2006-10-10 Thread Edward Diener No Spam
Fredrik Lundh wrote: > fumanchu wrote: > >>> 4) Custom property and component editors: A component editor can present >>> a property editor or an editor for an entire component which the visual >>> design-time RAD environment can use to allow the programmer end-user of >>> the component to set or

Re: Adding Worksheets to an Excel Workbook

2006-10-10 Thread John Machin
[EMAIL PROTECTED] wrote: > All > > I'm a Python newbie, and I'm just getting to the wonders of COM > programming. I am trying to programmatically do the following: > > 1. Activate Excel > 2. Add a Workbook > 3. Add a Worksheet > 4. Populate the new Worksheet > 5. Repeat steps 3,4 while there

Re: Python component model

2006-10-10 Thread Edward Diener No Spam
Kay Schluehr wrote: > fumanchu wrote: > >>> 4) Custom property and component editors: A component editor can present >>> a property editor or an editor for an entire component which the visual >>> design-time RAD environment can use to allow the programmer end-user of >>> the component to set or g

Re: Python component model

2006-10-10 Thread Georg Brandl
Bruno Desthuilliers wrote: > Marc 'BlackJack' Rintsch wrote: > (snip) > Python itself is a RAD tool. > > +1 QOTW > Agreed. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Sarcasm and irony

2006-10-10 Thread Georg Brandl
Steve Holden wrote: >> is that 'in America' meant to be an addendum to what I said, as in >> this is the situation in America and not elsewhere? If so I should >> probably point out that I am writing from Denmark and was thinking >> specifically of a situation where a dane told me they were be

Re: C++ to Python?

2006-10-10 Thread Roman Yakovenko
On 10/10/06, Frank Martinez <[EMAIL PROTECTED]> wrote: > Hi, Roman. > Thanks. I seem a bit confused. Does Py++ actually convert the C++ code to > Python or does it just provide a wrapper to C++ code? A second one. Now when I read your mail one more time, I think I was wrong, because you want to

Re: Python component model

2006-10-10 Thread Fredrik Lundh
Edward Diener No Spam wrote: > I agree and I would want to have a component event model for Python that > is much superior to the JavaBeans event model in ease of use. isn't that an old Perlis quote? "I want a component event model in which I need only say what I wish done"? -- http://mail

Re: what is this UnicodeDecodeError:....?

2006-10-10 Thread John Machin
Marc 'BlackJack' Rintsch wrote: > Because you are trying to compare a unicode string `val` with a byte > string in the list. The unicode string will be converted to a byte string > for this comparison with the default encoding: ASCII. :-) I presume you must live north of the equator. Down under

Re: Python component model

2006-10-10 Thread Edward Diener No Spam
fumanchu wrote: > Edward Diener No Spam wrote: >> OK, here is my idea of what such a component model envisages as a list >> of items. After this, unless I get some intelligent comments from people >> who might be interested in what I envision, or something very similar, I >> will be off to investig

Re: Python component model

2006-10-10 Thread Edward Diener No Spam
Paul Boddie wrote: > [EMAIL PROTECTED] wrote: >> Edward> My OP was just to query whether a component model existed for >> Edward> Python, like JavaBeans for Java or .Net for C#, C++/CLI >> Edward> etc. >> >> For those of us who've never used Java, .Net or C++/CLI, a more concrete >> description of

Re: what is this UnicodeDecodeError:....?

2006-10-10 Thread John Machin
kath wrote: > I have a number of excel files. In each file DATE is represented by > different name. I want to read the date from those different file. Also > the date is in different column in different file. > > To identify the date field in different files I have created a file > called _globals

Re: C++ to Python?

2006-10-10 Thread Frank Martinez
Hi, Roman. Thanks.  I seem a bit confused.  Does Py++ actually convert the C++ code to Python or does it just provide a wrapper to C++ code? You say tomater, I zader matermorts. -- Coach Z, Homestarrunner.com On Oct 10, 2006, at 3:55 PM, Roman Yakovenko wrote:On 10/10/06, Frank Martinez <[EMAIL PRO

Adding Worksheets to an Excel Workbook

2006-10-10 Thread e . h . doxtator
All I'm a Python newbie, and I'm just getting to the wonders of COM programming. I am trying to programmatically do the following: 1. Activate Excel 2. Add a Workbook 3. Add a Worksheet 4. Populate the new Worksheet 5. Repeat steps 3,4 while there is data. How do you add a Worksheet to a W

Re: what is this UnicodeDecodeError:....?

2006-10-10 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, kath wrote: > To identify the date field in different files I have created a file > called _globals where I keep all aliases for DATE in a array called > 'alias_DATE'. > > Array alias_DATE looks like, > > alias_DATE=['TRADEDATE', 'Accounting Date', 'Date de VL','Datum', >

Re: C++ to Python?

2006-10-10 Thread Roman Yakovenko
On 10/10/06, Frank Martinez <[EMAIL PROTECTED]> wrote: > Hi, Everybody! > Does anyone know of a cpp2py type application? Without going into details, > I need to port a bunch of C++ code to Python. Any such > converter/information would be helpful. > Thanks. Take a look on Py++( http://language

C++ to Python?

2006-10-10 Thread Frank Martinez
Hi, Everybody! Does anyone know of a cpp2py type application?  Without going into details, I need to port a bunch of C++ code to Python.  Any such converter/information would be helpful. Thanks. Hi, my name is Ray and, on Yesterday, my Daughter called me. -- A man named 'Ray'. -- http://mail.pytho

Re: Python component model

2006-10-10 Thread Peter Maas
Diez B. Roggisch wrote: > The amazing flexibility stems from the fact that it is _runtime_. This is > _exactly_ the difference between static and dynamic typing. Not _exactly_. You can have static typing in an interpreted language (Java) and dynamic typing in a machine language (Basic with variant

Re: Converting MSWord Docs to PDF

2006-10-10 Thread Andrew McLean
Steve Holden wrote: > If that *isn't* satisfactory then a modest investment in Adobe > Acrobat/Distiller plus the use of Python's scripting facilities to > direct the conversion would be preferable to spending a huge amount of > time writing a hand-crafted solution. An alternative to Adobe Dist

ANN: Leo 4.4.2 beta 2 released

2006-10-10 Thread Edward K. Ream
Leo 4.4.2 beta 2 October 9, 2006 Leo 4.4.2 beta 2 is available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.htm

Re: Is a list static when it's a class member?

2006-10-10 Thread Fredrik Lundh
glue wrote: > I have a class with a list member and the list seems to behave like > it's static while other class members don't. The code... *all* class attributes are shared by all instances. however, instance attributes hide class attributes with the same name. in your case, you're hiding th

Re: Is a list static when it's a class member?

2006-10-10 Thread kath
glue wrote: > I have a class with a list member and the list seems to behave like > it's static while other class members don't. The code... > > class A: > name = "" > data = [] > def __init__(self, name): > self.name = name > def append(self, info): > self.data.appe

Re: Funky file contents when os.rename or os.remove are interrupted

2006-10-10 Thread hg
Russell Warren wrote: > I've got a case where I'm seeing text files that are either all null > characters, or are trailed with nulls due to interrupted file access > resulting from an electrical power interruption on the WinXP pc. > > In tracking it down, it seems that what is being interrupted is

Re: Funky file contents when os.rename or os.remove are interrupted

2006-10-10 Thread Sybren Stuvel
Russell Warren enlightened us with: > On first pass I would think that both of those calls are single step > operations (removing/changing an entry in the FAT, or FAT-like > thing, on the HDD) and wouldn't result in an intermediate, > null-populated, step, but the evidence seems to indicate I'm > w

Re: Python component model

2006-10-10 Thread Fredrik Lundh
fumanchu wrote: >> 4) Custom property and component editors: A component editor can present >> a property editor or an editor for an entire component which the visual >> design-time RAD environment can use to allow the programmer end-user of >> the component to set or get component property values

  1   2   3   >