Re: Which is faster?

2008-08-30 Thread Gabriel Genellina
En Sat, 30 Aug 2008 01:26:35 -0300, cnb [EMAIL PROTECTED] escribi�: For a big nbr of it might matter? Is av_grade O(n*2) and the first O(n) when it comes to adding or is sum x for x in y just traversing the list ones, accumulating the values, it doesnt first build the list and then travese it

Re: When to use try and except?

2008-08-30 Thread Fredrik Lundh
Carl Banks wrote: I wouldn't say that the possibility of EAFP in Python makes it obsolute to use LBYL. when using CPython, EAFP at the Python level always involve LBYL at the C level. and it should be obvious to any programmer that checking for the same thing twice is quite often a waste

Re: Which is faster?

2008-08-30 Thread Steven D'Aprano
On Fri, 29 Aug 2008 21:26:35 -0700, cnb wrote: def averageGrade(self): tot = 0 for review in self.reviews: tot += review.grade return tot / len(self.reviews) def av_grade(self): return sum(review.grade for review in self.reviews) / \

Re: Which is faster?

2008-08-30 Thread Gabriel Genellina
En Sat, 30 Aug 2008 03:15:30 -0300, Steven D'Aprano [EMAIL PROTECTED] escribi�: On Fri, 29 Aug 2008 21:26:35 -0700, cnb wrote: def averageGrade(self): tot = 0 for review in self.reviews: tot += review.grade return tot / len(self.reviews) def

Re: Interrupt python thread

2008-08-30 Thread Dieter Maurer
En Mon, 25 Aug 2008 05:00:07 -0300, BlueBird [EMAIL PROTECTED] escribi╴: Unfortunately, this does not map very well with my program. Each of my threads are calling foreign code (still written in python though), which might be busy for 1 to 10 minutes with its own job. I wanted something to

Re: Date Comparison and Manipulation Functions?

2008-08-30 Thread Hendrik van Rooyen
John Machin sj..con.net wrote: On Aug 30, 10:41 am, W. eWatson notvalcglobal.net wrote: What I'm trying to do is adjust date-time stamped file names for date and time errors. The software program collects through a period that roughly coincides with night hours every day and according to

How to place menu on the bottom

2008-08-30 Thread qxyuestc
#!/usr/bin/env python import sys import os from tkinter import * def callback(self): #int this snippet, all menu entries use the same callback... print(callback) class DemoMenu(): def __init__(self): self.dataTemp = self.createWidgets() def

Re: __stack_chk_fail_local

2008-08-30 Thread Marco Bizzarri
On Fri, Aug 29, 2008 at 7:53 PM, gianluca [EMAIL PROTECTED] wrote: hy list, I've built _libfoo.so and libfoo.py library with swig and I've copied in /usr/lib/python2.5/lib-dynload/ but when import the module import libfoo I've that message Traceback (most recent call last): File stdin,

Re: How to place menu on the bottom

2008-08-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: self.rootWin.config(menu=menuBar) I want to place the menu on the bottom (menuFrame.pack(side=BOTTOM, fill=X)). But it does not work. Why? menubars that are configured via the window menu option are rendered by the underlying window system. to create a

Re: Which is faster?

2008-08-30 Thread cnb
how does doing something twice not change complexity? yes it maybe belongs to the same complexity-class but is still twice as slow no? -- http://mail.python.org/mailman/listinfo/python-list

Re: Date Comparison and Manipulation Functions?

2008-08-30 Thread W. eWatson
John Machin wrote: On Aug 30, 10:41 am, W. eWatson [EMAIL PROTECTED] wrote: What I'm trying to do is adjust date-time stamped file names for date and time errors. The software program collects through a period that roughly coincides with night hours every day and according to the OS clock. It

Re: How to place menu on the bottom

2008-08-30 Thread qxyuestc
On Aug 30, 6:04 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote:         self.rootWin.config(menu=menuBar) I want to place the menu on the bottom (menuFrame.pack(side=BOTTOM, fill=X)). But it does not work. Why? menubars that are configured via the window menu option

Re: Which is faster?

2008-08-30 Thread Fredrik Lundh
cnb wrote: how does doing something twice not change complexity? yes it maybe belongs to the same complexity-class but is still twice as slow no? doing two things quickly can still be faster than doing one thing slowly. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: How to place menu on the bottom

