Re: Directshow in Python

2008-09-18 Thread Thomas Heller
Sayanan Sivaraman schrieb: > Hey all, > > I'm trying to use DirectShow to display videos [I'm kind of new to > Python, from more of a C++ background on windows]. I found some > sample code online, but I am having trouble with calling the I > > import ctypes > from ctypes import * > from comtypes

Re: CTypes on a 64 bit machine truncates pointers to 32 bits?

2008-09-18 Thread Ron Garret
In article <[EMAIL PROTECTED]>, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > foolib = cdll.LoadLibrary('foo.so') > foolib.foo(0xF) > > 0 > > Shouldn't you tell ctypes that the argument and the result > of foo is a pointer? Yeah... that's it. Default return type is int, whic

Re: CTypes on a 64 bit machine truncates pointers to 32 bits?

2008-09-18 Thread Martin v. Löwis
foolib = cdll.LoadLibrary('foo.so') foolib.foo(0xF) > 0 Shouldn't you tell ctypes that the argument and the result of foo is a pointer? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: dict generator question

2008-09-18 Thread Paul Rubin
"Simon Mullis" <[EMAIL PROTECTED]> writes: > l = [ "1.1.1.1", "1.2.2.2", "1.2.2.3", "1.3.1.2", "1.3.4.5"] > ... > dict_of_counts = dict([(v[0:3], "count") for v in l]) Untested: def major_version(version_string): "convert '1.2.3.2' to '1.2'" return '.'.join(version_string.split(

Re: Program works great, except under less, cron or execl (Unicode?)

2008-09-18 Thread Sam
Diez for the win... :) sys.stdout.encoding does indeed have the proper value when called from the command line of UTF-8. But when piped into anything or called from anywhere it's None. Just for completeness, here's my test program: #!/usr/bin/env python import sys print sys.stdout.encoding And

Re: Launching a subprocess without waiting around for the result?

2008-09-18 Thread John Fabiani
erikcw wrote: > On Sep 18, 3:33 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: >> erikcw <[EMAIL PROTECTED]> writes: >> > I have a cgi script where users are uploading large files for >> > processing. I want to launch a subprocess to process the file so the >> > user doesn't have to wait for the page

Re: curses.setsyx()?

2008-09-18 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >I tried curses.setsyx(2,3) in my script and it doesn't move the curses >cursor. Any alternatives/solutions? Did you call doupdate after? setsyx just manipulates the data structures. It takes a call to doupdate to force those changes to take effect visually. -- Tim Rob

Re: improving a huge double-for cycle

2008-09-18 Thread Tino Wildenhain
Hi, Terry Reedy wrote: ... Yes, after figuring out what to do from the original post, I saw yours and then Pruebono's and decided that since two people had submitted the jackpot algorithm, I need not say more. I will say this: this solution amounts to finding equivalence classes (the sets of

Re: improving a huge double-for cycle

2008-09-18 Thread Terry Reedy
Steven D'Aprano wrote: On Thu, 18 Sep 2008 20:43:00 +0200, Bruno Desthuilliers wrote: Now the obvious winner is pruebono - even unoptimized, using sets seems to be *way* faster than even the most optimized corrected version of your algorithm. I'm not being snarky about losing priority here, b

Re: Extracting hte font name from a TrueType font file

2008-09-18 Thread Aaron "Castironpi" Brady
On Sep 18, 7:48 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Fredrik Lundh wrote: > > Steve Holden wrote: > > >> Does anyone have a Python recipe for this? > > from PIL import ImageFont > f = ImageFont.truetype("/windows/fonts/verdanai.ttf", 1) > f.font.family > > 'Verdana' > f

Re: Do HTTPError objects always have a read method?

2008-09-18 Thread Gabriel Genellina
En Thu, 18 Sep 2008 23:12:22 -0300, Gabriel Genellina <[EMAIL PROTECTED]> escribió: En Wed, 17 Sep 2008 22:48:27 -0300, Steven D'Aprano <[EMAIL PROTECTED]> escribió: Under what circumstances do HTTPError objects not have a valid file object? How common is this? Does anyone have an example

Re: Deflate with urllib2...

2008-09-18 Thread Sam
For those that are interested, but don't want to bother running the program themselves, here's the output I get. Trying: http://slashdot.org http://slashdot.org - Apache/1.3.41 (Unix) mod_perl/1.31-rc4 (deflate) Errored out on this site. Trying: http://www.hotmail.com http://www.hotmail.c

Re: Deflate with urllib2...

2008-09-18 Thread Sam
On Sep 18, 2:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 16 Sep 2008 21:58:31 -0300, Sam <[EMAIL PROTECTED]> escribió: > The code is correct - try with another server. I tested it with a   > LightHTTPd server and worked fine. Gabriel... I found a bunch of servers to test it on

Re: Do HTTPError objects always have a read method?

2008-09-18 Thread Gabriel Genellina
En Wed, 17 Sep 2008 22:48:27 -0300, Steven D'Aprano <[EMAIL PROTECTED]> escribió: I understood that HTTPError objects always have a read method, so they can be treated as if they were a webpage. E.g. something like this simplified snippet: address = 'http://www.yahoo.com/spamspamspamspamspam

Re: improving a huge double-for cycle

2008-09-18 Thread bearophileHUGS
bearophile: > doubles12 : 0.00184026840268 For fun, and to have an almost baseline reference, I have done a little benchmark in D too: import std.stdio: writefln; // Using Tango std lib you don't need all this version (Win32) { import std.c.windows.windows; double clock() { long

Re: Launching a subprocess without waiting around for the result?

2008-09-18 Thread Ben Finney
erikcw <[EMAIL PROTECTED]> writes: > On Sep 18, 3:33 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > erikcw <[EMAIL PROTECTED]> writes: > > > What is the correct way to launch subprocess without waiting for > > > the result to return? > > > > Creating an instance of 'subprocess.Popen' will launch

CTypes on a 64 bit machine truncates pointers to 32 bits?

2008-09-18 Thread Ron Garret
CTypes on a 64-bit machine appears to be truncating pointers to 32 bits: [EMAIL PROTECTED]:~]$ uname -a Linux monster1 2.6.18-6-amd64 #1 SMP Mon Jun 16 22:30:01 UTC 2008 x86_64 GNU/Linux [EMAIL PROTECTED]:~]$ cat foo.c void* foo(void* x) { return x; } [EMAIL PROTECTED]:~]$ gcc -fPIC -shared foo.c

