Re: Safe Local XMLRPC

2005-03-12 Thread Michael Urman
[Sorry, I previously replied to Diez offlist, and probably to a spam-protected address at that. Here's that reply and my followup after reading up on pyro ] On Sat, 12 Mar 2005 11:08:31 -0600, Michael Urman <[EMAIL PROTECTED]> wrote: > On Sat, 12 Mar 2005 14:12:21 +0100, Diez B. Ro

Re: Generating data types automatically

2005-03-12 Thread Michael Hoffman
think it would be better to define your types like this: ViUInt32, ViPUInt32, ViAUInt32 = generate_type_triplet(u_long) That way you will easily be able to find the initial definition of the object by searching and replacing. You'll also have to jump through fewer weird hoops to get the r

Building Python 2.4 with icc and processor-specific optimizations

2005-03-12 Thread Michael Hoffman
tel(R) C++ gcc 3.0 mode] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.builtin_module_names ('__main__', '__builtin__', '__builtin__', '__builtin__

Re: Safe Local XMLRPC

2005-03-12 Thread Michael Urman
Thanks for your time everyone; I got it XMLRPC working over unix domain stream sockets. In case people are interested, here's the pieces I put together. I'm sure they throw away a little flexibility, but they work for my purpose. Any pointers to make the code more robust, or do less total overridin

Re: blocking a program until a non-Python process terminates

2005-03-12 Thread Michael Hoffman
ates? Either: 1) returncode = subprocess.call(cmdline) 2) or: pipe = subprocess.Popen(cmdline) returncode = pipe.wait() -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: error sending path to Win OS

2005-03-12 Thread Michael Hoffman
cannot end in an odd number of backslashes). Specifically, a raw string cannot end in a single backslash (since the backslash would escape the following quote character). Note also that a single backslash followed by a newline is interpreted as those two characters as part of the string,

Re: Why does this not work?

2005-03-12 Thread Michael Hoffman
d this excellent document. The suggestions will help you get help: http://www.catb.org/~esr/faqs/smart-questions.html Then come back and post something with a sensible subject and you will probably get some more direct help. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Turning String into Numerical Equation

2005-03-12 Thread Michael Spencer
node.__class__.__name__,node) def calc(source): walker = EvalCalc() try: ast = compiler.parse(source,"eval") except SyntaxError, err: raise try: return walker.visit(ast) except CalcError, err: return err Examples: >>> calc("2+3*(4+5)*(7-3)**2") 434 >>> eval("2+3*(4+5)*(7-3)**2") # Check 434 >>> calc("sin(pi/2)") 1.0 >>> calc("sys.exit()") Syntax Error: Getattr >>> calc("0x1000 | 0x0100") 4352 >>> Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Using reverse iteration to clean up a list

2005-03-13 Thread Michael Hoffman
u insist on a list of lists. Tuples are generally used for heterogeneous fixed-length sequences. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does this not work?

2005-03-13 Thread Michael Hoffman
Gensek wrote: Thanks, guys, it works now. I couldn't have done it without your generous help. You're welcome! Any time. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Using reverse iteration to clean up a list

2005-03-13 Thread Michael Hoffman
key = tuple(row[:2]) portfolio[key] = portfolio.get(key, 0) + int(row[2]) You could also do a groupby solution with itemgetter(slice(0, 2))--thanks to Steven Bethard for recently pointing out the possibility here of doing that. I'd go with the dict for this application though. -

Re: pyasm 0.2 - dynamic x86 assembler for python

2005-03-13 Thread Michael Spencer
bler directives for flow. Michael >>> import ackermann >>> Ackermann = assemble(ackermann.ackSrc) [snip assembler output] >>> Ackermann >>> Ackermann(3,8) 2045 # ackermann.py -- def ackSrc(m,n): "Co

Re: Determining the length of strings in a list

2005-03-13 Thread Michael Hoffman
et the length of all of the values this way: sum(len(value) for value in cmdline_dict.itervalues()) I don't think it's a good idea to call your dict "dict" as it shadows a built-in. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Building Python 2.4 with icc and processor-specific optimizations

