Re: Quixote+Nevow+LivePage

2004-12-04 Thread Jp Calderone
ons of the aproach. Links to > relevent articles and tutorials are really appreciated > > Thanks in advance. You might get more in the way of helpful responses on this list: http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Quixote+Nevow+LivePage

2004-12-04 Thread Jp Calderone
On Sat, 4 Dec 2004 15:40:44 -0200, Carlos Ribeiro <[EMAIL PROTECTED]> wrote: >On Sat, 04 Dec 2004 16:17:06 GMT, Jp Calderone <[EMAIL PROTECTED]> wrote: > > I haven't used LivePage myself, but someone in the know tells me > > that LivePage requires an extra, no

Re: Quixote+Nevow+LivePage

2004-12-04 Thread Jp Calderone
On Sat, 04 Dec 2004 20:05:59 -0700, Dave Brueck <[EMAIL PROTECTED]> wrote: >Jp Calderone wrote: > > On 3 Dec 2004 22:02:51 -0800, Mir Nazim <[EMAIL PROTECTED]> wrote: > >>Q1) Is it possibe to use "Nevow + LivePage + Quixote" together in a > >>web

Re: import fails

2004-12-05 Thread Jp Calderone
= 20 __all__ = ['x'] [EMAIL PROTECTED]:~$ python -c "from foo import *; print x" Traceback (most recent call last): File "", line 1, in ? TypeError: attribute name must be string [EMAIL PROTECTED]:~$ python -c "from bar import *; print x" 20 [EMAIL PROTECTED]:~$ Hope this helps, Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: help using sockets, and OOP?

2004-12-05 Thread Jp Calderone
a(). Handling concurrency can be quite tricky, but fortunately there are some tools to help you out. For starters, check out http://www.twistedmatrix.com/ - in particular, you may be interested in http://www.twistedmatrix.com/documents/current/examples/ircLogBot.py Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: help using sockets, and OOP?

2004-12-05 Thread Jp Calderone
On Mon, 06 Dec 2004 07:45:34 +1000, Dfenestr8 <[EMAIL PROTECTED]> wrote: >On Sun, 05 Dec 2004 20:17:31 +, Jp Calderone wrote: > > > Your problem doesn't seem to have anything to do with "OOP" (whatever > > that is). Rather, you are try

Re: using cmd.exe as a telnet client

2004-12-07 Thread Jp Calderone
tion, based on the command for which the subnegotiation is negotiating options. There are also do() and dont() methods that return Deferreds. There's a whole bunch of other new cool features too, but I've probably gone on long enough, especially for a module that hasn't even been released :) Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Flow based programming & python coding style

2004-12-15 Thread Jp Calderone
y here and there, their limitations become apparent in almost any non-trivial application. Other languages (and other implementations of Python) go a lot further towards making "flow based programming" natural. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are tuples immutable?

2004-12-15 Thread Jp Calderone
d on identity instead of the values of attributes. Mutating an object in a dictionary is completely reasonable. What is unreasonable is wanting to make a change that would change its hash value. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are tuples immutable?

2004-12-17 Thread Jp Calderone
ete absence of code in the class definition to make it so. Nor is this behavior restricted to classic classes: make Foo's base class object and the behavior remains the same. The correct characterization is that Python makes user-defined mutable classes hashable (arguably correctly so) as the default behavior. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Why no list heritable type?

2004-12-17 Thread Jp Calderone
def foo(self): pass f = Foo()" "f.foo()" 100 loops, best of 3: 0.611 usec per loop [EMAIL PROTECTED]:~$ This is due to the attribute lookup as well as the creation and destruction of a bound method object for each call. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good use for lambda

2004-12-17 Thread Jp Calderone
e be more careful and attentive in the future. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: better lambda support in the future?

2004-12-17 Thread Jp Calderone
rrelevant as giving a name to a short function that will be referenced exactly once. I am quite envious of those who can easily come up with names for any function. Perhaps you lot should go a bit easier on the rest of us and let us keep our crutches. After all, Python is a language which

Re: spawn* or exec* and fork, what should I use and how ?

2004-12-15 Thread Jp Calderone
ec family of functions replaces the current process image with a new process image. So the program is doing exactly what you asked it to. If you want to run multiple things, os.execv() is probably not for you. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are tuples immutable?

