ANN: pythonutils 0.2.1

2005-09-09 Thread Fuzzyman
Hello Python Folk, pythonutils 0.2.1 is now available. This is a *major* update since 0.1.0 http://www.voidspace.org.uk/python/modules.shtml#pythonutils http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py?file=pythonutils-0.2.1.win32.zip

Re: List of integers L.I.S. (SPOILER)

2005-09-09 Thread n00m
Bravo, Bryan! It's incredibly fast! But your code got WA (wrong answer). See my latest submission: http://spoj.sphere.pl/status/SUPPER/ Maybe you slipped a kind of typo in it? Silly boundary cases? -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python with COM to communicate with proprietary Windows software

2005-09-09 Thread Thomas Heller
Joakim Persson [EMAIL PROTECTED] writes: [...] This means that I must come up with a way to interface Python with this log tool. After some investigations, I have run inte problems -- my inital approach was to use Python + win32com to communicate with the COM interface. Unfortunately, it

Re: Question about consistency in python language

2005-09-09 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: Let's say I define a list of pairs as follows: l = [('d', 3), ('a', 2), ('b', 1)] Can anyone explain why this does not work? h = {}.update(l) and instead I have to go: h = {} h.update(l) to initialize a dictionary with the given list of pairs? when an

Re: What's the difference between VAR and _VAR_?

2005-09-09 Thread EP
I thought there must be something special when you named a VAR with '_' the first character. Maybe it's just a programming style and I had thought too much... Perhaps you are thinking of the use of double leading underscore names within class declarations or system defined names with

Re: List of integers L.I.S. (SPOILER)

2005-09-09 Thread n00m
Bravo, Bryan! Looks very neat! (pity I can't give it a try in my Py 2.3.4 because of reversed() and sorted() functions) And I've submitted it but got ... TLEs: http://spoj.sphere.pl/status/SUPPER/ Funnily, the exec.time of the best C solution is only 0.06s! PS In my 1st submission I overlooked

python script under windows

2005-09-09 Thread Jan Gregor
Hello I run python script on another computer and want to survive that script after my logout. the script also uses drive mapping to network drive. Can you help me ? Or better is there some info for unix person how to survive with python on windows ;-) thanks, jan gregor --

sys.stdout

2005-09-09 Thread Sébastien Boisgérault
Hi, The sys.stdout stream behaves strangely in my Python2.4 shell: import sys sys.stdout.write() sys.stdout.write(\n) sys.stdout.write(\n) sys.stdout.flush() [...nothing...] Have you ever seen sys.stdout behave like that ? Any idea

Re: List of integers L.I.S. (SPOILER)

2005-09-09 Thread Bryan Olson
n00m wrote: Bravo, Bryan! It's incredibly fast! Not compared to a good implementation for a compiled, low-level language. But your code got WA (wrong answer). See my latest submission: http://spoj.sphere.pl/status/SUPPER/ Maybe you slipped a kind of typo in it? Silly boundary cases?

Re: sys.stdout

2005-09-09 Thread tiissa
Sébastien Boisgérault a écrit : The sys.stdout stream behaves strangely in my Python2.4 shell: import sys sys.stdout.write() sys.stdout.write(\n) sys.stdout.write(\n) sys.stdout.flush() [...nothing...] There are two things

Re: Sockets: code works locally but fails over LAN

2005-09-09 Thread Bryan Olson
n00m wrote: [...] Btw, the newest oops in the topic's subject is: the code does not work in the case of: sqls_host, sqls_port = '192.168.0.8', 1433 proxy_host, proxy_port = '192.168.0.3', 1434 ## proxy_host, proxy_port = '127.0.0.1', 1434 ## proxy_host, proxy_port = '', 1434 I.e.

Re: List of integers L.I.S. (SPOILER)

2005-09-09 Thread n00m
Oops Bryan... I've removed my reply that you refer to... See my previous - CORRECT - reply. The code just times out... In some sense it doesn't matter right or wrong is its output. Btw, what is the complexity of your algorithm? Currently I'm at work and it's not easy for me to concentrate on our

Re: sys.stdout

