Re: SSL follow up

2006-10-26 Thread Michael Ströder
x27;s not so bad. I wouldn't recommend that. Actually I tried one time. Use a decent module instead which parses certs for you. I wrote one myself for web2ldap. Ciao, Michael. -- http://mail.python.org/mailman/listinfo/python-list

Re: Want to reduce steps of an operation with dictionaries

2006-10-26 Thread Michael Naunton
It does not look nice at all, mainly because you are asking either asking the question upside down, or not providing enough information. If a and b are of vastly different sizes, say so. Otherwise, think about your algorithm, and realize you are asking for things in b if they exist in a: > dict

Re: Cards deck problem

2006-10-26 Thread Michael Naunton
but CS is mostly about thinking about (and thus naming) things clearly. Find someone who does. -- Michael > d> Create a new class deck that represents a pack of 52 cards. Which > supports the following methods: > > _ _init_ _ (self) - Creates a deck of cards in standard

Re: looping through two list simultenously

2006-10-29 Thread Michael S
What if you do it in 2 separate threads? --- CSUIDL PROGRAMMEr <[EMAIL PROTECTED]> wrote: > folks > I have two lists > > i am trying to loop thorough them simultenously. > > Here is the code i am using > > f1 = os.popen('ls chatlog*.out') > data1=f1.readlines() > f1.close() > > data1=[x.str

Re: best way to check if a file exists?

2006-10-31 Thread Michael S
se, but still) try to open it for reading and python will throw an IOException which you can catch and handle. Michael --- John Salerno <[EMAIL PROTECTED]> wrote: > What is the best way to check if a file already > exists in the current > directory? I saw os.path.isfile(), but

report progress from C function