webbrowser fragment identifier

2008-09-18 Thread scottbvfx
Hi, I'm trying to launch a web browser along with an html file with a fragment identifier in its path. I'm using the webbrowser module for this. ie. webbrowser.open('file:///C:/myfile.html#SomeEntryInTheHTML') for some reason it is truncating the path to 'file:///C:/myfile.html'. Does anyone kno

Re: Extracting hte font name from a TrueType font file

2008-09-18 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: > >> Does anyone have a Python recipe for this? > from PIL import ImageFont f = ImageFont.truetype("/windows/fonts/verdanai.ttf", 1) f.font.family > 'Verdana' f.font.style > 'Italic' > Thanks so much, Fredrik. The reason I asked is b

Re: PEP proposal optparse

2008-09-18 Thread James Mills
On Thu, Sep 18, 2008 at 9:02 PM, James Nicolson <[EMAIL PROTECTED]> wrote: > Perhaps it is better to keep descriptions short and store longer > descriptions elsewhere, but there are many programs that have long > descriptions, for example try: ls --help (at least on my machine a lot > of these desc

Re: Twisted vs Python Sockets

2008-09-18 Thread James Mills
On Fri, Sep 19, 2008 at 6:24 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > James Matthews wrote: > >> I am wondering what are the major points of twisted over regular python >> sockets. I am looking to write a TCP server and want to know the pros can >> cons of using one over the other. > > Twiste

Re: Python newbie question re Strings and integers

2008-09-18 Thread rmac
Ah! Arghh!!! You are so correct on the usage of the ':' Python syntax is a little different from what I am used to. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: improving a huge double-for cycle

2008-09-18 Thread Steven D'Aprano
On Thu, 18 Sep 2008 20:43:00 +0200, Bruno Desthuilliers wrote: > Now the obvious winner is pruebono - even unoptimized, using sets seems > to be *way* faster than even the most optimized corrected version of > your algorithm. I'm not being snarky about losing priority here, but I submitted essen

Re: Python newbie question re Strings and integers

2008-09-18 Thread Miki
>     currentSymbol=filename[int(filenameStart),int(extensionStart)] Should be currentSymbol=filename[int(filenameStart):int(extensionStart)] (change , to :) You don't need to convert to int all the time, rfind will return an integer. Also you can use os.path for this from os.path import

Re: Python newbie question re Strings and integers

2008-09-18 Thread Christian Heimes
rmac wrote: the following code attempts to extract a symbol name from a string: extensionStart = int(filename.rfind('.')) filenameStart = int(filename.rfind('/')) #print 'Extension Start - ' + str(extensionStart) #print 'FileName Start - ' + str(filenameStart) currentSymbol=f

Re: Launching a subprocess without waiting around for the result?

2008-09-18 Thread erikcw
On Sep 18, 3:33 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > erikcw <[EMAIL PROTECTED]> writes: > > I have a cgi script where users are uploading large files for > > processing. I want to launch a subprocess to process the file so the > > user doesn't have to wait for the page to load. > > For "how

Re: improving a huge double-for cycle

2008-09-18 Thread bearophileHUGS
Bruno Desthuilliers: > def doubles9(): > ... > SN = [] > sn_append = SN.append Few more: import psyco def doubles10(): dup = set() SN = [] for item in IN: c = item.coordinates if c in dup: SN.append(item) else: dup.add

Python newbie question re Strings and integers

2008-09-18 Thread rmac
the following code attempts to extract a symbol name from a string: extensionStart = int(filename.rfind('.')) filenameStart = int(filename.rfind('/')) #print 'Extension Start - ' + str(extensionStart) #print 'FileName Start - ' + str(filenameStart) currentSymbol=filename[int(f

curses.setsyx()?

2008-09-18 Thread linkmaster032000
I tried curses.setsyx(2,3) in my script and it doesn't move the curses cursor. Any alternatives/solutions? -- http://mail.python.org/mailman/listinfo/python-list

Re: Automated Build System ?

2008-09-18 Thread Martin v. Löwis
> I'm working on a python Package which includes some extension modules > and unit tests. I want to automate some tasks like "build extsion > module, then copy xxx.pyd to folder yyy and run all unit tests from > folder ". > > I used google but found no hints to existing solutions. > Can anybod

Re: Launching a subprocess without waiting around for the result?

2008-09-18 Thread Ben Finney
erikcw <[EMAIL PROTECTED]> writes: > I have a cgi script where users are uploading large files for > processing. I want to launch a subprocess to process the file so the > user doesn't have to wait for the page to load. For "how do I deal with subprocesses from Python", the (new in Python 2.4) 's

Intercepting printed strings

2008-09-18 Thread Robert Dailey
Hi, I'm currently using Python 3.0 b3 and I'm curious as to how I can go about intercepting things send to print() for some intermediate processing before they're actually sent to sys.stdout. Right now I've thought of the following: Replace sys.stdout with a class named PrintStream. PrintStream i

Directshow in Python

2008-09-18 Thread Sayanan Sivaraman
Hey all, I'm trying to use DirectShow to display videos [I'm kind of new to Python, from more of a C++ background on windows]. I found some sample code online, but I am having trouble with calling the I import ctypes from ctypes import * from comtypes import client from ctypes.wintypes import *