2005-09-09 Thread Sébastien Boisgérault
Tiissa, Thanks for your answer. The execution of your example leads to a 'aaa' display during 2 secs, before it is erased by the prompt. This behavior is standard ? The standard output is not supposed to *concatenate* the 'aaa' and the '' ? SB --

Inconsistent reaction to extend

2005-09-09 Thread Jerzy Karczmarczuk
Gurus, before I am tempted to signal this as a bug, perhaps you might convince me that it should be so. If I type l=range(4) l.extend([1,2]) l gives [0,1,2,3,1,2], what else... On the other hand, try p=range(4).extend([1,2]) Then, p HAS NO VALUE (NoneType). With append the behaviour is

Re: sys.stdout

2005-09-09 Thread Robert Kern
Sébastien Boisgérault wrote: Tiissa, Thanks for your answer. The execution of your example leads to a 'aaa' display during 2 secs, before it is erased by the prompt. This behavior is standard ? The standard output is not supposed to *concatenate* the 'aaa' and the '' ? FWIW: Python

Re: Inconsistent reaction to extend

2005-09-09 Thread Timo
Jerzy Karczmarczuk kirjoitti: On the other hand, try p=range(4).extend([1,2]) Then, p HAS NO VALUE (NoneType). With append the behaviour is similar. I didn't try other methods, but I suspect that it won't improve. WHY? range(4) returns a list and Python's list.extend() returns None.

Re: Inconsistent reaction to extend

2005-09-09 Thread Robert Kern
Jerzy Karczmarczuk wrote: Gurus, before I am tempted to signal this as a bug, perhaps you might convince me that it should be so. If I type l=range(4) l.extend([1,2]) l gives [0,1,2,3,1,2], what else... On the other hand, try p=range(4).extend([1,2]) Then, p HAS NO VALUE

Re: sys.stdout

2005-09-09 Thread Fredrik Lundh
Sébastien Boisgérault wrote: Thanks for your answer. The execution of your example leads to a 'aaa' display during 2 secs, before it is erased by the prompt. This behavior is standard ? The standard output is not supposed to *concatenate* the 'aaa' and the '' ? what python shell are you

Re: Inconsistent reaction to extend

2005-09-09 Thread Steven D'Aprano
On Fri, 09 Sep 2005 11:47:41 +0200, Jerzy Karczmarczuk wrote: Gurus, before I am tempted to signal this as a bug, perhaps you might convince me that it should be so. If I type l=range(4) l.extend([1,2]) l gives [0,1,2,3,1,2], what else... That is correct. range() returns a list. You

python callbacks and windows

2005-09-09 Thread davidstummer
I was wondering if anyone could point me to an example. Currently i have a c++ program which calls and c++ dll (i created both). The dll uses SendMessage to pass messages back to the calling .exe, and the .exe process the messages in it's Windows Procedure function WindProc(). What i want is to

Re: sys.stdout

2005-09-09 Thread Sébastien Boisgérault
Robert Kern wrote: Sébastien Boisgérault wrote: Tiissa, Thanks for your answer. The execution of your example leads to a 'aaa' display during 2 secs, before it is erased by the prompt. This behavior is standard ? The standard output is not supposed to *concatenate* the 'aaa' and

Re: sys.stdout

2005-09-09 Thread Fredrik Lundh
what python shell are you using, and what platform are you running it on? here's what I get on a standard Unix console: import sys sys.stdout.write() sys.stdout.write(\n) sys.stdout.write(\n) btw, what does sys.stdout.encoding print ? /F

Re: sys.stdout

2005-09-09 Thread Sébastien Boisgérault
Fredrik Lundh wrote: Sébastien Boisgérault wrote: Thanks for your answer. The execution of your example leads to a 'aaa' display during 2 secs, before it is erased by the prompt. This behavior is standard ? The standard output is not supposed to *concatenate* the 'aaa' and the '' ?

Re: encryption with python

2005-09-09 Thread Steven D'Aprano
On Wed, 07 Sep 2005 15:52:19 -0700, James Stroud wrote: Also, I should note that the sha function will, to the limits of anyone's ability to analyze it, decouple the information from the hash. So, to be careful, you should keep the algorithm to generate the IDs secret. Security by obscurity