2008-08-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: What the problem is? the menu is drawn by the window system when you use the menu option, not by Tkinter. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: How to check is something is a list or a dictionary or a string?

2008-08-30 Thread Ken Starks
George Sakkis wrote: On Aug 29, 12:16 pm, [EMAIL PROTECTED] wrote: Hi, How to check if something is a list or a dictionary or just a string? Eg: for item in self.__libVerDict.itervalues(): self.cbAnalysisLibVersion(END, item) where __libVerDict is a dictionary that holds values

Re: How to ignore the first line of the text read from a file

2008-08-30 Thread josh logan
On Aug 28, 3:47 am, Santiago Romero [EMAIL PROTECTED] wrote: I want to read text line-by-line from a text file, but want to ignore only the first line. I know how to do it in Java (Java has been my primary language for the last couple of years) and following is what I have in Python, but I

Re: How to check is something is a list or a dictionary or a string?

2008-08-30 Thread josh logan
But this changes with Python 3, right? On Aug 30, 7:15 am, Ken Starks [EMAIL PROTECTED] wrote: George Sakkis wrote: On Aug 29, 12:16 pm, [EMAIL PROTECTED] wrote: Hi, How to check if something is a list or a dictionary or just a string? Eg: for item in self.__libVerDict.itervalues():

Re: Which is faster?

2008-08-30 Thread Diez B. Roggisch
cnb schrieb: how does doing something twice not change complexity? yes it maybe belongs to the same complexity-class but is still twice as slow no? Because big O notation is not about constant factors. Or even subterms with lower powers. http://en.wikipedia.org/wiki/Big_O_notation Diez --

Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
Hi all. I read the PEP8 and the importing Python Modules article. However, I'm still a little confused on what should the general rules for importing modules. I'm showing what I used in my current project, and will accept your advices on how I should change them. The style is consistently the

Segmentation Fault on CDLL reloading

2008-08-30 Thread Marcus.CM
Hi, I use the following ctype to load a .so library in Linux. vr = ctypes.CDLL(sstr) And the following to release it so that i can reload the library without quiting the python script. _ctypes.dlclose(vr._handle) These calls are guarded by a writer lock and access to it guarded by a

Re: Advice on the style to use in imports

2008-08-30 Thread Fredrik Lundh
Marco Bizzarri wrote: I'm showing what I used in my current project, and will accept your advices on how I should change them. The style is consistently the following: from package.subpackge.module import MyClass Is this an accepted way to write imports? According to what I understood in

Re: Fastest way to write huge files

2008-08-30 Thread Larry Bates
Mohamed Yousef wrote: Thanks all , but there is still something i forget to state -sorry - all communication will be via Http with a server so data is received via Http so local network solutions won't work the problem really starts after receiving data in storing them without much of a

Re: How to check is something is a list or a dictionary or a string?

2008-08-30 Thread Ken Starks
josh logan wrote: But this changes with Python 3, right? right! see http://docs.python.org/dev/3.0/whatsnew/3.0.html (quote) Strings and Bytes * There is only one string type; its name is str but its behavior and implementation are like unicode in 2.x. * The basestring superclass

Re: __stack_chk_fail_local

2008-08-30 Thread gianluca
On 30 Ago, 12:05, Marco Bizzarri [EMAIL PROTECTED] wrote: On Fri, Aug 29, 2008 at 7:53 PM, gianluca [EMAIL PROTECTED] wrote: hy list, I've built _libfoo.so and libfoo.py library with swig and I've copied in /usr/lib/python2.5/lib-dynload/ but when import the module import libfoo I've

Re: Segmentation Fault on CDLL reloading

2008-08-30 Thread Diez B. Roggisch
Marcus.CM schrieb: Hi, I use the following ctype to load a .so library in Linux. vr = ctypes.CDLL(sstr) And the following to release it so that i can reload the library without quiting the python script. _ctypes.dlclose(vr._handle) These calls are guarded by a writer lock and access

Re: microsoft terminal server