Launching a subprocess without waiting around for the result?

2008-09-18 Thread erikcw
Hi, I have a cgi script where users are uploading large files for processing. I want to launch a subprocess to process the file so the user doesn't have to wait for the page to load. What is the correct way to launch subprocess without waiting for the result to return? Thanks! -- http://mail.py

Re: Deflate with urllib2...

2008-09-18 Thread Gabriel Genellina
En Tue, 16 Sep 2008 21:58:31 -0300, Sam <[EMAIL PROTECTED]> escribió: Gabriel, et al. It's hard to find a web site that uses deflate these days. Luckily, slashdot to the rescue. I even wrote a test script. If someone can tell me what's wrong that would be great. Here's what I get when I run

Re: improving a huge double-for cycle

2008-09-18 Thread Bruno Desthuilliers
Alexzive a écrit : Hello there :) , I am a python newbie and need to run following code for a task in an external simulation programm called "Abaqus" which makes use of python to access the mesh (ensamble of nodes with xy coordinates) of a certain geometrical model. [IN is the starting input co

Re: Extracting hte font name from a TrueType font file

2008-09-18 Thread Fredrik Lundh
Steve Holden wrote: Does anyone have a Python recipe for this? >>> from PIL import ImageFont >>> f = ImageFont.truetype("/windows/fonts/verdanai.ttf", 1) >>> f.font.family 'Verdana' >>> f.font.style 'Italic' -- http://mail.python.org/mailman/listinfo/python-list

Re: creating an (inefficent) alternating regular expression from a list of options

2008-09-18 Thread metaperl.com
On Sep 9, 12:42 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > you may also want to do re.escape on all the words, to avoid surprises > when the choices contain special characters. yes, thank you very much: import re def oneOf(s): alts = sorted(s.split(), reverse=True) alts = [re.esca

Re: Twisted vs Python Sockets

2008-09-18 Thread Fredrik Lundh
James Matthews wrote: I am wondering what are the major points of twisted over regular python sockets. I am looking to write a TCP server and want to know the pros can cons of using one over the other. Twisted is a communication framework with lots of ready-made components: http://twisted

Re: improving a huge double-for cycle

2008-09-18 Thread Bruno Desthuilliers
Harald Luessen a écrit : (snip) I did not test the syntax, but here is an idea with sorted lists. It should be O(NlogN). def sk(x): return x.coordinates[0] IN.sort(key=sk) for i in xrange(len(IN)): for j in xrange(i+1, len(IN)): if IN[i].coordinates[0] == IN[j].coordinates[0]:

Re: improving a huge double-for cycle

2008-09-18 Thread Paul Hankin
On Sep 18, 2:25 pm, Alexzive <[EMAIL PROTECTED]> wrote: > Hello there :) , > > I am a python newbie and need to run following code for a task in an > external simulation programm called "Abaqus" which makes use of python > to access the mesh (ensamble of nodes with xy coordinates) of a > certain ge

Twisted vs Python Sockets

2008-09-18 Thread James Matthews
Hi I am wondering what are the major points of twisted over regular python sockets. I am looking to write a TCP server and want to know the pros can cons of using one over the other. Thanks James -- http://www.goldwatches.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: creating an (inefficent) alternating regular expression from a list of options

2008-09-18 Thread metaperl.com
On Sep 9, 9:23 am, [EMAIL PROTECTED] wrote: >     >> I really dont care if theexpressionis optimal. So the goal is >     >> something like: > >     >> vowel_regexp = oneOf("a aa i ii u uu".split())  # yielding r'(aa|a|uu| >     >> u|ii|i)' > >     >> Is there a public module available for this purp

Re: improving a huge double-for cycle

2008-09-18 Thread Paul Hankin
On Sep 18, 2:25 pm, Alexzive <[EMAIL PROTECTED]> wrote: > Hello there :) , > > I am a python newbie and need to run following code for a task in an > external simulation programm called "Abaqus" which makes use of python > to access the mesh (ensamble of nodes with xy coordinates) of a > certain ge