Re: List of integers L.I.S. (SPOILER)

2005-09-09 Thread Bryan Olson
n00m wrote: Oops Bryan... I've removed my reply that you refer to... See my previous - CORRECT - reply. The code just times out... In some sense it doesn't matter right or wrong is its output. If my code times out, then they are using an archaic platform. With respect to my code, you

Re: visit_decref: Assertion `gc-gc.gc_refs != 0' failed.

2005-09-09 Thread Michael Hudson
alexLIGO [EMAIL PROTECTED] writes: Hi, I got this error when trying to execute the following python command with in a C module: Py_BuildValue You get that error immediately on calling that function? Do anyone have any idea what this error is about? You've probably got your refcounting

signal.SIGHUP handling

2005-09-09 Thread Maksim Kasimov
hi, please help to find out where is the problem: i'm trying to hadle signal.SIGHUP (in unix prompt: kill -HUP pid) first of all, i'm trying to do: signal.signal(signal.SIGHUP, signal.SIG_IGN) - it works fine (signal ignored) but if use my handler, than it raises Interrupted system call: #

Re: python script under windows

2005-09-09 Thread Harlin Seritt
Hi Jan, Unfortunately you will have to register it as a service. I am almost certain there is no other way to do it. However, setting up an executable as a true Windows Service is extremely tedious. You can try this utility that I use. You can get it here:

Re: List of integers L.I.S. (SPOILER)

2005-09-09 Thread n00m
Oh! Seems you misunderstand me! See how the last block in your code should look: for tc in range(10): _ = stdin.readline() sequence = [int(ch) for ch in stdin.readline().split()] supers = supernumbers(sequence) print len(supers) for i in supers: print i, When I

subprocess solved all my problems

2005-09-09 Thread Jacek Popławski
In the last week I was working to create script which will read command from socket, call it, return result, stdout, stderr and kill it after timeout. After playing with threads, processes, spawns and popens I found subprocess module. To call command I use following construction:

Re: Inconsistent reaction to extend

2005-09-09 Thread Antoon Pardon
Op 2005-09-09, Steven D'Aprano schreef [EMAIL PROTECTED]: On Fri, 09 Sep 2005 11:47:41 +0200, Jerzy Karczmarczuk wrote: Gurus, before I am tempted to signal this as a bug, perhaps you might convince me that it should be so. If I type l=range(4) l.extend([1,2]) l gives [0,1,2,3,1,2],

Re: Inconsistent reaction to extend

2005-09-09 Thread Christophe
Antoon Pardon a écrit : Because creating a new list is potentially very time-consuming and expensive of memory. Imagine you have a list of 100,000 large objects, and you want to add one more object to it. The way Python works is that append and extend simply add that new object to the end of the

using metaclass __call__ to replace class instance

2005-09-09 Thread Ksenia Marasanova
Hi all, I am creating some library, and want use declarative style in the subclasses as much as possible, while the actual use will be more method-like. Just to give an impression, the library would be something like this: class Baseclass(object): # lot's of code goes here... class

how to get the return value of a thread?

2005-09-09 Thread Leo Jay
Dear all, i would like to get the return value of all threads e.g. def foo(num): if num10: return 1 elif num50: return 2 else return 0 after i invoked t = thread.start_new_thread(foo,(12,)) how to get the return value of `foo'? Thanks -- Best Regards,

Python linear algebra module -- requesting comments on interface

2005-09-09 Thread C. Barnes
Hi, I'm in the process of writing a Python linear algebra module. The current targeted interface is: http://oregonstate.edu/~barnesc/temp/linalg/ The interface was originally based on Raymond Hettinger's Matfunc [1]. However, it has evolved so that now it is nearly identical to JAMA [2],

Re: Inconsistent reaction to extend

2005-09-09 Thread Antoon Pardon
Op 2005-09-09, Christophe schreef [EMAIL PROTECTED]: Antoon Pardon a écrit : Because creating a new list is potentially very time-consuming and expensive of memory. Imagine you have a list of 100,000 large objects, and you want to add one more object to it. The way Python works is that append and

Re: Video display, frame rate 640x480 @ 30fps achievable?

