Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread Ray
Robert Kern wrote: > You might be. No one else in the thread is. What are you saying? That my perception that RoR is mature is wrong? I never even said that was mine. That was what I got from talking to a lot of developers whose main language is neither Python nor Ruby, while I was trying to intro

Re: random writing access to a file in Python

2006-08-28 Thread Claudio Grondi
Dennis Lee Bieber wrote: > On 27 Aug 2006 15:06:07 -0700, Paul Rubin > declaimed the following in comp.lang.python: > > > >>I think that's not so bad, though probably still not optimal. 85 GB >>divided by 18 hours is 1.3 MB/sec, which means if the program is >>reading

Truly platform-independent DB access in Python?

2006-08-28 Thread bobrik
Hello, I am using the Python DB API for access to MySQL. But it is not platform-independent - I need a module not included in Python by default - python-mysql, and it uses a compiled binary _mysql.so. So it is not platform-independent because for each web-server on different platform, I would have

Re: unpaking sequences of unknown length

2006-08-28 Thread Anthra Norell
I get it! >>> def f (*a): print a print zip (a) # My mistake print zip (*a) # Gerard's solution. >>> f (l1, l2, l3) ([1, 2, 3], [4, 5, 6], [7, 5, 34]) # Argument: tuple of lists [([1, 2, 3],), ([4, 5, 6],), ([7, 5, 34],)] # My mistake [(1, 4, 7), (2, 5, 5), (3, 6, 34)] # That's w

Re: time.clock() going backwards??