2004-12-15 Thread Jp Calderone
On Wed, 15 Dec 2004 23:38:04 -0500, Adam DePrince <[EMAIL PROTECTED]> wrote: >On Wed, 2004-12-15 at 10:26, Jp Calderone wrote: > > On Wed, 15 Dec 2004 14:18:21 GMT, Roel Schroeven <[EMAIL PROTECTED]> wrote: > > >Antoon Pardon wrote: > > > > Op 2004-12-1

Re: A rational proposal

2004-12-18 Thread Jp Calderone
am not advocating the use of gmpy (nor the avoidance of it), simply pointing out that there is ample precedent in the standard library for dependence on third party libraries. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: A rational proposal

2004-12-18 Thread Jp Calderone
ition to self and an optional context argument. So if the goal is symmetry with the Decimal type, then Rational.max() and Rational.min() should take only one argument. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: How about "pure virtual methods"?

2004-12-18 Thread Jp Calderone
n" does. Unit tests, similarly, will show you where you forgot to implement a method, because they _will_ exercise your code. Nothing is preventing you from creating a base class and a notimplemented decorator which cooperative to make subclasses uninstantiable if "pure virtual methods" remain, though. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: How about "pure virtual methods"?

2004-12-19 Thread Jp Calderone
the method call was made and then go to _its_ class definition to add the missing method. If the line immediately before "someobj.bar()" is "someobj = FooType()", this will surely be easy. If someobj is instantiated further away, then more digging is required. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Web forum (made by python)

2004-12-19 Thread Jp Calderone
ronment on python-list is not making comments like these. Hoping-it's-obviously-why'ly, Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Web forum (made by python)

2004-12-19 Thread Jp Calderone
On Sun, 19 Dec 2004 18:45:12 -0600, Doug Holton <[EMAIL PROTECTED]> wrote: >Jp Calderone wrote: > > Part of fostering a friendly environment on python-list is not making > > comments like these. > > Another part is actually answering the content of a person's

Re: A completely silly question

2004-12-19 Thread Jp Calderone
the CLI framework in pyNMS. > I found this: http://cvs.sourceforge.net/viewcvs.py/*checkout*/pynms/pyNMS/lib/termtools.py?content-type=text%2Fplain&rev=1.4 But I don't see a function named "sane". Is sf cvs out of date? If so, where should I be looking? Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Writev

2004-12-19 Thread Jp Calderone
for a PEP. I think a patch, including documentation and unit tests (something along the lines of http://cvs.twistedmatrix.com/cvs/*checkout*/trunk/sandbox/exarkun/test_iovec.py?content-type=text%2Fplain&rev=9505&root=Twisted for example) on sf.net is probably a good next step. I imagine t

Re: Parallelization with Python: which, where, how?

2004-12-21 Thread Jp Calderone
les included in the documentation you can start > with and just change the parts that are specific to your application. > > It is easy to understand and use and has been working well for me for > more than 2 years. How have you chosen to deal with the security implications? Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: How about "pure virtual methods"?

2004-12-21 Thread Jp Calderone
def instanceFactory(self): return Wibble(1, 2, 3) This lets you avoid duplicate test code as well as easily test new concrete implementations. It's an ideal approach for frameworks which mandate application-level implementations of a particular interface and want to ease the application developer's task. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Ack! Zombie processes won't die!

2004-12-22 Thread Jp Calderone
completely minimize the time the zombie exists. You could also use something other than os.spawnv(). The new subprocess module may have something that simplifies this (I haven't looked at it in detail yet). Twisted's spawnProcess() might also be worth a look, as it does take care of waiting at the appropriate time. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expression: perl ==> python

2004-12-22 Thread Jp Calderone
I am using Python 2.3.4/Win32 (from ActiveState.com). The > code works in my interpreter. Note that _ is only automagically defined when you are using the interpreter interactively. If you were to run this program on the command line, or invoke it any way other than interact

Re: Lambda going out of fashion

2004-12-23 Thread Jp Calderone
exec() isn't a function. You "exec foo", not "exec(foo)". The latter works simply because parens act as to set precedent instead of as part of function call syntax when used this way. Also, you should do the dictionary lookup first, in a try/except, and then execute it later, _outside_ the try/except, otherwise you risk masking KeyErrors from exec'd code. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda going out of fashion

2004-12-23 Thread Jp Calderone
'twisted.protocols.','basic')))('twisted.internet.',lambda a,b:__import__(a+b,None,None,b))) OTOH, maybe that's still trivial, it's only a multiuser network chat server, after all. plumbing-the-depths-ly, Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda going out of fashion