2005-09-09 Thread Guenter
Peter Hansen schrieb: Maybe it would be a good idea to tell us something about the nature of the image you'll be displaying (though the fact that it needs a cross-hair or something is useful information, for a start). For example, is it a photographic image? A map? A drawing? Is it

Re: using metaclass __call__ to replace class instance

2005-09-09 Thread Ksenia Marasanova
2005/9/9, Ksenia Marasanova [EMAIL PROTECTED]: class BasemethodMeta(type): def __new__(cls, class_name, bases, new_attrs): cls = type.__new__(cls, class_name, bases, new_attrs) new_attrs['__metaclass__'].cls = cls return cls def __call__(self):

Re: subprocess solved all my problems

2005-09-09 Thread Peter Hansen
Jacek Popławski wrote: In the last week I was working to create script which will read command from socket, call it, return result, stdout, stderr and kill it after timeout. After playing with threads, processes, spawns and popens I found subprocess module. [snip rest of answer] While in

Re: using metaclass __call__ to replace class instance

2005-09-09 Thread Peter Otten
Ksenia Marasanova wrote: class BasemethodMeta(type): def __new__(cls, class_name, bases, new_attrs): cls = type.__new__(cls, class_name, bases, new_attrs) new_attrs['__metaclass__'].cls = cls return cls def __call__(self): return self.cls.get_foo()

Re: Video display, frame rate 640x480 @ 30fps achievable?

2005-09-09 Thread Guenter
Michael Sparks schrieb: Yes. Co-incidentally we've been looking at video playback this week as well. We've been using Pygame with an Overlay surface, and it works fairly well. I guess Pygame was more suitable overall for your application? I would just be interested whether you have

Timezone and ISO8601 struggles with datetime and xml.utils.iso8601.parse

2005-09-09 Thread Samuel
Hello, I am trying to convert a local time into UTC ISO8601, then parse it back into local time. I tried the following: -- #!/usr/bin/python import time import datetime import xml.utils.iso8601 year = 2005 month = 7 day= 22 hour = 10 # This is localtime minute =

Re: Video display, frame rate 640x480 @ 30fps achievable?

2005-09-09 Thread Peter Hansen
Guenter wrote: It is a video image coming from a camera over a frame grabber board. The video from the frame grabber is passed to another board that performs some processing and when it comes back from that board it needs to be displayed. The joystick allows to specify some regions of

Re: How to dynamicly define function and call the function?

2005-09-09 Thread bruno modulix
FAN wrote: I want to define some function in python script dynamicly and call them later, but I get some problem. I have tried the following: ## # code ## class test: def __init__(self): exec(def

Re: python script under windows

2005-09-09 Thread Benji York
Jan Gregor wrote: I run python script on another computer and want to survive that script after my logout. Start at http://www.python.org/windows/win32/#NTServices. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get the return value of a thread?