2008-08-30 Thread Larry Bates
Tim Golden wrote: [EMAIL PROTECTED] wrote: HI, i would like to know if there is a way to create a python script for automate mstsc.exe username and pwd credential, i mean i would create a script that first open mstsc.exe and in the same time is able to fill [computer+username+pwd]. Haven't

Re: How to check is something is a list or a dictionary or a string?

2008-08-30 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hi, How to check if something is a list or a dictionary or just a string? Eg: for item in self.__libVerDict.itervalues(): self.cbAnalysisLibVersion(END, item) where __libVerDict is a dictionary that holds values as strings or lists. So now, when I iterate

Re: __stack_chk_fail_local

2008-08-30 Thread Marco Bizzarri
The ldd should point you to the library which is not loaded. Maybe the library you need is not in one of the normal locations in your Linux/Unix path. Normally, the linker looks for library under /lib and /usr/lib, and maybe other paths specified in /etc/ld.so.conf If you know the library is

Re: Fastest way to write huge files

2008-08-30 Thread Mohamed Yousef
If connection is over Internet via HTTP the connection speed is so slow in relation to the speed of your CPU that it doesn't really matter. this is not always true , espicially when using a localhost or a local netwtork server the problem is the increase in cpu and memory usage make it a

Re: Ensure only single application instance.

2008-08-30 Thread Larry Bates
Cameron Laird wrote: In article [EMAIL PROTECTED], Uberman [EMAIL PROTECTED] wrote: On Fri, Aug 29, 2008 at 6:51 AM, Heston James [EMAIL PROTECTED] wrote: Good afternoon all. I have an application/script which is launched by crontab on a regular basis. I need an effective and accurate way to

Re: __stack_chk_fail_local

2008-08-30 Thread [EMAIL PROTECTED]
Thanks! I've resolved the problem with libraries but... I've still error with this message: ImportError: ./_python_grass6.so: undefined symbol: __stack_chk_fail_local exuse me, I'm not a guru. Gianluca -- Initial Header --- From : Marco Bizzarri [EMAIL PROTECTED] To

Re: Fastest way to write huge files

2008-08-30 Thread Larry Bates
Mohamed Yousef wrote: If connection is over Internet via HTTP the connection speed is so slow in relation to the speed of your CPU that it doesn't really matter. this is not always true , espicially when using a localhost or a local netwtork server the problem is the increase in cpu and memory

Re: __stack_chk_fail_local

2008-08-30 Thread Marco Bizzarri
On Sat, Aug 30, 2008 at 3:03 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks! I've resolved the problem with libraries but... I've still error with this message: ImportError: ./_python_grass6.so: undefined symbol: __stack_chk_fail_local exuse me, I'm not a guru. Gianluca I'm not a

How to delete elements from Tix Combo Box?

2008-08-30 Thread dudeja . rajat
HI, I'm using a Tix combo box (I call it combo2), the contents of which are loaded depeding on the selection in another Tix combo box(I call it combo1) I have used the commands: self.cbAnalysisLibVersion.insert(END, results) to insert elements to the combo box. I'm looking for some similar

Re: How to delete elements from Tix Combo Box?

2008-08-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I'm using a Tix combo box (I call it combo2), the contents of which are loaded depeding on the selection in another Tix combo box(I call it combo1) I have used the commands: self.cbAnalysisLibVersion.insert(END, results) to insert elements to the combo box. I'm

Re: Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
On Sat, Aug 30, 2008 at 2:20 PM, Fredrik Lundh [EMAIL PROTECTED] wrote: importing objects instead of the module (namespace) they live in can cause all sorts of aliasing and dependency issues. avoid unless you know exactly what you're doing. /F Thanks Fredrik; I understand that is the

Re: How to delete elements from Tix Combo Box?