2004-12-23 Thread Jp Calderone
On Thu, 23 Dec 2004 12:00:29 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote: > > >> While I'm sure it can be done, I'd hate to see a non-trivial Python > >> program written with lambda instead of def. > > Jp> What, like this? >

Re: Other notes

2004-12-29 Thread Jp Calderone
or. Perhaps something like this: def &(..)(x, y): return range(x, y + 1) This is much better than supporting macros because it will lead to a 6 month long debate over the exact syntax and adds exactly zero other features to the language (whereas macros let you pick your own syntax and give you essentially unlimited other abilities). Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Other notes

2004-12-29 Thread Jp Calderone
On Wed, 29 Dec 2004 12:38:02 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote: >Jp Calderone <[EMAIL PROTECTED]> writes: > > > On Wed, 29 Dec 2004 11:42:00 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote: > >>[EMAIL PROTECTED] writes: > >> > >> >

Re: Tkinter vs wxPython

2004-12-29 Thread Jp Calderone
. wxPython GUIs reflect this automatically and > the controls always look and work like the underlying system. I think you're right about what "native" means. > > I may be wrong but I don't think you get that with TKinter! Tk has native widgets for many platforms. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Jp Calderone
loops and two if clauses. That's four altogether. Does that qualify as "several"? :) Sure, they're not statements according to the grammar, but that's entirely beside the point. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Mixing metaclasses and exceptions

2004-12-30 Thread Jp Calderone
sound "Metaclass!" at me. I wonder if you could elaborate on your usage? Perhaps there's a better solution which doesn't involve metaclasses at all. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Jp Calderone
On Fri, 31 Dec 2004 00:19:29 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote: >Jp Calderone wrote: > > On Fri, 31 Dec 2004 00:00:31 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote: > > > >>Paul Rubin wrote: > >> > >>>Nick Coghlan <[EMAIL P

Re: Other notes

2004-12-30 Thread Jp Calderone
On Thu, 30 Dec 2004 15:16:42 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote: >Jp Calderone <[EMAIL PROTECTED]> writes: > > > On Wed, 29 Dec 2004 12:38:02 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote: > >>Jp Calderone <[EMAIL PROTECTED]> writes: >

Re: String Splitter Brain Teaser

2005-03-27 Thread Jp Calderone
>>> s = 'ATT/GATA/G' >>> re.findall('(./.|.)', s) ['A', 'T', 'T/G', 'A', 'T', 'A/G'] >>> If it is really important to have ['A'] instead of 'A', etc, looping over the result and noticing strings of length 3 vs length 1, then applying the appropriate transformation, should be simple enough. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Dumb*ss newbie Q

2005-03-27 Thread Jp Calderone
ributes are in collision with each other. When you try to look up the attribute, you might get the method. When you try to look up the method, you might get the attribute. It is deterministic, but depends on the order in which you do things, and highly confusing no matter what. Avoid naming attributes and methods the same thing. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding methods in classes you don't control

2005-03-27 Thread Jp Calderone
replace wxFrame's __init__ with my new version by assigning > it before any frames are instantiated. from thirdparty.project import Something orig = Something.meth def new(x, y, z): foo() orig(x, y, z) bar() Something.meth = new HTH, Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: SSL Server Socket Support in Python?

2005-04-22 Thread Jp Calderone
o, PyOpenSSL, TLSLite), or for an easier time, Twisted. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode problems, yet again

2005-04-23 Thread Jp Calderone
e you can always do things explicitly and avoid invoking the implicit behavior. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: What is situation with threads in Python

2005-04-25 Thread Jp Calderone
s the result in the form of the thread module. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: What is situation with threads in Python

2005-04-25 Thread Jp Calderone
Python programs. Notable exceptions to this include most IO related operations (opening files, reading from sockets, etc), which explicitly release the lock during the actual IO operations, so as to allow other threads to execute Python bytecode while waiting on the disk or the netw

Re: compile shebang into pyc file

2005-04-26 Thread Jp Calderone
x, read up on /proc/sys/fs/binfmt_misc Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding Standards (and Best Practices)

2005-04-26 Thread Jp Calderone
http://python.org/peps/pep-0008.html Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: compile shebang into pyc file

2005-04-27 Thread Jp Calderone
are trivially (or near trivially) converted back into .py files. The only parts which cannot be restored are the comments, which are discarded at compilation time. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Shutting down twisted reacotr