2005-03-14 Thread Michael Hoffman
Michael Hoffman wrote: Just out of curiosity, I was wondering if anyone has compiled Python 2.4 with the Intel C Compiler and its processor specific optimizations. I can build it fine with OPT="-O3" or OPT="-xN" but when I try to combine them I get this as soon as ./pyt

Re: Wishlist item: itertools.flatten

2005-03-14 Thread Michael Spencer
Leif K-Brooks wrote: Michael Spencer wrote: if hasattr(item,"__iter__"): # Avoids iterating over strings That's probably the cleanest way to avoid strings, but it's unfortunately not a good idea IMHO. Many objects (IndexedCatalog's Result objects are what

Re: optparse alternative

2005-03-14 Thread Michael Hoffman
for a THIRD way to do the same thing. Just a suggestion. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: optparse alternative

2005-03-14 Thread Michael Hoffman
Henry Ludemann wrote: I had actually written most of this module before I became aware > of optparse (it was one of those bash the head against the wall > moments when I found it), I've been there :) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining the length of strings in a list

2005-03-14 Thread Michael Spencer
# continue to build the command accumulator.append(item) len_accumulator = trial_len if accumulator: yield separator.join(accumulator) >>> list(iterjoin(source, ", ", width = 20)) ['some, fragments', 'of, text, some', 'fragments, of, text', 'some, fragments, of', 'text, some', 'fragments, of, text', 'some, fragments, of', 'text, some', 'fragments, of, text', 'some, fragments, of', 'text, some', 'fragments, of, text', 'some, fragments, of', 'text, some', 'fragments, of, text'] >>> Now you can simply iterate over each list in your dictionary: for k in d: for command in iterjoin(d[k], your_separator_here, width = 200) HTH Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Conversion to string: how do `s work?