2005-09-09 Thread Fredrik Lundh
Leo Jay wrote: i would like to get the return value of all threads e.g. def foo(num): if num10: return 1 elif num50: return 2 else return 0 after i invoked t = thread.start_new_thread(foo,(12,)) how to get the return value of `foo'? threads are

Re: Python linear algebra module -- requesting comments on interface

2005-09-09 Thread Volker Grabsch
C. Barnes wrote: Hi, I'm in the process of writing a Python linear algebra module. The current targeted interface is: http://oregonstate.edu/~barnesc/temp/linalg/ Is this going to become free software. If yes, what license will you use? So my suggestions: In cases like these ones:

is interactive mode same as calculator mode?

2005-09-09 Thread Alex
Loking at Rossum's tutorial I've seen that he sometimes uses the expression interactive mode and sometimes calculator mode. Or these concepts same? I've made the following assertion. When Python prompts for the next command with the primary prompt , the interpreter is said to be in an

ANN: pythonutils 0.2.1

2005-09-09 Thread Fuzzyman
Hello Python Folk, pythonutils 0.2.1 is now available. This is a *major* update since 0.1.0 http://www.voidspace.org.uk/python/modules.shtml#pythonutils http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py?file=pythonutils-0.2.1.win32.zip

Re: using metaclass __call__ to replace class instance

2005-09-09 Thread Ksenia Marasanova
2005/9/9, Peter Otten [EMAIL PROTECTED]: Ksenia Marasanova wrote: class BasemethodMeta(type): def__new__(cls,class_name,bases,new_attrs): cls=type.__new__(cls,class_name,bases,new_attrs) new_attrs['__metaclass__'].cls=cls returncls

Re: redefining a function through assignment

2005-09-09 Thread Terry Hancock
On Thursday 08 September 2005 06:56 pm, Daniel Britt wrote: This will print out 'new method'. If any other instance of mod1.test is created calling func1, func1 will always reference the newFunc function. This is less than desirable to say the least. Well, actually it's very desireable, but

Re: redefining a function through assignment

2005-09-09 Thread Peter Hansen
Daniel Britt wrote: I am new to Python so if there is an obvious answer to my question please forgive me. Lets say I have the following code in mod1.py class test: def func1(self): print 'hello' Now lets say I have another file called main.py: import mod1 inst =

Re: Inconsistent reaction to extend

2005-09-09 Thread Steve Holden
Fredrik Lundh wrote: Jerzy Karczmarczuk wrote: Gurus, before I am tempted to signal this as a bug, perhaps you might convince me that it should be so. it's not a bug, and nobody should have to convince you about any- thing; despite what you may think from reading certain slicing

Re: python script under windows

2005-09-09 Thread Larry Bates
Making a Python program into a service isn't all that tedious. Get a copy of Mark Hammonds Python Programming on Win32 which contains excellent examples on how to do this. I've written several and after the first one, it is quite easy to do. -Larry Bates Harlin Seritt wrote: Hi Jan,

NDMP Library?

2005-09-09 Thread Jesse Noller
Does anyone know of a python module/library for communicating with the NDMP (ndmp.org) protocol? I'm doing some research and anything would be a great help, thanks! -jesse -- http://mail.python.org/mailman/listinfo/python-list

New docs for Leo

2005-09-09 Thread Edward K. Ream
Leo has new documentation: simpler, clearer, shorter. See: http://webpages.charter.net/edreamleo/leo_TOC.html Everything a newbie needs to know about Leo is at: http://webpages.charter.net/edreamleo/intro.html Please post any questions, comments or corrections here:

Re: What's the difference between VAR and _VAR_?

2005-09-09 Thread S. D. Rose
I can't get the value of the variable (out of the class function) if it has two leading underscores. -Dave class encrypt: def encrypt(self, userValue): self.initialNumber = userValue self.__secretSeed = 7 return self.initialNumber * self.__secretSeed enc = encrypt() enc.encrypt(5) 35

Re: python script under windows

2005-09-09 Thread Roger Upole
You can use the Task Scheduler to run a script persistently if you don't need the capabilities of the service framework. Roger Jan Gregor [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello I run python script on another computer and want to survive that script after my

Re: question from beginner

2005-09-09 Thread dario
Dennis, my english is not too good... About first question this is the implementation of SER class (this is freeware from the source www.telit.it): #Telit Extensions # #Copyright © 2004, DAI Telecom S.p.A. #All rights reserved. # #Redistribution and use in source and binary forms, with or

Python linear algebra module -- requesting comments on interface

2005-09-09 Thread barnesc
Thanks for your commentary. The module will be public domain. I fixed the broken link (epydoc was inserting backslashes in URLs), changed the default arguments to None as you suggested, and added a randfunc=None and randargs=() default argument for random_matrix() and random_vector() (the

How to upgrade to 2.4.1 on Mac OS X tiger

2005-09-09 Thread stri ker
Has anyone here upgraded from 2.3 to 2.4 on Tiger? If so how'd ya do it? TIA, Kevin -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode, C++, python 2.2

2005-09-09 Thread jepler
Python comes in two flavors. In one, sys.maxunicode is 65535 and Py_UNICODE is a 16-bit type, and in the other, sys.maxunicode is 1114111 and Py_UNICODE is a 32-bit type. This is selected at compile time, and RedHat has chosen in some versions to compile for sys.maxunicode == 1114111. By using

Interactive use of Help with class/instance data

2005-09-09 Thread Colin J. Williams
help(instance.property) gives the same information as help(instance) but help(cls.property) gives information specific to the property. Is this a bug? Colin W. -- http://mail.python.org/mailman/listinfo/python-list

re module help

2005-09-09 Thread rattan
I am trying to make prescript-2.2 (old python based psotscript to plain text converter). It gives the following dprecation message /local/users/ishwar/prescript-2.2/misc.py:23: DeprecationWarning: the regex module is deprecated; please use the re module import os, regex, sys, string if I start

Re: Inconsistent reaction to extend

2005-09-09 Thread Terry Hancock
On Friday 09 September 2005 08:29 am, Steve Holden wrote: Yes it is :) That's not an argument! That's just a contradiction. I'm not payin' for this! -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com --

Re: Python linear algebra module -- requesting comments on interface

2005-09-09 Thread Martin Miller
Since one of the module's targeted applications is for 3D applications, I think there should be some specific support for applying the Matrix-vector product operation to a sequence of vectors instead of only one at a time -- and it should be possible to optimize the module's code for this common

Why do Pythoneers reinvent the wheel?

2005-09-09 Thread Stefano Masini
On 8 Sep 2005 08:24:50 -0700, Fuzzyman [EMAIL PROTECTED] wrote: What is pythonutils ? = ConfigObj - simple config file handling validate - validation and type conversion system listquote - string to list conversion StandOut - simple logging and output control object

icmp sniffer with pcapy module

2005-09-09 Thread billiejoex
Hi all. The source below is a simple icmp sniffer made with pcapy. To decode packets I'm using the EthDecoder() function that returns a rapresentation of the packet including ICMP type, ICMP code, IP source and IP destination. All I need, now, is to get the ip src and ip dst only but I don't

Create new instance of Python class in C

2005-09-09 Thread Sybren Stuvel
Hi people, I'm creating a program that can solve and create Sudoku puzzles. My creation function needs to make a lot of copies of a puzzle. Until now, I used copy.deepcopy(), but that's too slow. I want to implement such a copying function in C and use that instead. My idea about this is: - Get

Re: visit_decref: Assertion `gc-gc.gc_refs != 0' failed.