2006-08-28 Thread Claudio Grondi
Tim Roberts wrote: > "Tim Peters" <[EMAIL PROTECTED]> wrote: > > >>[Giovanni Bajo[ >> I experimented something very strange, a few days ago. I was debugging an application at a customer's site, and the problem turned out to be that time.clock() was going "backwards", that is it was so

Re: Segmentation Fault

2006-08-28 Thread John Machin
pycraze wrote: > I would like to ask a question. How do one handle the exception due to > Segmentation fault due to Python ? This is confusing. A seg fault kills the process immediately. No exception (in the Python sense of that word) is raised. > Our bit operations and arithmetic > manipulations

Re: import function from user defined modules

2006-08-28 Thread Fredrik Lundh
groves wrote: > Can anybody give me an example of how to import a function of module X > in module y. And please if yu can use classes(Object oriented approach) > would be great. > > The problem is that I have created a text on canvas, and now I want > that whenever a user right clicks on it, the

Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread Robert Kern
Ray wrote: > Robert Kern wrote: >> You might be. No one else in the thread is. > > What are you saying? That my perception that RoR is mature is wrong? No, that the part of your message that I quoted was wrong. Specifically, "we're talking of perception here." No one else here is talking about t

Misleading error message when opening a file (on Windows XP SP 2)

2006-08-28 Thread Claudio Grondi
Here an example of what I mean (Python 2.4.2, IDLE 1.1.2, Windows XP SP2, NTFS file system, 80 GByte large file): >>> f = file('veryBigFile.dat','r') >>> f = file('veryBigFile.dat','r+') Traceback (most recent call last): File "", line 1, in -toplevel- f = file('veryBigFile.dat','r+')

Re: Problem of function calls from map()

2006-08-28 Thread Dasn
On Tue, Aug 22, 2006 at 04:50:39PM +0200, Fredrik Lundh wrote: > (you cannot really use "profile" to *benchmark* things written in > Python either; the profiler tells you where a given program spends the > time, not how fast it is in com- parision with other programs) Thanks for your indication.

Re: A problem from a Vim user

2006-08-28 Thread Dasn
On Sun, Aug 27, 2006 at 07:10:06AM -0500, Dasn wrote: > vim.command('let vim_str=input("Please type something.\n")') > py_str = vim.eval('vim_str') py_str = vim.eval('input("Please type something.\n")') may be better. -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you get the name of a dictionary?

2006-08-28 Thread Antoon Pardon
On 2006-08-23, Georg Brandl <[EMAIL PROTECTED]> wrote: > jojoba wrote: >>> And what im saying is that isnt it silly that we need pass an entire >>> namespace, when a much simpler notion would be to have each object know >>> its own name(s) (even if that name doesnt exist). >> >> >> please note:

Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread Andre Meyer
Hi allIt might be interesting to watch the videos about Django and Rails (http://www.djangoproject.com/snakesandrubies/). Django makes a good impression, although I would not agree with all of their arguments (eg. templating language, ajax). Most striking, though, is the difference in attitude! Whi

Re: dictionaries vs. objects

2006-08-28 Thread Steve Holden
Andre Meyer wrote: > Hi all > > I have the following question: I need a representation of a physically > inspired environment. The environment contains a large number of objects > with varying attributes. There may be classes of objects, but there is > not necessarily a strictly defined hierarc

Re: avoiding file corruption

2006-08-28 Thread Cliff Wells
On Sun, 2006-08-27 at 07:51 -0700, Amir Michail wrote: > How often do you need to open a file multiple times for writing? How often do you write code that you don't understand well enough to fix? This issue is clearly a problem within *your* application. I'm curious how you could possibly think

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-28 Thread William James
[EMAIL PROTECTED] wrote: > I would be interested in comments about how Common Lisp, Scheme, and > Haskell deal with the decorate-sort-dedecorate technique. %w(FORTRAN LISP COBOL).sort_by{|s| s.reverse} ==>["COBOL", "FORTRAN", "LISP"] -- Common Lisp did kill Lisp. Period. ... It is to Lisp

Re: Misleading error message when opening a file (on Windows XP SP 2)

2006-08-28 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Claudio Grondi wrote: > > Here an example of what I mean > (Python 2.4.2, IDLE 1.1.2, Windows XP SP2, NTFS file system, 80 GByte > large file): > > >>> f = file('veryBigFile.dat','r') > >>> f = file('veryBigFile.dat','r+') You mention the file size and gave a "speaking

how to get the os file icon for a given content-type?

2006-08-28 Thread neoedmund
any simple method? -- http://mail.python.org/mailman/listinfo/python-list

Re: Segmentation Fault

2006-08-28 Thread Steve Holden
pycraze wrote: > I would like to ask a question. How do one handle the exception due to > Segmentation fault due to Python ? Our bit operations and arithmetic > manipulations are written in C and to some of our testcases we > experiance Segmentation fault from the python libraries. > > If i know

Re: f2py on windows XP - "Unknown Switch"??

2006-08-28 Thread Sile
Cheers John - I did finally getting f2py working on XP using MinGW, GnuFcompiler for F77, and much help! However, having set up everything correctly I have been told in work I now need to use F90. I have downloaded and installed G95 MinGW in my MinGW directory and this isn't working now, I'm not

Re: newbe question about removing items from one file to another file

2006-08-28 Thread [EMAIL PROTECTED]
Anthra Norell wrote: > Eric, >Having played around with problems of this kind for quite some time I find > them challenging even if I don't really have time to > get sidetracked. Your description of the problem makes it all the more > challenging, because its 'expressionist' quality adds the

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-28 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Tom Cole wrote: > In Java, classes can implement the Comparable interface. This interface > contains only one method, a compareTo(Object o) method, and it is > defined to return a value < 0 if the Object is considered less than the > one being passed as an argument, it retu

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread [EMAIL PROTECTED]
bobrik wrote: > I am using the Python DB API for access to MySQL. But it is not > platform-independent - I need a module not included in Python by > default - python-mysql, and it uses a compiled binary _mysql.so. So it > is not platform-independent because for each web-server on different > platfo

Re: Firewire comms using Python?

2006-08-28 Thread PetDragon
yeah man no joy there "Simon Forman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Fraggle69 wrote: >> Hi, >> Does anyone have any idea of how I can use Python to get images from my >> firewire camera?? >> I am using python under winXP pro >> >> Cheers >> Fraggle > > Have you

Re: How to let a loop run for a while before checking for break condition?

2006-08-28 Thread Hendrik van Rooyen
"Claudio Grondi" <[EMAIL PROTECTED]> Wrote: | Fredrik Lundh wrote: | > Diez B. Roggisch wrote: | > | >> A while loop has a condition. period. The only thing to change that is | >> to introduce a uncoditioned loop, and use self-modifying code to make | >> it a while-loop after that timer interrupt

Re: How to let a loop run for a while before checking for breakcondition?

2006-08-28 Thread Hendrik van Rooyen
"Claudio Grondi" <[EMAIL PROTECTED]> wrote: | Diez B. Roggisch wrote: | > Claudio Grondi schrieb: | > | >> | >> Sometimes it is known in advance, that the time spent in a loop will | >> be in order of minutes or even hours, so it makes sense to optimize | >> each element in the loop to make it

Re: Misleading error message when opening a file (on Windows XP SP 2)

2006-08-28 Thread Claudio Grondi
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Claudio Grondi wrote: > > >>Here an example of what I mean >>(Python 2.4.2, IDLE 1.1.2, Windows XP SP2, NTFS file system, 80 GByte >>large file): >> >> >>> f = file('veryBigFile.dat','r') >> >>> f = file('veryBigFile.dat','r+') > > > Yo

Re: Segmentation Fault

2006-08-28 Thread Duncan Booth
pycraze wrote: > I would like to ask a question. How do one handle the exception due to > Segmentation fault due to Python ? Our bit operations and arithmetic > manipulations are written in C and to some of our testcases we > experiance Segmentation fault from the python libraries. > >From what

DirectPython

2006-08-28 Thread J�r�me Le Bougeant
Hello, I have DirectPython 0.5 (http://directpython.sourceforge.net/) and python2.4 (directx9.0C installed). Samples do not work, I have this error : "RuntimeError: Failed to create a device" For example with sampleBasic.py : Traceback (most recent call last): File "sampleBasic.py", line 147,

close event handling for ScrollView

2006-08-28 Thread mail2sirshendu
I have a class in which I have created an instance QScrollView and added a QDialog inside it using addChild().I have Ok and Cancel button in the Dialog.When either Ok or Cancel is clicked the Dialog is closed properly (receiving accept or reject signals). I have a exec loop on the Dialog. When I c

Starting up the server

2006-08-28 Thread john Perry
hi all, how to solve these error Traceback (most recent call last): File "mrsm-start.py", line 2, in import pkg_resources ImportError: No module named pkg_resources please help me thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: f2py on windows XP - "Unknown Switch"??

2006-08-28 Thread John Machin
On 28/08/2006 6:44 PM, Sile wrote: > Cheers John - > > I did finally getting f2py working on XP using MinGW, GnuFcompiler for > F77, and much help! However, having set up everything correctly I have > been told in work I now need to use F90. I have downloaded and > installed G95 MinGW in my MinGW

Re: Starting up the server

2006-08-28 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, john Perry wrote: > how to solve these error > > Traceback (most recent call last): > File "mrsm-start.py", line 2, in > import pkg_resources > ImportError: No module named pkg_resources Install the module `pkg_resources`. SCNR, Marc 'BlackJack' Rintsch --

Re: Misleading error message when opening a file (on Windows XP SP 2)

2006-08-28 Thread Tim Peters
[Claudio Grondi] > Here an example of what I mean > (Python 2.4.2, IDLE 1.1.2, Windows XP SP2, NTFS file system, 80 GByte > large file): > > >>> f = file('veryBigFile.dat','r') > >>> f = file('veryBigFile.dat','r+') > > Traceback (most recent call last): >File "", line 1, in -toplevel- >

Re: how to get the os file icon for a given content-type?

2006-08-28 Thread Bruno Desthuilliers
neoedmund wrote: Please repeat the whole question in the message body =>how to get the os file icon for a given content-type? > any simple method? This is specific to your OS (and FWIW, there's nothing like a "file icon" on the OS I'm using). -- bruno desthuilliers python -c "print '@'.join([

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > bobrik wrote: >> I am using the Python DB API for access to MySQL. But it is not >> platform-independent - I need a module not included in Python by >> default - python-mysql, and it uses a compiled binary _mysql.so. So it >> is not platform-independent because for each w

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread Bruno Desthuilliers
bobrik wrote: > Hello, > > I am using the Python DB API for access to MySQL. But it is not > platform-independent It is. You don't have to change your Python code according to the OS or CPU. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in

Re: Starting up the server

2006-08-28 Thread Fredrik Lundh
"john Perry" wrote: > how to solve these error > > Traceback (most recent call last): > File "mrsm-start.py", line 2, in >import pkg_resources > ImportError: No module named pkg_resources > > please help me thanks what server? what software are you using? -- http://mail.python.org/m

Re: Starting up the server

2006-08-28 Thread john Perry
Fredrik Lundh wrote: > "john Perry" wrote: > > > how to solve these error > > > > Traceback (most recent call last): > > File "mrsm-start.py", line 2, in > >import pkg_resources > > ImportError: No module named pkg_resources > > > > please help me thanks > > what server? what software are y

Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread Bruno Desthuilliers
Ray wrote: (snip) > Sadly, there are more Java guys who know about Ruby than Python, > despite the fact that Python predates Ruby by quite a few years... FWIW, Python is somewhat older than Java too... -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) f

Re: how to get the os file icon for a given content-type?

2006-08-28 Thread neoedmund
So what? Java 5.0 has the method, why python has not? Bruno Desthuilliers wrote: > neoedmund wrote: > Please repeat the whole question in the message body > > =>how to get the os file icon for a given content-type? > > any simple method? > > This is specific to your OS (and FWIW, there's nothing l

Re: Misleading error message when opening a file (on Windows XP SP 2)

2006-08-28 Thread Fredrik Lundh
Tim Peters wrote: > Assuming the file exists and isn't read-only, I bet it's a Windows > bug, and that if you open in binary mode ("r+b") instead I bet it goes > away (this wouldn't be the first large-file text-mode Windows bug). > dir bigfile.dat 2006-08-28 11:46 5 000 000 000 bigfile.dat

Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > First, I don't intend this to be a flame war, please. Then avoid crossposting to both c.l.ruby and c.l.python !-) (BTW, fu2 c.l.python). > Python > and Ruby are the only two languages I'd willingly work in > (at least amongst common languages), and TurboGears and > Rai

Re: how to get the os file icon for a given content-type?

2006-08-28 Thread Fredrik Lundh
"neoedmund" <[EMAIL PROTECTED]> wrote: > So what? Java 5.0 has the method, why python has not? python's developed by volunteers, and nobody has volunteered to develop such a function. why not check how Java does this, and contribute the code ? -- http://mail.python.org/mailman/listinfo/py

Re: Starting up the server

2006-08-28 Thread Fredrik Lundh
"john Perry" wrote: >> what server? what software are you using? > > TurboGears 0.8.9,python 2.53 and using sql server have you checked the TurboGears mailing list archives ? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to let a loop run for a while before checking for break condition?

2006-08-28 Thread Claudio Grondi
Hendrik van Rooyen wrote: > "Claudio Grondi" <[EMAIL PROTECTED]> Wrote: > > | Fredrik Lundh wrote: > | > Diez B. Roggisch wrote: > | > > | >> A while loop has a condition. period. The only thing to change that is > | >> to introduce a uncoditioned loop, and use self-modifying code to make > | >>

Re: Learning Python - Have Question.

2006-08-28 Thread Tal Einat
> Thank you for this. The most daunting task in learning Python, is learning > all of the modules and functions that are available. And there's a tonne > of them. :-) > Actually, much of this file-system related stuff really is badly spread out between many different modules (os, os.path, glob,

Re: Is this a good idea or a waste of time?

2006-08-28 Thread Antoon Pardon
On 2006-08-25, Simon Forman <[EMAIL PROTECTED]> wrote: > asincero wrote: >> Would it be considered good form to begin every method or function with >> a bunch of asserts checking to see if the parameters are of the correct >> type (in addition to seeing if they meet other kinds of precondition >> c

Re: Misleading error message when opening a file (on Windows XP SP 2)

2006-08-28 Thread Claudio Grondi
Tim Peters wrote: > [Claudio Grondi] > >> Here an example of what I mean >> (Python 2.4.2, IDLE 1.1.2, Windows XP SP2, NTFS file system, 80 GByte >> large file): >> >> >>> f = file('veryBigFile.dat','r') >> >>> f = file('veryBigFile.dat','r+') >> >> Traceback (most recent call last): >>File

Re: Misleading error message when opening a file (on Windows XP SP 2)

2006-08-28 Thread Fredrik Lundh
Tim Peters wrote: >> Traceback (most recent call last): >>File "", line 1, in -toplevel- >> f = file('veryBigFile.dat','r+') >> IOError: [Errno 2] No such file or directory: 'veryBigFile.dat' >> >> Is it a BUG or a FEATURE? > > Assuming the file exists and isn't read-only, I bet it's a Wi

when is a != foo.a?

2006-08-28 Thread Chaz Ginger
I am somewhat new to Python (last year). As such I encounter little "gotchas" all the time. I am wondering is someone can explain this to me: If have three simple files: a.py - foo = None def a(b): global foo foo = b b.py -- from a impor

Re: Starting up the server

2006-08-28 Thread john Perry
yes i'll have check it please guide me if i'm wrong thanks Fredrik Lundh wrote: > "john Perry" wrote: > > >> what server? what software are you using? > > > > TurboGears 0.8.9,python 2.53 and using sql server > > have you checked the TurboGears mailing list archives ? > > -- http://mail.pyth

Re: when is a != foo.a?

2006-08-28 Thread Duncan Booth
Chaz Ginger wrote: > Can someone explain what is really going on here? Think of 'from x import y' as an assignment. Roughly equivalent to: y = sys.modules['x'].y (except of course you don't have to have imported sys, and it will load the module 'x' if it hasn't already been imported.) > b.

Re: f2py on windows XP - "Unknown Switch"??

2006-08-28 Thread Sile
Thanks for your reply, Sorry about the last post - pasting from another post didn't work so well... The --version output from my f95 compiler is as follows: C:\>g95 --version G95 (GCC 4.0.3 (g95 0.90!) Aug 22 2006) Copyright (C) 2002-2005 Free Software Foundation, Inc. G95 comes with NO WARRANTY

Re: when is a != foo.a?

2006-08-28 Thread Chaz Ginger
Duncan Booth wrote: > Chaz Ginger wrote: > >> Can someone explain what is really going on here? > > Think of 'from x import y' as an assignment. Roughly equivalent to: > >y = sys.modules['x'].y > > (except of course you don't have to have imported sys, and it will load the > module 'x' if

Re: Middle matching - any Python library functions (besides re)?

2006-08-28 Thread Andrew Robert
Simon Forman wrote: > Paul Rubin wrote: >> "EP" <[EMAIL PROTECTED]> writes: >>> Given that I am looking for matches of all files against all other >>> files (of similar length) is there a better bet than using re.search? >>> The initial application concerns files in the 1,000's, and I could use >>>

Re: when is a != foo.a?

2006-08-28 Thread John Machin
Chaz Ginger wrote: > I am somewhat new to Python (last year). As such I encounter little > "gotchas" all the time. I am wondering is someone can explain this to me: > > If have three simple files: > > a.py - > > foo = None > def a(b): > global foo > foo = b > > b.py

Re: when is a != foo.a?

2006-08-28 Thread Chaz Ginger
John Machin wrote: > Chaz Ginger wrote: >> I am somewhat new to Python (last year). As such I encounter little >> "gotchas" all the time. I am wondering is someone can explain this to me: >> >> If have three simple files: >> >> a.py - >> >> foo = None >> def a(b): >> global

Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread Paul Boddie
Ray wrote: > fuzzylollipop wrote: > > uh, no, Python predates Ruby by a good bit > > Rails might be "older" than Turbogears but it still JUST went 1.0 > > officially. > > It can't be called "mature' by any defintition. Version numbers are a fairly useless general metric of project maturity, taken

Re: Misleading error message when opening a file (on Windows XP SP 2)

2006-08-28 Thread Claudio Grondi
Fredrik Lundh wrote: > Tim Peters wrote: > > >>>Traceback (most recent call last): >>> File "", line 1, in -toplevel- >>> f = file('veryBigFile.dat','r+') >>>IOError: [Errno 2] No such file or directory: 'veryBigFile.dat' >>> >>>Is it a BUG or a FEATURE? >> >>Assuming the file exists and is

Re: Segmentation Fault

2006-08-28 Thread thomas . samson
"Simon Forman" <[EMAIL PROTECTED]> writes: > pycraze wrote: >> I would like to ask a question. How do one handle the exception due to >> Segmentation fault due to Python ? Our bit operations and arithmetic >> manipulations are written in C and to some of our testcases we >> experiance Segmentatio

Re: f2py on windows XP - "Unknown Switch"??

2006-08-28 Thread John Machin
On 28/08/2006 9:47 PM, Sile wrote: > Thanks for your reply, > Sorry about the last post - pasting from another post didn't work so > well... > > The --version output from my f95 compiler is as follows: > > C:\>g95 --version > G95 (GCC 4.0.3 (g95 0.90!) Aug 22 2006) > Copyright (C) 2002-2005 Free

Re: creating multiply arguments for a method.

2006-08-28 Thread noro
John Roth wrote: > noro wrote: > > Hi all, > > > > I use a method that accept multiply arguments ("plot(*args)"). > > so plot([1,2,3,4]) is accepted and plot([1,2,3,4],[5,6,7,8]) is also > > accepted. > > > > the problem is that i know the number of arguments only at runtime. > > Let say that duri

Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread gregarican
As I read in another post on this thread, do some initial scoping out of either framework and pick the one that seems to suit your way of thinking/coding the best. If you scan over some sample code on the projects' websites you should get a basic idea of what they will be like. Although a bit more

Re: how to get the os file icon for a given content-type?

2006-08-28 Thread Paul Boddie
neoedmund wrote: [File icons for a given content type] > So what? Java 5.0 has the method, why python has not? I'd be generally surprised if whichever Java API responsible for this managed to work it out correctly for the different free desktop environments (KDE, GNOME, etc.), partly because thi

Re: f2py on windows XP - "Unknown Switch"??

2006-08-28 Thread Sile
Thanks John, Your help is very much appreciated - my f2py finally recognises my fortran compiler - I'm very relieved! > > That won't match the guff your f95 puts out. The "!)" appears *after* > the version number. See below. > > |>>> import re > |>>> guff = 'G95 (GCC 4.0.3 (g95 0.90!) Aug 22 2006

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread skip
boris> I am using the Python DB API for access to MySQL. But it is not boris> platform-independent - I need a module not included in Python by boris> default - python-mysql, and it uses a compiled binary boris> _mysql.so. So it is not platform-independent because for each boris

TNEF decoder

2006-08-28 Thread David Isaac
I'm aware of http://cheeseshop.python.org/pypi/pytnef/ but it uses the tnef utility, and I'd like a pure Python solution (along the lines of http://www.freeutils.net/source/jtnef/ ). Is there one? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: XML parsing and writing

2006-08-28 Thread uche . ogbuji
c00i90wn wrote: > Nice package ElementTree is but sadly it doesn't have a pretty print, > well, guess I'll have to do it myself, if you have one already can you > please give it to me? thanks :) FWIW Amara and plain old 4Suite both support pretty-print, canonical XML print and more such options.

Re: time.clock() going backwards??

2006-08-28 Thread Rob Williscroft
Claudio Grondi wrote in news:[EMAIL PROTECTED] in gmane.comp.python.general: > Tim Roberts wrote: >> "Tim Peters" <[EMAIL PROTECTED]> wrote: >> >> It is much simpler than that. With a multiprocessor HAL, including >> on a dual-core or hyperthreaded system, QueryPerformanceCounter >> returns th

rollover effect

2006-08-28 Thread Sorin Schwimmer
Hi, For the right-click event, you should use a bind to . If you have a new version of Python, chances are that you already have Tix installed. Tix, like Pmw, is an extension package for Tkinter, and it also offers a Balloon widget. See the following example: from Tix import * r=Tk() l=Label(r

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread Boris Dušek
Bruno Desthuilliers wrote: > bobrik wrote: > > Hello, > > > > I am using the Python DB API for access to MySQL. But it is not > > platform-independent > > It is. You don't have to change your Python code according to the OS or > CPU. > What I mean is that wiht platform-independent access, I should

Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread Sam Smoot
fuzzylollipop wrote: > uh, no, Python predates Ruby by a good bit > Rails might be "older" than Turbogears but it still JUST went 1.0 > officially. Wow that's a lot of FUD, especially since you're beating up on Rails for it's docs and maturity, when I doubt (but couldn't prove) turbogears comes cl

Re: time.clock() going backwards??

2006-08-28 Thread Claudio Grondi
Rob Williscroft wrote: > Claudio Grondi wrote in news:[EMAIL PROTECTED] in > gmane.comp.python.general: > > >>Tim Roberts wrote: >> >>>"Tim Peters" <[EMAIL PROTECTED]> wrote: > > >>>It is much simpler than that. With a multiprocessor HAL, including >>>on a dual-core or hyperthreaded system, Q

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread Boris Dušek
[EMAIL PROTECTED] wrote: > I don't think you mean "platform-independent". I suspect you mean > "batteries included". Prior to the release of Python 2.5, no modules to > access SQL databases were distributed with core Python. Starting with 2.5, > sqlite access will be available: > > >>> impor

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread Fredrik Lundh
Boris Dušek wrote: > So the only solution for me at this moment is to use jython and from > there use Java JDBC API (sorry :-) so who installed Java for you? -- http://mail.python.org/mailman/listinfo/python-list

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread Diez B. Roggisch
> > Yes, you excactly got my point. The thing is that I can't rely on > Python 2.5 to be installed soon. > So the only solution for me at this moment is to use jython and from > there use Java JDBC API (sorry :-) But it would be great if the Python > DB API compliant-modules would become parts of

Re: time.clock() going backwards??

2006-08-28 Thread Grant Edwards
On 2006-08-28, Claudio Grondi <[EMAIL PROTECTED]> wrote: >> I don't see any claim above that they run at different speeds, only >> that the counters are several million cycles apart, IOW running at the >> same speed but with different initial values, or more likely starting >> at different time

Re: time.clock() going backwards??

2006-08-28 Thread Fredrik Lundh
Claudio Grondi wrote: > If it were so, than why can't the delta of time between the processors > be set to exact zero? someone just wrote: This was a change from previous systems. On NT4 and Win2000, the operating actually rewrote the cycle counters on the second (and beyond) pr

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread Bruno Desthuilliers
Boris Dušek wrote: > Bruno Desthuilliers wrote: >> bobrik wrote: >>> Hello, >>> >>> I am using the Python DB API for access to MySQL. But it is not >>> platform-independent >> It is. You don't have to change your Python code according to the OS or >> CPU. >> > What I mean is that wiht platform-inde

unit test for a printing method

2006-08-28 Thread noro
What is the proper way to test (using unit test) a method that print information? for example: def A(s): print '---'+s+'---' and i want to check that A("bla") really print out "---bla---" thanks amit -- http://mail.python.org/mailman/listinfo/python-list

Re: time.clock() going backwards??

2006-08-28 Thread Fredrik Lundh
> so if you really want to know, you may have to ask microsoft. footnote: judging from http://support.microsoft.com/?id=896256 this might be related to advanced power management features in XP. that note also mentions a hotfix for this. -- http://mail.python.org/mailman/listinfo/pytho

Re: unit test for a printing method

2006-08-28 Thread Fredrik Lundh
noro wrote: > What is the proper way to test (using unit test) a method that print > information? > for example: > > def A(s): > print '---'+s+'---' > > and i want to check that A("bla") really print out "---bla---" http://docs.python.org/lib/module-doctest.html -- http://mail.pyth

Re: unit test for a printing method

2006-08-28 Thread Diez B. Roggisch
noro wrote: > What is the proper way to test (using unit test) a method that print > information? > for example: > > def A(s): > print '---'+s+'---' > > and i want to check that A("bla") really print out "---bla---" You can replace sys.stdout with a cStringIO-object or any other file-p

Re: time.clock() going backwards??

2006-08-28 Thread Grant Edwards
On 2006-08-28, Grant Edwards <[EMAIL PROTECTED]> wrote: >>> For processors that run at (say) 2GHz, several million (say 10 >>> million) represents a difference of 10e6/2e9 = 0.005 seconds >>> between when the processors were sufficiently powered up to >>> start counting cycles. > >> If it were so,

Operator Overloading Basics

2006-08-28 Thread Mohit Bhatt
Hello, I just started out with python( couple of weeks). I have a query regarding Operator Overloading   class c1:     def __init__(self,value):     self.data = "">     def __add__ (self,operand2):     self.data += operand2  

Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread Adam Jones
In my understanding, which relies completely on the judgements of co-workers regarding the rails side of the debate, TurboGears is more flexible. Tasks which fall inside the scope of Rails' "opinion" are probably easier there, but anything outside of what Rails was built to do is harder than equiva

Desktop Notification/Alerts In Python

2006-08-28 Thread Chaos
I am looking for ways to have a Desktop Alert, like the one most IM Messengers have (MSN, AIM) at the lower right above the taskbar. Can anyone point me to the right resources to use? -- http://mail.python.org/mailman/listinfo/python-list

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread Steve Holden
Bruno Desthuilliers wrote: > Boris Dušek wrote: > >>Bruno Desthuilliers wrote: >> >>>bobrik wrote: >>> Hello, I am using the Python DB API for access to MySQL. But it is not platform-independent >>> >>>It is. You don't have to change your Python code according to the OS or >>>CPU.

Re: Operator Overloading Basics

2006-08-28 Thread Fredrik Lundh
Mohit Bhatt wrote: > Hello, > > I just started out with python( couple of weeks). > > I have a query regarding Operator Overloading > > class c1: > def __init__(self,value): > self.data = value > def __add__ (self,operand2): >

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread Boris Dušek
Bruno Desthuilliers wrote: > > but what if the OS with server accessing the site that is on > > shared area changes? > > And what if Python is not installed on it ?-) > > Seriously, do you think that hosting companies swap OS very often ? No, I don't. But I was trying to find the best solution.

Re: Operator Overloading Basics

2006-08-28 Thread Tim Chase
> obj1 = c1(1) > > obj1 + 10 # this works just fine > 10 + obj1 # throws exception > Q. What do I have to do to make the following line work? > > 10 + obj1 http://docs.python.org/ref/numeric-types.html You want to read the section on __radd__ (and it's o

Re: unicode "table of character" implementation in python

2006-08-28 Thread Martin v. Löwis
Nicolas Pontoizeau schrieb: > I am handling a mixed languages text file encoded in UTF-8. Theres is > mainly French, English and Asian languages. I need to detect every > asian characters in order to enclose it by a special tag for latex. > Does anybody know if there is a unicode "table of characte

Re: libcurses.so & installing Python 2.4.3

2006-08-28 Thread Martin v. Löwis
dmulcahy schrieb: > I am trying to build the binaries for Python 2.4.3 on a Sun E6900 > running SPARC Solaris 9 and using gcc 3.4.2. > > When the makefile tries to build the _curses extension it fails with a > symbol referencing error on "mvwgetnstr", which it appears should exist > in libcurses.s

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-28 Thread Martin v. Löwis
Fredrik Lundh schrieb: >> Is there any way to force the actual python site-lib for M$ installers > > it's spelled "Windows installers" I want to second this. It was me who created the installer, and I don't like to see my name abbreviated as M$ (if you think you should write out the name of t

Re: question about class, functions and scope

2006-08-28 Thread Gabriel G
At Saturday 26/8/2006 06:13, nephish wrote: i have an app that runs three classes as threads in the same program. some of them need to be able to share some functions. Can i set a function before i define a class and have the class use it ? Kinda like this. def some_function(var1, var2): do

Re: how to get the os file icon for a given content-type?

2006-08-28 Thread Martin v. Löwis
Paul Boddie schrieb: > neoedmund wrote: > > [File icons for a given content type] > >> So what? Java 5.0 has the method, why python has not? > > I'd be generally surprised if whichever Java API responsible for this > managed to work it out correctly for the different free desktop > environments

Re: Truly platform-independent DB access in Python?

2006-08-28 Thread Boris Dušek
Dennis Lee Bieber wrote: > On 28 Aug 2006 00:01:06 -0700, "bobrik" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > for that platform. Do you know of any Python solution for MySQL access > > that is 100% platform-independent? > > > Subprocess module invoking the MyS

Re: DirectPython

2006-08-28 Thread Heikki Salo
Jérôme Le Bougeant wrote: > Hello, > > I have DirectPython 0.5 (http://directpython.sourceforge.net/) and python2.4 > (directx9.0C installed). > Samples do not work, I have this error : "RuntimeError: Failed to create a > device" > For example with sampleBasic.py : > > Traceback (most recent cal

Detecting window focus events in PyGTK

2006-08-28 Thread Peter TB Brett
Hi folks, I'm currently trying to work out how to detect when a PyGTK window receives the focus from the window manager -- I assume that it must receive some kind of X event, but I can't work out which signal it generates. Searching around the subject on the web doesn't seem to pull up anything us

  1   2   3   >