2005-04-28 Thread Jp Calderone
neral doing so has unpredictable behavior and is not supported. You also may be interested in twisted.internet.stdio and, in Twisted 2.0, twisted.conch.insults. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Reusing object methods?

2005-04-29 Thread Jp Calderone
is this possible in an elegant, straightforward way? This is what sub-classing is for. If it makes you feel better, call it "mixing in" instead. You can share this method between two classes without inheritance (by defining a free function and then ...), but using a common base class re

text to html

2011-12-13 Thread prakash jp
Hi All, Want to publish a log file as a web page, is there a parser to retain the format of the text as is and then convert to html. Please provide the relevant pointers Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread Jp Calderone
It has essentially the same thing, PostEvent(). Python thread support seems to have been something of an afterthought and there's a lot of weirdness like this to deal with. I'm not sure what you see as weird about this. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: BitKeeper for Python?

2005-05-01 Thread Jp Calderone
e including all the changes and be able to determine what parts of the code were changed. If it were opensource that would be even better. Have you checked out this page? http://www.google.com/search?hl=en&lr=&q=version+control+system&btnG=Search Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Whats the best Python Book for me

2005-05-01 Thread Jp Calderone
while geared more towards newer programmers, is also a nice introduction to the Python language. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging threaded Python code

2005-05-01 Thread Jp Calderone
t;probably just missing the obvious as usual. Is there some simple way I >can do this? > I saw an awesome demo of Komodo's debugger at Linux World this year. I still haven't had an excuse to mess around with its support of threads myself, but it seemed to handle them qu

Re: BitKeeper for Python?

2005-05-02 Thread Jp Calderone
d. Compare this to such systems as CVS (more than 16 years old) and I think everyone can agree that Mercurial may need a teensy bit more work before it is interesting to people looking for an RCS. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: pop3proxy

2005-05-02 Thread Jp Calderone
t the state of connection, since "QUIT" is perfectly legitimate as part of a message body and should not be interpreted the same as a QUIT outside a message body. > ClientSocket.send(DataFromClient) Same comments about send() as above. > if not DataFromClient: break > ClientSocket.close() > Connexion2Client.close() > >eof > > > [snip output] Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Bandwith Shaping

2005-05-04 Thread Jp Calderone
nts/current/api/twisted.protocols.htb.html Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Sockets

2005-05-05 Thread Jp Calderone
if cl is not client: cl.sendLine("%s sent me a message: %r" % (client, line)) # Start the server on TCP port 54321 reactor.listenTCP(54321, ClientMessageFactory()) # Run the main event loop reactor.run() Learn more about Twisted on its website: http://www.twistedmatrix.com/ Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Database backend?

2005-05-08 Thread Jp Calderone
songs, at that point you may wish to revisit your data storage solution. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: A question about inheritance

2005-05-08 Thread Jp Calderone
>But in such a way that cl2 instances have atributes 'b' AND 'a'. >Obviously, this is not the way of doing it, because the __init__ >definition in cl2 overrides cl1's __init__. > >Is there a 'pythonic' way of achieving this? class cl2(cl1):

Re: Clueless with cPickle

2005-05-08 Thread Jp Calderone
^ Note this variable name > # store the object > >questorlist = [] > ># Write to the file >f = file(questorfile, 'w') >p.dump(questorlist, f) # dump the object to a file >f.close() > >del questorlist # remove the shoplist > &

Re: __brace__ (PEP?)

2005-05-08 Thread Jp Calderone
school of language design suggests that doing so would not be a great idea. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: how to calc the difference between two datetimes?

2005-05-08 Thread Jp Calderone
a(-2, 72000) >>> y - x datetime.timedelta(1, 14400) >>> Parsing the time string is left as an exercise for the reader (hint: see the time module's strptime function). Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Put a file on an ftp server over ssl

2005-05-10 Thread Jp Calderone
d (<http://www.twistedmatrix.com>) has some rudamentary FTP support. It also has SSL support. It will probably take a little effort on your part to get them to work together, but I'm sure it will be easier than coming up with your own FTP implementation or kludging the standard li

Re: Put a file on an ftp server over ssl

2005-05-10 Thread Jp Calderone
ure. Or maybe it's really not worth it to you. Only you can decide, I suppose. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Solipsis: Python-powered Metaverse

2005-05-10 Thread Jp Calderone
out it the moment I get a couple adjacent free minutes. :) It should be an easy change to make, since their protocol code is orthogonal to their transport code (and defeating NATs and firewalls is a transport issue). Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacing open builtin

2005-05-11 Thread Jp Calderone
thers than >through __builtins__ and is __getattribute__, __setattr__ secure Only about a zillion. For example: >>> type(sys.stdout)('/dev/null') Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacing open builtin

2005-05-11 Thread Jp Calderone
months and months of development time, at least), or write a new interpreter from scratch. Older versions of Python thought they had this licked, see the rexec module for the attempt that is no longer maintained. Jp -- http://mail.python.org/mailman/listinfo/python-list

