Re: user-supplied locals dict for function execution?

2006-03-20 Thread bruno at modulix
Lonnie Princehouse wrote: > Can anyone think of a way to substitute a user-supplied dictionary as > the local dict for a function call? > > e.g. > > def f(): >x = 5 > > d = {} > > exec_function_in_dictionary( f, d ) # ??? > > print d["x"] # 5 > def f(**kw): kw['x'] = 5 d = {} f

how to make script interact with another script

2006-03-20 Thread Chason Hayes
How can I get a script to pipe data to another program, wait for a response, then send more data etc. For example, from a script, I want to run smbclient then send it the username, password, and then some commands. (I know there are better ways to achieve this functionality, it is the principle th

Re: Python equivalent of Perl-ISAPI?

2006-03-20 Thread rurpy
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Pure cgi is too slow. "Active Scripting" means ASP, yes? > > I need something that will do cgi scripts (a lot of which I already > > have > > and can modify but don't want to rewrite extensively, partly because > > of time issues, partly because

Re: whats your favourite object relational mapper?

2006-03-20 Thread Jonathan Ellis
Steve Holden wrote: > I think describing this as Ian saying the code in its current form "is a > dead end" is to read rather more into the words than is actually there. Well, that may be. However, given that the 0.x code is so crufty that the v2 "refactor" is a multi-day (-week, now) process that

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-20 Thread Mark Carter
I'd like to propose a coding challenge of my own. The challenge is to reproduce the TEA (Tiny Encryption Algorith): http://www.simonshepherd.supanet.com/tea.htm in your language of choice. Here's the code, just two simple functions: void encipher(unsigned long *const v,unsigned long *const w,

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-20 Thread Mark Tarver
Interesting. But you probably need to post this as a new message, since it is a distinctly different problem from the one driving this thread. Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: user-supplied locals dict for function execution?

2006-03-20 Thread Lonnie Princehouse
> What's your use case exactly ? I'm trying to use a function to implicitly update a dictionary. The whole point is to avoid the normal dictionary semantics, so kw['x'] = 5 unfortunately won't do. I think bytecode hacks may be the way to go -- http://mail.python.org/mailman/listinfo/python-lis

Re: converting sqlite return values

2006-03-20 Thread bolly
Hi Gerhard, Firstly my apologies for not replying sooner and secondly thanks for the advice.I went down the route of changing the data I was entering so that it was always an integer and zap - no more problems. Thanks again, Bolly -- http://mail.python.org/mailman/listinfo/python-list

Re: IMAP Checking Folder Size

2006-03-20 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Kevin F <[EMAIL PROTECTED]> wrote: > I'm trying to use the following code to get my remote server's folder > size information. Unfortunately, i'm getting the error: > > > > Traceback (most recent call last): >File "/Life/School/Homework/Spring 2006/OPIM >

Re: user-supplied locals dict for function execution?

2006-03-20 Thread Michael Spencer
Lonnie Princehouse wrote: >> What's your use case exactly ? > > I'm trying to use a function to implicitly update a dictionary. The > whole point is to avoid the normal dictionary semantics, so kw['x'] = 5 > unfortunately won't do. > > I think bytecode hacks may be the way to go > I once messed

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-20 Thread Mark Carter
Mark Tarver wrote: > Interesting. At the risk of being labelled a troll, one thought that is occuring to me is that in Lisp it seems that sometimes it is difficult to achieve a simple thing in a simple way. To clarify ... recently, I had been trying to obtain md5 hashes of the files we had on

Re: what's the general way of separating classes?

2006-03-20 Thread bruno at modulix
John Salerno wrote: > From my brief experience with C#, I learned that it was pretty standard > practice to put each class in a separate file. I assume this is a > benefit of a compiled language that the files can then be grouped together. > > What I'm wondering is how is this normally handled in

why isn't Unicode the default encoding?

2006-03-20 Thread John Salerno
Forgive my newbieness, but I don't quite understand why Unicode is still something that needs special treatment in Python (and perhaps elsewhere). I'm reading Dive Into Python right now, and it constantly refers to a 'regular string' versus a 'Unicode string' and how you need to convert back an

Re: Linear regression in NumPy

2006-03-20 Thread Christopher Barker
Matt Crema wrote: > > "More generally: Is there any kind of documentation that tells me what > > the functions in NumPy do, and what parameters they expect, how to > > call them, etc. This is a good start too: http://www.tramy.us/guidetoscipy.html Yes, you have to pay for it, but the money go

Re: String comparison question

2006-03-20 Thread Michael Spencer
Fredrik Lundh wrote: > " hello world ".split() > ['hello', 'world'] a.split() == b.split() is a convenient test, provided you want to normalize whitespace rather than ignore it. I took the OP's requirements to mean that 'A B' == 'AB', but this is just a guess. Michael -- http://mail.

Re: what's the general way of separating classes?

2006-03-20 Thread John Salerno
bruno at modulix wrote: >> It seems like this can >> get out of hand, since modules are separate from one another and not >> compiled together. You'd end up with a lot of import statements. > > Sorry, but I don't see the correlation between compilation and import > here ? I meant that in a langu

Re: user-supplied locals dict for function execution?

2006-03-20 Thread bruno at modulix
Lonnie Princehouse wrote: >>What's your use case exactly ? > > > I'm trying to use a function to implicitly update a dictionary. I think this was pretty obvious. What I wonder is *why* you want/think you need to do such a thing -I don't mean there can't be no good reason to do so, but this has

RE: String comparison question

2006-03-20 Thread Olivier Langlois
Hi Michael, Normalizing the whitespace is what I was looking to do. I guess that that aspect of my original query was not enough clear. But with either solutions, I get the result I wanted. Greetings, Olivier Langlois http://www.quazal.com > -Original Message- > Fredrik Lundh wrote: >

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-20 Thread Geoffrey Summerhayes
"Dinko Tenev" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: >> It would seem that your program is just filtering the full cartesian >> product, right? The solution I'm looking for generates the elements >> one-by-one so that it could be used in a loop. > >

Re: how to make script interact with another script

2006-03-20 Thread bruno at modulix
Chason Hayes wrote: > How can I get a script to pipe data to another program, wait for a > response, then send more data etc. > > For example, from a script, I want to run smbclient then send it the > username, password, and then some commands. (I know there are better ways > to achieve this funct

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-20 Thread Pascal Bourguignon
Mark Carter <[EMAIL PROTECTED]> writes: > I'd like to propose a coding challenge of my own. The challenge is to > reproduce the TEA (Tiny Encryption Algorith): > http://www.simonshepherd.supanet.com/tea.htm > in your language of choice. > > Here's the code, just two simple functions: > > void enci

Re: Python 2.5 Schedule

2006-03-20 Thread Ravi Teja
Only MS can answer those questions. Even though, Python on Windows is compiled with VC++, you can still use Mingw32 to compile extensions. There are some articles floating around on how to do this and I did try it successfully in the past. Please note that I am not advocating either compiler. Just

Re: ** Operator

2006-03-20 Thread Christoph Zwerschke
Kent Johnson wrote: > The way to make this change happen is to submit a bug report with your > suggested change. See the link at the bottom of the above page to find > out how. I know, but I wanted to see at least one person assenting before doing so. Anyway, I took your words as assent and fil

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Robert Kern
John Salerno wrote: > Forgive my newbieness, but I don't quite understand why Unicode is still > something that needs special treatment in Python (and perhaps > elsewhere). I'm reading Dive Into Python right now, and it constantly > refers to a 'regular string' versus a 'Unicode string' and how

Re: why isn't Unicode the default encoding?

2006-03-20 Thread John Salerno
Robert Kern wrote: > Well, *I* use UTF-8, but that's neither here nor there. I see UTF-8 a lot, but this particular book also mentions that UTF-16 is the most common. Is that true? >> Why can't Unicode replace them so we no longer need the 'u' >> prefix or the encoding tricks? > > It would br

[ANN] lxml 0.9 is out!

2006-03-20 Thread Stefan Behnel
Hello everyone, after almost five months of hacking, lxml 0.9 has finally seen the light of night. :) http://codespeak.net/lxml/ http://cheeseshop.python.org/pypi/lxml/0.9 """ lxml is a Pythonic binding for the libxml2 and libxslt libraries. It provides safe and convenient access to these librar

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Jan Niklas Fingerle
John Salerno <[EMAIL PROTECTED]> wrote: > to convert back and forth. But why isn't Unicode considered a regular > string by now? Is it for historical reasons that we still use ASCII and > Latin-1? The point is, that, with a regular string, you don't know its encoding or whether it has an encodi

Re: New-style Python icons

2006-03-20 Thread GISDude
very sharp! i like 'em! -- http://mail.python.org/mailman/listinfo/python-list

Re: Win32 ActiveX with COM support

2006-03-20 Thread M�ta-MCI
Hi! >>>Can I create a COM server / client component set with Python? Yes. Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Robert Kern
John Salerno wrote: > Robert Kern wrote: > >>Well, *I* use UTF-8, but that's neither here nor there. > > I see UTF-8 a lot, but this particular book also mentions that UTF-16 is > the most common. Is that true? I think it unlikely, but I have no numbers to give. And I'll bet that that book does

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-20 Thread joswig
> I had a crack at it in Lisp. My version doesn't work - but of greater > concern to me is that it doesn't appear nearly as compact as the C > version. Anyway, here's my Lisp code (no prizes for guessing that I'm a > noob to Lisp): Lot's of things you can write more compact. But compact is not alw

Re: user-supplied locals dict for function execution?

2006-03-20 Thread Steve Holden
bruno at modulix wrote: > Lonnie Princehouse wrote: > >>>What's your use case exactly ? >> >> >>I'm trying to use a function to implicitly update a dictionary. > > > I think this was pretty obvious. What I wonder is *why* you want/think > you need to do such a thing -I don't mean there can't be

Re: can't rebind magic methods

2006-03-20 Thread Michael Tobis
Thanks! Only a minor correction: the last line should be _setdelegate(myint, int,'__%s__' % spec) The business with f.func_name struck me as unnecessary, but I was quite wrong. This was an interesting exercise for me. Thanks. Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Jan Niklas Fingerle
Robert Kern <[EMAIL PROTECTED]> wrote: > > I see UTF-8 a lot, but this particular book also mentions that UTF-16 is > > the most common. Is that true? > > I think it unlikely, but I have no numbers to give. And I'll bet that that > book > doesn't either. I haven't got any numbers, but my guess

Re: ** Operator

2006-03-20 Thread Ron Adam
Christoph Zwerschke wrote: > Alex Martelli wrote: >> Sathyaish wrote: >> >>> I tried it on the interpreter and it looks like it is the "to the power >>> of" operator symbol/function. Can you please point me to the formal >>> definition of this operator in the docs? >> >> http://docs.python.org/ref/

Re: user-supplied locals dict for function execution?

2006-03-20 Thread Lonnie Princehouse
Occaisionally, the first two lines of The Zen of Python conflict with one another. An API I'm working on involves a custom namespace implementation using dictionaries, and I want a pretty syntax for initializing the custom namespaces. The fact that these namespaces are implemented as dictionaries

Function params with **? what do these mean?

2006-03-20 Thread J Rice
I'm sorry for such a basic question, but I haven't been able to phrase a search that gets me an answer and my books are totally silent on this. I have seen a number of python function defs that take parameters of the form (**param1). Looks like a pointer... but my books on python (basic as they a

Re: Win32 ActiveX with COM support

2006-03-20 Thread danbrwn
How would the controls run within a web browser. Would the python interpreter automatically run after loaded into a browser? Also, the python controls would be text files? -- http://mail.python.org/mailman/listinfo/python-list

Re: user-supplied locals dict for function execution?

2006-03-20 Thread Lonnie Princehouse
Very clever! This looks like exactly what I wanted. Thanks =) -- http://mail.python.org/mailman/listinfo/python-list

Re: Win32 ActiveX with COM support

2006-03-20 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I am creating a web application where I access a database on a SQL > server machine from local networked PC's via Javascript and HTML. > Unfortunately, Microsoft does not allow the ado intervace to fire > events back using Javascript or VBScript. I am trying to figure out

Re: why isn't Unicode the default encoding?

2006-03-20 Thread John Salerno
Robert Kern wrote: >> I figured this might have something to do with it, but then again I >> thought that Unicode was created as a subset of ASCII and Latin-1 so >> that they would be compatible...but I guess it's never that easy. :) > > No, it isn't. You seem to be somewhat confused about Unic

Re: Function params with **? what do these mean?

2006-03-20 Thread Dave Hansen
On 20 Mar 2006 12:46:43 -0800 in comp.lang.python, "J Rice" <[EMAIL PROTECTED]> wrote: >I'm sorry for such a basic question, but I haven't been able to phrase >a search that gets me an answer and my books are totally silent on >this. I have seen a number of python function defs that take >paramet

Re: Function params with **? what do these mean?

2006-03-20 Thread Jordan Greenberg
in the parameter list, **param gets a dict of arguments that dont correspond to somthing in the formal parameter list. More & examples in the python docs: http://docs.python.org/tut/node6.html#SECTION00672 -- Jordan T. Greenberg -- http://mail.python.org/mailman/listinfo/python

ANN: pywinauto 0.3.0 released - now localization proof

2006-03-20 Thread mark . m . mcmahon
ANN: pywinauto 0.3.0 released - now localization proof Hi, The 0.3.0 release of pywinauto is now available. pywinauto is a set of open-source (LGPL) modules for using Python as a GUI automation 'driver' for Windows NT based Operating Systems (NT/W2K/XP). SourceForge project page: http://sourcef

Re: epydoc: links to other methods/classes with reStructuredText

2006-03-20 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Max Kubierschky wrote: > I try to use epydoc with reStructuredText. > It works fine, my only problem is that I couldn't figure out > the syntax for links to other methods or classes. Any hints? IIRC it's `OtherClass`, `module.OtherClass`, `other_method` and so on. Ciao,

Re: Function params with **? what do these mean?

2006-03-20 Thread Larry Bates
J Rice wrote: > I'm sorry for such a basic question, but I haven't been able to phrase > a search that gets me an answer and my books are totally silent on > this. I have seen a number of python function defs that take > parameters of the form (**param1). Looks like a pointer... but my > books on

Re: what's the general way of separating classes?

2006-03-20 Thread I V
John Salerno wrote: > How does the __init__ file help if you are still individually importing > class1 and class2 in each other module of your program? Felipe's example is a little confusing because he uses the same name for the module and the class. Here's another example: --- package/class1.py

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-20 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > (defun >> (val num-bytes) > "Right-shift positive integer val by num-bytes" > (floor (/ val (expt 2 num-bytes or just (floor val (expt 2 num-bytes)) 'as -- http://mail.python.org/mailman/listinfo/python-list

Re: A Frame-space syntax ? - Re: global, globals(), _global ?

2006-03-20 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, robert wrote: > Marc 'BlackJack' Rintsch wrote: >> In <[EMAIL PROTECTED]>, robert wrote: >> >>>The fact is: >>>* Python has that big problem with unnecessary barriers for nested frame >>>access - especially painfull with callback functions where you want to >>>put back d

Re: Function params with **? what do these mean?

2006-03-20 Thread J Rice
Wow, this is incredibly useful! I can understand why an introductory book wouldn't make use of them, but I am really glad to know about them. I can think of a bunch of ways to simply some code I have using this. -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-20 Thread Christophe Rhodes
[ note followups ] Mark Carter <[EMAIL PROTECTED]> writes: > I'd like to propose a coding challenge of my own. The challenge is to > reproduce the TEA (Tiny Encryption Algorith): > http://www.simonshepherd.supanet.com/tea.htm > in your language of choice. Here's mine, in Common Lisp. (defmacro

Re: why isn't Unicode the default encoding?

2006-03-20 Thread John Salerno
Robert Kern wrote: > http://www.joelonsoftware.com/articles/Unicode.html That was fascinating. Thank you. So as it turns out, Unicode and UTF-8 are not the same thing? Am I right to say that UTF-8 stores the first 128 Unicode code points in a single byte, and then stores higher code points i

Re: what's the general way of separating classes?

2006-03-20 Thread John Salerno
I V wrote: > Now, in your code you can do: > > import package > > c = package.C1() > > If you hadn't included the lines in __init__.py, you would have to > write: > > import package > > c = package.class1.C1() > Ah, this makes sense! Thanks! :) -- http://mail.python.org/mailman/listinfo/py

Re: System Information

2006-03-20 Thread [EMAIL PROTECTED]
Good news! I asked a buddy that runs osx, and he whipped up a script for you :) I understand it's not python, but it gets you close, you should be able to use popen or subprocess.call to complete this. function is_charger_plugged_in() { sleep 3; BATTINFO=`ioreg -l -w 0 | grep IO

Re: New-style Python icons

2006-03-20 Thread and-google
Scott David Daniels wrote: > Maybe you could change the ink color to better distinguish > the pycon and pyc icons. Yeah, might do that... I'm thinking I might flip the pycon icon so that the Windows shortcut badge doesn't obscure the Python logo, too. Maybe. I'll let them stew on my desktop for

Re: how to make script interact with another script

2006-03-20 Thread M�ta-MCI
Hi! Few ways : - use TCP/IP server+client (this can also run via a LAN or Internet) - use mmap (this can run Python<=>Python, Python<=>Ruby, etc.) - use a file (and win persistance) - use telepathy (Oups! Sorry, the module is not published yet) - etc. MCI -- http://mail.python.org/m

Re: Win32 ActiveX with COM support

2006-03-20 Thread M�ta-MCI
Re! Make your COM server with PyWin32 (e.g. named PCOM) In your HTML, with JScript, you can : open : try{ var pserv = new ActiveXObject("PCOM");} catch(error){alert('Ne trouve pas PCOM');} call : var vret = pserv.youfunction( par1, par2) ; With PyWin32, all the remainder is a

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Martin v. Löwis
John Salerno wrote: > Robert Kern wrote: > >> http://www.joelonsoftware.com/articles/Unicode.html > > That was fascinating. Thank you. So as it turns out, Unicode and UTF-8 > are not the same thing? Am I right to say that UTF-8 stores the first > 128 Unicode code points in a single byte, and

Re: Multifile EOF error

2006-03-20 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > I had error in my script like "sudden EOF in MultiFile readline()" > Why such error occur Because there's something wrong. Sorry but you have to give a little more detail about your script and the exact error you see. Try to trim down your scri

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Martin v. Löwis
> I figured this might have something to do with it, but then again I > thought that Unicode was created as a subset of ASCII and Latin-1 so > that they would be compatible...but I guess it's never that easy. :) The real problem is that the Python string type is used to represent two very differ

Re: why isn't Unicode the default encoding?

2006-03-20 Thread John Salerno
Martin v. Löwis wrote: > John Salerno wrote: >> Robert Kern wrote: >> >>> http://www.joelonsoftware.com/articles/Unicode.html >> >> That was fascinating. Thank you. So as it turns out, Unicode and UTF-8 >> are not the same thing? Am I right to say that UTF-8 stores the first >> 128 Unicode code

Re: Win32 ActiveX with COM support

2006-03-20 Thread danbrwn
Thanks to Michel and Larry, very interesting. How about database access. Can I create a Python component that will run in my browser and be able to use the ADO (active data objects) activeX interfaces. I am right now using the ADO activex with javascript but javascript and vbscript can not subscrib

Re: why isn't Unicode the default encoding?

2006-03-20 Thread John Salerno
Martin v. Löwis wrote: > The real problem is that the Python string type is used to represent > two very different concepts: bytes, and characters. You can't just drop > the current Python string type, and use the Unicode type instead - then > you would have no good way to represent sequences of b

Re: anonymous memory mapping

2006-03-20 Thread Fabiano Sidler
2006/3/14, Fabiano Sidler <[EMAIL PROTECTED]>: > 2006/3/14, Peter Hansen <[EMAIL PROTECTED]>: > > (As for me, I have no idea what the question is about, so this is the > > most help I can give.) > > Ok, sorry! I wanted to do this: > > --- snip --- > from mmap import mmap, MAP_ANONYMOUS > mm = mmap(

Re: why isn't Unicode the default encoding?

2006-03-20 Thread and-google
John Salerno wrote: > So as it turns out, Unicode and UTF-8 are not the same thing? Well yes. UTF-8 is one scheme in which the whole Unicode character repertoire can be represented as bytes. Confusion arises because Windows uses the name 'Unicode' in character encoding lists, to mean UTF-16_LE,

Re: user-supplied locals dict for function execution?

2006-03-20 Thread Bruno Desthuilliers
Lonnie Princehouse a écrit : > Occaisionally, the first two lines of The Zen of Python conflict with > one another. """ Beautiful is better than ugly. Explicit is better than implicit. """ Err... I see no contradiction nor conflict here. > An API I'm working on involves a custom namespace implem

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Matt Goodall
John Salerno wrote: > Martin v. Löwis wrote: > >> The real problem is that the Python string type is used to represent >> two very different concepts: bytes, and characters. You can't just drop >> the current Python string type, and use the Unicode type instead - then >> you would have no good way

Re: what's the general way of separating classes?

2006-03-20 Thread Ido Yehieli
or you can write the (slightly dangerous) following: import os for file in os.listdir("/path/to/modules"): if file.endswith(".py"): exec("from "+file[:-3]+" import *") -- http://mail.python.org/mailman/listinfo/python-list

prevent memory leak in C+Python

2006-03-20 Thread Uwe Mayer
Hi, I am wrapping a C function returning large amount of binary data back to Python using SWIG. I have the data malloc()ed or new()ed on the heap and buffer objects seem a good way to wrap it in python (http://docs.python.org/api/bufferObjects.html) >From the documentation it seems PyBuffer_Fro

Re: Python equivalent of Perl-ISAPI?

2006-03-20 Thread Atanas Banov
[EMAIL PROTECTED] wrote: > Steve Holden wrote: > > [EMAIL PROTECTED] wrote: > > > > Pure cgi is too slow. "Active Scripting" means ASP, yes? > > > I need something that will do cgi scripts (a lot of which I already > > > have > > > and can modify but don't want to rewrite extensively, partly beca

win32com on Windows CE

2006-03-20 Thread solid . snake . 84
Hi, I was able to build both python and its win32 extensions on windows ce. Unfortunately, I haven't had much success with the win32com module. Does anyone have experience building the win32com module on CE or know where I can find a makefile? Thanks -- http://mail.python.org/mailman/listinfo/p

Re: user-supplied locals dict for function execution?

2006-03-20 Thread Lonnie Princehouse
> Beautiful is better than ugly. > Explicit is better than implicit. >> Err... I see no contradiction nor conflict here. What to do when explicit is ugly and implicit is beautiful? Aye, there's the rub. ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: anonymous memory mapping

2006-03-20 Thread Ben Caradoc-Davies
Fabiano Sidler wrote: > 2006/3/14, Fabiano Sidler <[EMAIL PROTECTED]>: >>Ok, sorry! I wanted to do this: >> >>--- snip --- >>from mmap import mmap, MAP_ANONYMOUS >>mm = mmap(-1, 1024, MAP_ANONYMOUS) >>--- snap --- >> >>But I got an EnvironmentError, "[Errno 22] Invalid argument" (on >>Linux2.6, btw

Re: New-style Python icons

2006-03-20 Thread dimitri pater
wow,good work!thanks,DimitriOn 20 Mar 2006 08:56:59 -0800, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:Personally, I *like* the new website look, and I'm glad to see Python having a proper logo at last!I've taken the opportunity to knock up some icons using it, finallybanishing the poor old standa

Re: Function params with **? what do these mean?

2006-03-20 Thread Aahz
In article <[EMAIL PROTECTED]>, Dave Hansen <[EMAIL PROTECTED]> wrote: >On 20 Mar 2006 12:46:43 -0800 in comp.lang.python, "J Rice" ><[EMAIL PROTECTED]> wrote: >> >>I'm sorry for such a basic question, but I haven't been able to phrase >>a search that gets me an answer and my books are totally sil

Re: can't rebind magic methods

2006-03-20 Thread Michael Tobis
Still a bit confused actually. Any explanation of the following? mt def getf(method,name): def f(self, *a, **k): return method(self.val, *a, **k) f.func_name = name return f class myint(object): def __init__(self, val): self.val = int(val) for spec in 'str repr has

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Martin v. Löwis
John Salerno wrote: > Interesting. So then the read() method, if given a numeric argument for > bytes to read, would act differently depending on if you were using > Unicode or not? The read method currently returns a byte string, not a Unicode string. It's not clear to me how the numeric argume

win32com on Windows CE

2006-03-20 Thread solid . snake . 84
Hi, I was able to build both python and its win32 extensions on windows ce. Unfortunately, I haven't had much success with the win32com module. Does anyone have experience building the win32com module on CE or know where I can find a makefile? Thanks -- http://mail.python.org/mailman/listinfo/p

Re: Function params with **? what do these mean?

2006-03-20 Thread Dave Hansen
On 20 Mar 2006 15:45:36 -0800 in comp.lang.python, [EMAIL PROTECTED] (Aahz) wrote: >In article <[EMAIL PROTECTED]>, >Dave Hansen <[EMAIL PROTECTED]> wrote: [...] >>It's harder to explain than understand. Try playing with the >>following function in the python interpreter: >> >> def test(a,b='b

Remote teamwork anecdotes (was: Where can we find top-notch python developers?)

2006-03-20 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: . . . >Unfortunately, I entirely understand _why_ most software development >firms prefer face-to-face employees: when I found myself, back when I >was a

Re: New-style Python icons

2006-03-20 Thread Michael Tobis
I think this is great work but imagine what you could do with a real logo! Besides the pleasant colors what do you like about it? I have in mind something with a coil motif but I can't execute it worth a damn. mt -- http://mail.python.org/mailman/listinfo/python-list

Spidering Hacks for Python, not Perl

2006-03-20 Thread dananrg
O'Reilly's Spidering Hacks books terrific. One problem. All the code samples are in Perl. Nothing Pythonic. Is there a book out there for Python which covers spidering / crawling in depth? -- http://mail.python.org/mailman/listinfo/python-list

Re: Function params with **? what do these mean?

2006-03-20 Thread Ben Cartwright
Dave Hansen wrote: > On 20 Mar 2006 15:45:36 -0800 in comp.lang.python, > [EMAIL PROTECTED] (Aahz) wrote: > >Personally, I think it's a Good Idea to stick with the semi-standard > >names of *args and **kwargs to make searching easier... > > Agreed (though "kwargs" kinda makes my skin crawl). Coinc

Re: Function params with **? what do these mean?

2006-03-20 Thread Dave Benjamin
On Mon, 20 Mar 2006, Ben Cartwright wrote: > Dave Hansen wrote: >> On 20 Mar 2006 15:45:36 -0800 in comp.lang.python, >> [EMAIL PROTECTED] (Aahz) wrote: >>> Personally, I think it's a Good Idea to stick with the semi-standard >>> names of *args and **kwargs to make searching easier... >> >> Agreed

Re: New-style Python icons

2006-03-20 Thread and-google
Michael Tobis wrote: > Besides the pleasant colors what do you like about it? I like that whilst being a solid and easily-recognisable, it isn't clever-clever. I had personally been idly doodling some kind of swooshy thing before, with a snake's head forming a P and its forked tongue a Y coming

Re: what's the general way of separating classes?

2006-03-20 Thread Ben Cartwright
John Salerno wrote: > bruno at modulix wrote: > > >> It seems like this can > >> get out of hand, since modules are separate from one another and not > >> compiled together. You'd end up with a lot of import statements. > > > > Sorry, but I don't see the correlation between compilation and import >

Re: Python 2.5 Schedule

2006-03-20 Thread Tim Peters
> For more details about the plan for Python 2.5, see: > > http://www.python.org/doc/peps/pep-0356/ Looks like links to PEPs are completely hosed at the moment. For example, the link above displays an empty directory, and http://www.python.org/doc/peps displays a directory full of empty

Re: New-style Python icons

2006-03-20 Thread Michael Tobis
OK, but Python IS clever, so its logo ought to be too. Since you are acknowledging they are tadpoles, I guess you've heard my gripes... mt -- http://mail.python.org/mailman/listinfo/python-list

Do anyone already have code to copy nested files to a flat directory?

2006-03-20 Thread Podi
Hi, I am trying to copy all files under a directory tree to a single directory (in Windows). I can well write the script myself, but was wonder if anyone has done it so I won't be reinventing the wheel. Thanks in advance. Requirement: # Source file set source\file1.txt source\file2.doc source\d

Re: Function params with **? what do these mean?

2006-03-20 Thread Carl Banks
Aahz wrote: > Personally, I think it's a Good Idea to stick with the semi-standard > names of *args and **kwargs to make searching easier... I usually do stick to these names (since the I usually only use them when forwarding arguments to another function, where such names are a pretty good descri

Re: New-style Python icons

2006-03-20 Thread Carl Banks
[EMAIL PROTECTED] wrote: > Personally, I *like* the new website look, and I'm glad to see Python > having a proper logo at last! > > I've taken the opportunity to knock up some icons using it, finally > banishing the poor old standard-VGA-palette snake from my desktop. If > you like, you can grab

Re: Remote teamwork anecdotes (was: Where can we find top-notch python developers?)

2006-03-20 Thread Dan Sommers
On Tue, 21 Mar 2006 00:08:02 GMT, [EMAIL PROTECTED] (Cameron Laird) wrote: > Briefly, remote collaboration works for me. I work on > customer premises part of the year, and, while there are > multipliers, my estimate is that they're far closer to > one than four. Sometimes they're less than one-

Re: Do anyone already have code to copy nested files to a flat directory?

2006-03-20 Thread Podi
OK, please don't bother. Here is my wheel :-) import os import shutil def CopyFlat(source, target): count = 0 for root, dirs, files in os.walk(source): for file in files: count += 1 name = root + '\\' + file print '%04d Copying' % count, name,

Re: Do anyone already have code to copy nested files to a flat directory?

2006-03-20 Thread Felipe Almeida Lessa
Em Seg, 2006-03-20 às 18:05 -0800, Podi escreveu: > OK, please don't bother. Here is my wheel :-) Please, please! Remove all the... x + "\\" + y ...and put some... os.path.join(x, y) ... Please? Even if you're planning to use it only on Windows, please use standard methods. Just my 2 cents, t

Re: Do anyone already have code to copy nested files to a flat directory?

2006-03-20 Thread Peter Hansen
Podi wrote: > OK, please don't bother. Here is my wheel :-) > > import os > import shutil > > def CopyFlat(source, target): > count = 0 > for root, dirs, files in os.walk(source): > for file in files: > count += 1 > name = root + '\\' + file A small improv

Re: can't rebind magic methods

2006-03-20 Thread Alex Martelli
Michael Tobis <[EMAIL PROTECTED]> wrote: > Still a bit confused actually. Any explanation of the following? I believe the problem you're having is with WHEN a name is looked up -- which tends to be 'as late as possible, but no later'. > def getf(method,name): > def f(self, *a, **k): return m

Re: Remote teamwork anecdotes

2006-03-20 Thread Alex Martelli
Dan Sommers <[EMAIL PROTECTED]> wrote: ... > Design meetings and similar almost have to be face to face. Agreed. > OTOH, once the design is set, leave me alone and let me > simulate it or code it, and maybe even get it past the first > round of testing and tweaking/fixing. The last thing I w

Re: Python 2.5 Schedule

2006-03-20 Thread Terry Reedy
"Tim Peters" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> For more details about the plan for Python 2.5, see: >> >> http://www.python.org/doc/peps/pep-0356/ > > Looks like links to PEPs are completely hosed at the moment. For > example, the link above displays an empty dir

Re: Remote teamwork anecdotes

2006-03-20 Thread Roy Smith
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Alex Martelli) wrote: > And even if I'm wrong, and a Joe Supercoder I've never met > works best with 3 days a week of solo effort, 3 days of solo coding plus > 2 of strong in-person interaction is NOT the same thing as, say, 3 > _weeks_ of solo c

Error sending message [1142594190671.2752.rpppl] from [randpoly.com]

2006-03-20 Thread randpoly.com PostMaster
[<00>] V-POP3bounce: [EMAIL PROTECTED];Error=[The maximum number of delivery attempts has been reached] [<01>] Error sending message [1142594190671.2752.rpppl] from [randpoly.com]. ID: Mail From: Rcpt To: <[EMAIL PROTECTED]> Server: [209.120.245.170] [<02>] The reason of the de

<    1   2   3   >