imp.find_module don't found my module but standard import statement can import this module… why ?

2011-07-05 Thread Stéphane Klein
Hi, I would like import some module dynamically. First, I install "js.jquery" $ pip install js.jquery Here, I would like import "js" module. >>> import imp >>> imp.find_module("js") Traceback (most recent call last): File "", line 1, in ImportError: No module named js >>> import js >>> I

Re: Implicit initialization is EVIL!

2011-07-05 Thread Robin Becker
On 03/07/2011 23:21, Chris Angelico wrote: . var(0x14205359) x # Don't forget to provide an address where the object will be located x=42 did you forget to specify the memory bank and computer (and presumably planet etc etc) -molly-coddled-ly yrs- Robin Becker -- http:/

Re: Problem!!

2011-07-05 Thread Nobody
On Sun, 03 Jul 2011 16:58:24 -0700, amir chaouki wrote: > the problem is when i use the seek function on windows it gives me > false results other then the results on *ux. the file that i work with > are very large about 10mb. This is probably an issue with how the underlying C functions behave o

wx MenuItem - icon is missing

2011-07-05 Thread Laszlo Nagy
def onPopupMenu(self,evt): menu = wx.Menu() for title,bitmap in self.getPopupMenuItems(): item = wx.MenuItem(None,-1,title) if bitmap: item.SetBitmap(bitmap) menu.AppendItem(item) menu.Bind(wx.EVT_MENU,self.onPopup

Secure ssl connection with wrap_socket

2011-07-05 Thread Andrea Di Mario
Hi, I'm a new python user and I'm writing a small web service with ssl. I want use a self-signed certificate like in wiki: http://docs.python.org/dev/library/ssl.html#certificates I've used wrap_socket, but if i try to use cert_reqs=ssl.CERT_REQUIRED, it doesn't work with error: urllib2.URLError:

Re: Implicit initialization is EVIL!

2011-07-05 Thread Gregory Ewing
rantingrick wrote: You say "root" windows are bad however any parent-child relationship has to BEGIN somewhere. There's no need for *toplevel* windows to be children of anything, though. HOWEVER any of the windows ARE in fact instances of Tk.Toplevel[1]. So they ARE all equal because they al

Re: Implicit initialization is EVIL!

2011-07-05 Thread Gregory Ewing
rantingrick wrote: Most applications consist of one main window (a Tkinter.Tk instance). You've obviously never used a Macintosh. On the Mac, it's perfectly normal for an application to open multiple documents, each in its own window, with no one window being the "main" window. Any of them can

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread rantingrick
On Jul 4, 2:36 am, Gregory Ewing wrote: > We have different languages because different people have different > ideas about what a language should be like. Ruby people like user > defined control structures; Python people regard user defined > control structures as an anti-feature. It's fundament

Re: HeaderParseError

2011-07-05 Thread Thomas Guettler
On 04.07.2011 13:20, Peter Otten wrote: > Thomas Guettler wrote: > >> On 04.07.2011 11:51, Peter Otten wrote: >>> Thomas Guettler wrote: >>> I get a HeaderParseError during decode_header(), but Thunderbird can display the name. >>> from email.header import decode_header >>>

embedding: how do I redirect print output?

2011-07-05 Thread Ulrich Eckhardt
Hi! I'm trying to add some scripting capabilities to an application. Since it is a GUI application, I need some way to display output from Python. For 3.x, where "print" is a function, I'd just exchange this function with one that redirects the output to a log window, right. However, I'm using

Re: imp.find_module don't found my module but standard import statement can import this module… why ?

2011-07-05 Thread Eric Snow
On Tue, Jul 5, 2011 at 1:36 AM, Stéphane Klein wrote: > Hi, > > I would like import some module dynamically. > To import a module dynamically, you can use the built-in __import__ function: module = __import__("js") Even better, use importlib's import_module, which is available in 2.7/3.2. A

Re: imp.find_module don't found my module but standard import statement can import this module… why ?

2011-07-05 Thread Stéphane Klein
Le 05/07/2011 15:44, Eric Snow a écrit : On Tue, Jul 5, 2011 at 1:36 AM, Stéphane Klein wrote: Hi, I would like import some module dynamically. To import a module dynamically, you can use the built-in __import__ function: module = __import__("js") Even better, use importlib's import_mo

Re: wx MenuItem - icon is missing

2011-07-05 Thread Philip Semanchuk
On Jul 5, 2011, at 4:02 AM, Laszlo Nagy wrote: >def onPopupMenu(self,evt): >menu = wx.Menu() >for title,bitmap in self.getPopupMenuItems(): >item = wx.MenuItem(None,-1,title) >if bitmap: >item.SetBitmap(bitmap) >menu.AppendIt

Re: Secure ssl connection with wrap_socket

2011-07-05 Thread Jean-Paul Calderone
On Jul 5, 4:52 am, Andrea Di Mario wrote: > Hi, I'm a new python user and I'm writing a small web service with ssl. > I want use a self-signed certificate like in > wiki:http://docs.python.org/dev/library/ssl.html#certificates > I've used wrap_socket, but if i try to use > cert_reqs=ssl.CERT_REQU

Re: Testing if a global is defined in a module

2011-07-05 Thread Grant Edwards
On 2011-07-05, Chris Angelico wrote: > On Tue, Jul 5, 2011 at 10:01 AM, Tim Johnson wrote: >>>Steven, I'm building a documentation system. I have my own MVC >>>framework and the goal is to have a documentation module for each >>>project. >> > > Is there a reason for not using Doxygen / Autodoc /

Re: embedding: how do I redirect print output?

2011-07-05 Thread Thomas Jollans
On 07/05/2011 02:50 PM, Ulrich Eckhardt wrote: > I'm trying to add some scripting capabilities to an application. Since it is > a GUI application, I need some way to display output from Python. For 3.x, > where "print" is a function, I'd just exchange this function with one that > redirects the

Re: Embedding a thin python

2011-07-05 Thread Thomas Jollans
On 07/05/2011 08:28 AM, victor lucio wrote: > Hi All, > > I would like to remove some modules for embedding a thin python. > how to do that? > I would be grateful for your suggestions > > > Start your favourite file manager and delete them. -- http://mail.python.org/mailman/listinfo/python-li

Re: Compiling Python 3.2 on Cygwin fails

2011-07-05 Thread David Robinow
On Mon, Jul 4, 2011 at 3:49 PM, Aly Tawfik wrote: > On Jun 20, 12:44 pm, sewpafly wrote: >> I was able to a little further by changing 2 lines in Makefile.pre.in. >> >> On line 170, changed: >>     DLLLIBRARY= @DLLLIBRARY@ >> to: >>     DLLLIBRARY= libpython$(VERSION).dll >> >> On line 509 it had

Re: Implicit initialization is EVIL!

2011-07-05 Thread Steven D'Aprano
Gregory Ewing wrote: > rantingrick wrote: >> Most applications consist of one main window >> (a Tkinter.Tk instance). > > You've obviously never used a Macintosh. On the Mac, it's > perfectly normal for an application to open multiple > documents, each in its own window, with no one window > bein

Re: from module import * using __import__?

2011-07-05 Thread Thomas Jollans
On 07/02/2011 09:52 PM, Dan Stromberg wrote: > > Is there a decent way of running "from import *"? Perhaps > using __import__? > > Does it mean using the copy module or adding an element to globals() > somehow? Yes, exactly. That's what `from x import *` does: Get the module, and then add all

Re: embedding: how do I redirect print output?

2011-07-05 Thread Steven D'Aprano
Ulrich Eckhardt wrote: > Hi! > > I'm trying to add some scripting capabilities to an application. Since it > is a GUI application, I need some way to display output from Python. For > 3.x, where "print" is a function, I'd just exchange this function with one > that redirects the output to a log w

Re: can I package a distutil based python app in deb?

2011-07-05 Thread Thomas Jollans
On 06/26/2011 07:59 PM, hackingKK wrote: > Hello all, > I guess the subject line says it all. > I want to package a python app to deb. > I have 3 interesting issues with it. > 1, I would want it to run on Ubuntu 10.04, Ubuntu 10.10, Ubuntu 11.04 > and Debian 5. > 2, the package depends on another p

Re: module problem on windows 64bit

2011-07-05 Thread Thomas Jollans
On 06/27/2011 06:59 PM, miamia wrote: > Hello, > > on 32-bit windows everything works ok but on 64-bit win I am getting > this error: > Traceback (most recent call last): > File "app.py", line 1040, in do_this_now > File "kinterbasdb\__init__.pyc", line 119, in > File "kinterbasdb\_kinterba

Re: Implicit initialization is EVIL!

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 12:25 AM, Steven D'Aprano wrote: > Gregory Ewing wrote: > >> You've obviously never used a Macintosh. On the Mac, it's >> perfectly normal for an application to open multiple >> documents, each in its own window, with no one window >> being the "main" window. Any of them can

Re: embedding: how do I redirect print output?

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 12:36 AM, Steven D'Aprano wrote: print "Hello world" > dlrow olleH > You, sir, have a warped and twisted mind. And I love it!! Now to secretly put code into some module somewhere and wait for people to start tearing their hair out wait, did I say that out loud?

Re: Testing if a global is defined in a module

2011-07-05 Thread Tim Johnson
* Ian Kelly [110704 20:37]: > > It sounds like what you really want is to detect the names *exported* > by the module, then. i Yes! > Why not do it the same way Python does it? If > the module defines an "__all__" attribute, then it is taken to be a > sequence of strings which are the export

Implicit initialization is EXCELLENT

2011-07-05 Thread Steven D'Aprano
This is not strictly Python, although it is peripherally relevant. Some month or three ago, I read an article or blog post about API design, specifically the wrong-headedness of insisting that callers manually initialise instances using a separate step after creation. The argument goes, if your A

Re: Implicit initialization is EVIL!

2011-07-05 Thread nn
On Jul 4, 11:35 am, Robin Becker wrote: > On 03/07/2011 23:21, Chris Angelico wrote: > . > > > var(0x14205359) x   # Don't forget to provide an address where the > > object will be located > > x=42 > > > did you forget to specify the memory bank and computer (and presumably planet

Re: Testing if a global is defined in a module

2011-07-05 Thread Grant Edwards
On 2011-07-05, Tim Johnson wrote: > * Ian Kelly [110704 20:37]: >> >> It sounds like what you really want is to detect the names *exported* >> by the module, then. i > Yes! >> Why not do it the same way Python does it? If >> the module defines an "__all__" attribute, then it is taken to be

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread Corey Richardson
Excerpts from rantingrick's message of Tue Jul 05 07:42:39 -0400 2011: > > I was thinking more about this comment and it occurred to me that > Python does have user controlled data structures. Just because there > is no "top level syntax" like ruby does not mean these do not exists. > You only have

Re: Implicit initialization is EVIL!

2011-07-05 Thread Robin Becker
On 05/07/2011 16:33, nn wrote: .. Ah, I see we have a mainframe programmer among us ... :-) so long since I manipulated the switches of that old pdp-8 -anciently yrs- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

