Re: Problem!!

2011-07-04 Thread TheSaint
Irmen de Jong wrote: > No, I misplaced my crystal ball. I'm waiting mine, brand new in HD :D, with remote control :D :D -- goto /dev/null -- http://mail.python.org/mailman/listinfo/python-list

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

2011-07-04 Thread Gregory Ewing
rantingrick wrote: I agree however i see merit in both approaches. But why must we have completely different languages just for that those two approaches? We have different languages because different people have different ideas about what a language should be like. Ruby people like user defin

Re: Why won't this decorator work?

2011-07-04 Thread Gregory Ewing
OKB (not okblacke) wrote: A decorator basically modifies a function/method, so that ALL subsequent calls to it will behave differently. Furthermore, usually a decorator is used when for some reason you *can't* achieve the same effect with code inside the function itself. For example, the

HeaderParseError

2011-07-04 Thread Thomas Guettler
Hi, I get a HeaderParseError during decode_header(), but Thunderbird can display the name. >>> from email.header import decode_header >>> decode_header('=?iso-8859-1?B?QW5tZWxkdW5nIE5ldHphbnNjaGx1c3MgU_xkcmluZzNwLmpwZw==?=') Traceback (most recent call last): File "", line 1, in File "/usr/l

Re: Implicit initialization is EVIL!

2011-07-04 Thread Gregory Ewing
rantingrick wrote: Unlike most GUI libraries the Tkinter developers thought is would "just wonderful" if the root GUI window just sprang into existence if the programmer "somehow" forgot to create one. IMO the real problem here is the existence of a privileged "root" window at all. No GUI plat

Re: Implicit initialization is EVIL!

2011-07-04 Thread Chris Angelico
On Mon, Jul 4, 2011 at 6:33 PM, Gregory Ewing wrote: > rantingrick wrote: > >> Unlike most GUI libraries the Tkinter developers thought is would >> "just wonderful" if the root GUI window just sprang into existence if >> the programmer "somehow" forgot to create one. > > IMO the real problem here

Re: Virtual functions are virtually invisible!

2011-07-04 Thread Gregory Ewing
rantingrick wrote: what concerns me is the fact that virtual methods in derived classes just blend in to the crowd. I think we really need some sort of visual cue in the form of forced syntactical notation (just like the special method underscores). If you're suggesting that it should be imp

Re: Problem!!

2011-07-04 Thread Gregory Ewing
TheSaint wrote: On 4-7-2011 1:41, amir chaouki wrote: No, I misplaced my crystal ball. I'm waiting mine, brand new in HD :D, with remote control :D :D The new digital models are great. But there's a distressing tendency for visions to come with DRM protection these days, so you can only sh

Re: web hosting, first hand experiences?

2011-07-04 Thread Daniel Fetchinson
>> Hi folks, I know this comes up regularly but the thing is that the >> quality of service changes also quite regularly with many of the >> hosting companies. What's currently the best option for shared hosting >> of a turbogears application? I'm thinking of dreamhost and webfaction >> does anyone

Re: HeaderParseError

2011-07-04 Thread Peter Otten
Thomas Guettler wrote: > I get a HeaderParseError during decode_header(), but Thunderbird can > display the name. > from email.header import decode_header decode_header('=?iso-8859-1?B?QW5tZWxkdW5nIE5ldHphbnNjaGx1c3MgU_xkcmluZzNwLmpwZw==?=') > Traceback (most recent call last): > Fil

Sending email in python

2011-07-04 Thread vijay swaminathan
Hi All, I read through the smtplib and email modules of python and have come up with a simple program to send a email as an attachment. This module sends out an email but not as an attachment but in the body of the email. Any problem with this code? any insight would be greatly appreciated. impo

Re: HeaderParseError