2006-10-31 Thread Michael S
g the progress. However I am not sure how to call it. Once I call the C function that does the work (it's a while loop that takes minutes sometimes) I can't call that progress function. Any ideas? Thanks in advance, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: report progress from C function

2006-10-31 Thread Michael S
> BTW, why did you rewrite in C rarher than using > Pyrex? I was not aware of pyrex. I didn't really mind doing some C, it made me remember the syntax. Thanks a lot. I did think that I could pack a function address as a parameter. --- John Machin <[EMAIL PROTECTED]> wrote:

Re: report progress from C function

2006-11-01 Thread Michael S
I downloaded Pyrex and ran it through their own example. The code looks quite messy, and I even saw a few "goto"s. I think I will stick with my own code for now. Thanks in any case. --- John Machin <[EMAIL PROTECTED]> wrote: > Michael S wrote: > > Good day all. >

Re: report progress from C function

2006-11-01 Thread Michael S
My assembler is very basic, so it wouldn't help, while my C is OK, well sort of. BTW. Neither have I looked at the machine code that the assembler produces. --- Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Michael S wrote: > > > I downloaded Pyrex and ran it through the

Re: report progress from C function

2006-11-01 Thread Michael S
What if it doesn't do exactly what you need to? How do you debug through that code? --- Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Michael S wrote: > > > My assembler is very basic, so it wouldn't help, > while > > my C is OK, well sort of. > > &g

Re: is mod_python borked?

2006-11-02 Thread Michael S
I used it for various projects. It's alright. The only problem I had, was that I was unable to get mod_python and pysqlite to work together. Other than that it was pretty good. --- walterbyrd <[EMAIL PROTECTED]> wrote: > I am considering python, instead of php, for > web-application > development

Re: WebScraping

2006-11-04 Thread Michael Torrie
ays speedy, but it sure is the most flexible scraper I've ever came across. I hacked together a web forum-to-nntp gateway using Beautiful Soup. Worked very well. Michael > > And of course, GIYF ("Google Is Your Friend") http://www.google.com which > leads me to: > >

Re: python-ldap/win32 or python/ldap/win32

2006-11-06 Thread Michael Ströder
rcmn wrote: > i'm running around in circle trying to to use python/ldap/ on > win32(WinXP). Maybe this message sent to the python-ldap-dev mailing list helps. You're welcome to follow up on this list. Ciao, Michael. Original Message Subject: Experimental 2.2

Re: Using Python from Cocoa App via PyObjc - numbers dont match...

2006-11-08 Thread Michael Ash
ng point numbers are inherently imprecise. Read through this essential resource: http://docs.sun.com/source/806-3568/ncg_goldberg.html -- Michael Ash Rogue Amoeba Software -- http://mail.python.org/mailman/listinfo/python-list

Py3K idea: why not drop the colon?

2006-11-09 Thread Michael Hobbs
Can anyone find a flaw with this change in syntax? Instead of dividing a compound statement with a colon, why not divide it on a newline? For example, the colon could be dropped from this statement: if self.hungry: self.eat() to if self.hungry self.eat() Python is already

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Michael Hobbs
Paul Boddie wrote: > Michael Hobbs wrote: > >> I think the colon could be omitted from every type of compound >> statement: 'if', 'for', 'def', 'class', whatever. Am I missing anything? >> > > The FAQ answer. ;-) > &g

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Michael Hobbs
Ben Finney wrote: > Please don't hide your new thread as a reply to an existing, unrelated > message. Start a new message if your message isn't actually a reply. > > My apologies. My email client was apparently hiding some important headers from me. >> The colon that divides the statement ther

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Michael Hobbs
Steve Holden wrote: > Michael Hobbs wrote: > >> Ben Finney wrote: >> > [...] > >>> A use case. What problem is being solved by introducing this >>> inconsistency? >>> >>> >> The same problem that is solved by

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Michael Hobbs
Ron Adam wrote: > The faq also pointed out a technical reason for requiring the colon. It > makes > the underlying parser much easier to write and maintain. This shouldn't be > taken to lightly in my opinion, because a simpler easer to maintain and more > reliable python parser means developm

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Michael Hobbs
Ron Adam wrote: > It is also an outline form that frequently used in written languages. > Something > python tries to do, is to be readable as if it were written in plain language > where it is practical to do so. So the colon/outline form makes a certain > sense > in that case as well. >

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Steven D'Aprano wrote: > On Fri, 10 Nov 2006 15:18:55 -0600, Michael Hobbs wrote: > > >> Ron Adam wrote: >> >>> It is also an outline form that frequently used in written languages. >>> Something >>> python tries to do, is to be

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Antoon Pardon wrote: > On 2006-11-11, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> On Fri, 10 Nov 2006 13:16:32 -0600, Michael Hobbs wrote: >> >> >>> Yeah, okay, I didn't read through the details of the PEP. I picked a bad >>>

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Georg Brandl wrote: > Ron Adam wrote: > >> Michael Hobbs wrote: >> >> >>> The same problem that is solved by not having to type parens around the >>> 'if' conditional, a la C and its derivatives. That is, it's unnecessary >&g

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Ron Adam wrote: > [EMAIL PROTECTED] wrote: > >> > I'm not sure why '\'s are required to do multi-line before the >> colon. >> Special cases aren't special enough to break the rules. >> >> Georg >> >>> A bit of a circular answer. >> >>> >> >>> Why

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Carsten Haese wrote: > On Sat, 2006-11-11 at 23:18 -0800, Doug wrote: > >> Michael Hobbs wrote: >> >>> I think the colon could be omitted from every type of compound >>> statement: 'if', 'for', 'def', 'class', wha

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Ron Adam wrote: > LOL, of course it would. I would expect that too after a suitable amount of > 'brain washing', oops, I mean training and conditioning. ;-) > Trust me, my brain is quite filthy and doesn't wash easily. I do appreciate aesthetics, which is why still stay with Python, even aft

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Ron Adam wrote: > Michael Hobbs wrote: > >> Ron Adam wrote: >> >>> LOL, of course it would. I would expect that too after a suitable amount >>> of >>> 'brain washing', oops, I mean training and conditioning. ;-) >>> &

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Robert Kern wrote: > Michael Hobbs wrote: > >> In the end, I have to admit that I really couldn't give a flying frog if >> the colon is there or not. It's just a colon, after all. I *was* hoping >> that I could convince someone to honestly think about i

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Robert Kern wrote: > Michael Hobbs wrote: > >> True enough. Although, I have to ask how many times you define a new >> function only to have Python spit a syntax error out at you saying that >> you forgot a colon. It happens to me all the time. (Usually after an &

Re: Python v PHP: fair comparison?

2006-11-14 Thread Michael Torrie
we're rewriting them in python. Although I can't think of a single app written in php that's not web- based (other than standalone scripts I have written), there are up-to- date php bindings for GTK: http://gtk.php.net/ Michael > On the other hand, Python is a general purpose

python-ldap and Python 2.5 (was: Python 2.5 Core Dump on Solaris 8)

2006-11-15 Thread Michael Ströder
ith some patches: http://sourceforge.net/mailarchive/forum.php?thread_id=30574782&forum_id=4346 During the next days I hope to commit some of the changes I've made since then. Contributions welcome. Ciao, Michael. -- http://mail.python.org/mailman/listinfo/python-list

Re: python-ldap and Python 2.5

2006-11-16 Thread Michael Ströder
Michael Ströder wrote: > > But this seems to help (tested on my local system): > http://sourceforge.net/tracker/index.php?func=detail&aid=1575329&group_id=2072&atid=102072 Released python-ldap 2.2.1 yesterday which contains this fix. Ciao, Michael. -- http://mail.python

ANN: python-ldap-2.2.1

2006-11-16 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. p

Tkinter - changing existing Dialog?

2006-06-01 Thread Michael Yanowitz
nt to do is to search for it myself. Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

RE: Tkinter - changing existing Dialog?

2006-06-02 Thread Michael Yanowitz
Thanks. That is what I was looking for. The configure command (as you and John pointed out), should do what I need. The first response of starting a new thread was not what I was looking for. Michael Yanowitz -Original Message- In article <[EMAIL PROTECTED]>, Michael Ya

Python to be used to build OLPC apps

2006-06-09 Thread Michael Dillon
The $100 laptop from MIT will be providing Python for application developers to use. This laptop is a low-power consumption innovative laptop that includes features like: - low-power wi-fi with longer than normal range and the ability to keep communicating after the CPU has been put to sleep. -

Re: [newbie]apache authentication questions

2006-06-13 Thread Michael Ströder
>> http://www.peej.co.uk/articles/http-auth-with-html-forms.html >> > That's neat! IMHO this makes things more complicated and error-prone. And it requires Javascript. I also can't see why this is more secure than a proper session management (using cookies or URL for

.py and running in Windows:

2006-06-13 Thread Michael Yanowitz
when finished rather than exit the shell. How do I do that? Or would it cause a problem (so that Python no longer works) if I change the default .py extension to open in an editor rather than execute it if I open it? Thanks: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

RE: .py and running in Windows:

2006-06-13 Thread Michael Yanowitz
13, 2006 9:48 AM To: [email protected] Subject: Re: .py and running in Windows: Andrew Gwozdziewycz wrote: > You'll have better results posting this to it's own thread. > He certainly should have, but since I've read it here anyway: > On Jun 13, 2006, at 9:29 AM, M

Re: a good programming text editor (not IDE)

2006-06-15 Thread Michael Williams
If you're on a Mac, I'd recommend TextWrangler (http:// www.barebones.com/products/textwrangler/) hands down. -- http://mail.python.org/mailman/listinfo/python-list

memory-leak in pysqlite 2.3.0 ?

2006-06-19 Thread Michael Husmann
e: Python 2.4.1, Sqlite3 3.3.6, Pysqlite 2.3.0 Regards, Michael -- http://mail.python.org/mailman/listinfo/python-list

SWIG problems with gcc and Cygwin?

2006-06-20 Thread Michael Yanowitz
d? Of course when I then try to go into python and import example, I get: >>> import example Traceback (most recent call last): File "", line 1, in ? File "example.py", line 5, in ? import _example ImportError: No module named _example Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

Re: Running code on assignment/binding

2006-06-20 Thread Michael Spencer
tty_dict that wraps the __dict__ of a loaded module) 3. Limit yourself to attribute assignment, which can be overridden: >>> SomeInstance.a = Test Then you can use __setattr__ or a data descriptor to customize the assignment HTH Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting external name of passed variable

2006-06-20 Thread Michael Spencer
; Can't you use keyword arguments? >>> def test(**kw): ... print kw ... >>> test(val=3) {'val': 3} >>> test(val=3, otherval = 4) {'otherval': 4, 'val': 3} >>> Michael -- http://mail.python.org/mailman/listinfo/python-list

pypy-0.9.0: stackless, new extension compiler

2006-06-25 Thread Michael Hudson
t from numerous people. Please feel free to give feedback and raise questions. contact points: http://codespeak.net/pypy/dist/pypy/doc/contact.html have fun, the pypy team, (Armin Rigo, Samuele Pedroni, Holger Krekel, Christian Tismer, Carl Friedrich Bolz, Michael Hudson,

queue deadlock possibility

2006-06-25 Thread Michael Bayer
Hi - i was just going through this thread: http://mail.python.org/ pipermail/python-list/2006-April/336948.html , where it is suggested that the Lock instance used by Queue.Queue should be publically configurable. I have identified another situation where a Queue can be deadlocked, one whi

RE: SWIG problems with gcc and Cygwin?

2006-06-26 Thread Michael Yanowitz
++ compiler I have presently is Cygwin gcc. Thanks in advance: Michael Yanowitz -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Michael Yanowitz Sent: Tuesday, June 20, 2006 3:39 PM To: [email protected] Subject: SWIG problems with gcc and Cygwin? Hello

Re: Beginner Programmer Question

2006-06-26 Thread Michael Goettsche
[EMAIL PROTECTED] wrote: > I am doing alot of reading and trying to teach myself how to program. > I can not figure out how to make "Write a program that continually > reads in numbers from the user and adds them together until the sum > reaches 100." this work. If someone could show me the correct

RE: SWIG problems with gcc and Cygwin?

2006-06-27 Thread Michael Yanowitz
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Steve Holden Sent: Tuesday, June 27, 2006 2:55 AM To: [email protected] Subject: Re: SWIG problems with gcc and Cygwin? Michael Yanowitz wrote: > No response yet. The SWIG test works fine in Linux

RE: SWIG problems with gcc and Cygwin?

2006-06-27 Thread Michael Yanowitz
Thanks. It now works for me in Cygwin. I would never have guessed to write it as a dll. Michael Yanowitz -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Norman Vine Sent: Tuesday, June 27, 2006 4:21 PM To: [email protected] Subject: Re: SWIG

Re: Modelica

2006-06-28 Thread michael . tiller
Srijit Kumar Bhadra wrote: > I am looking for possible options to interface Modelica > (http://www.modelica.org/) with Python (scipy and numpy). Any > suggestions? When you say "interface", what do you mean? Do you want to be able to process Modelica models or do you simply want to be able to com

Module executed twice when imported!

2006-06-28 Thread Michael Abbott
It seems to be an invariant of Python (insofar as Python has invariants) that a module is executed at most once in a Python session. I have a rather bizzare example that breaks this invariant: can anyone enlighten me as to what is going on? --- test.py --- import imptest execfile('subtest.py',

Interprocess communication on multi-user machine

2006-06-29 Thread Michael Butscher
s would be uncomfortable for the user. Any hints? TIA Michael -- Homepage:http://www.mbutscher.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Import bug: Module executed twice when imported!

2006-06-30 Thread Michael Abbott
Bump In article <[EMAIL PROTECTED]>, Michael Abbott <[EMAIL PROTECTED]> wrote: > --- test.py --- > import imptest > execfile('subtest.py', dict(__name__ = 'subtest.py')) > --- imptest.py --- > print 'Imptest imported' > --- su

Re: Module executed twice when imported!

2006-06-30 Thread Michael Abbott
In article <[EMAIL PROTECTED]>, John Salerno <[EMAIL PROTECTED]> wrote: > > (http://docs.python.org/lib/built-in-funcs.html#l2h-24) > > "It is different from the import statement in that it does not use the > > module administration --" > > Just after the above statement, it also says: > > "it

Re: Module executed twice when imported!

2006-06-30 Thread Michael Abbott
In article <[EMAIL PROTECTED]>, Georg Brandl <[EMAIL PROTECTED]> wrote: > That's because __name__ is normally set to the module's name in the package > hierarchy. When you set it to "some1.some2", Python thinks it's > in a subpackage A. So what I *should* have set it to is the module name *w

Re: Import bug: Module executed twice when imported!

2006-06-30 Thread Michael Abbott
In article <[EMAIL PROTECTED]>, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > Set __name__ to 'subtest' as it would be if you had really imported > subtest and the import system will correctly name the modules, causing > imptest to be imported only once. Ach. I get it now. -- http://mail.py

Re: I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-02 Thread Michael Abbott
Ove Pettersen <[EMAIL PROTECTED]> wrote: > for server in "server1 server2 server3 server100"; do Two comments: 1. Leave out the quotes(!) 2. Either iterate as for server in $(seq -fserver%g 100); do or, probably better for server in $(cat server-list); do -- http://mail.python.org/

Re: what's wrong here? (search script)

2006-07-07 Thread Michael Fisher
Brendan Fay wrote: > I figured it out. Is there any way to delete your own posts? > > Brendan Fay wrote: >> Dear Someone: >> >> I have written a script that accesses the googleAPI through >> pygoogle and saves each of the ten documents as a .txt file by using a >> specific function for each

RE: Detecting 64bit vs. 32bit Linux

2006-07-10 Thread Michael Yanowitz
The one thing I observed (just an observation) is that: a) on 32-bit machines: sizeof(int) = 32 sizeof(long) = 32 b) on 64-bit machines: sizeof(int) = 32 sizeof(long) = 64 This in C and Python. Thanks in advance: Michael Yanowitz -Original Message- From: [EMAIL

dictionaries - returning a key from a value

2006-09-01 Thread Michael Malinowski
Appologies if this is a somewhat simple question, but currently I can return a value from a dictionary using its key by doing :    dDictionary.get( key )   However, I am curious to know if its possible to get the key from giving a value (basically the opposite of what I did above, inste

Re: working with ldap files

2006-09-04 Thread Michael Ströder
ing is more complex than simply using string.split(). If you are sure that all the attribute values used in your DNs don't have any special chars you could use string.split(). But you should definitely cross-check with RFC 4514 or use a decent DN parser. Ciao, Michael. -- http://mail.python.org/mailman/listinfo/python-list

Re: replace deepest level of nested list

2006-09-05 Thread Michael Spencer
[[r00, r01], [r10, r11]]) >>> _.tolist() [['r00', 'r01'], ['r10', 'r11']] >>> pyarray (single pure-python module) can be downloaded from: http://svn.brownspencer.com/pyarray/trunk/ Regards Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Refactor a buffered class...

2006-09-06 Thread Michael Spencer
index(sentry)+1] ... yield buffer ... >>> s = "this . is a . test to . check if it . works . well . it looks. like ." >>> for p in chunker(s.split()): print " ".join(p) ... this . this . is a . this . is a . test to . is a . test to . check if it . test to . check if it . works . check if it . works . well . works . well . it looks. like . >>> HTH Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Refactor a buffered class...

2006-09-06 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > actually for the example i have used only one sentry condition by they > are more numerous and complex, also i need to work on a huge amount on > data (each word are a line with many features readed from a file) An open (text) file is a line-based iterator that can be fed

Re: Refactor a buffered class...

2006-09-06 Thread Michael Spencer
George Sakkis wrote: > Michael Spencer wrote: > >> Here's a small update to the generator that allows optional handling of the >> head >> and the tail: >> >> def chunker(s, chunk_size=3, sentry=".", keep_first = False, keep_last = >>

Re: Refactor a buffered class...

2006-09-07 Thread Michael Spencer
George Sakkis wrote: > Michael Spencer wrote: >> George Sakkis wrote: >>> Michael Spencer wrote: >>> >>>> def chunker(s, chunk_size=3, sentry=".", keep_first = False, keep_last = >>>> False): >>>> buffer=[] >

Invitation: Kamaelia Open Space, Brussels, Sept 22 2006

2006-09-14 Thread Michael Sparks
e kamaelia mailing list: [EMAIL PROTECTED] If you know someone who you think is interested in the theme, could benefit from coming - for example someone interested in making practical concurrency safer and easier to use in future - please don't hesitate to forward this invitation to them. H

Re: How to build extensions on Windows?

2006-09-14 Thread michael . hatmaker
Kevin D. Smith wrote: > I've written a simple Python extension for UNIX, but I need to get it > working on Windows now. I'm having some difficulties figuring out how > to do this. I've seen web pages that say that MS Visual Studio is > required, and other that say that's not true, that MinGW wil

Re: How to build extensions on Windows?

2006-09-15 Thread michael . hatmaker
[EMAIL PROTECTED] wrote: > Kevin D. Smith wrote: > > I've written a simple Python extension for UNIX, but I need to get it > > working on Windows now. I'm having some difficulties figuring out how > > to do this. I've seen web pages that say that MS Visual Studio is > > required, and other that

Re: Pythondocs.info : collaborative Python documentation project

2006-09-18 Thread Michael Ströder
with content? If you have improvements to the official docs put them into Python's SF tracker: http://sourceforge.net/tracker/?func=add&group_id=5470&atid=305470 Ciao, Michael. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help me use my Dual Core CPU!

2006-09-18 Thread Michael Sparks
if new approaches are better, we'd welcome implementations since not all problems are screws and not all tools are hammers :-) (as a result I'd also welcome people saying what sucks and why, but preferably based on the system as it is today, not as it was :) Have fun :) Michael. -- http://mail.python.org/mailman/listinfo/python-list