2005-09-09 Thread Tim Peters
[alexLIGO] I got this error when trying to execute the following python command with in a C module: Py_BuildValue Do anyone have any idea what this error is about? Just the comment on the failing assert: assert(gc-gc.gc_refs != 0); /* else refcount was too small */ There are more

Re: PEP-able? Expressional conditions

2005-09-09 Thread Terry Hancock
On Thursday 08 September 2005 04:30 am, Paul Rubin wrote: Terry Hancock [EMAIL PROTECTED] writes: Not the same at all. It evaluates both the true and false results, which may have side effects. If you are depending on that kind of nit-picking behavior, you have a serious design

Launching Python programs from Linux shell script

2005-09-09 Thread Ernesto
Does anyone know how to start Python program(s) from a Linux shell script? Is it just $python myscript.py ?? Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: python script under windows

2005-09-09 Thread Grig Gheorghiu
Jan, Here's what I did to run a Python script (let's call it myscript.py) as a service: 1. Install Win2K Resource Kit. 2. Run instsrv to install srvany.exe as a service with the name myscript: C:\Program Files\Resource Kit\instsrv myscript C:\Program Files\Resource Kit\srvany.exe 3. Go to

Where do .pyc files come from?

2005-09-09 Thread Ernesto
I noticed in a python distribution there were 5 python files (.py) and 5 other files with the same name, but with the extension .pyc . Is this some kind of compiled version of the .py files. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: DrPython debugger

2005-09-09 Thread Colin J. Williams
Pandiani wrote: Thanks for repy. However, I found SimpleDebugger 0.5 from sourceforge.net as plugin for drPython but I'm getting error message because DrPython cannot load module drPythonChooser and it seems that the module is removed from latest version of drPython. Or maybe I wasn't able to

Re: sys.stdout