VIDEOS FOR HOT GUYS

2011-07-05 Thread SAHITHI
FOR GOOD JOBS SITES TO YOU http://goodjobssites.blogspot.com/ FOR HOT PHOTO&VIDEOS KATRINA KAIF IN BEAUTIFUL RED DRESS http://southactresstou.blogspot.com/2011/05/katrina-kaif_22.html GO

Re: Testing if a global is defined in a module

2011-07-05 Thread Waldek M.
Dnia Tue, 5 Jul 2011 14:11:56 + (UTC), Grant Edwards napisał(a): > Because those specially-formatted comments are wrong. ... because? Not in sarcasm mode; just curious why you don't like them. Br. Waldek -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing if a global is defined in a module

2011-07-05 Thread Steven D'Aprano
Waldek M. wrote: > Dnia Tue, 5 Jul 2011 14:11:56 + (UTC), Grant Edwards napisał(a): >> Because those specially-formatted comments are wrong. > > ... because? > Not in sarcasm mode; just curious why you don't like them. Because unless you are extremely disciplined, code and the comments descr

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread sal migondis
On Jul 4, 10:31 pm, alex23 wrote: > rantingrick wrote: > > I believe (unlike most people) that nature is striving for perfection > > Your belief is wrong. "Nature" doesn't "strive" for _anything_. Things > in the world are either fit enough to continue their existence or not. > As circumstances c

