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: 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 su

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

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: 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

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,

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: Where do .pyc files come from?

2005-09-09 Thread tooper
Yes, these are bytecode files. If you run "python -o", you should also get .pyo files for optimized bytecode. As long as you do not modify the source code, python directly reuse the bytecode (that's also a way to distribute script without source code to avoid your users fiddling in thecode and make

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

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 behav

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 abl

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: 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 Co

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: 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 serio

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 p

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 t

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 know

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 objec

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 ca

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 -- http://mail.python.org/mailman/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

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: 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 t

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

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 matrix

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 without

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

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.encryp

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: http://sourceforge.net/forum/f

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

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, > > U

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 slici

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

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, bu

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 > > > >

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 http://www.voidspace.org.uk/cgi-bin/voidspace/downman

Re: is interactive mode same as calculator mode?

2005-09-09 Thread Peter Hansen
Alex wrote: > Loking at Rossum's tutorial I've seen that he sometimes uses the > expression "interactive mode" and sometimes "calculator mode". Or these > concepts same? Yes. -- http://mail.python.org/mailman/listinfo/python-list

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

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:

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 num>10: >return 1 >elif num>50: >return 2 >else >return 0 > > > after i invoked > t = thread.start_new_thread(foo,(12,)) > how to get the return value of `foo'? th

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 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: 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 > int

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 = 30

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 consid

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.ge

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

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: 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: 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

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], the

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 num>10: return 1 elif num>50: 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, L

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 Baseme

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 o

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

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: 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 submi

Re: encryption with python

2005-09-09 Thread Steven D'Aprano
On Wed, 07 Sep 2005 14:31:03 -0700, jlocc wrote: > Basically I will like to combine a social security number (9 digits) > and a birth date (8 digits, could be padded to be 9) and obtain a new > 'student number'. It would be better if the original numbers can't be > traced back, they will be kept i

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: http://www.seritt.org/pub/srvinst13b.exe.

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 ) 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": # al

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 refcou

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 n

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 obscuri

Re: sys.stdout

2005-09-09 Thread Sébastien Boisgérault
Fredrik Lundh a écrit : > > 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") >

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

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 >>> sy

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* t

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 r

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.

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" a

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 V

Re: Inconsistent reaction to extend

2005-09-09 Thread Fredrik Lundh
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 threads, this mailing list is not

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() retu

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: P

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 simil

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

2005-09-09 Thread n00m
> nor even what submission is yours and your latest. Oops.. my UserName there is ZZZ. Submissions in the html table are ordered by date DESC. -- http://mail.python.org/mailman/listinfo/python-list

Re: dual processor

2005-09-09 Thread Robin Becker
Robin Becker wrote: > Paul Rubin wrote: > >> >>This module might be of interest: http://poshmodule.sf.net >> > > It seems it might be a bit out of date. I've emailed the author via sf, but > no > reply. Does anyone know if poshmodule works with latest stuff? haven't been able to contact posh'

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 -- http://mail.python.org/mailman/listinfo/pyt

unicode, C++, python 2.2

2005-09-09 Thread Trond Eivind Glomsrød
I am currently writing a python interface to a C++ library. Some of the functions in this library take unicode strings (UTF-8, mostly) as arguments. However, when getting these data I run into problem on python 2.2 (RHEL3) - while the data is all nice UCS4 in 2.3, in 2.2 it seems to be UTF-8 o

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 su

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 >

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() > [...not

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

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 l

Re: Possible improvement to slice opperations.

2005-09-09 Thread Michael Hudson
Ron Adam <[EMAIL PROTECTED]> writes: > Magnus Lycka wrote: >> Ron Adam wrote: [...] >>> REVERSE ORDER STEPPING >>> -- >>> When negative steps are used, a slice operation >>> does the following. (or the equivalent) >>> >>>1. reverse the list >>>2. cut the reversed seque

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 -- http://mail.p

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 tha

<    1   2