RE: Interactive shell for demonstration purposes

2005-05-11 Thread Jp Calderone
gt;which might get you started. > execnet lets you easily run arbitrary Python code on remote hosts. This doesn't seem too closely related to the OP's question, which seems directed at finding a pretty GUI to display the results of such execution. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Escape spaces in strings

2005-05-12 Thread Jp Calderone
, > >Florian Yes, but you don't want to use them. Instead, use a process launching function which doesn't smoosh arguments together into a single string which then needs to be parsed. For example, os.execl, os.spawnl, or subprocess.call. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: wxTimer problem

2005-05-13 Thread Jp Calderone
d by thread)? >2. About the wxTimer, does any parameter to let it be independent? > What does "independent" mean? Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: doc tags?

2005-05-13 Thread Jp Calderone
and method definitions. I don't think >that's what Wolfram is referring to. Decorator syntax may only work there. Decorators are a more general concept orthogonal to the '@' syntax, which can be applied to any kind of object. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: stop a thread safetely

2005-05-13 Thread Jp Calderone
the function it is running terminate (either by returning or raising an exception). Instead of using threads for network communication, you may want to look into these: http://www.twistedmatrix.com/ http://python.org/doc/lib/module-asyncore.html http://www.nightmare.com/medusa/

Re: Solipsis: Python-powered Metaverse

2005-05-13 Thread Jp Calderone
uter. Many routers support the former of these, and a sizable portion support the latter. Of course, if your protocol includes port numbers in the application areas of the packets it sends, the router usually can't properly rewrite the packet, so things go pear shaped. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted an several CPUs

2005-05-19 Thread Jp Calderone
top has a 128-way cell processor in it, you'll still be able to take advantage of it :) Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted an several CPUs

2005-05-19 Thread Jp Calderone
On 19 May 2005 17:01:11 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >Jp Calderone <[EMAIL PROTECTED]> writes: >> Distributing load across multiple machines scales better than >> distributing it over multiple CPUs in a single machine

Re: buffer_info error

2005-05-20 Thread Jp Calderone
ut buffer_info expects an array. How do >i deal with this? What's the low-level call you're invoking? Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: first release of PyPy

2005-05-21 Thread Jp Calderone
ire semantic changes to existing behavior, without actually knowing that they'll speed things up, or even that they are targetted at bottleneck code, is kind of a waste of time. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: line-by-line output from a subprocess

2005-05-23 Thread Jp Calderone
yield data, > Or, doing the same thing, but with less code: def iterread(fobj): return iter(fobj.readline, '') Haven't tried this on subprocess's pipes, but I assume they behave much the same way other file objects do (at least in this regard). Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: os independent way of seeing if an executable is on the path?

2005-05-26 Thread Jp Calderone
exts = filter(None, os.environ.get('PATHEXT', '').split(os.pathsep)) for p in os.environ['PATH'].split(os.pathsep): p = os.path.join(p, name) if os.access(p, flags): result.append(p) for e in exts: pext = p + e if os.access(pext, flags): result.append(pext) return result Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Jp Calderone
y solved >> this problem. > >But they haven't. They depend on messy things like server processes >constantly running, which goes against the idea of a cgi that only >runs when someone calls it. SQLite is an in-process dbm. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Jp Calderone
On 27 May 2005 06:43:04 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >Jp Calderone <[EMAIL PROTECTED]> writes: >> >But they haven't. They depend on messy things like server processes >> >constantly running, which goes against the ide

Re: lambda a plusieurs arguments

2005-05-27 Thread Jp Calderone
st): > File "", line 1, in ? >TypeError: () takes exactly 1 argument (2 given) >>>> f((5.6)) ^--- , >>> f((5, 6)) 11 >>> Aussi, >>> f = lambda a, b: a + b >>> f(5, 6) 11 >>> Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem: using signal.alarm() to stop a run-away os.system() command