2005-03-14 Thread Michael Hoffman
t remember ever seeing it in production code, so many people wouldn't even know what it was. And ' vs. ` is confusing. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Building Python 2.4 with icc and processor-specific optimizations

2005-03-14 Thread Michael Hoffman
nal', 0) PyObject_RichCompareBool('errno', 'errno', 0) # totally bogus! PyObject_RichCompareBool('errno', 'errno', 0) # and repeating it twice for good measure! PyObject_RichCompareBool('_sre', 'errno', 0) PyObject_RichCompareBool('_sre', 'errno', 0) PyObject_RichCompareBool('_sre', 'posix', 0) Well I probably have spent too much time on this already. To top things off, python compiled with -O3 and without -xN actually runs faster, so I shouldn't even be trying this road. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Turning String into Numerical Equation

2005-03-14 Thread Michael Spencer
Giovanni Bajo wrote: Michael Spencer wrote: * this means that, eval("sys.exit()") will likely stop your interpreter, and there are various other inputs with possibly harmful consequences. Concerns like these may send you back to your original idea of doing your own expression parsi

Re: Question about string.printable and non-printable characters

2005-03-15 Thread Michael Hoffman
ng when the i18n heavies weigh in ;) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp-likeness

2005-03-15 Thread Michael Hoffman
all to ADDN. It's simple and straightforward. This is off-topic for comp.lang.python. Follow-ups set. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Turning String into Numerical Equation

2005-03-15 Thread Michael Spencer
loops. > otherwise would love to be proved wrong. Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: code for Computer Language Shootout

2005-03-15 Thread Michael Spencer
the same as: for line in sys.stdin: if line and (line[0] == ">" or line[0] == ";"): print line else: print line.translate(table) HTH Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: code for Computer Language Shootout

2005-03-15 Thread Michael Spencer
Jacob Lee wrote: On Tue, 15 Mar 2005 21:38:48 -0800, Michael Spencer wrote: string.translate is a good idea. Note you can handle upper-casing and translation in one operation by adding a mapping from lower case to the complement i.e., table = string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsr

Re: Good use for Jython

2005-03-16 Thread Michael Hoffman
Jython? What ever gave you the impression that Jython was targeted only at people who wanted to do GUI development? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: code for Computer Language Shootout

2005-03-16 Thread Michael Spencer
F. Petitjean wrote: Le Tue, 15 Mar 2005 23:21:02 -0800, Michael Spencer a écrit : def output(seq, linelength = 60): if seq: iterseq = iter(seq) while iterseq: print "".join(islice(iterseq,linelength)) I suppose you mean : print ""

Re: Turning String into Numerical Equation

2005-03-16 Thread Michael Spencer
Giovanni Bajo wrote: Michael Spencer wrote: In fact, I believe my solution to be totally safe, That's a bold claim! I'll readily concede that I can't access func_globals from restricted mode eval (others may know better). But your interpreter is still be vulnerable to DOS-st

Re: code for Computer Language Shootout

2005-03-16 Thread Michael Spencer
Steven Bethard wrote: Michael Spencer wrote: def output(seq, linelength = 60): if seq: iterseq = iter(seq) while iterseq: print "".join(islice(iterseq,linelength)) Worth noting: "while iterseq" only works because for this case, you have a

Obfuscated Python: fun with shadowing builtins

2005-03-16 Thread Michael Hoffman
ol)(long(2*int))][staticmethod(bool)(long(2*int+1))] for int in staticmethod(classmethod)(staticmethod(bool)(long(-1) Enjoy ;) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: generic text read function

2005-03-17 Thread Michael Spencer
John Hunter wrote: "les" == les ander <[EMAIL PROTECTED]> writes: les> Hi, matlab has a useful function called "textread" which I am les> trying to reproduce in python. les> two inputs: filename, format (%s for string, %d for integers, les> etc and arbitary delimiters) Builing on J

Re: Interface support?

2005-03-17 Thread Michael Spencer
st.jsp?thread=89161 as part of long-range planning for a future Python 3000 (some years in the future) HTH Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: PyGoogle featured on Google Code

2005-03-18 Thread Michael Hoffman
Python 2.3+. Although thanks anyway, Google! Although there is a flatten(); Raymond is still working on that. ;) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: adding a path module to stdlib

2005-03-18 Thread Michael Hoffman
y for it to make it easier to deploy on multiple systems I use. Installing path.py is so much easier than using os.path. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Working with Huge Text Files

2005-03-18 Thread Michael Hoffman
Python program but given the size of these files I think one of the other alternatives would be simpler. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Michael Spencer
end/value_extend and value_add methods respectively. I imagine (without any basis in fact) that it would also be possible the optimize the performance of large mappings of containers compared with the generic dict. Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Michael Spencer
ainer types which can be meaningfully applied, no matter what the types of the contents. (There may be exceptions, but I can't think of any at the moment) Does anyone else think this is a problem? Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Building Time Based Bins

2005-03-19 Thread Michael Spencer
ter(source.splitlines())) 1230 23 88 1235 22 94 >>> Note this groups by the time at the end of each 5 mins, rather than the beginning as in your example. If this needs changing, fix groupkey HTH Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Michael Spencer
ht thing" in each case. a bit cumbersome, because of having to specify the accumulation method, but avoids adding methods to, or sub-classing dict Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: The use of :

2004-11-28 Thread Michael Sparks
le than the one with the colon. And yet you use a colon above to indicate ownership of the following chunk of text - specifically ownership by the "I.e" to illustrate your point. Methinks there may be a connection between the assertions: * But I could be wrong :-) Michael. -- http://mail.python.org/mailman/listinfo/python-list

Bookmark CGI in Python

2004-11-30 Thread Michael Foord
Anyone written an online bookmarks manager in Python ? I can knock a simple one together... but wondered if anyone else had already done it ? I can't find one with google - but htere are *loads* in perl and PHP, so I suspect thayt someoen must have written one witrh python. One that uses XBEL woul

Re: decorators ?

2004-12-02 Thread Michael Hudson
Skip Montanaro <[EMAIL PROTECTED]> writes: > Jacek> Anything you can do with decorators, you could do before (with > Jacek> the exception of rebinding the __name__ of functions). > > And while that feature was added because we realized it would be nice if the > decorated function could ha

Python2.4: building '_socket' extension fails with `INET_ADDRSTRLEN' undeclared