2008-08-30 Thread dudeja . rajat
On Sat, Aug 30, 2008 at 2:32 PM, Fredrik Lundh [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I'm using a Tix combo box (I call it combo2), the contents of which are loaded depeding on the selection in another Tix combo box(I call it combo1) I have used the commands:

Re: Advice on the style to use in imports

2008-08-30 Thread bearophileHUGS
Marco Bizzarri: I'm just confused because PEP8 seems to suggest that the from module import Class style is acceptable; is there a big if you know what are doing before, which I'm unable to see? from somemodule import somename is often acceptable IHMO, but there are some things to consider: -

Re: When to use try and except?

2008-08-30 Thread Cameron Laird
In article [EMAIL PROTECTED], Carl Banks [EMAIL PROTECTED] wrote: . . . Basically, there's a general principle (EAFP: Easier to ask forgiveness than permission) in Python to just try something and then catch the exception

boxsizer inside a panel

2008-08-30 Thread Gandalf
the following code's panel elements doesn't react like a table though is haze boxsizer What is wrong here? : panel3=wx.Panel(self,-1,(10,10), style=wx.SIMPLE_BORDER, size=(370, 150)) panel3.SetBackgroundColour(#ff) text1=wx.StaticText(panel3, -1, 'Hello')

Writing to ms excel

2008-08-30 Thread Marin Brkic
Hello all, please, let me apologize in advance. English is not my first language (not even my second one), so excuse any errors with which I'm about to embarass myself in front of the general public. Second, I'm relatively new to python, so sorry if this seems like a stupid question. I'm trying

starting gazpacho on windows

2008-08-30 Thread nntpman68
Hi, I wanted to play with gazpacho ( no urgent need, but I was curious) I went to http://gazpacho.sicem.biz/ (is thios the official home page?) I downloaded the windows installer for Kiwi and the Windowsinstaller for Gazpacho. I started both, und they installed, but I even don't know where

Re: Advice on the style to use in imports

2008-08-30 Thread Eric Wertman
I read the PEP8 and the importing Python Modules article. However, I'm still a little confused on what should the general rules for importing modules. I'm showing what I used in my current project, and will accept your advices on how I should change them. import module and then use

Nokia N85 and N79 official, no surprises

2008-08-30 Thread javed044
Nokia N85 is a quad-band GSM and tri-band UMTS dual slider, inspired by the controversial design of the Nokia N81.. http://helpmobilebd.blogspot.com/search/label/NEWS -- http://mail.python.org/mailman/listinfo/python-list

How to clear the Entry subwidget of Tix Combo box?

2008-08-30 Thread dudeja . rajat
Hi, In my combo box taken from Tix, how can I delete item in Entry subwiget? My case is like this: I have a check button which when made un-ticked should clear the entry from combo box (i. anything selected in combo box previously) I used the following commands: subEntry =

Re: Writing to ms excel

2008-08-30 Thread Eric Wertman
I'm trying to find a way to write data to excel cells (or to be more specific to an .xls file), let's say for the sake of argument, data readen from a file (although it will be calculated in the process). I've been searching, but couldn't find any examples which allows that. The answer will

Re: [1,2,3] exactly same as [1,2,3,] ?

2008-08-30 Thread Fredrik Lundh
Roy Smith wrote: Yowza, you're right (at least for the one case I tried). This must be a new development (where new development is defined as, It wasn't legal in the original KR C I learned when I was a pup). the C 89 grammar appears to be: initializer: assignment-expression

Re: Process Killed

2008-08-30 Thread Eric Wertman
I'm doing some simple file manipulation work and the process gets Killed everytime I run it. No traceback, no segfault... just the word Killed in the bash shell and the process ends. The first few batch runs would only succeed with one or two files being processed (out of 60) before the

Re: [1,2,3] exactly same as [1,2,3,] ?

2008-08-30 Thread Roy Smith
In article [EMAIL PROTECTED], Fredrik Lundh [EMAIL PROTECTED] wrote: Roy Smith wrote: Yowza, you're right (at least for the one case I tried). This must be a new development (where new development is defined as, It wasn't legal in the original KR C I learned when I was a pup). the

Most pythonic way of weighted random selection

2008-08-30 Thread Manuel Ebert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear list, who's got aesthetic advice for the following problem? I've got some joint probabilities of two distinct events Pr(X=x, Y=y), stored in a list of lists of floats, where every row represents a possible outcome of X and every float in

Re: Picking up resource forks and extended attributes on Mac OS X ?!

2008-08-30 Thread Miles
Mitrokhin wrote: Also (dare I ask for this too) If some nice soul could point me in the right direction for picking up files with extended attributes under OS X I'd be really gratefull to. Should it be done the same way, ie. via os. calls or perhaps by way of a popen or ... ? Mac OS X 10.5