Re: Python and Open Office

2008-09-18 Thread David Boddie
On Wednesday 17 September 2008 21:59, Terry Reedy wrote: > Hartmut Goebel wrote: >> Terry Reedy schrieb: >> >> The API docs are a bit hidden on the webpage. Here is the link: >> > > I wrote my comment *after* looking at the above, whic

Re: SMTP via GMAIL

2008-09-18 Thread Chris Babcock
> >> Traceback (most recent call last): > >> File "mail5.py", line 21, in > >> session = smtplib.SMTP(SMTPserver,port) > >> File "/usr/local/lib/python2.5/smtplib.py", line 244, in __init__ > >> (code, msg) = self.connect(host, port) > >> File "/usr/local/lib/python2.5/smtplib.py",

Re: Blanket font setting?

2008-09-18 Thread giltay
On Sep 18, 12:55 pm, RGK <[EMAIL PROTECTED]> wrote: > Is there any sort of blanket font setting, perhaps like: > >    wx.SystemSettings_SetFont(font)   #this doesn't exist > > that could set everything with one fell swoop? > > Thanks for your attention... > > Ross. I do this by setting the font in

Python, Factset, and Excel - Oh my!

2008-09-18 Thread Desmond Scott E
I'm still a Python novice. I'm still attempting to migrate a Python-based process from Windows2000/Python v2.4.2 (#67)/Excel2000 to WindowsXP/Python v2.5.2 (r252:60911)/Excel2003. I now have a new "opportunity"! I need some help with the step in the Python script that calls Excel and invokes the Fa

Re: dict generator question

2008-09-18 Thread Gerard flanagan
George Sakkis wrote: On Sep 18, 11:43 am, Gerard flanagan <[EMAIL PROTECTED]> wrote: Simon Mullis wrote: Hi, Let's say I have an arbitrary list of minor software versions of an imaginary software product: l = [ "1.1.1.1", "1.2.2.2", "1.2.2.3", "1.3.1.2", "1.3.4.5"] I'd like to create a dict wit

Re: minimum install & pickling

2008-09-18 Thread Aaron "Castironpi" Brady
On Sep 18, 5:20 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 17 Sep, 22:18, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> > wrote: > > > On Sep 17, 4:43 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > > > >http://wiki.python.org/moin/How_can_I_run_an_untrusted_Python_script_...) > > > These solu

Re: improving a huge double-for cycle

2008-09-18 Thread Harald Luessen
On Thu, 18 Sep 2008 Alexzive wrote: >I am a python newbie and need to run following code for a task in an >external simulation programm called "Abaqus" which makes use of python >to access the mesh (ensamble of nodes with xy coordinates) of a >certain geometrical model. > >[IN is the starting inpu

Re: Cython dynamic library problem

2008-09-18 Thread Tommy Grav
On Sep 18, 2008, at 12:35 PM, Rob Wolfe wrote: I would try to use `distutils` because this package is much wiser than me and knows all necessary switches for gcc. ;) That worked! Thanks Cheers Tommy -- http://mail.python.org/mailman/listinfo/python-list

PyCon 2009 (US) - Call for Tutorials

2008-09-18 Thread Greg Lindstrom
*Pycon 2009 (US) – Call for Tutorials* The period for submitting tutorial proposals for Pycon 2009 (US) is now open and will continue through Friday, October 31th. This year features two "pre-conference" days devoted to tutorials on Wednesday March 25 & Thursday March 26 in Chicago. This allows fo

RE: Extracting hte font name from a TrueType font file

2008-09-18 Thread Andreas Tawn
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] g] On Behalf Of Steve Holden > Sent: Thursday, September 18, 2008 5:59 PM > To: python-list@python.org > Subject: Extracting hte font name from a TrueType font file > > Does anyone have a Python recipe for this? >