2004-12-02 Thread Michael Ströder
HI! I'm trying to build Python2.4 on a rather old Debian machine. I only have a shell account there. That's why I'm very limited in my actions. Building _socket fails (see below) although I tried to use configure --disable-ipv6 Any clue? Ciao, Michael.

Re: efficient intersection of lists with rounding

2004-12-02 Thread Michael Hoffman
ay to find out ;) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: efficient intersection of lists with rounding

2004-12-03 Thread Michael Hoffman
a dataset that small, it probably doesn't really matter which of these implementations you use. The exception would be if this were in an inner loop in the actual program and *were* being run 1 times or more. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: installing wxPython on Linux and Windows

2004-12-03 Thread Michael Hobbs
Daniel Bickett <[EMAIL PROTECTED]> wrote: >> I have no way to build it on Windows though, as I don't have Visual C++ >> 7.1, for that we must wait for Robin Dunn. > > Would it be too difficult of a task to try getting the build working > with Dev-C++? That way those without enough incentive for pu

Re: question on regular expressions

2004-12-03 Thread Michael Fuhr
s causes the pattern to replace everything up to the last '%5C' before a comma or the end of the string. Regular expressions aren't the only way to do what you want. Python has standard modules for parsing URLs and file paths -- take a look at urlparse, urllib/urllib2, and os.path. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list

ANN: python-ldap-2.0.6

2004-12-03 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g. pro

ANN: python-ldap-2.0.6

2004-12-03 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g. pro