2005-09-09 Thread Jorgen Grahn
On 9 Sep 2005 03:40:58 -0700, Sébastien Boisgérault [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: Sébastien Boisgérault wrote: Thanks for your answer. The execution of your example leads to a 'aaa' display during 2 secs, before it is erased by the prompt. This behavior is standard ?

Re: [Py2exe-users] py2exe 0.6.2 released

2005-09-09 Thread Thomas Heller
Ray Schumacher [EMAIL PROTECTED] writes: First, Thanks again for the update. At 08:55 AM 9/7/2005, Thomas Heller wrote: This part of the code is distributed under the MPL 1.1, so this license is now pulled in by py2exe. As I read it, it seems that I need to include an Exibit A

Re: Launching Python programs from Linux shell script

2005-09-09 Thread tooper
Yes, provided your python interpreter is installed, and in your path ($ whereis python should give you something like /usr/bin/python or /usr/local/bin/python) -- http://mail.python.org/mailman/listinfo/python-list

Re: Launching Python programs from Linux shell script

2005-09-09 Thread tooper
Yes, provided your python interpreter is installed, and in your path ($ whereis python should give you something like /usr/bin/python or /usr/local/bin/python) -- http://mail.python.org/mailman/listinfo/python-list

Re: Video display, frame rate 640x480 @ 30fps achievable?

2005-09-09 Thread Michael Sparks
Guenter wrote: Michael Sparks schrieb: Yes. Co-incidentally we've been looking at video playback this week as well. We've been using Pygame with an Overlay surface, and it works fairly well. I guess Pygame was more suitable overall for your application? It's not really that, it's just

Re: bug in numarray?

2005-09-09 Thread Colin J. Williams
Xiangyi wrote: Hi, there, I got the following segmentation fault. from numarray import * a = zeros((5,100), Float64) b = kroneckerproduct(a, identity(12)) segmentation fault If I use a = zeros((5,100)), everything is fine. Kind of weird! Can someone help me figure it out? BTW, the

Re: Where do .pyc files come from?

2005-09-09 Thread Fredrik Lundh
Ernesto wrote: I noticed in a python distribution there were 5 python files (.py) and 5 other files with the same name, but with the extension .pyc . Is this some kind of compiled version of the .py files. Thanks, http://www.python.org/doc/2.4.1/tut/node8.html#SECTION00812

Re: Using Python with COM to communicate with proprietary Windows software

2005-09-09 Thread Joakim Persson
On Fri, 09 Sep 2005 08:36:00 +0200, Thomas Heller [EMAIL PROTECTED] wrote: Joakim Persson [EMAIL PROTECTED] writes: I have a rather bloated C++ client prototype which works, so I should have all the code needed to invoke the interface, but this client is of course rather bloated in itself and

Re: distutils question

2005-09-09 Thread Jorgen Grahn
On Wed, 07 Sep 2005 10:56:40 -0700, Joachim Dahl [EMAIL PROTECTED] wrote: I am trying to make a customized install script for an extension module using the distutils.ccompiler class. I want to embed an existing makefile for the C libraries into the Python setup script, but I am not sure

Re: Launching Python programs from Linux shell script

2005-09-09 Thread Ruben Charles
Yes... - Or... Add this line in de source: #!/usr/bin/env python then chmod +x myscript.py ./myscript.py On 9 Sep 2005 08:31:27 -0700, Ernesto [EMAIL PROTECTED] wrote: Does anyone know how to start Python program(s) from a Linux shell script?

Re: Why do Pythoneers reinvent the wheel?

2005-09-09 Thread Michael Amrhein
Stefano Masini schrieb: On 8 Sep 2005 08:24:50 -0700, Fuzzyman [EMAIL PROTECTED] wrote: What is pythonutils ? = ConfigObj - simple config file handling validate - validation and type conversion system listquote - string to list conversion StandOut - simple logging and output

Re: Create new instance of Python class in C

2005-09-09 Thread djw
Sybren Stuvel wrote: Hi people, I'm creating a program that can solve and create Sudoku puzzles. My creation function needs to make a lot of copies of a puzzle. Until now, I used copy.deepcopy(), but that's too slow. I want to implement such a copying function in C and use that instead. My

Re: Why do Pythoneers reinvent the wheel?

2005-09-09 Thread djw
Stefano Masini wrote: I don't know what's the ultimate problem, but I think there are 3 main reasons: 1) poor communication inside the community (mhm... arguable) 2) lack of a rich standard library (I heard this more than once) 3) python is such an easy language that the I'll do it myself