Question about how to get line buffering from paramiko

2011-07-05 Thread Steven W. Orr
I'm writing a program that uses paramiko to run a lot of commands over ssh. Some of the commands take time to run and they write to stdout and stderr as a normal part of their operation so that we can see progress happening. I can't seem to get the output from the remote commands (which is inpu

Re: Implicit initialization is EXCELLENT

2011-07-05 Thread Michel Claveau - MVP
Hi! +1 @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: emacs lisp text processing example (html5 figure/figcaption)

2011-07-05 Thread Ian Kelly
On Mon, Jul 4, 2011 at 12:36 AM, Xah Lee wrote: > So, a solution by regex is out. Actually, none of the complications you listed appear to exclude regexes. Here's a possible (untested) solution: ((?:\s*)+) \s*((?:[^<]|<(?!/p>))+) \s* and corresponding replacement string: \1 \2 I don't kno

Re: Implicit initialization is EXCELLENT

2011-07-05 Thread Mel
Steven D'Aprano wrote: [ ... ] > Python generally follows this design. Apart from files, I can't easily > think off the top of my head of any types that require a separate > open/start/activate call before they are usable. It's also relevant to > tkinter, which will implicitly create a root window

Re: Implicit initialization is EXCELLENT

2011-07-05 Thread Stefaan Himpe
Hello, I agree with the contents of this post. I see a similar problem with API's requiring to initialize all kinds of data using setters/properties instead of receiving it in the initializer (or constructor). Python generally follows this design. Apart from files, I can't easily think off

Re: emacs lisp text processing example (html5 figure/figcaption)

2011-07-05 Thread Xah Lee
On Jul 4, 12:13 pm, "S.Mandl" wrote: > Nice. I guess that XSLT would be another (the official) approach for > such a task. > Is there an XSLT-engine for Emacs? > > -- Stefan haven't used XSLT, and don't know if there's one in emacs... it'd be nice if someone actually give a example... Xah --

Re: emacs lisp text processing example (html5 figure/figcaption)

2011-07-05 Thread Xah Lee
On Jul 5, 12:17 pm, Ian Kelly wrote: > On Mon, Jul 4, 2011 at 12:36 AM, Xah Lee wrote: > > So, a solution by regex is out. > > Actually, none of the complications you listed appear to exclude > regexes.  Here's a possible (untested) solution: > > > ((?:\s* height="[0-9]+">)+) > \s*((?:[^<]|<(?!/

ANN: python-ldap 2.4.1

2011-07-05 Thread Michael Ströder
Find a new release of python-ldap: http://pypi.python.org/pypi/python-ldap/2.4.1 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 stu

Re: emacs lisp text processing example (html5 figure/figcaption)

2011-07-05 Thread Xah Lee
On Jul 5, 12:17 pm, Ian Kelly wrote: > On Mon, Jul 4, 2011 at 12:36 AM, Xah Lee wrote: > > So, a solution by regex is out. > > Actually, none of the complications you listed appear to exclude > regexes.  Here's a possible (untested) solution: > > > ((?:\s* height="[0-9]+">)+) > \s*((?:[^<]|<(?!/

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread Andrew Berg
On 2011.07.05 01:14 PM, sal migondis wrote: > How could a belief be wrong? Beliefs aren't subjective. One's taste in music, for example, is largely subjective and can't be right or wrong, but a belief (which has to do with facts) certainly can be. > > > What do you think will be the eventual outco

Re: embedding: how do I redirect print output?

2011-07-05 Thread Andrew Berg
On 2011.07.05 10:20 AM, Chris Angelico wrote: > You, sir, have a warped and twisted mind. > > And I love it!! > > Now to secretly put code into some module somewhere and wait for > people to start tearing their hair out wait, did I say that out > loud? from pytroll import print -- http://mail.

Re: Implicit initialization is EXCELLENT

2011-07-05 Thread John Gordon
In Stefaan Himpe writes: > > Now, I have an ulterior motive in raising this issue... I can't find the > > original article I read! My google-fu has failed me (again...). I don't > > suppose anyone can recognise it and can point me at it? > My sarcasm detector warns me not to add a link, althou

write file

2011-07-05 Thread miguel olivares varela
Hi, i got a csv file that i need to modify and create a new one, i have no problem to read mi 'test.cvs' which is the source file but when i try to create a new one with the modifications i only got the first row in my 'out.csv' file. I think there is somethng wrong in my loop because i can

Re: write file

2011-07-05 Thread Dan Stromberg
What's date_cdr supposed to be? Is your exception handler doing unusual things with sys.exit? Did you try to run this? When I try to run it, it fails to compile. You might want to try opening your output file once and writing to it repeatedly, then close()ing it after all your writes are comple

How do twisted and multiprocessing.Process create zombies?

2011-07-05 Thread bitcycle
In python, using twisted loopingcall, multiprocessing.Process, and multiprocessing.Queue; is it possible to create a zombie process. And, if so, then how? -- http://mail.python.org/mailman/listinfo/python-list

Re: Implicit initialization is EXCELLENT

2011-07-05 Thread John Gordon
In John Gordon writes: > which praised the bendfists of implicit initialization. Wow, that's quite a typo! I meant "benefits", of course. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears

RE: write file

2011-07-05 Thread miguel olivares varela
What's date_cdr supposed to be? It was a mistake it should be date_source Is your exception handler doing unusual things with sys.exit? Not really Did you try to run this? When I try to run it, it fails to compile. it compiles i have no problems with the compilation. The issue is the res

Re: emacs lisp text processing example (html5 figure/figcaption)

2011-07-05 Thread Ian Kelly
On Tue, Jul 5, 2011 at 2:37 PM, Xah Lee wrote: > but in anycase, i can't see how this part would work > ((?:[^<]|<(?!/p>))+) It's not that different from the pattern 「alt="[^"]+"」 earlier in the regex. The capture group accepts one or more characters that either aren't '<', or that are '<' but a