Re: PEP proposal optparse

2008-09-18 Thread Grant Edwards
On 2008-09-18, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Thu, 18 Sep 2008 11:07:45 -0500, Grant Edwards wrote: > >> While we're making suggestions, I've always wished that the --help >> output displayed the default values for options in addition to the help >> text specified by the u

Re: Zsi interoperability

2008-09-18 Thread Marco Bizzarri
On Thu, Sep 18, 2008 at 7:10 PM, Dieter Maurer <[EMAIL PROTECTED]> wrote: > "Marco Bizzarri" <[EMAIL PROTECTED]> writes on Mon, 15 Sep 2008 20:26:27 > +0200: >> On Mon, Sep 15, 2008 at 8:15 PM, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> > Mailing List SVR wrote: >> >> I have to implement a soap w

Re: How to Determine Name of the Day in the Week

2008-09-18 Thread Mensanator
On Sep 18, 12:01 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 17 Sep 2008 20:34:02 -0700, Mensanator wrote: > > And technically, weeks begin on Sunday, not Monday, but business likes > > to think of Monday as day 0 of the week and it doesn't conflict with any > > prior date format. > >

Re: improving a huge double-for cycle

2008-09-18 Thread giltay
On Sep 18, 11:18 am, [EMAIL PROTECTED] wrote: > dup=set() > SN=[] > for item in IN: >    c=item.coordinates[0], item.coordinates[1] >    if c in dup: >       SN.append(item.label) >    else: >       dup.add(c) +1 for O(N) If item.coordinates is just an (x, y) pair, you can skip building c and sav

Re: append on lists

2008-09-18 Thread Steve Holden
Armin wrote: > Duncan Booth wrote: >> "Chris Rebert" <[EMAIL PROTECTED]> wrote: >>> On Tue, Sep 16, 2008 at 1:20 AM, Armin <[EMAIL PROTECTED]> wrote: [1,2,3,4,7].append(c) -> Is this a valid expression? >>> Literally, no, because you can't call methods on literals. >> >> Rubbish. There is no

Re: Cython dynamic library problem

2008-09-18 Thread Tommy Grav
On Sep 18, 2008, at 12:35 PM, Rob Wolfe wrote: I would try to use `distutils` because this package is much wiser than me and knows all necessary switches for gcc. ;) That worked! Thanks Cheers Tommy -- http://mail.python.org/mailman/listinfo/python-list

Re: Zsi interoperability

2008-09-18 Thread Dieter Maurer
"Marco Bizzarri" <[EMAIL PROTECTED]> writes on Mon, 15 Sep 2008 20:26:27 +0200: > On Mon, Sep 15, 2008 at 8:15 PM, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > Mailing List SVR wrote: > >> I have to implement a soap web services from wsdl, the server is > >> developed using oracle, is zsi or some o

Re: Zsi interoperability

