On Jun 10, 2006, at 5:14 AM, ywzhan wrote:
> Hi, I am new here.
> When I use sys.stdin.readline() to get input string from user,
> how can I set a timeout value for this operation?
> thank you.
>
>
You can do a select() on sys.stdin, and put a timeout on the select, ie:
rfds, wfds, efds = selec
On May 12, 2006, at 5:45 PM, DataSmash wrote:
> I need to unzip all zip file(s) in the current directory
> into their own subdirectories. The zip file name(s) always
> start with the string "usa" and end with ".zip".
> The code below will make the subdirectory, move the zip
> file into the subdi
On May 5, 2006, at 10:33 PM, Leo Breebaart wrote:
> I have a simple question (I hope), but one I'd love to get some
> feedback on in case I am missing something obvious:
>
> If I have a Python script that is executable, and therefore
> already uses '''if __name__ == "__main__"''' to call a functi
On May 5, 2006, at 6:35 AM, John J. Lee wrote:
> ...I wrote something to do this once, but didn't do as good a job as I
> might have done and wondered if anybody else has done it properly.
>
> I know about nose, but it seems just a little too magical for my
> tastes, and includes stuff I don't re
On May 4, 2006, at 12:12 AM, [EMAIL PROTECTED] wrote:
> hi
> I have a file with columns delimited by '~' like this:
>
> 1SOME STRING ~ABC~12311232432D~20060401~
> 2SOME STRING ~DEF~13534534543C~20060401~
> 3SOME STRING ~ACD~14353453554G~20060401~
>
> .
>
On Apr 27, 2006, at 3:26 PM, [EMAIL PROTECTED] wrote:
> I think I have reached an important moment in my growth as a Python
> Developer. I realize now why interfaces aren't really necessary in
> Python. :]
>
> Still, I'm designing an application that I want to be extendable by
> third-party devel
On Apr 24, 2006, at 5:38 PM, Neil Adams wrote:
> How do Ifix memory message Ox033fc512 at Ox can't be read
>
You're going to have to provide a LOT more information if you expect
anyone here to help you with that. What program caused that? For all we
know, notepad.exe could have crashe
On Apr 23, 2006, at 4:59 PM, Panos Laganakos wrote:
> Thanks Ben.
>
> What does it mean that they're statically bound?
>
> It seems weird that I'm not able to access variables in the class
> namespace even though these attributes come into existance after class
> instantiation.
>
The parameters
On Apr 20, 2006, at 9:33 AM, david brochu jr wrote:
> Hello,
>
> I wrote a script to monitor ping activity and output it to a log file.
> I am using windows and want to have another script constantly check
> the latest entry to see if Request timed out is seen. Is there a way
> to "tail" a f
On Apr 20, 2006, at 1:22 PM, Mateo wrote:
> I've played around with pygame, and it seems to have much of what I
> need. Still, is there any way to initiate a mouse click from Python?
>
> Thanks.
>
In OS X, you'll probably need PyObjC. I've never had a chance to try it
myself, but if any package
On Apr 18, 2006, at 9:06 PM, Alex Martelli wrote:
>
> Funny timing coincidence: your 1st draft of Python for Dummies going in
> now, my 2nd edition of Python in a Nutshell just went to production,
> AND
> Wesley Chun's 2nd ed is also being finished this week. Three
> Baypiggies
> (or whatever w
On Apr 18, 2006, at 9:58 AM, [EMAIL PROTECTED] wrote:
> Its the Java developer again...
>
> I'm working on an application framework that I would like to implement
> in Python. Part of the application framework is a plug-in model that is
> similar to the one used in Eclipse.
>
> Is it possible to
On Apr 18, 2006, at 4:43 AM, [EMAIL PROTECTED] wrote:
> ok, well enough, looked at struct and it does seem to be what i am
> after. for that anyway.
> thanks, guess i will just have to take the time and pull it apart.
>
I recommend you also take a look at http://pyconstruct.sourceforge.net/
I
On Apr 17, 2006, at 8:58 PM, Alex Martelli wrote:
>
> I don't know of any such books, but if M$ is willing to slip me a
> suitable sweetener (to make it worth my while to install Windows again
> after years of blissfully Windows-free existence: it must at least
> cover
> the expense of the extra
On Apr 14, 2006, at 9:44 AM, Philippe Martin wrote:
> Thanks,
>
> It's a pretty big structure: painfull to pass each item as a param.
>
> Regards,
>
> Philippe
>
Maybe this can do something for you?
http://pyconstruct.sourceforge.net/
Jay P.
--
http://mail.python.org/mailman/listinfo/python
On Apr 13, 2006, at 5:57 PM, Karlo Lozovina wrote:
> Consider this short script:
>
> ---
> from time import time, sleep
>
> st = time()
> print 'Start: %f, ' % st,
> sleep(10)
> sp = time()
> print 'Stop: %f, Duration: %f' % (sp, (st - sp))
> ---
>
> On my environment (Linux, py24), when run, Pyt
On Apr 13, 2006, at 12:09 PM, Kelvie Wong wrote:
> try this:
>
> string = 'D c a V e r " = d w o r d : 0 0 0 0 0 6 4 0'
> import re
> re.sub("\s", "", string)
>
> On 4/13/06, david brochu jr <[EMAIL PROTECTED]> wrote:
>
Even easier (if you only want to replace blank spaces, and not all
whitespa
On Apr 12, 2006, at 5:13 AM, Michael Yanowitz wrote:
>>
>
> Thanks. I want to translate from Python to C++ for a few reasons:
> 1) Curiosity. I would like to see how well the translation goes.
> 2) Efficiency. It is alot quicker to code something in Python. If I can
>write it in Python and a
On Apr 8, 2006, at 1:40 PM, [EMAIL PROTECTED] wrote:
>
> Hi there,
>
> I'm new to Python, but know other scripting and programming languages.
> I
> want to develop a script which will receive emails with attachments
> from my POP3 account, perform certain actions on it and email it back
> to some
On Apr 6, 2006, at 3:25 PM, Jay Parlar wrote:
> I just downloaded, built, and installed the new 2.5 alpha on OS X
> 10.3, and it seems that the new 'functional' didn't get installed.
>
> I know that it got built (done from the 2.5 source directory):
>
> Ja
I just downloaded, built, and installed the new 2.5 alpha on OS X 10.3,
and it seems that the new 'functional' didn't get installed.
I know that it got built (done from the 2.5 source directory):
Jay-Computer:~/Desktop/Python-2.5a1 jayparlar$ find . -iname functional*
./build/lib.darwin-7.9.0-Po
On Mar 21, 2006, at 1:12 PM, Fredrik wrote:
>
>> (I notice there's no mention in PEP 3000 of deprecating
>> the doctest module).
>
> why is it that comp.lang.python is suddenly full of folks who
> want to deprecate anything they don't understand ? don't
> you have better things to do with your t
On Mar 16, 2006, at 3:14 PM, Peter Bismuti wrote:
> Can anyone explain this error message?
>
> Traceback (most recent call last):
> File "/acct/pjb9508/RAT/Scripts/PyQt/RatDialog.py", line 30, in
> NewClipButton_clicked
>
> self.rat.planeClip(self.o,"SQUARE"+str(self.squareCounter),w
On Mar 8, 2006, at 8:43 AM, Tom Bradford wrote:
>
>
> This type of hinting would only break type ducking in-so-much as a
> function that leveraged that hinting would be looking specifically for
> an instance of a particular type, which would be absolutely no
> different than a developer performing
On Mar 8, 2006, at 7:20 AM, Tom Bradford wrote:
> Really what we're talking about here is weak typing in the form of
> optional type hinting performed on a function by function basis. As an
> option, what it would do is allow an author to semantically 'hint' to
> the interpreter that a function
On Mar 7, 2006, at 1:32 PM, Tom Bradford wrote:
>
> Let me first say that I'm sure that this subject has come up before,
> and so forgive me for beating a dead horse. Secondly, let me say that
> Python's strength is its dynamic nature, and I don't believe that it
> should ever require a precondit
On Mar 6, 2006, at 8:44 PM, James Stroud wrote:
> Since python is "weakly typed", you will not be able to check what
> "type" of arguments a function expects. TypeErrors relating to the
> type of argemtns you pass will be raised inside the function only and
> not when it is called. I.e. there
On Mar 5, 2006, at 2:30 PM, Marek wrote:
> Assume I want to add a method to an object at runtime. Yes, to an
> object, not a class - because changing a class would have global
> effects and I want to alter a particular object only. The following
> approach fails:
>
> class kla:
> x = 1
>
> de
On Mar 4, 2006, at 3:00 PM, Paul Boddie wrote:
>
> I'd have a look at the following Python-related papers:
>
> Michael Salib's Starkiller paper (and presentation):
> http://www.python.org/pycon/dc2004/papers/1/
>
> Mark Dufour's ShedSkin paper:
> http://kascade.org/optimizing_python.pdf
>
> John A
For one of my grad school classes, I'm writing a paper on "Dynamic
Languages". What a wonderfully vague topic (but at least it'll let me
write about Python).
Anyway, I want to talk about things like typing disciplines (weak,
strong, etc.),"class vs. prototype, JIT technologies in dynamic
langu
On Feb 10, 2006, at 4:21 AM, Nebur wrote:
> Hi,
> I tried to understand the docs of Peak's PyProtocols, and failed.
> I use PyProtocols v0.93 final. I fetched the ...tar.gz file for Linux
> and installed it using the setup.py.
> Here's my Hello-World-like example, that defines a Duck, which
> "imp
I was hoping to get some c.l.p. opinions on O'Reilly's new Twisted book.
I'm coming at Twisted as someone who's been programming mainly in
Python for almost 6 years now, but who's never done any Twisted
development. I've used some of its prepackaged libraries before (and
did some custom tweaks
Randall Parker wrote:
> Alex Martelli wrote:
>
>> The "but without declaration it can't be self-documenting" issue is a
>> red herring. Reading, e.g.:
>>
>> int zappolop(int frep) { ...
>>
>> gives me no _useful_ "self-documenting" information about the role and
>> meaning of frep, or zappolop's
Enigma Curry wrote:
>
>
> Sorry, for the noob question, but I haven't been able to find
> documentation on this matter.
>
> I've been looking for documentation that describes what the @function()
> syntax is all about.
>
> I've seen this on a few pages, for instance:
>
> http://aspn.activestate.co
> Paul Boddie wrote:
>
>> I don't think I've ever seen anyone advocating calling a function like
>> getattr(obj "foo" + "bar")().
>
>> From Lib/compiler/visitor.py:
>
> meth = getattr(self.visitor, 'visit' + className, 0)
>
> Later on:
>
> meth(node, *args)
>
> Of course, you can drop the "visit" p
> Indeed, especially Eckels article shed some light about testing as an
> alternative to static typing. I still can't quite understand why you
> can't
> do both. Clearly unit tests should be part of any software, not only
> Python software.
>
You can do both, but why? *Especially* in a language li
On Dec 22, 2005, at 2:20 PM, Greg Stein wrote:
> Guido would acknowledge a query, but never announce it. That's not his
> style.
>
> This should have a positive impact on Python. His job description has a
> *very* significant portion of his time dedicated specifically to
> working on Python. (much
On Dec 8, 2005, at 5:29 PM, [EMAIL PROTECTED] wrote:
>
> Hello all,
>
> I'm a beginner with programming. Trying to teach myself with that
> excellent rat book. Unfortunately I just can't seem to figure out a
> simple problem that has come up at my work (biology lab):
> let's say I have a lis
reddit.com, which was formerly implemented in LISP (and somewhat famous
for that fact) has just *relaunched* and is now written in Python!
They haven't given their reasons yet, but I'll certainly be interested
to see why.
Paul Graham's reaction should also be interesting, he said reddit.com
ha
On Nov 9, 2005, at 7:30 PM, Alex Martelli wrote:
> No way -- the itertools module is and remains a PRECIOUS resource. If
> you want an iterator rather than a list, itertools.ifilter is quite
> appropriate here.
Or if you're on 2.4 and want an iterator:
(x for x in xrange(10) if p(x))
Jay P.
On Nov 7, 2005, at 3:00 AM, sumi wrote:
> can i tar and untar using python
The standard library does it again:
http://docs.python.org/lib/module-tarfile.html
Jay P.
--
http://mail.python.org/mailman/listinfo/python-list
You may also want to look at the following Summer of Code project:
http://pysizer.8325.org/
Their SVN repo is at http://codespeak.net/svn/user/nick8325/sizer/ I
haven't had a chance to try it yet, but it might be exactly what you
need. The project is described as
"PySizer is a library for mea
On Oct 28, 2005, at 9:20 AM, pywrote:
From what I have seen Python does not come with an snmp module built
in, can anyone suggest some other SNMP module (preferably one you have
used/experienced)..I have googled and seen yapsnmp and pysnmp (which
seem to be the two most active SNMP modules).
W
On Oct 25, 2005, at 3:10 PM, David wrote:
>
> It looks like I am going to have to bite the bullet and use properties.
> The following should do what I want.
>
> class test:
>
> def __init__(self):
> self.__HB = 0
> self.__VPG = 0
> ...
FYI, for property to work, your class ha
> I've recently configured my network such that I use squid as a http
> proxy. I'd now like to be able to use setuptools and ez_setup via this
> proxy. Is this possible? If so, how do I do it?
It should work if you sent the environment variable (in your shell)
'http_proxy' to the address of you
I haven't been following this whole thread, but it sounds like you want
something like PJE's RuleDispatch package.
There's a Developer Works article about it, put up very recently:
http://www-128.ibm.com/developerworks/linux/library/l-cppeak2/?ca=dgr-
lnxw02aScalingPEAK
PJE (IIRC) based it of
Jumping in a bit late here, but I'd personally REALLY like to see
something about PEP 246, and more specifically, what Phillip Eby has
done about it with the PyProtocols package.
Especially with all this static typing talk going on these days, a good
set of documentation (with lots of useful ex
47 matches
Mail list logo