Re: write file

2011-07-05 Thread Benjamin Kaplan
On Jul 5, 2011 2:28 PM, "miguel olivares varela" wrote: > > > Hi, > > i got a csv file that i need to modify and create a new one, i have no problem to read mi 'test.cvs' which is the source file but when i try to create a new one with the modifications i only got the first row in my 'out.csv' fi

Re: emacs lisp text processing example (html5 figure/figcaption)

2011-07-05 Thread S.Mandl
> haven't used XSLT, and don't know if there's one in emacs... > > it'd be nice if someone actually give a example... > Hi Xah, actually I have to correct myself. HTML is not XML. If it were, you could use a stylesheet like this: http://www.w3.org/1999/XSL/Transform";>

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 4:14 AM, sal migondis wrote: > On Jul 4, 10:31 pm, alex23 wrote: >> rantingrick wrote: >> > What do you think will be the eventual outcome of the human existence >> > Alex? Since you have no imagination i will tell you, a singular >> > intelligence. > > All from the land o

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread rantingrick
On Jul 5, 11:04 am, Corey Richardson wrote: > How is giving the sort method a function by which to determine the relative > value of objects a control structure? Do you know what a control structure is? > It's something that you use to modify control flow: > > if foo <= bar: >         foo += 1 >

Re: Implicit initialization is EVIL!

