Re: Python threads and Numeric/SciPy exploit Dual Core ?

2006-10-02 Thread robert
Fredrik Lundh wrote: > "robert" wrote: > > >>Simple Python code obviously cannot use the dual core by Python threads. >>Yet, a program drawing CPU mainly for matrix computations - preferably >>with Numeric/SciPy - will this profit from a dual core wh

numpy magic: cast scalar returns auto to python types float & int ?

2006-11-17 Thread robert
your whole object tree. Wouldn't it be much better if numpy would return Python scalars for float64 (maybe even for float32) and int32, int64 ... where possible? (as numarray and Numeric did) I suppose numpy knows internally very quickly how to cast. Or is there maybe a config-setting to turn numpy this way? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Multithreaded C API Python questions

2006-11-17 Thread robert
yone who didn't develop Python himself :-) Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy magic: cast scalar returns auto to python types float & int ?

2006-11-17 Thread robert
Tim Hochberg wrote: > robert wrote: >> To avoid this you'd need a type cast in Python code everywhere you get >> scalars from numpy into a python variable. Error prone task. Or >> check/re-render your whole object tree. >> Wouldn't it be much better if

Re: numpy magic: cast scalar returns auto to python types float & int ?

2006-11-18 Thread robert
Robert Kern wrote: > robert wrote: > >> Didn't find the relevant reasoning within time. Yet guess the reason is >> isolated-module-centric. > > I gave you a brief rundown on this list already. > > http://mail.python.org/pipermail/python-list/2006-October/

numpy: frequencies

2006-11-18 Thread robert
out python looping ia=array([4,2,1,5,3,2,2,0,1,1]) -> mvmax(ia,3) -> [4,4,4,5,5,5,3,2,2,1]) Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Programmatically finding "significant" data points

2006-11-19 Thread robert
erikcw wrote: > Hi all, > > I have a collection of ordered numerical data in a list. The numbers > when plotted on a line chart make a low-high-low-high-high-low (random) > pattern. I need an algorithm to extract the "significant" high and low > points from this data. > > Here is some sample da

X class missing in Python :-) - Re: What's going on here?

2006-11-22 Thread robert
ict() :-) I have in almost every app/toolcore-module this one: -- class X(object): def __init__(self,_d={},**kwargs): kwargs.update(_d) self.__dict__=kwargs class Y(X): def __repr__(self): return ''%self.__dict__ -- x=X(spam=1) Maybe X should be renamed to __builtin__.Object ... Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: X class missing in Python :-) - Re: What's going on here?