Wanted: python script to convert to/from UTF-8 to/from XML Entities

2008-08-30 Thread Siegfried Heintze
Does someone have a little python script that will read a file in UTF-8/UTF-16/UTF-32 (my choice) and search for all the characters between 0x7f-0xff and convert them to an ASCII digit string that begins with # and ends with ; and output the whole thing? If not, could someone tell me how

Re: Wanted: python script to convert to/from UTF-8 to/from XML Entities

2008-08-30 Thread Fredrik Lundh
Siegfried Heintze wrote: Does someone have a little python script that will read a file in UTF-8/UTF-16/UTF-32 (my choice) and search for all the characters between 0x7f-0xff and convert them to an ASCII digit string that begins with # and ends with ; and output the whole thing? If not,

Re: Which is faster?

2008-08-30 Thread Lie
On Aug 30, 5:30 pm, cnb [EMAIL PROTECTED] wrote: how does doing something twice not change complexity? yes it maybe belongs to the same complexity-class but is still twice as slow no? Who is doing something twice? Definitely not sum(). sum() does not create intermediate list, and if you pass

Re: Most pythonic way of weighted random selection

2008-08-30 Thread bearophileHUGS
Manuel Ebert, this may be related/useful: http://code.activestate.com/recipes/498229/ Note that numpy has a bisection method/function that are probably quite faster. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Which is faster?

2008-08-30 Thread Fredrik Lundh
Lie wrote: how does doing something twice not change complexity? yes it maybe belongs to the same complexity-class but is still twice as slow no? Who is doing something twice? Definitely not sum(). nobody's claiming that -- but as mentioned above, even if sum() had done two passes over the

Re: Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
Hi bearophile On Sat, Aug 30, 2008 at 4:04 PM, [EMAIL PROTECTED] wrote: from somemodule import somename is often acceptable IHMO, but there are some things to consider: - you and the person that reads your code have to remember where somename comes from. So you can do it for well known

Re: Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
On Sat, Aug 30, 2008 at 4:53 PM, Eric Wertman [EMAIL PROTECTED] wrote: I read the PEP8 and the importing Python Modules article. However, I'm still a little confused on what should the general rules for importing modules. I'm showing what I used in my current project, and will accept your

Re: Date Comparison and Manipulation Functions?

2008-08-30 Thread W. eWatson
W. eWatson wrote: John Machin wrote: On Aug 30, 10:41 am, W. eWatson [EMAIL PROTECTED] wrote: What I'm trying to do is adjust date-time stamped file names for date and time errors. The software program collects through a period that roughly coincides with night hours every day and according

Re: Writing to ms excel

2008-08-30 Thread Marco Bizzarri
On Sat, Aug 30, 2008 at 4:41 PM, Marin Brkic [EMAIL PROTECTED] wrote: Hello all, I'm trying to find a way to write data to excel cells (or to be more specific to an .xls file), let's say for the sake of argument, data readen from a file (although it will be calculated in the process). I've

Re: Date Comparison and Manipulation Functions?

2008-08-30 Thread W. eWatson
John Machin wrote: On Aug 30, 10:41 am, W. eWatson [EMAIL PROTECTED] wrote: What I'm trying to do is adjust date-time stamped file names for date and time errors. The software program collects through a period that roughly coincides with night hours every day and according to the OS clock. It

Counting Elements in an xml file

2008-08-30 Thread Ouray Viney
Hi All: I am looking at writing a python script that will let me parse a TestSuite xml file that contains n number of TestCases. My goal is to be able to count the TestCase elements base on a key value pair in the xml node. Example Testcase execute=true name=foobar I would like to be able to

Re: Date Comparison and Manipulation Functions?

2008-08-30 Thread W. eWatson
The author has updated the Tutorial and added a flex method. -- http://mail.python.org/mailman/listinfo/python-list

Re: Counting Elements in an xml file

2008-08-30 Thread Marco Bizzarri
On Sat, Aug 30, 2008 at 7:37 PM, Ouray Viney [EMAIL PROTECTED] wrote: Hi All: I am looking at writing a python script that will let me parse a TestSuite xml file that contains n number of TestCases. My goal is to be able to count the TestCase elements base on a key value pair in the xml