2011-07-05 Thread rantingrick
On Jul 5, 10:17 am, Chris Angelico wrote: > It's actually quite easy to implement this, even if you _are_ forced > to have one primary window. You just have an invisible primary whose > sole purpose is to "be the application", and then everything else is > secondary windows. Kinda defeats the pur

Re: Testing if a global is defined in a module

2011-07-05 Thread Grant Edwards
On 2011-07-05, Waldek M. wrote: > Dnia Tue, 5 Jul 2011 14:11:56 + (UTC), Grant Edwards napisa?(a): >> Because those specially-formatted comments are wrong. > > ... because? In my experience, they're wrong because somebody changes the code and not the comments. > Not in sarcasm mode; just cur

Re: Implicit initialization is EVIL!

2011-07-05 Thread rantingrick
On Jul 5, 11:00 am, Web Dreamer wrote: > What he means is that On Mac, if you close "all" windows, the application is > still running. Then that is NOT closing windows that is only ICONIFIYING/HIDING them. Let's use the correct lingo people! -- http://mail.python.org/mailman/listinfo/python-li

Re: Testing if a global is defined in a module

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 3:36 AM, Steven D'Aprano wrote: > > Because unless you are extremely disciplined, code and the comments > describing them get out of sync. Quote: > > "At Resolver we've found it useful to short-circuit any doubt and just > refer to comments in code as 'lies'. " > --Michael F

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 8:35 AM, rantingrick wrote: > You're the > best enemy a person could have. Thank you. *bows* Compliments are made to be returned, and this one is particularly well suited. *bow* Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Implicit initialization is EVIL!