Problems wth os.stat().st_mtime on Mac

2006-09-29 Thread Michael Glassford
The Python 2.5 News at http://www.python.org/download/releases/2.5/NEWS.txt states that Python 2.5 was changed to "Use Win32 API to implement os.stat/fstat. As a result, subsecond timestamps are reported, the limit on path name lengths is removed, and stat reports WindowsError now (instead of O

Re: Problems wth os.stat().st_mtime on Mac

2006-10-02 Thread Michael Glassford
Martin v. Löwis wrote: > Michael Glassford schrieb: >> Although not mentioned in the Python 2.5 News, apparently there was a >> similar change on Mac that I'm having some problems with. On the Mac, >> just as on Windows, os.stat().st_mtime now returns a float instead o

String Replace only if whole word?

2006-11-17 Thread Michael Yanowitz
hing which determines when a word ends, and I will define a word as containing only 'A'-'Z','a'-'z','0'-'9','_' . As long as the string contains more of the word digits after the match, don't replace? Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

RE: String Replace only if whole word?

2006-11-17 Thread Michael Yanowitz
>Michael Yanowitz wrote: >> Hello: >> >> I am hoping someone knows if there is an easier way to do this or someone >> already implemented something that does this, rather than reinventing the >> wheel: >> I have been using the string.replace(from_string

Re: Python v PHP for web, and restarting Apache?

2006-11-17 Thread Michael Ströder
e restarting more easily than Python. As usual it depends. Ciao, Michael. -- http://mail.python.org/mailman/listinfo/python-list

Re: Slicing / subsetting list in arbitrary fashion

2006-11-17 Thread Michael Spencer
tions are implemented (for list and array.array types) in pure python in my pyarray module: http://svn.brownspencer.com/pyarray/trunk/ Michael -- http://mail.python.org/mailman/listinfo/python-list

syntax error in sum(). Please explicate.

2006-11-18 Thread Michael Press
n -v: Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin Type "help", "copyright", "credits" or "license" for more information -- Michael Press -- http://mail.python.org/mailman/listinfo/python-list

Re: syntax error in sum(). Please explicate.

2006-11-18 Thread Michael Press
In article <[EMAIL PROTECTED]> , "Matt Moriarity" <[EMAIL PROTECTED]> wrote: > try surrounding your sum argument in brackets: > > sum([phi(x // ps[i+1], i) for i in range(a)]) > > instead of: > > sum(phi(x // ps[i+1], i) for i in range(a)) Thank

Re: ldapsearch example in python-ldap?

2006-11-23 Thread Michael Ströder
n,DC=com","secret") r = l.search_s( "CN=ANYCOMPUTER,CN=Computers,DC=mydomain,DC=com", ldap.SCOPE_SUBTREE, # this is the default of ldapsearch "(objectClass=*)" ) But you really should learn more about it by diving into: http://python-ldap.sourceforge.net/doc/python-ldap/ldap-objects.html Ciao, Michael. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are slice indices the way they are in python?

2006-11-30 Thread Michael Torrie
lier than "2007-01-01 00:00:00"? Hence they are two different dates are they not? Michael -- http://mail.python.org/mailman/listinfo/python-list

How to read the directory which the actively running python file is located in?

2006-12-01 Thread Michael Malinowski
Is there a way to read the directory that the currently running python file is located in? Cheers Mike. -- http://mail.python.org/mailman/listinfo/python-list

RE: How to read the directory which the actively running python file islocated in?

2006-12-01 Thread Michael Malinowski
Nevermind, I got it using the sys.argv[0] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Malinowski Sent: Friday, December 01, 2006 9:07 AM To: [email protected] Subject: How to read the directory which the actively running python file

Re: PythonWin And Excel Problem

2006-12-01 Thread Michael S
, 1.0). In your loop try to call random.randit() and call the random.seed() beforehand. HTH, Michael --- Andrea Gavana <[EMAIL PROTECTED]> wrote: > Hi All, > > I am having some problems in running a very > simple python script, > which prints some numbers in an Excel sprea

Re: PythonWin And Excel Problem

2006-12-01 Thread Michael S
Andrea, Also, could it be that when you do the following: sheet.Range("A1:A10").Value = therand you actually initialize all 10 cells to the first element of the array? Try to iterate and initialize every cell separately. Michael --- Andrea Gavana <[EMAIL PROTECTED]> wrote: >

Re: Inheritance doesn't work

2006-12-04 Thread Michael S
How about calling base class __init__ and then the pass statement? --- zefciu <[EMAIL PROTECTED]> wrote: > I have a problem with inheritance under python. The > class definition is > longer, but the troublesome thing is: > > from PIL import Image > class MandelbrotImage (Image): > pass

Best way to split up lines - RE: About the 79 character line recommendation

2006-12-07 Thread Michael Yanowitz
, strMessage) Thanks in advance: Michael Yanowitz -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ramon Diaz-Uriarte Sent: Wednesday, December 06, 2006 5:12 PM To: Steve Bergman Cc: [email protected] Subject: Re: About the 79 character line recommendation

Re: merits of Lisp vs Python

2006-12-11 Thread Michael Livshin
Paul Rubin writes: > Nobody seems to concerned that Haskell lacks macros. What's up with > that? Haskell is lazy, so it doesn't need macros (well, it would be more accurate to say that by not evaluating function arguments until they are needed it makes many of the usua

Re: py-ldap question

2006-12-12 Thread Michael Ströder
rce distribution: http://python-ldap.cvs.sourceforge.net/*checkout*/python-ldap/python-ldap/Demo/initialize.py?content-type=text%2Fplain Ciao, Michael. -- http://mail.python.org/mailman/listinfo/python-list

Re: Defining classes

2006-12-13 Thread Michael Spencer
cls): return cls.__name__ ... >>> class Brinjal(object): # must be new-style ... def __get__(self, obj, cls): return brinjal(cls) ... >>> class Weeble(object): # should be new-style ... wumpus = Brinjal() ... >>> Weeble.wumpus

Re: Iterating over several lists at once

2006-12-13 Thread Michael Spencer
oduct("01","01","01")) [('0', '0', '0'), ('0', '0', '1'), ('0', '1', '0'), ('0', '1', '1'), ('1', '0', '0'), ('1', '0', '1'), ('1', '1', '0'), ('1', '1', '1')] >>> Michael -- http://mail.python.org/mailman/listinfo/python-list

Can a Tkinter GUI check for abort script:

2006-12-18 Thread Michael Yanowitz
| | [Abort Script] | +-+ So, every tenth of a seconds or ??? better time, I would like to 'return' to the GUI and check if the "Abort Script" button has been pressed. How do I do this? Or is there a better way to implement this? Thanks

RE: Can a Tkinter GUI check for abort script:

2006-12-18 Thread Michael Yanowitz
check if the "Abort Script" button is pressed. Presently what happens is that the script takes over and all the buttons on the GUI disappear as the GUI is not given any cpu time to refresh or check if any activity in the dialog. Thanks in advance: Michael Yanowitz -Origin

RE: Can a Tkinter GUI check for abort script:

2006-12-19 Thread Michael Yanowitz
make, without knowing any of the GUI objects, I can call from test3.py (or while test3.py is running) which will refresh the GUI and check for activity such as button presses on the GUI itself. For example, if I just call sleep(), will it do this? Thanks in advance: Michael Yanowitz

Re: python poetry?

2006-12-19 Thread Michael Spencer
t;.join("DA-DA-DUM" for dummy in [None] for foot in repeat("metric", feet)) Michael -- http://mail.python.org/mailman/listinfo/python-list

RE: Can a Tkinter GUI check for abort script:

2006-12-19 Thread Michael Yanowitz
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of hg Sent: Tuesday, December 19, 2006 9:44 AM To: [email protected] Subject: Re: Can a Tkinter GUI check for abort script: Michael Yanowitz wrote: > Hello: > >I have successfully impl

Re: code optimization (calc PI) / Full Code of PI calc in Python and C.

2007-01-03 Thread Michael M.
Ok, here is the code. It is a translation of the following code, found on the internet. * The C is very fast, Python not. * Target: Do optimization, that Python runs nearly like C. Auf 800 Stellen in 160 Zeichen... -- int a=1,b,c=2800,d,e,f[2801],g;main(){for(;b-c;)f[b++]=a/5; for

Re: code optimization (calc PI) / New Algorithme for PI

2007-01-04 Thread Michael M.
Mainly, it was fload-div. Changed to int-div (python //) runs faster. Yes, this "gmpy" sounds good for calc things like that. But not available on my machine. ImportError: No module named gmpy Anyway, thanks for posting. This gmpy module can be very intersting. But right now, the focus was, if i

Re: code optimization (calc PI) / New Algorithme for PI

2007-01-04 Thread Michael M.
[EMAIL PROTECTED] wrote: >>Yes, this "gmpy" sounds good for calc things like that. >>But not available on my machine. >>ImportError: No module named gmpy > > > What type of machine? Windoof with Cygwin. > > The home page for gmpy is http://sourceforge.net/projects/gmpy/ > > I have Windows ve

<    27   28   29   30   31   32   33   34   35   36   >