2011-07-04 Thread Thomas Guettler
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 > > decode_header('=?iso-8859-1?B?QW5tZWxkdW5nIE5ldHphbnNjaGx1c3MgU_xkcmluZzNwLmpwZw==

Re: HeaderParseError

2011-07-04 Thread Peter Otten
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 >> >> decode_header('=?iso-8859-1?B?QW5tZWxkdW5nIE5ld

ONLY FOR MEN`

2011-07-04 Thread SAHITHI
FOR FAST UPDATED IN TELUGU FILM INDUSTRY http://allyouwants.blogspot.com/ PRIYAMANI SPICY PHOTOS IN COW GIRL http://allyouwants.blogspot.com/2011/02/priyamani-spicy-photo-shoot-cow-girl.html KAJAL HOT PHOTOS IN SAREE http:

Re: Implicit initialization is EVIL!

2011-07-04 Thread rantingrick
On Jul 4, 3:33 am, Gregory Ewing wrote: > IMO the real problem here is the existence of a privileged > "root" window at all. No GUI platform I know of has any > such concept (except for a "desktop" window that represents > the whole screen, which is not the same thing). All top-level > windows sh

Re: Implicit initialization is EVIL!

2011-07-04 Thread rantingrick
On Jul 4, 3:44 am, Chris Angelico wrote: > I don't know Tkinter, but from the look of the example code, he's > creating a Label that's not attached to a window, and then packing it > into nothing. The toolkit kindly creates him a window. Is that the > "root GUI window" that he means? A basic top-

Re: Implicit initialization is EVIL!

2011-07-04 Thread Chris Angelico
On Tue, Jul 5, 2011 at 1:19 AM, rantingrick wrote: > But let's dig a little deeper here. Your comment suggests that you > "personally" need to create multiple windows for your applications. Is > this correct? If so i pity any users of such application as they would > be thoroughly confused. Most a

Re: Implicit initialization is EVIL!

2011-07-04 Thread rantingrick
On Jul 4, 10:40 am, Chris Angelico wrote: > Uhh, sorry. No. There are plenty of good reasons for one application > to make multiple top-level windows, and if I ever find myself using a > toolkit that makes this difficult, I'll either be hacking the toolkit > or using a different one. I've been bu

Re: Implicit initialization is EVIL!

2011-07-04 Thread rantingrick
oops. should have used symmetric_difference! >>> a.symmetric_difference(b) set(['_w', '_setup', 'report_callback_exception', '_do', '__getattr__', 'loadtk', '_loadtk', 'readprofile']) -- http://mail.python.org/mailman/listinfo/python-list

Re: Implicit initialization is EVIL!

2011-07-04 Thread Chris Angelico
On Tue, Jul 5, 2011 at 1:46 AM, rantingrick wrote: > On Jul 4, 10:40 am, Chris Angelico wrote: > >> Uhh, sorry. No. There are plenty of good reasons for one application >> to make multiple top-level windows, and if I ever find myself using a >> toolkit that makes this difficult, I'll either be ha

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

2011-07-04 Thread rantingrick
On Jul 4, 12:06 am, alex23 wrote: > rantingrick wrote: > > But why must we have > > completely different languages just for that those two approaches? > > Because monocultures die. That's an interesting statement Alex (even though you parrot it constantly). So what IS a mono culture exactly? Lem

Re: Anyone want to critique this program?

2011-07-04 Thread OKB (not okblacke)
John Salerno wrote: > On Jul 3, 1:06 pm, "OKB (not okblacke)" > wrote: > >> > Yeah, I considered that, but I just hate the way it looks when the >> > line wraps around to the left margin. I wanted to line it all up >> > under the opening quotation mark. The wrapping may not be as much >> > of an

Re: Implicit initialization is EVIL!

2011-07-04 Thread rantingrick
On Jul 4, 11:01 am, Chris Angelico wrote: > On Tue, Jul 5, 2011 at 1:46 AM, rantingrick wrote: > > On Jul 4, 10:40 am, Chris Angelico wrote: > > >> Uhh, sorry. No. There are plenty of good reasons for one application > >> to make multiple top-level windows, and if I ever find myself using a > >>

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

2011-07-04 Thread Chris Angelico
On Tue, Jul 5, 2011 at 2:35 AM, rantingrick wrote: > I believe (unlike most people) that nature is striving for perfection > NOT for diversity. Diversity is just a byproduct of feeble attempts to > GUESS the correct answer. Here is a thought exercise for the advanced > reader...Which is more effic

Re: Anyone want to critique this program?

2011-07-04 Thread Chris Angelico
On Tue, Jul 5, 2011 at 2:37 AM, OKB (not okblacke) wrote: >        Well, what I'm saying is I use an editor that lets me make the > lines as long as I want, and it still wraps them right, so I never > explicitly hit enter to break a line except at the end of a string (or > paragraph). In this ins

i have configured proxy but fiddler can't capture python's network requests

2011-07-04 Thread 成都七中2002级7班_大家都是天才~
here's my code. I've change the port from to . import urllib2 proxy_support = urllib2.ProxyHandler({'http':'http://127.0.0.1:'}) opener = urllib2.build_opener(proxy_support, urllib2.HTTPHandler) urllib2.install_opener(opener) content = urllib2.urlopen('http://www.google.com').read() p

Re: Implicit initialization is EVIL!

2011-07-04 Thread Chris Angelico
On Tue, Jul 5, 2011 at 3:09 AM, rantingrick wrote: > On Jul 4, 11:01 am, Chris Angelico wrote: >> This is not >> a modal dialog; it's not even a modeless dialog - it's a completely >> stand-alone window that can be moved around the Z order independently >> of the parent. > > You can do the exact

[RELEASED] Python 3.2.1 rc 2

2011-07-04 Thread Georg Brandl
On behalf of the Python development team, I am pleased to announce the second release candidate of Python 3.2.1. Python 3.2.1 will the first bugfix release for Python 3.2, fixing over 120 bugs and regressions in Python 3.2. For an extensive list of changes and features in the 3.2 line, see h

Re: i have configured proxy but fiddler can't capture python's network requests

2011-07-04 Thread Chris Angelico
2011/7/5 成都七中2002级7班_大家都是天才~ : > 2. If I open fiddler, everything works great. But I can't see the > traffic in fiddler. And if I change port from to any other > number, it works find too. > It sounds to me like the traffic's going through fiddler, but you're just not seeing any log entries.

Testing if a global is defined in a module

2011-07-04 Thread Tim Johnson
Using Python 2.6 on ubuntu 10.04. inspect module : I want to 'inspect' a module and get a list of all functions, classes and global variables in that module. ## A module has been imported, and we call `getmembers' members = inspect.getmembers(mod) ## While iterating thru `members', we test to see

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

2011-07-04 Thread S.Mandl
Nice. I guess that XSLT would be another (the official) approach for such a task. Is there an XSLT-engine for Emacs? -- Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Implicit initialization is EVIL!

2011-07-04 Thread rantingrick
On Jul 4, 12:41 pm, Chris Angelico wrote: > For another example, look at where web browsers are going. By your > description, one instance of a browser should work with precisely one > "document" (which in this case would be a web page). That's how > browsers were in the early days, but by the ea

Re: Testing if a global is defined in a module

2011-07-04 Thread rantingrick
On Jul 4, 1:11 pm, Tim Johnson wrote: > Using Python 2.6 on ubuntu 10.04. > inspect module : > I want to 'inspect' a module and get a list of all > functions, classes and global variables in that module. > > ## A module has been imported, and we call `getmembers' > members = inspect.getmembers(mod

Re: Compiling Python 3.2 on Cygwin fails

2011-07-04 Thread Aly Tawfik
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: >     $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OB

Re: Compiling Python 3.2 on Cygwin fails

2011-07-04 Thread Aly Tawfik
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: >     $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OB

Re: [Python-ideas] Allow isinstance second argument to be a set of types

2011-07-04 Thread MRAB
On 04/07/2011 20:41, Amaury Forgeot d'Arc wrote: Hi, 2011/7/4 Antoine Pitrou: Le lundi 04 juillet 2011 à 10:52 -0700, Gregory P. Smith a écrit : note that a fast lookup implies exact type and not subclass making my point silly... at which point you're back to iterating so I suspect supporting

Re: [Python-ideas] Allow isinstance second argument to be a set of types

2011-07-04 Thread Chris Rebert
On Mon, Jul 4, 2011 at 12:53 PM, MRAB wrote: > On 04/07/2011 20:41, Amaury Forgeot d'Arc wrote: >>> Le lundi 04 juillet 2011 à 10:52 -0700, Gregory P. Smith a écrit : note that a fast lookup implies exact type and not subclass making my point silly... at which point you're back to i

Re: Testing if a global is defined in a module

2011-07-04 Thread Tim Johnson
* rantingrick [110704 12:00]: > On Jul 4, 1:11 pm, Tim Johnson wrote: > > Well if you follow the python style guide (and most accepted styles > for global notation) then it's a trial exercise. You don't even have > to import anything!!! :) > > >>> GLOBAL_STR = 'str' > >>> GLOBAL_FLOAT = 1.3

Re: Testing if a global is defined in a module

2011-07-04 Thread Chris Rebert
On Mon, Jul 4, 2011 at 11:11 AM, Tim Johnson wrote: > Using Python 2.6 on ubuntu 10.04. > inspect module : > I want to 'inspect' a module and get a list of all > functions, classes and global variables in that module. You meant "first defined in" that module. > Example, for a module name `mvcInst

Re: Testing if a global is defined in a module

2011-07-04 Thread rantingrick
On Jul 4, 3:30 pm, Tim Johnson wrote: > >   Thanks for the reply: *but* >   dir() will also show globals from other modules imported >   by the target module. So I would need a way to distinguish between >   those imported and those defined in Okay, then do some processing on the source. You can

Re: Testing if a global is defined in a module

2011-07-04 Thread Tim Johnson
* Chris Rebert [110704 13:16]: > > > > What else can I do here? > > Look at the names in the module's import statements using the `ast` > module, and exclude those from the set of names defined in the module. > Won't work for `from foo import *`, but that's bad practice and should > be refactored

Re: Implicit initialization is EVIL!

2011-07-04 Thread Chris Angelico
On Tue, Jul 5, 2011 at 5:30 AM, rantingrick wrote: > Umm, if you want to see where things are "going" you should learn > about the inner workings of chrome which actually spawns a new process > for every tab created; which has the benefit of avoiding application > lock up when one page decides to

Re: Testing if a global is defined in a module

2011-07-04 Thread Tim Johnson
* rantingrick [110704 13:47]: > On Jul 4, 3:30 pm, Tim Johnson wrote: > > > >   Thanks for the reply: *but* > >   dir() will also show globals from other modules imported > >   by the target module. So I would need a way to distinguish between > >   those imported and those defined in > > Okay,

Re: Testing if a global is defined in a module

2011-07-04 Thread Steven D'Aprano
Tim Johnson wrote: > dir() will also show globals from other modules imported > by the target module. So I would need a way to distinguish between > those imported and those defined in Why would you want to do that? Importing *is* a definition in . Consider these two code snippets: #1 fr

Re: Testing if a global is defined in a module

2011-07-04 Thread Tim Johnson
* Steven D'Aprano [110704 15:18]: > > You are mistaken. TestAddresses is *not* a member of an imported module. It > is a member of the current module, which may or may not happen to point to > the same object as the other module as well. You are correct. I mispoke or misapplied. See my last post

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

2011-07-04 Thread Steven D'Aprano
rantingrick wrote: > On Jul 4, 12:06 am, alex23 wrote: >> rantingrick wrote: >> > But why must we have >> > completely different languages just for that those two approaches? >> >> Because monocultures die. > > That's an interesting statement Alex (even though you parrot it > constantly). So wh

Re: Problem!!

2011-07-04 Thread Steven D'Aprano
amir chaouki wrote: > the problem is when i use the seek function on windows it gives me > false results What do you mean "false results"? What does this even mean? Please show us: * what you do * what result you expect * what result you actually get -- Steven -- http://mail.python.org/m

Re: Testing if a global is defined in a module

2011-07-04 Thread Steven D'Aprano
Tim Johnson wrote: >> It seems to me that your approach here is unnecessarily complex and >> fragile. I don't know what problem you are trying to solve, but trying to >> solve it by intraspecting differences that aren't differences is surely >> the wrong way to do it. > See my last post... Yes

Re: Testing if a global is defined in a module

2011-07-04 Thread Tim Johnson
* Steven D'Aprano [110704 15:48]: > Tim Johnson wrote: > > >> It seems to me that your approach here is unnecessarily complex and > >> fragile. I don't know what problem you are trying to solve, but trying to > >> solve it by intraspecting differences that aren't differences is surely > >> the wr

Re: Anyone want to critique this program?

2011-07-04 Thread Ben Finney
Chris Angelico writes: > In this instance, I believe the OP was paragraphing his text. What is “paragraphing”? > Is there a convenient way to do that in a triple-quoted string? Did I answer this earlier in the thread (also at http://stackoverflow.com/questions/2504411/proper-indentation-for-py

Re: Testing if a global is defined in a module

2011-07-04 Thread Chris Angelico
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 / etc, or at least something in the same style? T

Re: Problem!!

2011-07-04 Thread Dan Stromberg
It turned out that switching to binary I/O made seek do what he was expecting. I'm guessing the transparent crlf to lf conversions in windows text I/O get seek() a bit perplexed, because it transparently changes the number of bytes. On Mon, Jul 4, 2011 at 4:30 PM, Steven D'Aprano < steve+comp.lan

Re: Anyone want to critique this program?

2011-07-04 Thread Chris Angelico
On Tue, Jul 5, 2011 at 10:03 AM, Ben Finney wrote: > Chris Angelico writes: > >> In this instance, I believe the OP was paragraphing his text. > > What is “paragraphing”? If you look at the original code, you'll see embedded newlines used to create multiple paragraphs. Hence, paragraphing as opp

Re: Testing if a global is defined in a module

2011-07-04 Thread Tim Johnson
* Chris Angelico [110704 16:19]: > 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 / e

Re: Problem!!

2011-07-04 Thread Dave Angel
On 01/-10/-28163 02:59 PM, 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. If you still care about this problem, you should take some of the other suggestio

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

2011-07-04 Thread alex23
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 change, some things that were once suitably fit

Re: Testing if a global is defined in a module

2011-07-04 Thread Ian Kelly
On Mon, Jul 4, 2011 at 6:01 PM, Tim Johnson wrote: >> Yes, but what are you actually *trying to do*? "Detecting data members" is >> not an end in itself. Why do you think you need to detect data members? > >  Steven, I'm building a documentation system. I have my own MVC framework >  and the goal

Re: from module import * using __import__?

2011-07-04 Thread Gabriel Genellina
En Sat, 02 Jul 2011 16:52:11 -0300, Dan Stromberg escribió: 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, I think I do have a good use for this: importing either pure python

Embedding a thin python

2011-07-04 Thread victor lucio
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 -- http://mail.python.org/mailman/listinfo/python-list