Re: Counting Elements in an xml file

2008-08-30 Thread Fredrik Lundh
Ouray Viney wrote: I am looking at writing a python script that will let me parse a TestSuite xml file that contains n number of TestCases. My goal is to be able to count the TestCase elements base on a key value pair in the xml node. Example Testcase execute=true name=foobar I would like

Re: Tkinter event loop question

2008-08-30 Thread gordon
On Aug 29, 10:46 pm, Russell E. Owen [EMAIL PROTECTED] wrote: you can safely compute stuff with a background thread and display it from the main thread). But cross that bridge later. -- Russell thanks Russel gordon -- http://mail.python.org/mailman/listinfo/python-list

Importing module with name given as a variable

2008-08-30 Thread Sean Davis
What is the best practice for importing an arbitrary module given that the name is stored in a variable? The context is a simple web application with URL dispatching to a module and function. I know of __import__(), the imp module, and exec. For each of these, is there a way to make them work

Re: Counting Elements in an xml file

2008-08-30 Thread Paul Boddie
On 30 Aug, 19:37, Ouray Viney [EMAIL PROTECTED] wrote: Testcase execute=true name=foobar I would like to be able to count the number of TestCases that contain the execute=true but not the ones that contain execute=false. With XPath-capable libraries, it should be enough to execute an XPath

Relative imports and import X as Y

2008-08-30 Thread OKB (not okblacke)
I was looking at PEP 328. It says that relative imports with the dot syntax will only be allowed with the from import variety (e.g., from ..somemodule import somename). The reason given for this in the PEP is that after import xxx.yyy, xxx.yyy is usable in an expression, but the

Customizing code.InteractiveConsole

2008-08-30 Thread Leonhard Vogt
Hello I have subclassed code.InteractiveInterpreter for testing an interpreter i have written myself. The interpreter is a function (evaluate) that can raise MyError exceptions. I want these to be reported with an indication of the position (^) as in the python interactive interpreter. The

Re: Importing module with name given as a variable

2008-08-30 Thread Wojtek Walczak
On Sat, 30 Aug 2008 11:02:03 -0700 (PDT), Sean Davis wrote: What is the best practice for importing an arbitrary module given that the name is stored in a variable? The context is a simple web application with URL dispatching to a module and function. I know of __import__(), the imp module,

Re: Advice on the style to use in imports

2008-08-30 Thread Bruno Desthuilliers
Marco Bizzarri a écrit : Hi all. I read the PEP8 and the importing Python Modules article. However, I'm still a little confused on what should the general rules for importing modules. I'm showing what I used in my current project, and will accept your advices on how I should change them. The

Re: Importing module with name given as a variable

2008-08-30 Thread Bruno Desthuilliers
Sean Davis a écrit : What is the best practice for importing an arbitrary module given that the name is stored in a variable? The context is a simple web application with URL dispatching to a module and function. I know of __import__(), the imp module, and exec. For each of these, is there a

Re: When to use try and except?

2008-08-30 Thread Carl Banks
On Aug 30, 2:03 am, Fredrik Lundh [EMAIL PROTECTED] wrote: Carl Banks wrote: I wouldn't say that the possibility of EAFP in Python makes it obsolute to use LBYL. when using CPython, EAFP at the Python level always involve LBYL at the C level. I don't think that's true. For example, here

Re: Writing to ms excel

2008-08-30 Thread Leonhard Vogt
Marin Brkic schrieb: I'm trying to find a way to write data to excel cells (or to be more specific to an .xls file), let's say for the sake of argument, data readen from a file (although it will be calculated in the process). I've been searching, but couldn't find any examples which allows that.

Re: Writing to ms excel

2008-08-30 Thread Tino Wildenhain
Marin Brkic wrote: Hello all, please, let me apologize in advance. English is not my first language (not even my second one), so excuse any errors with which I'm about to embarass myself in front of the general public. Second, I'm relatively new to python, so sorry if this seems like a stupid

Re: Writing to ms excel

2008-08-30 Thread Tino Wildenhain
Marin Brkic wrote: Hello all, please, let me apologize in advance. English is not my first language (not even my second one), so excuse any errors with which I'm about to embarass myself in front of the general public. Second, I'm relatively new to python, so sorry if this seems like a stupid