2008-09-18 Thread Dieter Maurer
Mailing List SVR <[EMAIL PROTECTED]> writes on Tue, 16 Sep 2008 08:31:13 +0200: > ... > however my server require client > certificate authentication, > > does soaplib or zsi work in this environment? ZSI allows you to provide an alternative transport. That's the usual way to let ZSI work over "h

Re: Tkinter Bold Text

2008-09-18 Thread Guilherme Polo
On Thu, Sep 18, 2008 at 1:06 PM, April Lekin <[EMAIL PROTECTED]> wrote: > Is there any way to highlight, bold or change the color of one word in a > variable to be displayed on a Tkinter GUI? Yes. > > Like: > > material = "Plastic" > introVal = "This report describes the construction of the %s."

Tkinter Bold Text

2008-09-18 Thread April Lekin
Is there any way to highlight, bold or change the color of one word in a variable to be displayed on a Tkinter GUI? Like: material = "Plastic" introVal = "This report describes the construction of the %s." % (material) this is what I want: This report describes the construction of the Plastic.

Re: append on lists

2008-09-18 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Sep 16, 6:03 am, Peter Anderson <[EMAIL PROTECTED]> > wrote: >> "/... I don't think you've thought this one through, really./" >> snip >> >> We ought to try and be a little kinder to others on the list, don't you >> think? :-) >> >> snip > > Well said! >From personal

Re: Cython dynamic library problem

2008-09-18 Thread bearophileHUGS
Rob Wolfe: > # setup.py > from distutils.core import setup > from distutils.extension import Extension > from Cython.Distutils import build_ext as build_pyx > > setup(name = 'pyx_test', > ext_modules=[Extension('pyx_test', ['test_cython.pyx'])], > cmdclass = { 'build_ext': build_pyx })

Re: PEP proposal optparse

2008-09-18 Thread Marc 'BlackJack' Rintsch
On Thu, 18 Sep 2008 11:07:45 -0500, Grant Edwards wrote: > While we're making suggestions, I've always wished that the --help > output displayed the default values for options in addition to the help > text specified by the user. I end up having to enter the default values > twice -- once as a ke

Extracting hte font name from a TrueType font file

2008-09-18 Thread Steve Holden
Does anyone have a Python recipe for this? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Blanket font setting?

2008-09-18 Thread RGK
I'm doing an app with the AUI manager capabilities (using some of the wxPython demo's for help). All is well, except I'm a bit disappointed with the font management. The default font for all the widgets (TextCtrl's, StaticText's etc) are a bit large for my design intent and as I try to adjust

Re: Cython dynamic library problem

2008-09-18 Thread Rob Wolfe
Tommy Grav <[EMAIL PROTECTED]> writes: > I am trying to learn how to use cython, and while I am following the > cython-dev > mailing list I didn't feel like this question was totally appropriate > for its audience > so I am trying here first. [...] > Does anyone know what the ImportError means a

Out of memory issue with dialog box

2008-09-18 Thread numan . salati
Hi, We have a mutilthreaded process in which one of the threads uses too much memory causing the process to run out of memory. However when this happens we see a dialog box pop up with the message "fatal error in GC : too many heap sections." When you click "ok" only then does the process die. Is

TCP Server

2008-09-18 Thread James Matthews
Dear List, I am looking to write a TCP socket server and was wondering what are the pros and cons of using twisted over the sockets modules bundled in python? Thanks James -- http://www.goldwatches.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP proposal optparse

2008-09-18 Thread Tim Chase
Grant Edwards wrote: While we're making suggestions, I've always wished that the --help output displayed the default values for options in addition to the help text specified by the user. I end up having to enter the default values twice -- once as a keyword argument and again in the help text.

Re: locks

2008-09-18 Thread kalin m
yea... sorry... i just have all python stuff in the same folder and messed up... [EMAIL PROTECTED] wrote: kalin> mailman has been locking one list out. the web interface just kalin> hangs and it generates a bunch of locks. it seems that it can not kalin> write to a log but not

Re: Installing pySerial

2008-09-18 Thread Grant Edwards
On 2008-09-18, Joe G (Home) <[EMAIL PROTECTED]> wrote: > Hi All, > > Background >=== > I have installed Python for windows today from the python web site .I also > installed pySerial using the Windows installer from the sourceforge web > site. Both installs use the default di

Tkinter Bold Text

2008-09-18 Thread April Lekin
Is there any way to highlight, bold or change the color of one word in a variable to be displayed on a Tkinter GUI? Like: material = "Plastic" introVal = "This report describes the construction of the %s." % (material) this is what I want: This report describes the construction of the Plastic.