2011-07-05 Thread rantingrick
On Jul 5, 6:14 am, Gregory Ewing wrote: > rantingrick wrote: > > Most applications consist of one main window > > (a Tkinter.Tk instance). > > You've obviously never used a Macintosh. On the Mac, it's > perfectly normal for an application to open multiple > documents, each in its own window, with

Re: wx MenuItem - icon is missing

2011-07-05 Thread Laszlo Nagy
1. Post a complete example that demonstrates the problem so that we don't have to dummy up a wx app ourselves to try your code. import sys import wx from wx.lib.embeddedimage import PyEmbeddedImage img = PyEmbeddedImage( "iVBORw0KGgoNSUhEUgAAABAQCAYf8/9hBmJLR0QAAAD5Q

Re: Implicit initialization is EVIL!

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 8:42 AM, rantingrick wrote: > Chris are you playing devils advocate (for my team). I am confused? :-) I say whatever I choose to say. Don't pigeon-hole me into "on your team" or "not on your team" or "devil's advocate" or whatever. And at two in the morning, "whatever I cho

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread Tim Chase
On 07/05/2011 05:35 PM, rantingrick wrote: One thing is for sure, i always get a giggle from your self defeating posts. You're the best enemy a person could have. Thank you. *bows* Every time I see a rantingrick post, it's like watching the Black Knight scene from the Holy Grail yet again. Yo

Re: wx MenuItem - icon is missing

2011-07-05 Thread Philip Semanchuk
On Jul 5, 2011, at 3:32 PM, Laszlo Nagy wrote: > >> 1. Post a complete example that demonstrates the problem so that we don't >> have to dummy up a wx app ourselves to try your code. > [code sample snipped] > > Under windows, this displays the icon for the popup menu item. Under GTK it > d

Re: Implicit initialization is EVIL!

2011-07-05 Thread rantingrick
On Jul 5, 6:20 pm, Chris Angelico wrote: > On Wed, Jul 6, 2011 at 8:42 AM, rantingrick wrote: > [...] > > On Jul 5, 11:00 am, Web Dreamer wrote: > >> What he means is that On Mac, if you close "all" windows, the application > >> is > >> still running. > > > Then that is NOT closing windows that

Re: Implicit initialization is EVIL!

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 9:47 AM, rantingrick wrote: >> > Then that is NOT closing windows that is only ICONIFIYING/HIDING them. >> > Let's use the correct lingo people! >> >> Actually, it IS closing those windows. Why wouldn't it be? >> [...] >> The memory used by that window can be reclaimed. Hand

Re: Implicit initialization is EVIL!