looping over arrays in numarray/numeric

2005-09-09 Thread proof
a = range(100) b = [a] * 3 b[1] = [k + i for k, i in zip(b[1], b[2])] This is rather slow in python and I thought that kind of things should be written using numeric or numarray. I tried to read trough manuals but it didn't help me. So how is this done using numeric or numarray? --

disabling TCP connections, just for one script

2005-09-09 Thread Adam Monsen
It would be helpful to be able to temporarily disable AF_INET socket connections (I don't care about IPv6 for now). What I'd like to do is create an environment for a Python script that appears like the network interface is down, so any remote socket stuff should fail (like an HTTP GET request to

Re: Why do Pythoneers reinvent the wheel?

2005-09-09 Thread Dave Brueck
Stefano Masini wrote: I wonder how many people (including myself) have implemented their own versions of such modules, at least once in their pythonic life. I indeed have my own odict (even same name! :). My own pathutils (different name, but same stuff). My own validate... and so forth.

Re: distutils question

2005-09-09 Thread Fredrik Lundh
Joachim Dahl wrote: E.g., say I want to compile a project as: gcc -Ddef1 -c foo.c -o foo_def1.o gcc -Ddef2 -c foo.c -o foo_def2.o gcc foo_def1.o foo_def2.o -o myext_module.o How would I do that using distutils? It doesn't seem to be possible with the normal core.setup method, and

Re: re module help

2005-09-09 Thread Daniel Dittmar
[EMAIL PROTECTED] wrote: if I start replacing regex by re I get stuck at replacement of regex.symcomp() and regex.pattern() Groups identified by names are part of the standard regular expression syntax: regex.symcomp ('\(id[a-z][a-z0-9]*\)') becomes re.compile ('(?Pid[a-z][a-z0-9]*)') I

Re: Create new instance of Python class in C

2005-09-09 Thread Sybren Stuvel
djw enlightened us with: Personally, I would try Psyco first, and consider Pyrex next. Ok, I'll take a look at those. Are you sure your algorithm can't be optimized first, before you start trying to write this in C? I'm sure there will be optimizations, but profiling showed that the copying

Re: Yielding a chain of values

2005-09-09 Thread [EMAIL PROTECTED]
unless you are going many levels deep (and that's usually a design smell of some kind) No, its not a bug. its a feature! See the discussion in the recursive generator thread below:

Re: Why do Pythoneers reinvent the wheel?

2005-09-09 Thread Stefano Masini
On 9/9/05, Michael Amrhein [EMAIL PROTECTED] wrote: Did you take a look at pyPI (http://www.python.org/pypi) ? At least you'd find another odict ... Oh, yeah. And another filesystem abstraction layer... and another xml serialization methodology... :) PyPI is actually pretty cool. If I had to

Grouping lists

2005-09-09 Thread PyPK
If I have a list say lst = [1,1,1,1,3,5,1,1,1,1,7,7,7] I want to group the list so that it returns groups such as [(0,3),4,5,(6,9),(10,12)]. which defines the regions which are similar. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Python linear algebra module -- requesting comments on interface

2005-09-09 Thread Colin J. Williams
Connelly, Apologies, my first message was sent in error. I like your general setup. You appear to permit matrix operations, which the folk at Numeric and, later, numarray did not. My own package, PyMatrix, has similar aims to yours but it may be slower as it is based on numarray. My package

Re: Why do Pythoneers reinvent the wheel?

2005-09-09 Thread Stefano Masini
On 9/9/05, djw [EMAIL PROTECTED] wrote: I think, for me, this most important reason is that the stdlib version of a module doesn't always completely fill the requirements of the project being worked on. That's certainly why I wrote my own, much simpler, logging module. In this case, its

Re: Grouping lists

2005-09-09 Thread Benji York
PyPK wrote: lst = [1,1,1,1,3,5,1,1,1,1,7,7,7] I want to group the list so that it returns groups such as [(0,3),4,5,(6,9),(10,12)]. which defines the regions which are similar. You'll probably want to use groupby from the itertools module. See

  1   2   >