Re: PEP proposal optparse

2008-09-18 Thread Grant Edwards
While we're making suggestions, I've always wished that the --help output displayed the default values for options in addition to the help text specified by the user. I end up having to enter the default values twice -- once as a keyword argument and again in the help text. Then later when I deci

Automated Build System ?

2008-09-18 Thread Uwe Schmitt
Hi, I'm working on a python Package which includes some extension modules and unit tests. I want to automate some tasks like "build extsion module, then copy xxx.pyd to folder yyy and run all unit tests from folder ". I used google but found no hints to existing solutions. Can anybody help me

Re: Installing pySerial

2008-09-18 Thread Richard Brodie
"Joe G (Home)" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have installed Python for windows today from the python web site .I also > installed > pySerial using the Windows installer from the sourceforge web site. You need to read the pySerial smallprint, where it say

Re: Installing pySerial

2008-09-18 Thread Tim Golden
Joe G (Home) wrote: Hi All, Background === I have installed Python for windows today from the python web site .I also installed pySerial using the Windows installer from the sourceforge web site. Both installs use the default directories. Phyton version: Python 2.5.

ANN: Wing IDE for Python v. 3.1.4 released

2008-09-18 Thread Wingware
Hi, Wingware has released version 3.1.4 of Wing IDE. This bug fix release is available for all three product levels of Wing IDE. *Release Highlights* This release includes the following: * Debugger support for Python 2.6 * Support zope buildout directories not named "instance" * Added highlig

Re: dict generator question

2008-09-18 Thread Simon Mullis
Haha! Thanks for all of the suggestions... (I love this list!) SM 2008/9/18 <[EMAIL PROTECTED]>: > On Sep 18, 10:54 am, "Simon Mullis" <[EMAIL PROTECTED]> wrote: >> Hi, >> >> Let's say I have an arbitrary list of minor software versions of an >> imaginary software product: >> >> l = [ "1.1.1.1"

Re: dict generator question

2008-09-18 Thread George Sakkis
On Sep 18, 11:43 am, Gerard flanagan <[EMAIL PROTECTED]> wrote: > Simon Mullis wrote: > > Hi, > > > Let's say I have an arbitrary list of minor software versions of an > > imaginary software product: > > > l = [ "1.1.1.1", "1.2.2.2", "1.2.2.3", "1.3.1.2", "1.3.4.5"] > > > I'd like to create a dict

Re: improving a huge double-for cycle

