Re: How is GUI programming in Python?

2008-04-11 Thread Gabriel Genellina
En Fri, 11 Apr 2008 11:31:42 -0300, Michel Bouwmans <[EMAIL PROTECTED]> escribió: > Gabriel Genellina wrote: >> Another annoying thing with the Qt license is that you have to choose it >> at the very start of the project. You cannot develop something using the >> open source license and later de

str(bytes) in Python 3.0

2008-04-11 Thread Gabriel Genellina
Hello Is this the intended behavior? Python 3.0a4+ (py3k, Apr 12 2008, 02:53:16) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> x = b"abc" >>> repr(x) "b'abc'" >>> str(x,"ascii") 'abc' >>> str(x,"utf-8") 'abc' >>> str(x) "b'abc'"

accessing individual characters in unicode strings

2008-04-11 Thread Peter Robinson
Dear list I am at my wits end on what seemed a very simple task: I have some greek text, nicely encoded in utf8, going in and out of a xml database, being passed over and beautifully displayed on the web. For example: the most common greek word of all 'kai' (or και if your mailer can see utf

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Tim Golden
Ross Ridge wrote: > rdahlstrom <[EMAIL PROTECTED]> wrote: >> Basically, I'm looking for something similar to the Process.Responding >> property in System.Diagnostics... > > You probably want to use IsHungAppWindow(): Brilliant! So simple when you find out. Thanks. (Added to my list of things I

Re: Question on threads

2008-04-11 Thread John Nagle
Steve Holden wrote: > Jonathan Shao wrote: >> On Fri, Apr 11, 2008 at 3:29 PM, Steve Holden <[EMAIL PROTECTED] >> > wrote: >> >> Jonathan Shao wrote: >> >> Hi all, >> I'm a beginner to Python, so please bear with me. >> Is there a way of guar

Re: How is GUI programming in Python?

2008-04-11 Thread Steve Holden
Rune Strand wrote: > On Apr 11, 8:35 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> wxDesigner. > > Yeah, but it's like Heron of Alexandria's Aeolipile compared to the > steam engine of James Watt. > > IMHO, GUI with Python is pain, pain and utter pain. Even boring and > meaningless pain. IMHO y

Re: How is GUI programming in Python?

2008-04-11 Thread CM
On Apr 11, 3:29 pm, Rune Strand <[EMAIL PROTECTED]> wrote: > On Apr 11, 8:35 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > wxDesigner. > > Yeah, but it's like Heron of Alexandria's Aeolipile compared to the > steam engine of James Watt. > > IMHO, GUI with Python is pain, pain and utter pain. Ev

Re: How is GUI programming in Python?

2008-04-11 Thread David Cook
On 2008-04-11, Gabriel Ibanez <[EMAIL PROTECTED]> wrote: > Why is nobody talking about pyGTK ? There are no limits with licenses (I > think) The OS X port is still pretty preliminary. Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Ross Ridge
rdahlstrom <[EMAIL PROTECTED]> wrote: >Basically, I'm looking for something similar to the Process.Responding >property in System.Diagnostics... You probably want to use IsHungAppWindow(): IsHungAppWindow Function You call the IsHungAppWindow function to determine if Mic

Rpy - partially blank R window

2008-04-11 Thread tkpmep
I have just installed R and Rpy, and am experiencing an odd problem when driving R from Python - if I create a plot in R, the portion of the plot window that lies under the IDLE window in which I type my Python code remains blank. So if I type >>> from rpy import * >>> x = range(10) >>> y = [i **

Re: tkinter, annoying grid-problem

2008-04-11 Thread jim-on-linux
On Friday 11 April 2008 18:41, [EMAIL PROTECTED] wrote: > so my little calculator works perfectly > now. just having some trouble with the > layout. > this whole tkinter-thing seems to be more > tricky than it should be. how can i make > the 4 column of buttons have the same > distance and size b

Re: How is GUI programming in Python?

2008-04-11 Thread baalbek
Rune Strand wrote: > Numerous RAD' env's, fx Delphi, suggests this kind of incredibly > boring almost pre-historic, self-pestering non-sense pain is ancient, I have used Delphi for a lot of projects, as well as wxPython with the Glade Gui designer (and wxDesigner with C++ projects). Delphi/Obje

Re: Wrapping C++ class with SWIG, Mac OS X

2008-04-11 Thread Diez B. Roggisch
Paul Anton Letnes schrieb: > Hello guys, > > > (related to previous thread on wrapping C/C++ in Python, trying the SWIG > approach.) > Trying to map a C++ class to python, one method for now. Running the > following commands to "compile": > > -- > #!/usr/bin

Re: win-shortcuts, file associates and command-line parameters ?

2008-04-11 Thread Mike Driscoll
On Apr 11, 4:40 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: > Gabriel Genellina wrote: > > En Thu, 10 Apr 2008 16:03:28 -0300, Stef Mientki <[EMAIL PROTECTED]> > > escribió: > > >> under windows I tried to make a shortcut to a py -file, to run a program. > >> So making a shortcut like this works pe

[ANN]: Python-by-Example updates

2008-04-11 Thread AK
Python-by-Example is a guide to LibRef, aiming to give examples for all functions, classes, modules, etc. Right now examples for functions in some of the most important modules are included. Over the last week, I've added examples for the following modules: re special characters, inspect, shutil,

matplotlib in fedora 8, png format and easy_instal failure on 64bit machine

2008-04-11 Thread Daniel Fetchinson
Hi folks, I have a number of issues with matplotlib and was wondering if any of you had similar experiences: 1. I was trying to use the stock matplotlib package that comes with fedora 8, python-matplotlib-0.90.1-2.fc8 for saving graphs in png format. This failed, because the written files are all

Re: How is GUI programming in Python?

2008-04-11 Thread sturlamolden
On Apr 11, 5:01 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Another annoying thing with the Qt license is that you have to choose it > at the very start of the project. You cannot develop something using the > open source license and later decide to switch to the commercial licence > and

Re: How is GUI programming in Python?

2008-04-11 Thread sturlamolden
On Apr 12, 12:32 am, Rune Strand <[EMAIL PROTECTED]> wrote: > produce "what I want" without _wasting life_. But Boa is too unstable, > and does not claim otherwise, and there's no descent alternative I'm > aware of. wxFormDesigner is the best there is for wx. QtDesigner ditto for Qt. Glade ditto

Re: CDATA and lxml

2008-04-11 Thread Silfheed
On Apr 11, 3:49 pm, Silfheed <[EMAIL PROTECTED]> wrote: > On Apr 11, 10:33 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > > > > Hi again, > > > Stefan Behnel wrote: > > > Silfheed wrote: > > >> So first off I know that CDATA is generally hated and just shouldn't > > >> be done, but I'm simply req

Re: CDATA and lxml

2008-04-11 Thread Silfheed
On Apr 11, 10:33 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Hi again, > > Stefan Behnel wrote: > > Silfheed wrote: > >> So first off I know that CDATA is generally hated and just shouldn't > >> be done, but I'm simply required to parse it and spit it back out. > >> Parsing is pretty easy with l

tkinter, annoying grid-problem

2008-04-11 Thread skanemupp
so my little calculator works perfectly now. just having some trouble with the layout. this whole tkinter-thing seems to be more tricky than it should be. how can i make the 4 column of buttons have the same distance and size between them as the other 3 columns? and how can i make the top entry en

Re: https and POST method

2008-04-11 Thread Rob Williscroft
Lorenzo Stella wrote in news:7956f925-1037-49ea-a360-b58d627ffb20 @z24g2000prf.googlegroups.com in comp.lang.python: > Hi all, > I'm trying to write a simple script for sending sms via vyke... I have > to make a https > connection and pass some data with the POST method, like this perl > script do

Re: How is GUI programming in Python?

2008-04-11 Thread Rune Strand
On Apr 12, 12:03 am, Michel Bouwmans <[EMAIL PROTECTED]> wrote: > > Qt Designer. And creating the GUI yourself in the text editor isn't that > bad, plus you have much better control over it. If you like designing isual elements in an editor, that's fine for me! I don't, And as I don't do it all th

Re: How is GUI programming in Python?

2008-04-11 Thread Gabriel Ibanez
Hello all ! More fire .. Why is nobody talking about pyGTK ? There are no limits with licenses (I think) If we work on Ubuntu or Fedora, is there any reason to give GTK away and develop on Qt ? - Original Message - From: "Stef Mientki" <[EMAIL PROTECTED]> Cc: Sent: Friday, April 11,

Re: Question on threads

2008-04-11 Thread Grant Edwards
On 2008-04-11, Steve Holden <[EMAIL PROTECTED]> wrote: > Yes - you are calling it before you have started ALL your > threads, thereby making hte main thread wait for the end of > thread 1 before starting the next. An impressive demonstration > of thread synchronization, Well, that's one way to ge

Re: How is GUI programming in Python?

2008-04-11 Thread Michel Bouwmans
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rune Strand wrote: > On Apr 10, 3:54 am, Chris Stewart <[EMAIL PROTECTED]> wrote: > ... >> >> Next, what would you say is the best framework I should look into? >> I'm curious to hear opinions on that. > > GUI-programming in Python is a neanderthal e

Re: Question on threads

2008-04-11 Thread Steve Holden
Jonathan Shao wrote: > On Fri, Apr 11, 2008 at 3:29 PM, Steve Holden <[EMAIL PROTECTED] > > wrote: > > Jonathan Shao wrote: > > Hi all, > I'm a beginner to Python, so please bear with me. > Is there a way of guarenteeing that all created th

Re: win-shortcuts, file associates and command-line parameters ?

2008-04-11 Thread Stef Mientki
Gabriel Genellina wrote: > En Thu, 10 Apr 2008 16:03:28 -0300, Stef Mientki <[EMAIL PROTECTED]> > escribió: > > >> under windows I tried to make a shortcut to a py -file, to run a program. >> So making a shortcut like this works perfect: >> D:\PyLab_Works.py >> >> But the problem is that I n

Re: How is GUI programming in Python?

2008-04-11 Thread Stef Mientki
Rune Strand wrote: > On Apr 10, 3:54 am, Chris Stewart <[EMAIL PROTECTED]> wrote: > ... > >> Next, what would you say is the best framework I should look into? >> I'm curious to hear opinions on that. >> > > GUI-programming in Python is a neanderthal experience. What one may > love with con

Re: Question on threads

2008-04-11 Thread Jonathan Shao
On Fri, Apr 11, 2008 at 3:29 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Jonathan Shao wrote: > > > Hi all, > > I'm a beginner to Python, so please bear with me. > > Is there a way of guarenteeing that all created threads in a program > > are finished before the main program exits? I know that

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Mike Driscoll
On Apr 11, 3:22 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > Mike Driscoll wrote: > >http://www.informit.com/articles/article.aspx?p=19489&seqNum=4 > > > If you're better than I am, you can probably translate this to the > > Python equivalent. Zenoss also has some monitoring software that's > > open

Re: How to make a "command line basd" interactive program?

2008-04-11 Thread Matimus
On Apr 11, 2:32 am, Evan <[EMAIL PROTECTED]> wrote: > Hope this hasn't been posted hundreds of times. I'm new for this. > > Before using python for this kind of script, I was using TCL to write > down a "command line based" interactive program. it likes a "tclsh", > or "python" command, after that

Re: Rounding a number to nearest even

2008-04-11 Thread Arnaud Delobelle
On Apr 11, 8:27 pm, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Apr 11, 2:33 pm, Lie <[EMAIL PROTECTED]> wrote: [...] > > Another mistake, in an unquantized value the probability of getting > > exactly 0.5 (or any other number specified) is not 0 but an > > infinitesimal (i.e. lim(x) where x ->

Re: Rounding a number to nearest even

2008-04-11 Thread hdante
On Apr 11, 3:33 pm, Lie <[EMAIL PROTECTED]> wrote: > > That old-school rounding method you're taught is based on a wrong > assumption of the nature of number. In the past, rounding algorithm is > based on this: > > Original => (RoundUp(u|d|n), RoundNearestEven(u|d|n) > ... > 1.0 => 1(n), 1(n) > 1.1

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Roger Dahlstrom
On Apr 11, 3:46 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > rdahlstrom wrote: > > On Apr 11, 1:45 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: > >> Does anyone know how to determine the window status (Running or Not > >> Responding)? I've tried various methods with no success... > > >> This would be

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Roger Dahlstrom
On Apr 11, 3:54 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Apr 11, 2:10 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: > > > On Apr 11, 1:45 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: > > > > Does anyone know how to determine the window status (Running or Not > > > Responding)? I've tried various

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Roger Dahlstrom
On Apr 11, 3:46 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > rdahlstrom wrote: > > On Apr 11, 1:45 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: > >> Does anyone know how to determine the window status (Running or Not > >> Responding)? I've tried various methods with no success... > > >> This would be

Re: How is GUI programming in Python?

2008-04-11 Thread sturlamolden
On Apr 11, 8:35 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > wxDesigner. IMHO, wxFormBuilder is better. http://wxformbuilder.org/ http://preview.tinyurl.com/6l8wp4 -- http://mail.python.org/mailman/listinfo/python-list

Re: Rounding a number to nearest even

2008-04-11 Thread Gabriel Genellina
On 11 abr, 15:33, Lie <[EMAIL PROTECTED]> wrote: > On Apr 11, 10:19 pm, Mikael Olofsson <[EMAIL PROTECTED]> wrote: > > That's exactly how I was taught to do rounding in what-ever low-level > > class it was. The idea is to avoid a bias, which assumes that the > > original values are already quantiz

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Tim Golden
Mike Driscoll wrote: > http://www.informit.com/articles/article.aspx?p=19489&seqNum=4 > > If you're better than I am, you can probably translate this to the > Python equivalent. Zenoss also has some monitoring software that's > open source Python code. I'm afraid that article only allows you to d

Wrapping C++ class with SWIG, Mac OS X

2008-04-11 Thread Paul Anton Letnes
Hello guys, (related to previous thread on wrapping C/C++ in Python, trying the SWIG approach.) Trying to map a C++ class to python, one method for now. Running the following commands to "compile": -- #!/usr/bin/env bash MOD_NAME=Wavelet swig -c++ -pyth

Re: pty.spawn directs stderr to stdout

2008-04-11 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Wilbert Berendsen <[EMAIL PROTECTED]> wrote: > Hi, > > using pty.spawn() it seems that stderr output of the spawned process is > directed to stdout. Is there a way to keep stderr separate and only direct > stdin and stdout to the pty? There is, of course. Firs

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Mike Driscoll
On Apr 11, 2:10 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: > On Apr 11, 1:45 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: > > > Does anyone know how to determine the window status (Running or Not > > Responding)? I've tried various methods with no success... > > > This would be on a variety of Windows

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Tim Golden
rdahlstrom wrote: > On Apr 11, 1:45 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: >> Does anyone know how to determine the window status (Running or Not >> Responding)? I've tried various methods with no success... >> >> This would be on a variety of Windows systems, but all at least XP, >> and mostly

Re: How is GUI programming in Python?

2008-04-11 Thread Rune Strand
On Apr 11, 8:35 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > wxDesigner. Yeah, but it's like Heron of Alexandria's Aeolipile compared to the steam engine of James Watt. IMHO, GUI with Python is pain, pain and utter pain. Even boring and meaningless pain. -- http://mail.python.org/mailman/listin

Re: Rounding a number to nearest even

2008-04-11 Thread Mark Dickinson
On Apr 11, 2:33 pm, Lie <[EMAIL PROTECTED]> wrote: > In this table, we consider that a number is rounded down when the > number is equal to truncated value (the number without fractional > part), while round up is equal to truncated value + 1 or truncated > value -1 if value is negative (Actually t

Re: Question on threads

2008-04-11 Thread Steve Holden
Jonathan Shao wrote: > Hi all, > > I'm a beginner to Python, so please bear with me. > > Is there a way of guarenteeing that all created threads in a program are > finished before the main program exits? I know that using join() can > guarentee this, but from the test scripts I've run, it see

frozen/builtin modules and new interpreter instances

2008-04-11 Thread Patrick Stinson
So when creating a new interpreter (thread state) are you expected to re-set PyImport_FrozenModules and call yImport_ExtendInittab() again? the former seems to get corrupted between Py_Initialize() and Py_NewInterpreter(). I know that modules are not shared between interpreter instances, and it wou

Re: Profiling programs/scripts?

2008-04-11 Thread Aaron Watters
On Apr 11, 2:49 pm, [EMAIL PROTECTED] wrote: > how do i profile a program? i found out that there are some profilers > included in the standard library but couldnt really figure out how to > access/use them I put this at the bottom of my main module: === cut if __name__=="__main__": try:

Re: Profiling programs/scripts?

2008-04-11 Thread Mike Driscoll
On Apr 11, 1:49 pm, [EMAIL PROTECTED] wrote: > how do i profile a program? i found out that there are some profilers > included in the standard library but couldnt really figure out how to > access/use them Are you talking about using PyChecker or nose or what? In other words, do you want to check

Re: Profiling programs/scripts?

2008-04-11 Thread George Sakkis
On Apr 11, 2:49 pm, [EMAIL PROTECTED] wrote: > how do i profile a program? i found out that there are some profilers > included in the standard library but couldnt really figure out how to > access/use them Did you actually read the docs ? There is an example in the stdlib documentation: http://d

Question on threads

2008-04-11 Thread Jonathan Shao
Hi all, I'm a beginner to Python, so please bear with me. Is there a way of guarenteeing that all created threads in a program are finished before the main program exits? I know that using join() can guarentee this, but from the test scripts I've run, it seems like join() also forces each individ

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread rdahlstrom
On Apr 11, 1:45 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: > Does anyone know how to determine the window status (Running or Not > Responding)? I've tried various methods with no success... > > This would be on a variety of Windows systems, but all at least XP, > and mostly server 2003. Everyone w

Re: About __init__ and default arguments

2008-04-11 Thread Nathan Duran
On Apr 11, 2008, at 11:35 AM, [EMAIL PROTECTED] wrote: > I'd like to assign the value of an attribute in __init__ as the > default > value of an argument in a method. See below: Are you sure? You will not get fresh values with each call in Python as you would in other languages. Why not jus

Re: String Literal to Blob

2008-04-11 Thread Steve Holden
Victor Subervi wrote: > I have worked on this many hours a day for two weeks. If there is an > easier way to do it, just take a minute or two and point it out. Have > you heard of the Law of Diminishing Returns? I have passed it long ago. > I no longer want to waste time trying to guess at what

Profiling programs/scripts?

2008-04-11 Thread skanemupp
how do i profile a program? i found out that there are some profilers included in the standard library but couldnt really figure out how to access/use them -- http://mail.python.org/mailman/listinfo/python-list

Re: About __init__ and default arguments

2008-04-11 Thread Arnaud Delobelle
On Apr 11, 7:20 pm, Kevin Takacs <[EMAIL PROTECTED]> wrote: > Hi, > > I'd like to assign the value of an attribute in __init__ as the default > value of an argument in a method.  See below: > > class aphorisms(): >     def __init__(self, keyword): >         self.default = keyword > >     def frankl

Re: How is GUI programming in Python?

2008-04-11 Thread Steve Holden
Rune Strand wrote: > On Apr 10, 3:54 am, Chris Stewart <[EMAIL PROTECTED]> wrote: > ... >> Next, what would you say is the best framework I should look into? >> I'm curious to hear opinions on that. > > GUI-programming in Python is a neanderthal experience. What one may > love with console scripts

Re: About __init__ and default arguments

2008-04-11 Thread Steve Holden
Kevin Takacs wrote: > Hi, > > I'd like to assign the value of an attribute in __init__ as the default > value of an argument in a method. See below: > > class aphorisms(): > def __init__(self, keyword): > self.default = keyword > > def franklin(self, keyword = self.default): >

Re: Rounding a number to nearest even

2008-04-11 Thread Lie
On Apr 11, 10:19 pm, Mikael Olofsson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] commented about rounding towards even numbers > from mid-way between integers as opposed to for instance always rounding > up in those cases: > > > Strange request though, why do you need it that way, because 2.5 is

Re: Graphs in Python

2008-04-11 Thread George Sakkis
On Apr 10, 1:05 pm, Sanhita Mallick <[EMAIL PROTECTED]> wrote: > Hi. > > I am a newbie to Python. I am trying to implement a > Python code for graph manipulation. My graphs are > about 200-500 nodes big. Excepting for the short basic > graph implementation info on Python.org, where can I > find mor

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-11 Thread Skip Montanaro
> Hi,You will only have one the different static Python variables, > so this is not possible. Thanks, that's pretty much what I expected... Skip -- http://mail.python.org/mailman/listinfo/python-list

About __init__ and default arguments

2008-04-11 Thread Kevin Takacs
Hi, I'd like to assign the value of an attribute in __init__ as the default value of an argument in a method. See below: class aphorisms(): def __init__(self, keyword): self.default = keyword def franklin(self, keyword = self.default): return "A %s in time saves nine."

Re: How is GUI programming in Python?

2008-04-11 Thread Rune Strand
On Apr 10, 3:54 am, Chris Stewart <[EMAIL PROTECTED]> wrote: ... > > Next, what would you say is the best framework I should look into? > I'm curious to hear opinions on that. GUI-programming in Python is a neanderthal experience. What one may love with console scripts is turned upside-down. Proj

Re: Rounding a number to nearest even

2008-04-11 Thread Mark Dickinson
On Apr 11, 10:29 am, hdante <[EMAIL PROTECTED]> wrote: > Strangely, a "faster" version is: > > def fast_round(x): > if x % 1 != 0.5: return round(x) > return 2.0*round(x/2.0) You should be a little bit careful with the test x%1 == 0.5 if x might be negative: >>> x = -0.5 + 2**-54 >>> x

Re: Cannot start RPy - need win32api

2008-04-11 Thread tkpmep
Thanks a mill - works like a charm! -- http://mail.python.org/mailman/listinfo/python-list

Re: Rounding a number to nearest even

2008-04-11 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Strange request though, why do you need it that way, because 2.5 is > CLOSER to 3 than to 2... Uhhh, no it isn't. (3 - 2.5) == (2.5 - 2) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad

Re: Graphs in Python

2008-04-11 Thread Robert Kern
Henry Chang wrote: > Try Google Chart with python wrapper: > > http://pygooglechart.slowchop.com/ > > http://code.google.com/apis/chart/ Wrong kind of graph. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad atte

Windows - window status (Running vs Not Responding)

2008-04-11 Thread rdahlstrom
Does anyone know how to determine the window status (Running or Not Responding)? I've tried various methods with no success... This would be on a variety of Windows systems, but all at least XP, and mostly server 2003. Everyone will have Python 2.5.1 on them, and the script would be running loca

Re: String Literal to Blob

2008-04-11 Thread Victor Subervi
I have worked on this many hours a day for two weeks. If there is an easier way to do it, just take a minute or two and point it out. Have you heard of the Law of Diminishing Returns? I have passed it long ago. I no longer want to waste time trying to guess at what you are trying to tell me. Victor

Re: [lxml-dev] CDATA and lxml

2008-04-11 Thread Stefan Behnel
Hi again, Stefan Behnel wrote: > Silfheed wrote: >> So first off I know that CDATA is generally hated and just shouldn't >> be done, but I'm simply required to parse it and spit it back out. >> Parsing is pretty easy with lxml, but it's the spitting back out >> that's giving me issues. The fact t

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-11 Thread Matthieu Brucher
2008/4/11, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > This question was posed to me today. Given a C/C++ program we can clearly > embed a Python interpreter in it. Is it possible to fire up multiple > interpreters in multiple threads? For example: > > C++ main > thread 1 >

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-11 Thread Matimus
On Apr 11, 9:24 am, [EMAIL PROTECTED] wrote: > This question was posed to me today. Given a C/C++ program we can clearly > embed a Python interpreter in it. Is it possible to fire up multiple > interpreters in multiple threads? For example: > > C++ main > thread 1 > Py_In

Re: Cannot start RPy - need win32api

2008-04-11 Thread Mike Driscoll
On Apr 11, 11:47 am, [EMAIL PROTECTED] wrote: > I'm running Python 2.5.2 on Windows XP and need to interface with R, > so I downloaded the R 2.6.2 statistical package and installed it, and > did the same for RPy 1.02 (i made sure I got the version for Python > 2.5 and R 2.62.). When I go to the Pyt

pyOpenSSL 0.7

2008-04-11 Thread Jean-Paul Calderone
pyOpenSSL is a wrapper around a subset of the OpenSSL API, including support for X509 certificates, public and private keys, and and SSL connections. pyOpenSSL 0.7 fixes a number of memory leaks and memory corruption issues. It also exposes several new OpenSSL APIs to Python: * SSL_get_shutdow

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-11 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > This question was posed to me today. Given a C/C++ program we can clearly > embed a Python interpreter in it. Is it possible to fire up multiple > interpreters in multiple threads? For example: > > C++ main > thread 1 > Py_Initialize() >

Cannot start RPy - need win32api

2008-04-11 Thread tkpmep
I'm running Python 2.5.2 on Windows XP and need to interface with R, so I downloaded the R 2.6.2 statistical package and installed it, and did the same for RPy 1.02 (i made sure I got the version for Python 2.5 and R 2.62.). When I go to the Python command line and type >>> from rpy import * I get

simple program

2008-04-11 Thread shawn s
Hi, Here is a simple prog that I can run from the Python shell and it runs fine but when I double click the 'filename.py' , it does not execute the ping statement, and seems like it is stuck at the following output: Fri Apr 11 12:16:09 2008 Testing 192.168.0.1 The prog is as follows: impo

Multiple independent Python interpreters in a C/C++ program?

2008-04-11 Thread skip
This question was posed to me today. Given a C/C++ program we can clearly embed a Python interpreter in it. Is it possible to fire up multiple interpreters in multiple threads? For example: C++ main thread 1 Py_Initialize() thread 2 Py_Initialize() D

Sr. Lead Architect - (NYC)

2008-04-11 Thread Timothy B
I am in need for a Sr. Lead Architect for an outstanding company located in NYC. The company has been outsourcing their technology to California and are bringing the office to NYC. The company is looking for an individual who can build and manage the technolgy team in NYC. Individual must be a Py

Re: text adventure game problem

2008-04-11 Thread Neil Cerutti
On Thu, Apr 10, 2008 at 8:25 PM, Carl Banks <[EMAIL PROTECTED]> wrote: > On Apr 10, 2:20 pm, Tommy Nordgren <[EMAIL PROTECTED]> wrote: > > > On 9 apr 2008, at 03.01, [EMAIL PROTECTED] wrote: > > > > > okay, I'm having this one problem with a text adventure game. It's > > > kind of hard to explai

Re: Graphs in Python

2008-04-11 Thread Henry Chang
Try Google Chart with python wrapper: http://pygooglechart.slowchop.com/ http://code.google.com/apis/chart/ On Thu, Apr 10, 2008 at 10:05 AM, Sanhita Mallick <[EMAIL PROTECTED]> wrote: > Hi. > > I am a newbie to Python. I am trying to implement a > Python code for graph manipulation. My graphs

Re: Rounding a number to nearest even

2008-04-11 Thread Mikael Olofsson
[EMAIL PROTECTED] commented about rounding towards even numbers from mid-way between integers as opposed to for instance always rounding up in those cases: > Strange request though, why do you need it that way, because 2.5 is > CLOSER to 3 than to 2... That's exactly how I was taught to do roundi

Re: tkinter, overwrite Label-text?

2008-04-11 Thread Bryan Oakley
[EMAIL PROTECTED] wrote: > ok but i have trouble using grid. if i try to use a Label witht he > text answer in the following code it doenst work very well. > Can you describe "have trouble"? What sort of trouble -- syntax errors, the text never shows up, etc? Following is my attempt to use a la

Re: Rounding a number to nearest even

2008-04-11 Thread Graham Breed
On Apr 11, 6:14 pm, bdsatish <[EMAIL PROTECTED]> wrote: > The built-in function round( ) will always "round up", that is 1.5 is > rounded to 2.0 and 2.5 is rounded to 3.0. > > If I want to round to the nearest even, that is > > my_round(1.5) = 2# As expected > my_round(2.5) = 2# Not

Re: How is GUI programming in Python?

2008-04-11 Thread Michel Bouwmans
Steve Holden wrote: > Michel Bouwmans wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Mike Driscoll wrote: >> >>> On Apr 10, 12:05 pm, Michel Bouwmans <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul Rubin wrote: > C

Re: How is GUI programming in Python?

2008-04-11 Thread Michel Bouwmans
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gabriel Genellina wrote: > Another annoying thing with the Qt license is that you have to choose it > at the very start of the project. You cannot develop something using the > open source license and later decide to switch to the commercial licence >

Re: Rounding a number to nearest even

2008-04-11 Thread hdante
On Apr 11, 11:13 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > Shorter version: > def round3k(x): > return x % 1 != 0.5 and round(x) or round(x / 2.) * 2. Strangely, a "faster" version is: def fast_round(x): if x % 1 != 0.5: return round(x) return 2.0*round(x/2.0) > > nums =

Re: Graphs in Python

2008-04-11 Thread Philipp Pagel
greg_kr <[EMAIL PROTECTED]> wrote: > You should use Python with R. Google for Rpy, this is the best > Graphing you can do with Python The OP was refering to graph as in 'graph-theory', not plotting data. Of course, R has some packages for dealing with graphs in the former sense but I don't think t

Re: text adventure game problem

2008-04-11 Thread corvettecraz92
On Apr 11, 10:16 am, [EMAIL PROTECTED] wrote: > On Apr 11, 1:40 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > On Thu, 10 Apr 2008 05:06:42 -0700 (PDT), [EMAIL PROTECTED] > > declaimed the following in comp.lang.python: > > > > okay, that explains it... > > > could you provide a working exa

Re: Convert PyIDispatch object to struct IDispatch*

2008-04-11 Thread Huayang Xia
On Apr 11, 9:47 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Huayang Xia wrote: > > On Apr 11, 12:15 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > >> En Thu, 10 Apr 2008 18:45:04 -0300, Huayang Xia <[EMAIL PROTECTED]> > >> escribió: > > >>> I am trying to use ctypes to call dll functions.

Re: text adventure game problem

2008-04-11 Thread corvettecraz92
On Apr 11, 1:40 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 10 Apr 2008 05:06:42 -0700 (PDT), [EMAIL PROTECTED] > declaimed the following in comp.lang.python: > > > okay, that explains it... > > could you provide a working example of a two-room game using your > > method please so I

Re: Rounding a number to nearest even

2008-04-11 Thread Ivan Illarionov
On Apr 11, 5:49 pm, hdante <[EMAIL PROTECTED]> wrote: > On Apr 11, 9:45 am, bdsatish <[EMAIL PROTECTED]> wrote: > > > > > On Apr 11, 5:33 pm, bdsatish <[EMAIL PROTECTED]> wrote: > > > > HI Gerard, > > > > I think you've taken it to the best possible implementation. Thanks ! > > > On Apr 11, 5:14 pm

RE: unpack

2008-04-11 Thread ha bo
thank you i did find solution i did have just change: unpackedData = struct.unpack(unpackFormat, data) to unpackedData = struct.unpack(unpackFormat, data.decode('string_escape')) From: [EMAIL PROTECTED] Subject: Python-list Digest, Vol 55, Issue 179 To: python-list@python.org Date

Re: Graphs in Python

2008-04-11 Thread greg_kr
You should use Python with R. Google for Rpy, this is the best Graphing you can do with Python On Apr 11, 7:40 am, Philipp Pagel <[EMAIL PROTECTED]> wrote: > Sanhita Mallick <[EMAIL PROTECTED]> wrote: > > I have looked at that, and other similar ones all of > > which are based on Graphviz. > > Net

Re: String Literal to Blob

2008-04-11 Thread Steve Holden
Victor Subervi wrote: > Nope. Do not see it. My ugly stupid way works. I guess I will just > proceed with that and write my howto accordingly. > Victor > OK, but be prepared for some pretty scathing feedback. You will make it clear you do not understand the web. I'd suggest a little more reading

Re: Rounding a number to nearest even

2008-04-11 Thread hdante
On Apr 11, 9:45 am, bdsatish <[EMAIL PROTECTED]> wrote: > On Apr 11, 5:33 pm, bdsatish <[EMAIL PROTECTED]> wrote: > > > > > HI Gerard, > > > I think you've taken it to the best possible implementation. Thanks ! > > On Apr 11, 5:14 pm, Gerard Flanagan <[EMAIL PROTECTED]> wrote: > > > > In fact you c

Re: Convert PyIDispatch object to struct IDispatch*

2008-04-11 Thread Tim Golden
Huayang Xia wrote: > On Apr 11, 12:15 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Thu, 10 Apr 2008 18:45:04 -0300, Huayang Xia <[EMAIL PROTECTED]> >> escribió: >> >>> I am trying to use ctypes to call dll functions. One of the functions >>> requires argument "struct IDispatch* ". I d

Python plus

2008-04-11 Thread M�ta-MCI (MVP)
After IronPython, Python + iron : http://www.golfermania.com/SnakeEyes/PYTHON-PLUS-IRON.jpg ;o) Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert PyIDispatch object to struct IDispatch*

2008-04-11 Thread Huayang Xia
On Apr 11, 12:15 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 10 Apr 2008 18:45:04 -0300, Huayang Xia <[EMAIL PROTECTED]> > escribió: > > > I am trying to use ctypes to call dll functions. One of the functions > > requires argument "struct IDispatch* ". I do have a PyIDispatch objec

  1   2   >