Re: Python2.4: building '_socket' extension fails with `INET_ADDRSTRLEN' undeclared

2004-12-04 Thread Michael Ströder
Martin v. Löwis wrote: Michael Ströder wrote: I'm trying to build Python2.4 on a rather old Debian machine. I only have a shell account there. That's why I'm very limited in my actions. Building _socket fails (see below) although I tried to use configure --disable-ipv6 Any cl

Re: PyQT Licensing and plugins/scripting

2004-12-04 Thread Michael Sparks
uld see and it just concerns me that if I ever wanted to port such a system to windows I could get extremely stung (Suppose I was redistributing an executeable). It's a hypothetical question at present, due to using Linux, but it's (realistically) possible at some point it may become less h

Re: Pythonic use of CSV module to skip headers?

2004-12-04 Thread Michael Hoffman
of csv.DictReader to deal with this, so I can just write: for row in tabdelim.DictReader(file(filename)): ... I think this is a lot easier than trying to remember this cumbersome idiom every single time. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic use of CSV module to skip headers?

2004-12-04 Thread Michael Hoffman
ple extra lines of code in my original example all that cumbersome to type though. If you started about half of the programs you write with those extra lines, you might . I'm a strong believer in OnceAndOnlyOnce. Thanks to Nick Coghlan for pointing out that I no longer need do this in Py

Re: os.listdir("\\\\delta\\public")

2004-12-04 Thread Michael Hoffman
] (C) Copyright 1985-2001 Microsoft Corp. C:\>hostname MINIMOO C:\>dir \\MINIMOO The filename, directory name, or volume label syntax is incorrect. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Help With Hiring Python Developers

2004-12-05 Thread Michael Fuhr
work in the good-ol'-boy network (although that might be part of it), but that by making it difficult for anybody else, you're ensuring that only good programmers ever work on the code. Tell that to the poor slob who gets stuck with the job because the department can't or won't hir

Re: long number multiplication

2004-12-06 Thread Michael Hudson
"Terry Reedy" <[EMAIL PROTECTED]> writes: > "I.V. Aprameya Rao" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > i have been wondering, how does python store its very long integers and > > perform aritmetic on it. Well, up until fair recently it used "high school" arithmetic in

Re: Mean, median, and mode

2004-12-06 Thread Michael Fuhr
return values. I like. :) > > Thank you, I'm just using a paradigm (exploiting lambdas) that I picked > up while going through various functional programming modules. print median([1, 2, 3, 4, 5, 6]) 4 Shouldn't the median be 3.5? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list

Upgrading Python Article

2004-12-07 Thread Michael Foord
http://www.voidspace.org.uk/python/articles/upgrading_python.html I've been looking at whether to upgrade immediately from Python 2.3 to Python 2.4 or postpone it. This is my first `major version change`, so I've come up against the usual windoze (tm) problem - upgrading python breaks all my exten

Re: Python 2.4 Tix failing on Windows XP

2004-12-09 Thread Michael Auerswald
j vickroy wrote: Could someone tell me what I am doing incorrectly? All I can tell you is that I have the exact same problem (which I did not have with 2.3). Not much of a help, I know... -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 Tix failing on Windows XP

2004-12-09 Thread Michael Auerswald
whole problem only turns up inside PythonWin, whereas if I try it from the command line everything works fine. Michael -- http://mail.python.org/mailman/listinfo/python-list

Python vs. Perl

2004-12-11 Thread Michael McGarry
Hi, I am just starting to use Python. Does Python have all the regular expression features of Perl? Is Python missing any features available in Perl? Thanks, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Perl

2004-12-11 Thread Michael McGarry
both languages can be used to perform both sets of tasks, my belief is that one should pair a language and a task by strengths rather than what can be done in each language. I hope this helps! Michael Loritsch Thank you all for your input. Please feel free to keep this discussion going. I intend t

Hashes

2004-12-11 Thread Michael McGarry
Hi, Are there hashes in Python? Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Hashes

2004-12-11 Thread Michael McGarry
Peter Hansen wrote: Michael McGarry wrote: Are there hashes in Python? Define hash. Or look at Python's 'dict' type, or the hash() function and decide for yourself if that's what you meant. -Peter Yes, I guess the dict type is what I am looking for. Thank you, Michael -- ht

Any books on PyQt

2004-12-12 Thread Michael McGarry
Hi, Do any books cover PyQt? Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Named pipes in threads

2004-12-12 Thread Michael Fuhr
are you trying to do? Perhaps if you backed up and described the "what" we could make better recommendations about the "how." -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list

Best book on Python?

2004-12-12 Thread Michael McGarry
Hi, What is the best book covering Python? Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Best book on Python?

2004-12-12 Thread Michael McGarry
I have many years of programming experience and know a little bit of Tcl. I am looking for a book to detail on the features including GUI in a reference style. Thanks, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Python mascot proposal

2004-12-12 Thread Michael Sparks
imed the dot in dot com, it makes sense for Python with the Python VM to claim the other important piece of punctuation as a logo. I believe that Apple will be adopting the double slash //, with go faster stripes colouration, in the new year, and that unfortunately leaves Microsoft with t

Problem with Qt

2004-12-12 Thread Michael McGarry
n("Poisson", trafftype) selfsimilar = QRadioButton("Self-Similar", trafftype) a.setMainWidget(widget) widget.show() a.exec_loop() Any help is greatly appreciated. Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with Qt

2004-12-12 Thread Michael McGarry
Thanks, I had just discovered Qt Designer. I will probably use this. It seems to work well. Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Best book on Python?

2004-12-12 Thread Michael McGarry
. Martelli published by O'Reilly. It has a section on Tkinter and many other things that you may find useful. ah On Mon, 13 Dec 2004, Rod Haper wrote: Michael McGarry wrote: I have many years of programming experience and know a little bit of Tcl. I am looking for a book to detail on the fea

Qt String Question

2004-12-12 Thread Michael McGarry
Hi, How do I convert from a qt.QString to a Python string? Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Qt String Question

2004-12-12 Thread Michael McGarry
Michael McGarry wrote: Hi, How do I convert from a qt.QString to a Python string? Michael Apparently the ascii() method of QString does this. (I answered my own question). sorry for wasting newsgroup space. -- http://mail.python.org/mailman/listinfo/python-list

PyQt on MAC OS X

2004-12-13 Thread Michael McGarry
uk, unpacked it, ran python configure.py and got this error: Error: /sw/share/qt3/mkspecs/darwin-g++/qmake.conf: macro 'QMAKE_LIBDIR/$(TARGET1)' is not defined. Any ideas? Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt on MAC OS X

2004-12-13 Thread Michael McGarry
Kevin Walzer wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've assembled a binary installer for the native version of PyQt. See http://www.wordtech-software.com/pyqt-mac.html I built it on Panther. Not sure if it will work on Jaguar, but you're welcome to give it a try. Micha

Re: PyQt on MAC OS X

2004-12-13 Thread Michael McGarry
glenn andreas wrote: In article <[EMAIL PROTECTED]>, Michael McGarry <[EMAIL PROTECTED]> wrote: One problem is my Window created in Qt appears underneath all others on the screen and focus never goes completely onto this window. Kind of weird. Any ideas? If the application is

Re: PyQt on MAC OS X

2004-12-13 Thread Michael McGarry
whamoo wrote: Michael McGarry <[EMAIL PROTECTED]> wrote: thanks that did the trick!!! One problem is my Window created in Qt appears underneath all others on the screen and focus never goes completely onto this window. Kind of weird. Any ideas? You must use pythonw for graphics application

Re: Regular Expression

2004-12-14 Thread Michael McGarry
Binu K S wrote: You can do this without regular expressions if you like uptime='12:12:05 up 21 days, 16:31, 10 users, load average: 0.01, 0.02, 0.04' load = uptime[uptime.find('load average:'):] load 'load average: 0.01, 0.02, 0.04' load = load.split(':') load ['load average', ' 0.01, 0.02, 0.04

Regular Expression

2004-12-14 Thread Michael McGarry
Hi, I am horrible with Regular Expressions, can anyone recommend a book on it? Also I am trying to parse the following string to extract the number after load average. " load average: 0.04, 0.02, 0.01" how can I extract this number with RE or otherwise? Michael -- http://mail.

ANN: Python Test Environment

2004-12-15 Thread Michael Foord
Well sort of... Highly experimental - I'm interested in ways of improving this. http://www.voidspace.org.uk/atlantibots/pythonutils.html#testenv I've created a script that will build a 'test environment'. Windoze(tm) only as it uses py2exe. It scans your Python\Lib folder (configurable) and bui

Re: Regular Expression

2004-12-15 Thread Michael McGarry
Philippe C. Martin wrote: I'm struggling myself and have bought: "Mastering Regular Expressions" 2nd Edition, O'REILLY Jeffrey E. F. Friedl I covers the reg exp concepts + applications in various languages (mostly PERL but some Python also) Thank you everyone for the tips!! -- http://mail.python

Re: create lowercase strings in lists - was: (No subject)

2004-12-17 Thread Michael Spencer
Bengt Richter wrote: On Fri, 17 Dec 2004 02:06:01 GMT, Steven Bethard <[EMAIL PROTECTED]> wrote: Michael Spencer wrote: ... conv = "".join(char.lower() for char in text if char not in unwanted) Probably a good place to use str.replace, e.g. conv = text.lower() for char in u

Re: better lambda support in the future?

2004-12-17 Thread Michael DeHaan
statements.Of course, this would require multi-line lambdas to exist... --Michael > I assume that the point you were trying to make is that: > > def f(*args): > return expr > > is equivalent to > > f = lambda *args: expr > > ? > > Steve > -- &g

Re: better lambda support in the future?

2004-12-17 Thread Michael Hoffman
arguments that I pass to function A. How does that differ from this? >>> def A(x): ... if x: ... def B(): return "True" ... else: ... def B(): return "False" ... return B ... >>> A(1) >>> _() 'True' >>>

Re: socket.makefile & AF_UNIX

2004-12-10 Thread Michael Fuhr
s like readline() depends on the format of the data that the other end will send. If it's binary then you might need to use s.recv(). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression

2004-12-15 Thread Michael Fuhr
Timothy Grant <[EMAIL PROTECTED]> writes: > On Tue, 14 Dec 2004 23:16:43 -0700, Michael McGarry > <[EMAIL PROTECTED]> wrote: > > > > " load average: 0.04, 0.02, 0.01" > > > > how can I extract this number with RE or otherwise? > >

Redirecting stdin, stdout, and stderr to a window

2004-12-16 Thread Michael McGarry
Hi, How do I redirect stdin, stdout and stderr to a window? I am using Qt for GUI. Thanks, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Redirecting stdin, stdout, and stderr to a window

2004-12-16 Thread Michael Fuhr
Michael McGarry <[EMAIL PROTECTED]> writes: > How do I redirect stdin, stdout and stderr to a window? I am using Qt > for GUI. I don't know what specific mechanisms Qt provides, but the general solution is to write a class that implements I/O methods like read, readline, and

Re: create lowercase strings in lists - was: (No subject)

2004-12-16 Thread Michael Spencer
list, according to the above rules?""" ... testelement = normalize(element) ... #brute force comparison until match - depends on small reflist ... for el in reflist: ... if el.issuperset(testelement): ... return True ... return False ... >>> for element in list2: ... print element, testmember(element) ... A B C D True A B D True A E F False A (E) B True A B True E A B True >>> Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good use for lambda

2004-12-18 Thread Michael Hoffman
) def _root_func(x): return y2 + lp*(x - x2) - wallFunc(x)[0] root = findRoot(xBeg, xEnd, _root_func, tolerance=1.0e-15) I think those are much easier to follow. I find consistent punctuation spacing helps readability too... -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python

Re: Troubleshooting: re.finditer() creates object even when no match found

2004-12-18 Thread Michael Hoffman
Steven Bethard wrote: first, iterable = peek(iterable) I really like this as a general solution to a problem that bothers me occasionally. IMHO it's much better than having UndoFiles or similar things lying about for every use case. Thanks! -- Michael Hoffman -- http://mail.python.org/ma

Re: BASIC vs Python

2004-12-18 Thread Michael Hoffman
= 'Python Rules!' xlApp.ActiveWorkbook.ActiveSheet.Cells(1,2).Value = 'Python Rules 2!' xlApp.ActiveWorkbook.Close(SaveChanges=0) xlApp.Quit() del xlApp (stolen from <http://www.markcarter.me.uk/computing/python/excel.html>) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good use for lambda

2004-12-19 Thread Michael Sparks
re intended as throwaways for sending to another function or putting in a dict: def _(arg): print arg def __(arg): print arg def ___(arg): print arg def (arg): print arg someMap = { "a": _, "a": __,"a": ___,"a": } (Though personally I can&#x

Re: Is this a good use for lambda

2004-12-20 Thread Michael Hoffman
Max M wrote: Isn't it about time you became xml avare, and changed that to: That makes no sense. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

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

2004-12-20 Thread Michael Hoffman
t you want, or you would already have it. But MPI is probably not what you want if you are doing embarassingly parallelizable problems. I would look into OpenPBS <http://www.openpbs.org/>. If you want to write a Poly plugin for OpenPBS, I would be happy to accept it. ;) -- Michael Hoffman

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Michael Hoffman
reply here, You keep using that word. I do not think it means what you think it means. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Boo who? (was Re: newbie question)

2004-12-21 Thread Michael Hoffman
ever even used Prothon, although I thought the way the implementor dropped it into conversation was non-obnoxious. There could be a valuable lesson here. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Kamaelia Released

2004-12-22 Thread Michael Sparks
aving nightly CVS snapshots at some point soon. Merry Christmas, Michael. -- [EMAIL PROTECTED] British Broadcasting Corporation, Research and Development Kingswood Warren, Surrey KT20 6NP This message (and any attachments) may contain personal views which are not the views of the BBC unl

<    16   17   18   19   20   21   22   23   24   25   >