2006-11-23 Thread robert
John Machin wrote: > robert wrote: >> Dale Strickland-Clark wrote: >>> Python 2.4.2 (#1, Oct 13 2006, 17:11:24) >>> [GCC 4.1.0 (SUSE Linux)] on linux2 >>> Type "help", "copyright", "credits" or "license" for more informat

Re: What's going on here?

2006-11-23 Thread robert
lot of advantanges. From ad-hoc instances, "OO-dicts" to reliable pickling of bunches of variables etc. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: python gaining popularity according to a study

2006-11-23 Thread robert
numbers mostly because of merely the superior language itself. Python is undersold und the key tools are somewhat too bloomy and fragmented for successful professional application. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Access to variable from external imported module

2006-11-23 Thread robert
make a func/method def f(a=1): b=2 c=3 return locals() #X/Object(locals()) d=module.f() print d['c'] # d.c Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Access to variable from external imported module

2006-11-24 Thread robert
GinTon wrote: > Thanks Robert, the best solution is get all local variables, else is > impossible access to them. For test purposes/ex post inspection you could also uncomment the line in: def f(a=1): b=2 c=3 #globals().update(locals()) return a+b -- then it is more easy a

Re: Local variables persist in functions?

2006-11-24 Thread robert
ould be > identical. Any pointers? Did I miss something in the python reference > manual? (running 2.4.3, fyi) > the default list() is only created once when the function is defined. And its later its always the same list Use def _chunkify( l, chunkSize, _curList=None ): _curList = _

Re: socket.error connection refused

2006-11-24 Thread robert
.read() '\n302 Moved\n302 Moved\nThe document has moved\nhttp://www.google.de/";>here.\r\n\r\n' >>> fails on multiple trials, then you have a very strange network setup. maybe multiple/confusing NIC's ... Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Pimping the 'cgi' module

2006-11-24 Thread robert
Christoph Haas wrote: > On Thursday 23 November 2006 21:29, robert wrote: >> When a LAMP programmer comes to Python, there are so many different >> confusing things. It starts with a 'non-documented' cgi module - a >> 'High-Level-Interface', that cannot ev

Re: How do I access a main frunction from an import module?

2006-11-24 Thread robert
## > from abc import * > def m(): > print 'something' > return None > > a() > ## > > python25.exe main.py > import __main__ ... __main__.m() but better make a start.py and "import main" - then its symmetric Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: fast listdir & stat

2006-11-24 Thread robert
[EMAIL PROTECTED] wrote: > robert wrote: >> I want to get the files and sizes and times etc. stats of a dir fast. >> os.listdir & iterating with os.stat seems not to run at optimal speed for >> network folders. Is there a faster possibility? (both for Win & *nix ;

Re: Pimping the 'cgi' module

2006-11-24 Thread robert
Christoph Haas wrote: > On Friday 24 November 2006 13:08, robert wrote: >> well, note, for that they have named it Ruby-On-Rails, so its still the >> language - leveraged. While it is Zope/Django/Ego-on-Python ... ? > > If by that you mean that neither Zope nor Django a

Re: Pimping the 'cgi' module

2006-11-24 Thread robert
h base material. There are guys who have an overview of what is good. There are guys who know the details. A decision call from the inner circle for an actual (probably joint) implementation is necessary. Regarding the python-on..-"framework" the greatest danger would be, to mak

Re: Pimping the 'cgi' module

2006-11-24 Thread robert
x27;s different from "CGI > programming", but if you have a deep understanding of the latter, I'm sure you > could come up with a nice "cgi2.py" library with relatively little effort. > Get to > work! think both are missing standard modules: cgi2 and a comfortable OO-dispatcher/server with clear tutorials. And to have them in front on the Python display window. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: can't get cgi values

2006-11-27 Thread robert
; > fileHandle.write("here aer the haskeys"); > fileHandle.write( str(form.has_key("citation"))) > /* returns TRUE */ > > temp = str(form("citation").value) > /* python stops here, > > form("citation ap

Re: can't get cgi values

2006-11-27 Thread robert
there is more than > one keyword entry. When I do: keywords = form["keywords"] - what sort > of data structure do I get back? there is another func to get multiple values - see the docs. Basically, one can iterate all over form.list (which is not documented) to get the origina

HTML Table-of-Content Extraction Script

2006-11-28 Thread robert
I'm looking for a function which extracts a table of contents of HTML file(s) from ... and possibly auto-creates the ancors. Maybe something already exists? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting recursion loops

2006-11-29 Thread robert
Rob Wolfe wrote: > robert wrote: >> My code does recursion loops through a couple of functions. Due to >> problematic I/O input this leads sometimes to "endless" recursions and after >> expensive I/O to the Python recursion exception. >> What would be a good

Re: Detecting recursion loops

2006-11-29 Thread robert
Carl Banks wrote: > robert wrote: >> My code does recursion loops through a couple of functions. Due to >> problematic I/O input this leads sometimes to "endless" recursions and after >> expensive I/O to the Python recursion exception. >> What would be a good

Re: Detecting recursion loops

2006-12-01 Thread robert
Ben Finney wrote: > robert <[EMAIL PROTECTED]> writes: > >> Carl Banks wrote: >>> 2. Consider whether you're unwittingly trying to cover up a bug. >>> ISTM no matter how problematic the input is, you should at least >>> be able to make progress o

Re: Pimping the 'cgi' module

2006-12-01 Thread robert
as just doing it in python. Thats the fragmented journey, almost any web programmer has to go when coming to python. A clear standard, even a clear intro, for simple tasks, like doing state mng, db, error handling, etc. is not there on an easy path. For a level above cgi, what do you think abo

Re: Detecting recursion loops

2006-12-01 Thread robert
Neil Cerutti wrote: > On 2006-12-01, robert <[EMAIL PROTECTED]> wrote: >> Ben Finney wrote: >>> robert <[EMAIL PROTECTED]> writes: >>> >>>> Carl Banks wrote: >>>>> 2. Consider whether you're unwittingly trying to cover up

finalization signal for an object with ZODB involved?

2006-12-09 Thread robert
I have (large) disk files connected with ZODB objects and want the disk files to be removed when the Python/ZODB object all finalizes. Is it possible to get a kind of reliable __del__ signal for that? Robert -- http://mail.python.org/mailman/listinfo/python-list

cxfrozen linux binaries run on FreeBSD?

2006-12-15 Thread robert
When i freeze a python app (simple - no strange sys calls) for x86 Linux, does this stuff run well also on x86 FreeBSD? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: cxfrozen linux binaries run on FreeBSD?

2006-12-15 Thread robert
ed on FreeBSD. Yet do the Linux compiled cx_freeze binaries (and Python .so's) usually run directly on FreeBSD without a lot of trouble? I have not access to a FreeBSD setup and someone wants to know the "probability" :-) > > On Dec 15, 5:52 am, robert <[EMAIL PROTE

Re: Why does Python never add itself to the Windows path?

2006-12-26 Thread robert
. I make similar links on *nix also. Perhaps in the future the Python Windows installer should create such pythonXX.exe "links" and maybe even a default python.exe (upon Checkbox in Installer!) into the Windows\system32 ? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: keypressed() function

2006-12-26 Thread robert
functions to get things early before \n buffering depending on the terminal mode ) Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does Python never add itself to the Windows path?

2007-01-01 Thread robert
y establishing the right precedence on the PATH !? - with re.sub() :-) Putting a pythonXX.exe next to pythonXX.dll into system32 should be a non-q and a kind of default comfort for multi-python users. Linking also a default python.exe into the system32 upon a (non-default) checkbox mark in t

Re: Forking in windows. Possible?

2007-01-01 Thread robert
And you obviously want to click an icon in Explorer. If you don't need the data memory status of the current process inherited, CreateProcess would be most similar. Then there is win32console.GetConsoleWindow , ShowWindow(SW_HIDE), win32console.AllocConsole, win32ui.CreateEdit, taskbar f

Re: OO question

2007-01-01 Thread robert
re attention to what some unsolicited objects want, than to what the programmer wants. Python is not so. Remember, you are the boss. You say: "I want to save all addresses to disk". I'd say: Just dump them to disk unless you feel a functional need in order to make it mor

Re: A python library to convert RTF into PDF ?

2007-01-03 Thread robert
on a Windows - print the RTF through Word (win32com/ctypes) or through a RichEdit control into a .ps then convert via ghostscript/ps2pdf into a pdf. (gs obviously doesn't know RTF by default or at all...) Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does Python never add itself to the Windows path?

2007-01-04 Thread robert
Ben Sizer wrote: > robert wrote: >> Ben Sizer wrote: >>> My opinion is that this is not as big a problem as some may feel that >>> it is. Unlike Unix systems, the PATH variable is rarely used. >> It is a big problem. >> >> It is not less than the ma

Re: howto overload with a NOP (empty statement)

2007-01-06 Thread robert
ror virtual method scheme will also be detected by pychecker in order to warn correctly: that classes of actual instances have to override all open virtuals. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Why less emphasis on private data?

2007-01-07 Thread robert
asses, methods/functions.. are not objects but namespaces, messages etc. - thus self-similarity is so broken, that this which will actually limit the power and scalability of this language. Robert > It appears to me (perhaps wrongly) that Python prefers to leave class > data public.

Re: Python cheatsheets

2007-01-07 Thread robert
isn't the right word, but you get the idea. :) search: python quick reference e.g.: http://www.benyoonline.com/pqr/pqr24/PQR2.4.html Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python

2007-01-08 Thread robert
of Py-Objects between multiple separated Interpreter instances of one process. .NET and Java have shown that the speed costs for this technique are no so extreme. I guess less than 10%. And Python is a VHLL with less focus on speed anyway. Also see discussions in http://groups.google.de

Ruby/Python Continuations: Turning a block callback into a read()-method ?

2006-02-12 Thread Robert
self.ftp.retrbinary("RETR %s" % self.relpath,callback) def read(self, bytes=-1): ... self.buf+=self.iter.next() ... ... = Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Tracking down memory leaks?

2006-02-12 Thread Robert
be removed from garbage too. For example, after breaking cycles, do del gc.garbage[:] to empty the list. It's generally better to avoid the issue by not creating cycles containing objects with __del__() methods, and garbage can be examined in that case to verify that no such cycles are being created. Robert -- http://mail.python.org/mailman/listinfo/python-list

How to find cause for Python/Pythonwin crash only on Dual Core Machines ?

2006-03-02 Thread robert
(known) problems with Python/Pythonwin specific for dual core's (py2.3.5 / pywin203) ? What could I do to find the problem? Robert -- PS: there is very little C extension-code (SWIG) involved, yet I looked over that so often, I guess its save: // #include "stdafx.h"

os.popen3 delivers no error exist status ?

2006-03-02 Thread robert
os.popen3 delivers no error exit status on .close() - while os.popen does Is this intended or a bug? How do I get the status? Robert Python 2.4.1 (#2, May 5 2005, 11:32:06) [GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2 Type "help", "copyright", "credits" or

wxPython memory footprint? - Re: Write a GUI for a python script?

2006-03-02 Thread robert
g. Pythonwin while a wxPython app is running. ( When I made a test with wxPython some years ago, it had no option to step/share its Messageloop. Interaction was "crust"y and I didn't manage to get smooth debugging (on Windows). ) Robert -- http://mail.python.org/mailman/listinfo/python-list

Correct auto line break in mail headers lines (subject)?

2007-06-08 Thread robert
can anyone contribute to this question about correct auto line break in mail header lines: https://sourceforge.net/tracker/?func=detail&aid=1645148&group_id=5470&atid=105470 -- http://mail.python.org/mailman/listinfo/python-list

piping data stream through GPG

2007-06-09 Thread robert
I played around trying to encrypt/decrypt data through GPG on the fly (or worse - by using a file) (on Windows first - later to try on Linux too) Using os.popen3 like >>> i,o,e=os.popen3('gpg -e -r Robert') >>> # i.write('y\n') >>> i

Re: piping data stream through GPG

2007-06-09 Thread robert
robert wrote: > I played around trying to encrypt/decrypt data through GPG on the fly > (or worse - by using a file) (on Windows first - later to try on Linux too) > > Using os.popen3 like > > >>> i,o,e=os.popen3('gpg -e -r Robert') > >

Re: piping data stream through GPG

2007-06-09 Thread robert
robert wrote: > I played around trying to encrypt/decrypt data through GPG on the fly > (or worse - by using a file) (on Windows first - later to try on Linux too) > > Using os.popen3 like > > >>> i,o,e=os.popen3('gpg -e -r Robert') > >

logging.config.fileConfig disables existing loggers

2007-08-30 Thread Robert
onfig file. If those lines are deleted and a new loop is created at the top of the function which resets all existing loggers to their default status, then we see the desired behaviour. This seems quite simple and sensible. Below is a patch file for applying the change. What do people thin

ValueError: insecure string pickle ?

2007-09-11 Thread robert
cPickle.loads raised "ValueError: insecure string pickle". The error is from a log file and I cannot reproduce it (quickly). What can be the cause for that error? Robert -- http://mail.python.org/mailman/listinfo/python-list

"sem_post: Invalid argument"

2007-10-25 Thread robert
On a server the binary (red hat) installed python2.4 and also a fresh compiled python2.5 spits "sem_post: Invalid argument". What is this and how can this solved? Robert == server [~]# python2.4 sem_post: Invalid argument sem_post: Invalid argument sem_post: Invali

Re: "sem_post: Invalid argument"

2007-10-25 Thread robert
Jonathan Gardner wrote: > On Oct 25, 12:56 pm, robert <[EMAIL PROTECTED]> wrote: >> On a server the binary (red hat) installed python2.4 and also a >> fresh compiled python2.5 spits "sem_post: Invalid argument". >> What is this and how can this solved? >&g

Re: "sem_post: Invalid argument"

2007-10-27 Thread robert
Jonathan Gardner wrote: > On Oct 25, 2:19 pm, robert <[EMAIL PROTECTED]> wrote: >> Jonathan Gardner wrote: >>> On Oct 25, 12:56 pm, robert <[EMAIL PROTECTED]> wrote: >>>> On a server the binary (red hat) installed python2.4 and also a >>>> fres

Re: add re module to a embeded device phyton interpreter

2007-01-10 Thread robert
start.py" to let him collect all the dependent modules in a dist-folder. Then you don't have to worry about all the details yourself. You can also use UPX and 7zip to further compress the dll's/so's and the py-modules zip archive well. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to protect a piece of critical code?

2007-01-10 Thread robert
ctions - basically using an atomic counter and you need to provide code for unrolling half executions. Search Google. Robert > It would be almost like getting and holding the GIL, > to prevent a thread swap out between the two operations. > - sort of the inverted function than for which

Re: Is there a way to protect a piece of critical code?

2007-01-11 Thread robert
Hendrik van Rooyen wrote: > "robert" <[EMAIL PROTECTED]> wrote: > >> List .append() and .pop() will be atomic in any Python though its not > mentioned explicitely - otherwise it would be time to leave Python. >> There is also Queue.Queue - though it has unne

Re: Parallel Python

2007-01-11 Thread robert
st challenging example on this are probably games - not to discuss about gaming here, but as tech example to the point: Would you do MPI, RPC etc. while 30fps 3D and real time physics simulation is going on? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python

2007-01-11 Thread robert
data is "serialized" - not directly used as with threads or with custom shared memory techniques like POSH object sharing. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: dot operations

2007-01-11 Thread robert
[EMAIL PROTECTED] wrote: > Hi, > Frequently I get to do like this: > a = (1, 2, 3, 4) # some dummy values > b = (4, 3, 2, 1) > import operator > c = map(operator.add, a, b) > > I am finding the last line not very readable especially when I combine > couple of such operations into one line. Is it

Re: Parallel Python

2007-01-11 Thread robert
sturlamolden wrote: > robert wrote: > >> Thus communicated data is "serialized" - not directly used as with threads >> or with custom shared memory techniques like POSH object sharing. > > Correct, and that is precisely why MPI code is a lot easier to write &g

Re: Is there a way to protect a piece of critical code?

2007-01-12 Thread robert
Hendrik van Rooyen wrote: > "robert" <[EMAIL PROTECTED]> wrote: > > >> pushing data objects through an inter-thread queue is a major source for > trouble - as this thread shows again. >> Everybody builds up a new protocol and worries about Empty/Full, >

Re: Parallel Python

2007-01-12 Thread robert
t; open to improvements and suggestions. > > Paul > > [1] http://www.python.org/pypi/parallel I'd be interested in an overview. For ease of use a major criterion for me would be a pure python solution, which also does the job of starting and controlling the other process(es) automatically right (by default) on common platforms. Which of the existing (RPC) solutions are that nice? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: catching signals in an object

2007-01-15 Thread robert
d as param ? > Just do it! Python is a functional language. You have access to self (search for the term "closure") and self.method is bound - thus a 'function' objects are nothing special in Python. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert float to sortable integer in Python

2007-01-16 Thread robert
What is the actual requirement? see also hash() and id() for keying. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: why scipy cause my program slow?

2007-01-16 Thread robert
& int are handled as extra (more conservative) types in numpy - with numpy scalar types only on request. Currently numpy uses Python. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.3-2.5 what improved?

2007-01-17 Thread robert
;s, on Windows, for deployable apps, GUI's etc. because the fat coming with Python 2.4 is not balanced by necessary goods - mostly just fancy things. ( I run even a list of patches and module copies/addaptations down to 2.3 because of that :-) ) Real news come with Py3K Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: predefined empty base class ??

2007-01-17 Thread robert
iwl wrote: > Hi, > > is there an predefined empty base class > which I can instanziate to have an > container i can copy attributes in? > you are not the only one missing such class http://groups.google.com/group/comp.lang.python/msg/3ff946e7da13dba9 RFE SF #1637926

Re: Distributed computation of jobs

2007-01-17 Thread robert
s page on the python.org Wiki: > > http://wiki.python.org/moin/ParallelProcessing > > Thanks for describing your work to us! > > Paul > as many libs are restriced to certain OS'es, and/or need/rely on extension modules, few tags would probably improve: OS'es, p

Re: predefined empty base class ??

2007-01-17 Thread robert
robert wrote: > iwl wrote: >> Hi, >> >> is there an predefined empty base class >> which I can instanziate to have an container i can copy attributes in? >> > > you are not the only one missing such class > > http://groups.google.com/group/comp

Re: Making a simple script standalone

2007-01-17 Thread robert
suggestions on an - easy and clear - path to follow ? > > cx_Freeze was not mentioned so far. its perhaps most easy and clear. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: predefined empty base class ??

2007-01-18 Thread robert
Gabriel Genellina wrote: > At Wednesday 17/1/2007 15:34, Dennis Lee Bieber wrote: > >> > is there an predefined empty base class >> > which I can instanziate to have an >> > container i can copy attributes in? >> >> I think that's a two-liner... >> >> >>> class EmptyBase(object): >> ...

Re: Making a simple script standalone

2007-01-18 Thread robert
Gabriel Genellina wrote: > At Wednesday 17/1/2007 16:05, Rikishi 42 wrote: > >> >>What I want to do is to compile/bundle/prepare/whatever_term a simple >> >>Python script for deployment on a Windows machine. Installing Python >> >>itself on that machine, is not an option. Ideally I would like to

Auto locate Python's .so on Linux (for cx_Freeze's --shared-lib-name)

2007-11-17 Thread robert
In a makefile I want to locate the .so for a dynamically linked Python on Linux. (for cx_Freeze's --shared-lib-name) e.g. by running a small script with that Python. How to? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Auto locate Python's .so on Linux (for cx_Freeze's --shared-lib-name)

2007-11-18 Thread robert
James Stroud wrote: > robert wrote: >> In a makefile I want to locate the .so for a dynamically linked Python >> on Linux. (for cx_Freeze's --shared-lib-name) >> e.g. by running a small script with that Python. How to? >> >> Robert > > def findaso(aso)

Re: Auto locate Python's .so on Linux (for cx_Freeze's --shared-lib-name)

2007-11-18 Thread robert
Neal Becker wrote: > robert wrote: > >> In a makefile I want to locate the .so for a dynamically linked >> Python on Linux. (for cx_Freeze's --shared-lib-name) >> e.g. by running a small script with that Python. How to? >> >> Robert > > How about

Simple DAV server?

2006-04-18 Thread robert
i.template is missing in that package. Found "python davserver" http://www.comlounge.net/webdav/ , but it doesn't run. It uses xml libs which are not anymore in recent python's. Is there something else? Or a (non-py) binary simple to set it up. robert -- http://mail.pyth

pywin32 : scheduled weakup from standby/hiberate ?

2006-04-18 Thread robert
On Windows the task scheduler tool can program (the BIOS?) to weak up the machine from standby/hibernate at certain pre-configured times. Can this be done directly through the (py)win32 API? robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple DAV server?

2006-04-20 Thread robert
Ivan Voras wrote: > robert wrote: > >> >> thanks, that's exactly to the point: >> >> python server.py 8080 mydavrootfolder > > > Thanks for the patch, I assume it's free to incorporate it into the > original archive? yes, of course > Als

Joining stdout & stderr of subprocess ?

2006-04-21 Thread robert
when I run a command myapp 2>&1 yet: #!python print os.popen("myapp 2>&1").read() the stderr stuff comes all after the stdout stuff. How can I get ahold of all the out and err joined synchronously in the order, it is created ? robert -- http://mail.python.org/mailman/listinfo/python-list

BackgroundCall as Pythonic Thread - Re: threading, how to?

2006-04-21 Thread robert
hich (example) you can probably understand fuildly within a second: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491280 Thus, you could forget about the technical term "thread". As you write yoursef "..call it as a separate function..": Thats how (new) Python pro

Re: Define type of 'module' object that is imported

2006-04-22 Thread robert
y ? ) * your module can be a class instance as well in newer pythons (2.2+?); => you can set sys.modules['foo']=Foo() # Foo having properties ... * simply import certain expensive modules only ad-hoc * maybe you don't need it as module at all, but an instance. or you avoid pre

Re: perspective on ruby

2006-04-22 Thread robert
se, who can write loops are mostly self-educated and can do all things quickly in any language. Isn't the fun, finding the right tools for certain purposes one-self? The job of (CS) courses more to provide a map ( "what fun to explore yourself" ) and display extremes (ASM and Lisp) to prevent from identification ? -robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding Module Dependancies

2006-04-23 Thread robert
dist)) * running written tests * code checks * walking major execution branches by manual tests * beta cycling -robert -- http://mail.python.org/mailman/listinfo/python-list

Re: python's thread problem on Linux platform

2006-04-23 Thread robert
ional. Thus encourages screwing "ego threads". Maybe you get things organized frictionless with those 2? : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491281 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491280 -robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Define type of 'module' object that is imported

2006-04-23 Thread robert
the original modules's __dict__ you still didn't mention the original motivation for that lazy-moduletype replacement. If its your module anyway, you could (auto-)rework your functions/class to do delayed initializations at the end of the module. something like: for func in :

Re: Simple DAV server?

2006-04-24 Thread robert
Ivan Voras wrote: > robert wrote: > >> maybe thats a good idea to put it on sf.net to boil out all bugs. >> Yet I like it in that simple default manner, maybe switch on those >> additional creation functions with commandline switches (or config >> class instan

Re: threads and sys.exit()

2006-04-24 Thread robert
way correctly: to terminate a thread cleanly in functional style. in the same style reverse the mainthread could be terminated cleanly.) I'd -robert -- http://mail.python.org/mailman/listinfo/python-list

Re: threads and sys.exit()

2006-04-24 Thread robert
omething, then I'd still say, the design question should be raised. -robert PS: SystemExit / sys.exit (doc: "Exit from Python"!?) is misleading/historic. Its in fact almost "ThreadExit". -- http://mail.python.org/mailman/listinfo/python-list

Re: threads and sys.exit()

2006-04-24 Thread robert
robert wrote: > killing hard (SIGKILL etc ) is low level. it should be OS-specific, as > Python should not make itself inconsistent (and os._exit() is that at mid-low level ; better not to say; no finalizations etc.) -robert -- http://mail.python.org/mailman/listinfo/python-list

A QFB agent: how to catch C-level crashes and last Python stack ?

2006-04-25 Thread robert
n a changed python.exe stub. Next to the machine stack/regs it should grab the relevant last Python thread stack(s), if any, and maybe other useful status and python global vars. (There are also Python threads going on. ) Is that possible? -robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Multithreading and Queue

2006-04-25 Thread robert
The whole CallQueue in http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491281 for example doesn't use a single lock - though its an inter-thread communication hot spot. -robert -- http://mail.python.org/mailman/listinfo/python-list

Re: KeybordInterrupts and friends

2006-04-26 Thread robert
> raw_input() > KeyboardInterrupt > > The crash happens when I type C-c another time (always *after* atleast > one C-d has been issued). > > What's wrong ? My expectations ? CPython (2.3 and 2.4 on debian exhibit > the same problem). > Is this a FAQ ? maybe consider signal.signal(signal.SIGINT,... -robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing Exceptions Across Threads

2006-04-26 Thread robert
aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491281 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491280 -robert -- http://mail.python.org/mailman/listinfo/python-list

Re: help finding

2006-04-26 Thread robert
Gary Wessle wrote: > Hi > > I am going through some tutorials, how do I find out about running a > script from the python prompt? > is there a online ref and how to access it? > if you really don't want to start from OS prompt do execfile('myscript.py') -

Re: Introspection Class/Instance Name

2006-04-26 Thread robert
__FUNC__ for things like super(), recursion etc. (compare http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491265 ) -robert -- http://mail.python.org/mailman/listinfo/python-list

Re: KeybordInterrupts and friends

2006-04-26 Thread robert
[EMAIL PROTECTED] wrote: > Thanks Robert. > > But I'm not trying something at all with this, only asking if it is a > bug (and it looks like one). I suspect too, that it is related to > signal handling. > > Cheers, > Aurélien. you not protected all the time duri

<    1   2   3   4   5   6   7   8   9   10   >