Re: Counting Elements in an xml file

2008-08-30 Thread Ouray Viney
On Aug 30, 2:17 pm, Paul Boddie [EMAIL PROTECTED] wrote: On 30 Aug, 19:37, Ouray Viney [EMAIL PROTECTED] wrote: Testcase execute=true name=foobar I would like to be able to count the number of TestCases that contain the execute=true but not the ones that contain execute=false. With

Re: Relative imports and import X as Y

2008-08-30 Thread Terry Reedy
So, will relative imports in Python 3.0 allow things like import ..relative.importing.path as prettyname? If not, why not? Download the latest beta for your system and give it a try. -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing to ms excel

2008-08-30 Thread Ken Starks
Marin Brkic wrote: Hello all, please, let me apologize in advance. English is not my first language (not even my second one), so excuse any errors with which I'm about to embarass myself in front of the general public. Second, I'm relatively new to python, so sorry if this seems like a stupid

Re: Which is faster?

2008-08-30 Thread Raymond Hettinger
On Aug 29, 9:26 pm, cnb [EMAIL PROTECTED] wrote: def av_grade(self):      return sum(review.grade for review in self.reviews) / \               len(self.reviews) Minor point. Consider making the divisor: float(len(self.reviews)). It would be a bummer to throw-off the average because of floor

Re: Most pythonic way of weighted random selection

2008-08-30 Thread duncan smith
Manuel Ebert wrote: Dear list, who's got aesthetic advice for the following problem? I've got some joint probabilities of two distinct events Pr(X=x, Y=y), stored in a list of lists of floats, where every row represents a possible outcome of X and every float in a row a possible outcome of

Re: Writing to ms excel

2008-08-30 Thread John Machin
On Aug 31, 12:41 am, Marin Brkic [EMAIL PROTECTED] wrote: I'm trying to find a way to write data to excel cells (or to be more specific to an .xls file), let's say for the sake of argument, data readen from a file (although it will be calculated in the process). I've been searching, but

Re: Which is faster?

2008-08-30 Thread Steven D'Aprano
On Sat, 30 Aug 2008 04:11:33 -0300, Gabriel Genellina wrote: Mmm, in this last test you're measuring the long integer operations performance (because the sum exceeds largely what can be represented in a plain integer). Long integers are so slow that the difference between both loops becomes

Re: Writing to ms excel

2008-08-30 Thread John Machin
On Aug 31, 12:57 am, Eric Wertman [EMAIL PROTECTED] wrote: If you have to interface with an exsisting excel file, you can try http://pypi.python.org/pypi/xlrd, but it may not support writing xls files, still. That remark appears to be an inverted cousin of the old joke question Have you

SAXReaderNotAvailble: No parsers found

2008-08-30 Thread josh logan
Vincent Yau [EMAIL PROTECTED] writes: I am trying to use Python SAX API to parse XML files. I do see expat.py somewhere underneath my Python 2.1.1 installation (on Solaris). But I got this error when invoking the xml.sax.make_parser() call. Any tip/help much appreciated. You should

Re: starting gazpacho on windows

2008-08-30 Thread Alan Franzoni
nntpman68 was kind enough to say: [cut] I didn't check, but if c:\python25 is your python install dir, you'll very likely find it in c:\python2.5\bin or c:\python25\scripts. -- Alan Franzoni [EMAIL PROTECTED] - Remove .xyz from my email in order to contact me. - GPG Key Fingerprint: 5C77 9DC3

Re: Writing to ms excel

2008-08-30 Thread Eric Wertman
Yes sorry, that's a really poorly formed sentence all the way around... not a dig on xlrd, but a warning to the OP that they may not find what they are looking for there. On Aug 31, 12:57 am, Eric Wertman [EMAIL PROTECTED] wrote: If you have to interface with an exsisting excel file, you can

Re: Writing to ms excel

2008-08-30 Thread Marin Brkic
On Sat, 30 Aug 2008 17:18:19 -0700 (PDT), John Machin [EMAIL PROTECTED] wrote: Hello John (and everyone else), thanks for answering. It helps in situations like this to mention details of your environment (1) what version of what operating system (Linux, OS X, Windows, etc) (2) what version of