2011-07-05 Thread rantingrick
On Jul 5, 6:54 pm, Chris Angelico wrote: > To do what for me? Close windows? Reclaim memory? Terminate > applications? I don't understand your bogglement. ClaimA: I made claim that Tkinter's window hierarchy is not only normal, but justified in modern GUI programming. ClaimB: You made a claim (

Re: Implicit initialization is EVIL!

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 10:15 AM, rantingrick wrote: > On Jul 5, 6:54 pm, Chris Angelico wrote: > >> To do what for me? Close windows? Reclaim memory? Terminate >> applications? I don't understand your bogglement. > > ClaimA: I made claim that Tkinter's window hierarchy is not only > normal, but j

Re: How do twisted and multiprocessing.Process create zombies?

2011-07-05 Thread Stefan Behnel
bitcycle, 05.07.2011 23:52: In python, using twisted loopingcall, multiprocessing.Process, and multiprocessing.Queue; is it possible to create a zombie process. And, if so, then how? I think it's best to consult your local Voodoo master on the matter of zombie creation processes. That bein

Re: Implicit initialization is EVIL!

2011-07-05 Thread rantingrick
On Jul 5, 7:34 pm, Chris Angelico wrote: > Actually, everything you do requires the underlying window manager, > otherwise you're just painting your own pixels on the screen. And I > never said that this model was possible in some and not others. > (Although it's a bit harder with Windows; there'

Re: web browsing short cut

2011-07-05 Thread Dustin Cheung
Hey, I am looking into Tkinter. But i am not sure if it will actually work. This maybe a crazy idea but i was wondering if i can put a web browser in the frame. I have tried to use Tkinter to resize and place the windows to certain areas of the screen but that's not working or the way im approachi

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread rantingrick
On Jul 4, 6:24 pm, Steven D'Aprano wrote: > rantingrick wrote: > Some people want to make Python more dynamic. Some want it to be less > dynamic. Some care about integrating it with Java or .Net, some don't care > about either. Some are interested in clever optimization tricks, some > oppose addi

Re: Implicit initialization is EXCELLENT

2011-07-05 Thread rantingrick
On Jul 5, 10:26 am, Steven D'Aprano wrote: > This is not strictly Python, although it is peripherally relevant. > > Some month or three ago, I read an article or blog post about API design, > specifically the wrong-headedness of insisting that callers manually > initialise instances using a separa

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 11:07 AM, rantingrick wrote: > On Jul 4, 6:24 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: >> Define "best for all", and try not to make it "what Rick wants". > > You want features? And remember i am talking about scripting/glue > level languages here. Someth

Re: Implicit initialization is EXCELLENT

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 11:53 AM, rantingrick wrote: > So you would start drivers education class with road construction? Or > the history of the internal combustion engine? Who cares about > actually *driving* the car. > I believe that starting driver ed with some basics of how an internal combus

Should ctypes handle mis-matching structure return ABI between mingw and MSVC?

2011-07-05 Thread Just Fill Bugs
According the Bug 36834 of gcc, there is a mis-matching between mingw and MSVC when a struct was returned by value from a C function. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36834 Should ctypes handle this situation automatically somehow? A ctypes discussion on 2009: http://thread

Re: Implicit initialization is EXCELLENT

2011-07-05 Thread rantingrick
On Jul 5, 9:44 pm, Chris Angelico wrote: > On Wed, Jul 6, 2011 at 11:53 AM, rantingrick wrote: > > So you would start drivers education class with road construction? Or > > the history of the internal combustion engine? Who cares about > > actually *driving* the car. > > I believe that starting d

hai

2011-07-05 Thread http://123maza.com/65/chill155/
http://123maza.com/65/chill155/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Implicit initialization is EXCELLENT

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 1:45 PM, rantingrick wrote: >> If you force too much on people, they'll go >> elsewhere. > >  Why all this running away with tail between legs? >  Do these these people have extremely small eggs? >  I wish they would stand firm and put up a fight >  instead they're just cowa

Microsoft GUIs (was: The end to all language wars and the great unity API to come!) (OT)

2011-07-05 Thread Andrew Berg
On 2011.07.05 09:31 PM, Chris Angelico wrote: > I've said for a while that Microsoft could do far worse than to turn > Windows into a GUI that sits on top of a Unix-derived kernel. They > won't do it, though, because it would be tantamount to admitting both > that Unix is superior to Windows, AND t

Re: Microsoft GUIs (was: The end to all language wars and the great unity API to come!) (OT)

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 2:13 PM, Andrew Berg wrote: > On 2011.07.05 09:31 PM, Chris Angelico wrote: >> I've said for a while that Microsoft could do far worse than to turn >> Windows into a GUI that sits on top of a Unix-derived kernel. They >> won't do it, though, because it would be tantamount to

Re: Microsoft GUIs

2011-07-05 Thread Andrew Berg
On 2011.07.05 11:25 PM, Chris Angelico wrote: > Suppose I gave you a computer that had GNOME ported to Windows, and > used the purplish palette that Ubuntu 10.10 uses, and had a Windows > port of bash as its most convenient terminal. Members of this list > will doubtless have no problem duck-typing

Re: Microsoft GUIs (was: The end to all language wars and the great unity API to come!) (OT)

2011-07-05 Thread Dan Stromberg
On Tue, Jul 5, 2011 at 9:13 PM, Andrew Berg wrote: > On 2011.07.05 09:31 PM, Chris Angelico wrote: > > I've said for a while that Microsoft could do far worse than to turn > > Windows into a GUI that sits on top of a Unix-derived kernel. They > > won't do it, though, because it would be tantamount

Re: Microsoft GUIs

2011-07-05 Thread Andrew Berg
On 2011.07.06 12:03 AM, Dan Stromberg wrote: > I disagree. The stuff endusers tend to use is polished to some > extent, but the backend is verging on hideous. If a developer > complains about the ugly internal structure "yeah, but you say that > just because you're a computer person / geek." Admi

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread Andrew Berg
On 2011.07.06 12:26 AM, Dennis Lee Bieber wrote: > On Tue, 05 Jul 2011 16:01:57 -0500, Andrew Berg > declaimed the following in > gmane.comp.python.general: > > > On 2011.07.05 01:14 PM, sal migondis wrote: > > > How could a belief be wrong? > > Beliefs aren't subjective. One's taste in music, fo

Re: Microsoft GUIs

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 2:53 PM, Andrew Berg wrote: >> Let Microsoft play with, and sell, pretty GUIs and pretty apps. > I completely disagree. MS sucks at making GUIs. > I never said they were good at making GUIs. I said they were good at selling GUIs. Dan is right about the ugliness of the Wind

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread Chris Angelico
On Wed, Jul 6, 2011 at 3:26 PM, Dennis Lee Bieber wrote: > On Wed, 6 Jul 2011 12:31:02 +1000, Chris Angelico > declaimed the following in gmane.comp.python.general: >> Democracy DOES NOT WORK. Plain and simple. You cannot build a >> programming language democratically. >> >        Uhm... COBOL an

Re: Testing if a global is defined in a module

2011-07-05 Thread Waldek M.
Dnia Wed, 06 Jul 2011 03:36:24 +1000, Steven D'Aprano napisał(a): > Because unless you are extremely disciplined, code and the comments > describing them get out of sync. [...] True, but that gets far worse with external docs. Do you have in mind any better replacement? Br. Waldek -- http://mail.

Re: Implicit initialization is EVIL!

2011-07-05 Thread Gregory Ewing
rantingrick wrote: What he means is that On Mac, if you close "all" windows, the application is still running. Then that is NOT closing windows that is only ICONIFIYING/HIDING them. No, the windows really are closed. They no longer exist in any way. The application is still running, though,

Re: Implicit initialization is EVIL!

2011-07-05 Thread Gregory Ewing
rantingrick wrote: And how do you EXPLICITY quit the application? Using its "Quit" menu command. But that's Mac-specific, and not central to the discussion. On Linux and Windows, an application will usually exit when its last window is closed. Either way, there is no need for a privileged mai

Re: Does hashlib support a file mode?

2011-07-05 Thread Chris Rebert
On Tue, Jul 5, 2011 at 10:54 PM, Phlip wrote: > Pythonistas: > > Consider this hashing code: > >  import hashlib >  file = open(path) >  m = hashlib.md5() >  m.update(file.read()) >  digest = m.hexdigest() >  file.close() > > If the file were huge, the file.read() would allocate a big string and >

Re: Does hashlib support a file mode?

2011-07-05 Thread Thomas Rachel
Am 06.07.2011 07:54 schrieb Phlip: Pythonistas: Consider this hashing code: import hashlib file = open(path) m = hashlib.md5() m.update(file.read()) digest = m.hexdigest() file.close() If the file were huge, the file.read() would allocate a big string and thrash memory. (Yes,