2008-09-18 Thread Tino Wildenhain
Tino Wildenhain wrote: Hi, Alexzive wrote: Hello there :) , I am a python newbie and need to run following code for a task in an external simulation programm called "Abaqus" which makes use of python to access the mesh (ensamble of nodes with xy coordinates) of a certain geometrical model. [I

Installing pySerial

2008-09-18 Thread Joe G (Home)
Hi All, Background === I have installed Python for windows today from the python web site .I also installed pySerial using the Windows installer from the sourceforge web site. Both installs use the default directories. Phyton version: Python 2.5.2 (r252:60911, Feb 21 2

Re: dict generator question

2008-09-18 Thread pruebauno
On Sep 18, 10:54 am, "Simon Mullis" <[EMAIL PROTECTED]> wrote: > Hi, > > Let's say I have an arbitrary list of minor software versions of an > imaginary software product: > > l = [ "1.1.1.1", "1.2.2.2", "1.2.2.3", "1.3.1.2", "1.3.4.5"] > > I'd like to create a dict with major_version : count. > > (

Re: improving a huge double-for cycle

2008-09-18 Thread Tino Wildenhain
Hi, Alexzive wrote: Hello there :) , I am a python newbie and need to run following code for a task in an external simulation programm called "Abaqus" which makes use of python to access the mesh (ensamble of nodes with xy coordinates) of a certain geometrical model. [IN is the starting input

Re: dict generator question

2008-09-18 Thread Gerard flanagan
Simon Mullis wrote: Hi, Let's say I have an arbitrary list of minor software versions of an imaginary software product: l = [ "1.1.1.1", "1.2.2.2", "1.2.2.3", "1.3.1.2", "1.3.4.5"] I'd like to create a dict with major_version : count. (So, in this case: dict_of_counts = { "1.1" : "1",

Re: improving a huge double-for cycle

2008-09-18 Thread Jake Anderson
psyco might help a fair bit (10x-40x) here ;-> perhaps look at dumping the data into sqlite then pulling it back out. It (or the other databases) are designed for tossing around large lumps of data. Alexzive wrote: Hello there :) , I am a python newbie and need to run following code for a t

Re: dict generator question

2008-09-18 Thread George Sakkis
On Sep 18, 10:54 am, "Simon Mullis" <[EMAIL PROTECTED]> wrote: > Hi, > > Let's say I have an arbitrary list of minor software versions of an > imaginary software product: > > l = [ "1.1.1.1", "1.2.2.2", "1.2.2.3", "1.3.1.2", "1.3.4.5"] > > I'd like to create a dict with major_version : count. > > (

Re: dict generator question

2008-09-18 Thread pruebauno
On Sep 18, 10:54 am, "Simon Mullis" <[EMAIL PROTECTED]> wrote: > Hi, > > Let's say I have an arbitrary list of minor software versions of an > imaginary software product: > > l = [ "1.1.1.1", "1.2.2.2", "1.2.2.3", "1.3.1.2", "1.3.4.5"] > > I'd like to create a dict with major_version : count. > > (

Re: unicode in multi-line strings

2008-09-18 Thread Diez B. Roggisch
Jiri Barton wrote: > Hello, > > I have a problem with international characters in multi-line strings. > > > Works: '''á''' > > Works: ''' > a''' > > Does not work: ''' > á''' > > > By does not work I mean the infamous > > 'ascii' codec can't encode character u'\xe1' in position 4: ordinal

Re: dict generator question

2008-09-18 Thread marek . rocki
Simon Mullis napisał(a): > Something like: > > dict_of_counts = dict([(v[0:3], "count") for v in l]) > > I can't seem to figure out how to get "count", as I cannot do x += 1 > or x++ as x may or may not yet exist, and I haven't found a way to > create default values. It seems to me that the "count

Re: ANN: Python GUI development using XULRunner

2008-09-18 Thread Don Spaulding
On Sep 17, 5:53 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Sep 17, 1:21 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: > >> Don Spaulding wrote: > >>> On Sep 16, 8:29 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: > I've put together a tutorial that shows off ho

unicode in multi-line strings

2008-09-18 Thread Jiri Barton
Hello, I have a problem with international characters in multi-line strings. Works: '''á''' Works: ''' a''' Does not work: ''' á''' By does not work I mean the infamous 'ascii' codec can't encode character u'\xe1' in position 4: ordinal not in range(128) I'm using Ubuntu 8.04 with Pytho

Re: improving a huge double-for cycle

2008-09-18 Thread pruebauno
On Sep 18, 8:25 am, Alexzive <[EMAIL PROTECTED]> wrote: > Hello there :) , > > I am a python newbie and need to run following code for a task in an > external simulation programm called "Abaqus" which makes use of python > to access the mesh (ensamble of nodes with xy coordinates) of a > certain ge

Re: Modifying the system menu

2008-09-18 Thread raj . indian . 08
On Sep 18, 6:39 am, [EMAIL PROTECTED] wrote: > I tested it again and found that the behaviour is a little different > from what I mentioned previously in the mailchain. > The item is working perfectly the first time around. Now if I close > the application and run it again (which was what I did ear

Re: A unique instance of Python GUI program

2008-09-18 Thread Grant Edwards
On 2008-09-16, akineko <[EMAIL PROTECTED]> wrote: > This may not be a Python specific challenge. I have a GUI > program written in Python + Tkinter. It works very well. > > Now, I would like to start it from a shell script. As my GUI > program includes a server, it should not have more than one >

dict generator question

2008-09-18 Thread Simon Mullis
Hi, Let's say I have an arbitrary list of minor software versions of an imaginary software product: l = [ "1.1.1.1", "1.2.2.2", "1.2.2.3", "1.3.1.2", "1.3.4.5"] I'd like to create a dict with major_version : count. (So, in this case: dict_of_counts = { "1.1" : "1", "1.2" : "

Re: Problem occured while sending mail

2008-09-18 Thread Peter Pearson
On Wed, 17 Sep 2008 23:53:36 -0700 (PDT), sui <[EMAIL PROTECTED]> wrote: > On Sep 17, 8:04 pm, Peter Pearson <[EMAIL PROTECTED]> wrote: >> On Wed, 17 Sep 2008 05:28:05 -0700 (PDT), sui <[EMAIL PROTECTED]> wrote: [snip] >> > socket.error: (110, 'Connection timed out') [snip] >> As a simple connectiv

  1   2   >