Re: Writing to ms excel

2008-08-30 Thread Marin Brkic
On Sat, 30 Aug 2008 19:37:16 +0200, Marco Bizzarri [EMAIL PROTECTED] wrote: Is it suitable for you to use a python program talking with a running instance of openoffice? in that case, pyuno could help you. Hello Marco, thanks for answering, no, sorry. As much as I like OOffice, several other

Re: Writing to ms excel

2008-08-30 Thread Marin Brkic
On Sun, 31 Aug 2008 03:36:39 +0200, Marin Brkic [EMAIL PROTECTED] wrote: On Sat, 30 Aug 2008 19:37:16 +0200, Marco Bizzarri [EMAIL PROTECTED] wrote: Is it suitable for you to use a python program talking with a running instance of openoffice? in that case, pyuno could help you. Hello Marco,

Re: Most pythonic way of weighted random selection

2008-08-30 Thread Steven D'Aprano
On Sat, 30 Aug 2008 17:41:27 +0200, Manuel Ebert wrote: Dear list, who's got aesthetic advice for the following problem? ... [ugly code removed] Now that looks plain ugly, and I wonder whether you might find a slightly more elegant way of doing it without using numpy and the like. Never

Re: Writing to ms excel

2008-08-30 Thread Steven D'Aprano
On Sun, 31 Aug 2008 03:36:39 +0200, Marin Brkic wrote: On Sat, 30 Aug 2008 19:37:16 +0200, Marco Bizzarri [EMAIL PROTECTED] wrote: Is it suitable for you to use a python program talking with a running instance of openoffice? in that case, pyuno could help you. Hello Marco, thanks for

Re: Writing to ms excel

2008-08-30 Thread Marin Brkic
On 31 Aug 2008 02:37:16 GMT, Steven D'Aprano [EMAIL PROTECTED] wrote: Of course you can. You could simply tell them that you need the programming interface to OpenOffice and that's the format you will be supplying the data. If they want your data, they will use what you tell them to use *if

Re: Writing to ms excel

2008-08-30 Thread Benjamin Kaplan
On Sat, Aug 30, 2008 at 9:32 PM, Marin Brkic [EMAIL PROTECTED]wrote: On Sat, 30 Aug 2008 17:18:19 -0700 (PDT), John Machin [EMAIL PROTECTED] wrote: Hello John (and everyone else), thanks for answering. It helps in situations like this to mention details of your environment (1) what

Mako -- Genshi

2008-08-30 Thread Chris Babcock
Is there a cheap way to convert Myghty/Mako templates to Kid/Genshi? There's some code written for Pylons that I want to incorporate into a TurboGears 2 project and Genshi templates are more likely to behave themselves with the tools I'm used to. Chris --

Re: Writing to ms excel

2008-08-30 Thread Steven D'Aprano
On Sun, 31 Aug 2008 05:12:01 +0200, Marin Brkic wrote: I remember an older coleague who said; open, free and whatever licence type ... software is free, only up to some amount of $$/per hour. After that you just want things to work, and if they don't work, there are people who are paid $/per

Re: Writing to ms excel

2008-08-30 Thread John Machin
On Aug 31, 11:32 am, Marin Brkic [EMAIL PROTECTED] wrote: On Sat, 30 Aug 2008 17:18:19 -0700 (PDT), John Machin [EMAIL PROTECTED] wrote: For Python version 2.[345] on any platform, you can use xlwt, which is as simple as this for writing a 1-worksheet Excel 97-to-2003 XLS file (without any

Re: Writing to ms excel

2008-08-30 Thread John Machin
On Aug 31, 12:37 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: Only because we treat it as standard. You had no hesitation to write code that relies on people having Excel installed, and yet you didn't want to rely on an open source free software package that anyone with a

[issue3679] pressing HOME key in IDLE editor ends IDLE

2008-08-30 Thread Terry J. Reedy
Terry J. Reedy [EMAIL PROTECTED] added the comment: The only system difference is that I have an older Athlon cpu. And I did try Home (key above End) in the editor window and it moves cursor to beginning of line. My options/configure/key bindings starts beginning-of-line Key-Home. So this

  1   2   >