2005-05-27 Thread Jp Calderone
7;m doing >wrong? CPython only delivers signals to Python programs in between bytecodes. Since your program is hanging around in the system(3) call, it isn't executing any bytecode, so CPython never gets an opportunity to deliver the signal. Try using a pipe (popen() or the new subprocess module) and select() with a timeout of 5. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: [Twisted-Python] xmlrpc deferred

2005-05-27 Thread Jp Calderone
ls .callback() on it - so, never having a result, it never bothers to invoke any of its callbacks. Deferred just hook results up to callbacks. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: [Twisted-Python] xmlrpc deferred

2005-05-27 Thread Jp Calderone
Err woops. Wrong list, sorry. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: evaluated function defaults: stored where?

2005-05-27 Thread Jp Calderone
s to where they are actually stored, this should be considered an implementation detail, but you can look at inspect.py to see how it pulls the values out (they're just in an attribute on the function object). Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Jp Calderone
On 27 May 2005 15:22:17 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >Jp Calderone <[EMAIL PROTECTED]> writes: >> >Oh, ok. But what kind of locks does it use? >> >> It doesn't really matter, does it? > >Huh? Sure, if there&#

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Jp Calderone
ing mechanisms it uses have changed between different releases, and may even be selected based on the platform being used. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast text display?

2005-06-08 Thread Jp Calderone
isfy the performance requirements. This was about three years ago, so the field may have changed. If you like, you can check out the code: http://sourceforge.net/projects/originalgamer As MUD clients go, it's pretty weak, but it solves the text display problem pretty decently. Hope this helps, Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: pack heterogeneous data types

2005-06-08 Thread Jp Calderone
this is send a packet over >a network. >>> import struct >>> struct.pack('!BL', 0xff, 0x) '\xff\xaa\xaa\xaa\xaa' >>> Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast text display?

2005-06-08 Thread Jp Calderone
his applies to other libraries as well, of course. Installing wxPython on Debian is a 5 second ordeal. This is not to say debian is awesome and you should go install it right now or *else*, just to say that the installation of a single piece of software can vary greatly in difficulty between different platforms. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: IMAP Proxy

2005-06-10 Thread Jp Calderone
meone here has already done such a thing I can use or know where >i can get it ? I recommend using Twisted's IMAP4 support for this. There's a simple proxy in the Twisted issue tracker that might be useful to start from: http://twistedmatrix.com/bugs/issue215 Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying behaviour of the != operator

2005-06-10 Thread Jp Calderone
ag)) >>>> clist >[(1+2j), (3+4j), (5+6j), (7+8j)] > It's not a general solution: >>> L = [1, 'hello', 2j] >>> L.sort(key=lambda x: (x.real, x.imag)) Traceback (most recent call last): File "", line 1, in ? File "", line 1, in AttributeError: 'int' object has no attribute 'real' Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: non OO behaviour of file

2005-06-15 Thread Jp Calderone
dn't need to go to this extreme, though. FWIW, I think the behavior of Python wrt file subclasses that override write() is silly, too. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: making a opc client in Python and use opc server Events

2007-06-28 Thread jp . eugster
On 4 juin, 11:32, [EMAIL PROTECTED] wrote: > Hi all > I have a sample code to implement opc client in Python. i use a > file .py making by makepy with pythonwin for Com Interface. > i can get all server in machine, connect to server opc, disconnect, > add group, add item, read, write item in server

Re: making a opc client in Python and use opc server Events

2007-08-07 Thread jp . eugster
On 28 juin, 16:55, [EMAIL PROTECTED] wrote: > On 4 juin, 11:32, [EMAIL PROTECTED] wrote: > > > > > > > Hi all > > I have a sample code to implement opc client in Python. i use a > > file .py making by makepy with pythonwin for Com Interface. > > i can get all server in machine, connect to server op

file transfer over LAN

2009-03-26 Thread prakash jp
Hi all, On generating log file on remote systems(say client), I want to transfer them to the Network Admins(say Server) Computer. In doing so all the contents of the log file r not transfered, only part of the file. I appreciate ur help, here is the pre-existant code: file sender !!!--client:

python -TFTP over LAN

2009-03-29 Thread prakash jp
Hi all, I am interested in using python based TFTP over my LAN. Do let me know how to ahead and any specific urls. Thaks in advance. Regards Prakash -- http://mail.python.org/mailman/listinfo/python-list

email from windows

2009-03-29 Thread prakash jp
Hi all, In windows environment, how to send email from one gmail address to another gmail (or another mail) addrress Regards Prakash -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   >