Archiving emails in Gmail

2010-06-15 Thread teja
Hi, I have a requirement that I want to log-in into a gmail account read all unread mails, mark them as read and then archive them. I am using libgmail (version 0.1.11) library to do so, using which I am able to log-in into a gmail account fetch all unread message and then read them one by one. No

Re: a +b ?

2010-06-15 Thread alex23
Ben Finney wrote: > No, it wasn't clear at all. That's why I asked, rather than making > assumptions. > > Thanks for clarifying. No problem. Thank you for another pleasant exchange. -- http://mail.python.org/mailman/listinfo/python-list

Re: File descriptor to file object

2010-06-15 Thread Gabriel Genellina
En Mon, 14 Jun 2010 11:57:20 -0300, Nathan Huesken escribió: tempfile.mkstemp returns a file name and a file descriptor (as returned by os.open). Can I somehow convert this descriptor to a file object? py> import os py> help(os.fdopen) Help on built-in function fdopen in module nt: fdopen(

Re: Community (A Modest Proposal)

2010-06-15 Thread Steven D'Aprano
On Mon, 14 Jun 2010 16:20:29 -0400, Terry Reedy wrote about IDLE: >> We are at once lucky to have a built in editor > > It is certainly a boon to someone like me who now only programs in > Python and had no experience, let alone commitment to any of the current > alternative. I know that lots

Re: Archiving emails in Gmail

2010-06-15 Thread Alf P. Steinbach
* teja, on 15.06.2010 09:03: Hi, I have a requirement that I want to log-in into a gmail account read all unread mails, mark them as read and then archive them. I am using libgmail (version 0.1.11) library to do so, using which I am able to log-in into a gmail account fetch all unread message an

Re: GUIs - A Modest Proposal

2010-06-15 Thread rantingrick
On Jun 15, 1:41 am, Stephen Hansen wrote: > On 6/14/10 9:08 PM, Stephen Hansen wrote: > > You're an *beep*. > > For the record, this was inappropriate. A moment's frustration after a > long day does not excuse belligerence, even if unnecessarily provoked. > > I apologize. No problem Stephen, as y

Re: newbie subprocess.Popen performance issues/questions

2010-06-15 Thread News123
Chris Seberino wrote: > I tried to use subprocess.Popen to make my web app do a bunch of stuff > in separate processes today. It appeared like only the first one > finished and/or the rest of the forked processes crashed. > First thing to do would be to show us a little code and to look for the e

Re: Community (A Modest Proposal)

2010-06-15 Thread James Mills
On Tue, Jun 15, 2010 at 5:30 PM, Steven D'Aprano wrote: > But other than that, I don't > see the advantage of an IDE. What am I missing? You're not missing anything my dear watson :) I myself use vim (as my editor) and 2-3 Terminals on virtual workspaces (in my DE). I guess the beauty with vim i

Re: First program

2010-06-15 Thread Gabriel Genellina
En Sat, 12 Jun 2010 06:03:43 -0300, Phil H escribió: Trying my hand with Python but have had a small hiccup. Reading 'A byte of Python' and created helloworld.py as directed. #!/usr/bin/python # filename : helloworld.py print 'Hello World' At the terminal prompt cd to the file location and r

Re: subprocess.Popen()/call() and appending file

2010-06-15 Thread hiral
On Jun 14, 7:11 pm, Kushal Kumaran wrote: > On Mon, Jun 14, 2010 at 7:01 PM,hiral wrote: > > Hi, > > > Do we have any facility to append file from Popen()/call(); see below > > example... > > > 1 import subprocess > > 2 f=open('log', 'w') > > 3 ...# writing some log-into into log file > > 4 p = su

Does MS Office need to be installed to use pywin32 for editing Excel docs?

2010-06-15 Thread Astley Le Jasper
I'm creating excel docs on the fly using XLWT. However, I need to include filters which I believe can only be done with pywin32. Does pywin32 use elements from Windows itself, or excel when dispatching? -- http://mail.python.org/mailman/listinfo/python-list

Re: Does MS Office need to be installed to use pywin32 for editing Excel docs?

2010-06-15 Thread Tim Golden
On 15/06/2010 09:32, Astley Le Jasper wrote: Does pywin32 use elements from Windows itself, or excel when dispatching? Yes: it's simply exposing to the Python user the API provided by MS Office (or whatever other app) via the IDispatch COM mechanism. IOW, if you don't have Microsoft Excel inst

Linking to a Python static library.

2010-06-15 Thread F van der Meeren
Hi, I am trying to figure out, what files to copy with my app so I am able to initialize the python runtime. Where can I find information about this? Thank you, Filip -- http://mail.python.org/mailman/listinfo/python-list

Re: Does MS Office need to be installed to use pywin32 for editing Excel docs?

2010-06-15 Thread Astley Le Jasper
On Jun 15, 10:44 am, Tim Golden wrote: > On 15/06/2010 09:32, Astley Le Jasper wrote: > > > Does pywin32 use elements from Windows itself, or excel when > > dispatching? > > Yes: it's simply exposing to the Python user the API provided > by MS Office (or whatever other app) via the IDispatch COM >

Re: Archiving emails in Gmail

2010-06-15 Thread teja
Ohh my bad... thanks a lot for replying Alf.. The error which I've pasted above, was thrown before I modified the code a bit.. Here's the error thrown on running the code I've pasted above.. there's not much of a difference in the error though. HTTP Error 500: Internal Server Error Traceback (m

biopython

2010-06-15 Thread madhuri vio
i am waiting for the reply as i am unable to proceed...;( -- madhuri :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Linking to a Python static library.

2010-06-15 Thread Thomas Jollans
On 06/15/2010 10:20 AM, F van der Meeren wrote: > Hi, > > I am trying to figure out, what files to copy with my app so I am able to > initialize the python runtime. > Where can I find information about this? You need to link with libpython. How you do this depends on the toolchain you're using.

Re: Archiving emails in Gmail

2010-06-15 Thread Thomas Jollans
On 06/15/2010 11:07 AM, teja wrote: > And there's a email library provided in Python (supports both POP and > SMTP) but I dont know whether it allows us to archive mails or mark > them as read for that matter. POP (the protocol) only allows downloading messages, AFAIK. SMTP is for sending. A more

[ANN] Robot Framework 2.5

2010-06-15 Thread Pekka Klärck
Hello, Robot Framework [1] is a generic open source test automation framework for acceptance testing and acceptance test driven development (ATDD). It has an easy-to-use tabular syntax for creating test cases and its testing capabilities can be extended by test libraries implemented either with Py

Re: First program

2010-06-15 Thread Phil Hansen
On Tue, 15 Jun 2010 04:53:52 -0300, Gabriel Genellina wrote: > Looks like you created helloworld.py on Windows, or using > Windows-oriented tools (perhaps a samba drive? ftp from a Windows disk?) > Windows text files end each line with the \r\n sequence (CR LF, bytes > 0x0D 0x0A, ^M^J). Unix (and L

Re: Community (A Modest Proposal)

2010-06-15 Thread Andreas Waldenburger
On Tue, 15 Jun 2010 17:45:43 +1000 James Mills wrote: > I myself use vim (as my editor) and 2-3 Terminals on virtual > workspaces (in my DE). I guess the beauty with vim is you just read > the line no. type it in and hit ^G > You mean just G (Shift+g), right? ^G (Ctrl+G) prints the file name and

Re: Community (A Modest Proposal)

2010-06-15 Thread Shashwat Anand
IDEs are seriously over-rated. Vim FTW. The only issue for beginners is they should know touch typing to fully utilize Vim and the initial curve is a bit high as compared to normal editors/IDEs. On Tue, Jun 15, 2010 at 4:16 PM, Andreas Waldenburger wrote: > On Tue, 15 Jun 2010 17:45:43 +1000 Jam

Re: GUIs - A Modest Proposal

2010-06-15 Thread Albert van der Horst
In article <80a7b823-6acb-4ac9-a273-525054265...@k25g2000prh.googlegroups.com>, ant wrote: > >My concern is simple: I think that Python is doomed to remain a minor >language unless we crack this problem. Capitalist fallacy: If I'm not a market leader, I'm a failure and my Mother will laugh at m

Re: a +b ?

2010-06-15 Thread alex23
Ben Finney wrote: > It should go without saying, but unfortunately the tenor of this forum > has been worsened (temporarily, I hope) by certain interminable threads > of late. So, to be clear: > > Thanks for clarifying that you were not expressing the attitude I > inferred. Ah, crap, I didn't see

Re: The Python Web Authoring and Application Pages

2010-06-15 Thread python
Travis, Great job - thanks for sharing your research! Note: you may want to add cherrypy.org to your framework page. This is an excellent, light weight, template agnostic framework. Turbogears runs on top of CherryPy. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

pythonize this!

2010-06-15 Thread superpollo
goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three consecutive + must be followed by two - (^ meaning ** in this context) my solution: >>> s = 0 >>> for i in range(1, 2011): ... s += i**2 ... if not (i+1)%5: ... s -= 2*i**2 ...

Re: pythonize this!

2010-06-15 Thread Xavier Ho
On 15 June 2010 21:49, superpollo wrote: > goal (from e.c.m.): evaluate > 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three > consecutive + must be followed by two - (^ meaning ** in this context) > Obligatory one-liner: >>> sum((1, 1, 1, -1, -1)[(x-1) % 5] * x**2 for x in x

Re: pythonize this!

2010-06-15 Thread Ulrich Eckhardt
superpollo wrote: > ... s += i**2 > ... if not (i+1)%5: > ... s -= 2*i**2 > ... if not i%5: > ... s -= 2*i**2 if not (i % 5) in [1, 2]: s += i**2 else: s -= i**2 Untested code. Uli -- Sator Laser GmbH Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR

Python Library Win7 -64 Bit

2010-06-15 Thread James Ravenscroft
Dear All, Before I start, I'm aware of how much of a nightmare MSys and MINGW are in comparison to UNIX/Linux environments, I'm a casual Ubuntu user myself and I wouldn't go near Windows if I didn't have to. I'm trying to install the Python LibXML2 extensions onto my 64 bit Cython 2.6 setup

Re: pythonize this!

2010-06-15 Thread Stefan Behnel
superpollo, 15.06.2010 13:49: goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three consecutive + must be followed by two - (^ meaning ** in this context) my solution: >>> s = 0 >>> for i in range(1, 2011): ... s += i**2 ... if not (i+1)%5: ... s -

Re: GUIs - A Modest Proposal

2010-06-15 Thread Mark Lawrence
On 15/06/2010 08:39, rantingrick wrote: On Jun 15, 1:41 am, Stephen Hansen wrote: On 6/14/10 9:08 PM, Stephen Hansen wrote: You're an *beep*. For the record, this was inappropriate. A moment's frustration after a long day does not excuse belligerence, even if unnecessarily provoked. I apolo

Re: pythonize this!

2010-06-15 Thread Alain Ketterlin
superpollo writes: > goal (from e.c.m.): evaluate > 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three > consecutive + must be followed by two - (^ meaning ** in this context) > > my solution: > s = 0 for i in range(1, 2011): > ... s += i**2 > ... if not (i+1)

Re: pythonize this!

2010-06-15 Thread superpollo
Ulrich Eckhardt ha scritto: superpollo wrote: ... s += i**2 ... if not (i+1)%5: ... s -= 2*i**2 ... if not i%5: ... s -= 2*i**2 if not (i % 5) in [1, 2]: s += i**2 else: s -= i**2 Untested code. does not work: >>> s = 0 >>> for i in range(1, 2011): ...

Re: a +b ?

2010-06-15 Thread Ben Finney
alex23 writes: > Ben Finney wrote: > > Thanks for clarifying that you were not expressing the attitude I > > inferred. > > Ah, crap, I didn't see this until now. I _did_ take the wrong meaning > from it and unfortunately replied accordingly :| So please take this > as a sincere apology (laced wi

Re: GUIs - A Modest Proposal

2010-06-15 Thread Gregory Ewing
Stephen Hansen wrote: unless I've been long mistaken in pack not having a proportional option. A combination of "fill/expand" and "anchor" do most of everything else, though, that wx's flags and alignment options. It's a while since I used tkinter, but if I recall correctly, the grid manager do

Re: pythonize this!

2010-06-15 Thread Jussi Piitulainen
superpollo writes: > goal (from e.c.m.): evaluate > 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three > consecutive + must be followed by two - (^ meaning ** in this context) > > my solution: > > >>> s = 0 > >>> for i in range(1, 2011): > ... s += i**2 > ... if not

Re: pythonize this!

2010-06-15 Thread Peter Otten
superpollo wrote: > goal (from e.c.m.): evaluate > 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three > consecutive + must be followed by two - (^ meaning ** in this context) >>> from itertools import cycle, izip >>> sum(sign*i*i for sign, i in izip(cycle([1]*3+[-1]*2), range(1

Different byte-code in same major version (2.6.x)?

2010-06-15 Thread Hartmut Goebel
Hi, I'm facing a curious problem: 2.6, 2.6.1 and 2.6.4 are generating different byte-code for the same source. I can not find the reason for. As you may know, I'm providing the 'decompyle' service as www.crazy-comnpilers.com. This service includes verification of the source against the original b

Re: pythonize this!

2010-06-15 Thread superpollo
Peter Otten ha scritto: superpollo wrote: goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three consecutive + must be followed by two - (^ meaning ** in this context) from itertools import cycle, izip sum(sign*i*i for sign, i in izip(cycle([1]*3+[

Re: pythonize this!

2010-06-15 Thread superpollo
superpollo ha scritto: Peter Otten ha scritto: superpollo wrote: goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three consecutive + must be followed by two - (^ meaning ** in this context) from itertools import cycle, izip sum(sign*i*i for sign,

Re: GUIs - A Modest Proposal

2010-06-15 Thread lkcl
On Jun 14, 9:00 pm, Stephen Hansen wrote: > On 6/14/10 1:00 PM, lkcl wrote: > >  what we typically recommend is that _even_ though you're going to run > > the application "desktop" - as pure python - you still use JSONRPC [or > > XmlHTTPRequest if JSONRPC is overkill].  so, _even_ though it's a >

Re: pythonize this!

2010-06-15 Thread Stefan Behnel
Stefan Behnel, 15.06.2010 14:23: superpollo, 15.06.2010 13:49: goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three consecutive + must be followed by two - (^ meaning ** in this context) my solution: >>> s = 0 >>> for i in range(1, 2011): ... s +=

Re: GUIs - A Modest Proposal

2010-06-15 Thread superpollo
lkcl ha scritto: ... That sounds too good to be true. yup, it does. how can one person, a free software developer, have come up with something like "The Holy Grail" of software development, right? when all the money in the world, from ibm, adobe, microsoft, google, nokia and so on _hasn't_ m

Re: pythonize this!

2010-06-15 Thread Xavier Ho
On 15 June 2010 22:55, superpollo wrote: > Peter Otten ha scritto: > > superpollo wrote: >> >> goal (from e.c.m.): evaluate >>> 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three >>> consecutive + must be followed by two - (^ meaning ** in this context) >>> >> >> from iterto

Re: pythonize this!

2010-06-15 Thread Andre Alexander Bell
On 06/15/2010 01:49 PM, superpollo wrote: > my solution: > > [...] > >>> print s > 536926141 Or, if you would like to use numpy: >>> import numpy >>> squares = numpy.arange(1, 2011, dtype=numpy.int)**2 >>> signs = numpy.ones(len(squares), dtype=numpy.int) >>> signs[3::5] = -1 >>> signs[4::5] = -1

Re: pythonize this!

2010-06-15 Thread Jean-Michel Pichavant
superpollo wrote: superpollo ha scritto: Peter Otten ha scritto: superpollo wrote: goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three consecutive + must be followed by two - (^ meaning ** in this context) from itertools import cycle, izip sum

Re: pythonize this!

2010-06-15 Thread Shashwat Anand
>>> sum(i*i*(-1)**((i % 5) / 4 + (i + 4) % 5 / 4) for i in range(1,2011)) 536926141 On Tue, Jun 15, 2010 at 6:25 PM, superpollo wrote: > superpollo ha scritto: > > Peter Otten ha scritto: >> >>> superpollo wrote: >>> >>> goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-1

Re: pythonize this!

2010-06-15 Thread Stefan Behnel
superpollo, 15.06.2010 14:55: Peter Otten ha scritto: superpollo wrote: goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three consecutive + must be followed by two - (^ meaning ** in this context) from itertools import cycle, izip sum(sign*i*i fo

Re: Community (A Modest Proposal)

2010-06-15 Thread Michael Torrie
On 06/15/2010 01:30 AM, Steven D'Aprano wrote: > I know that lots of people swear by IDEs, and back in Ancient Days I used > to use the THINK Pascal IDE on a Macintosh so I'm not hostile to the > idea. But in those days you could only run one app at a time, so you > needed an IDE or you'd go ins

Re: pythonize this!

2010-06-15 Thread superpollo
Stefan Behnel ha scritto: superpollo, 15.06.2010 14:55: Peter Otten ha scritto: superpollo wrote: goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three consecutive + must be followed by two - (^ meaning ** in this context) from itertools import

Re: pythonize this!

2010-06-15 Thread Peter Otten
Stefan Behnel wrote: > superpollo, 15.06.2010 14:55: >> Peter Otten ha scritto: >>> superpollo wrote: >>> goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three consecutive + must be followed by two - (^ meaning ** in this context) >>> >>>

Re: Community (A Modest Proposal)

2010-06-15 Thread Grant Edwards
On 2010-06-15, Steven D'Aprano wrote: > On Mon, 14 Jun 2010 16:20:29 -0400, Terry Reedy wrote about IDLE: > >>> We are at once lucky to have a built in editor >> >> It is certainly a boon to someone like me who now only programs in >> Python and had no experience, let alone commitment to any of

Re: Python Library Win7 -64 Bit

2010-06-15 Thread Thomas Jollans
On 06/15/2010 02:03 PM, James Ravenscroft wrote: > Dear All, > > Before I start, I'm aware of how much of a nightmare MSys and MINGW are > in comparison to UNIX/Linux environments, I'm a casual Ubuntu user > myself and I wouldn't go near Windows if I didn't have to. > > I'm trying to install the

Re: Archiving emails in Gmail

2010-06-15 Thread Grant Edwards
On 2010-06-15, teja wrote: > I have a requirement that I want to log-in into a gmail account read > all unread mails, mark them as read and then archive them. > I am using libgmail (version 0.1.11) library to do so, using which I > am able to log-in into a gmail account fetch all unread message a

Re: Different byte-code in same major version (2.6.x)?

2010-06-15 Thread Thomas Jollans
On 06/15/2010 02:54 PM, Hartmut Goebel wrote: > Hi, > > I'm facing a curious problem: 2.6, 2.6.1 and 2.6.4 are generating > different byte-code for the same source. I can not find the reason for. > > As you may know, I'm providing the 'decompyle' service as > www.crazy-comnpilers.com. This servic

Re: Archiving emails in Gmail

2010-06-15 Thread Tim Golden
On 15/06/2010 15:10, Grant Edwards wrote: On 2010-06-15, teja wrote: I have a requirement that I want to log-in into a gmail account read all unread mails, mark them as read and then archive them. I am using libgmail (version 0.1.11) library to do so, using which I am able to log-in into a gma

Re: newbie subprocess.Popen performance issues/questions

2010-06-15 Thread Chris Seberino
On Jun 15, 2:44 am, News123 wrote: > ChrisSeberinowrote: > > I tried to use subprocess.Popen to make my web app do a bunch of stuff > > in separate processes today.  It appeared like only the first one > > finished and/or the rest of the forked processes crashed. > First thing to do would be to s

Re: GUIs - A Modest Proposal

2010-06-15 Thread Steven D'Aprano
On Tue, 15 Jun 2010 05:57:13 -0700, lkcl wrote: > to be honest, if you don't put any effort in to use the appropriate > "lovely-prettiness" panels you can end up with something truly "90s- > esque". but with a little effort you can do round-edged lovely colour > tabs: >http://pyjs.org/exampl

Re: Archiving emails in Gmail

2010-06-15 Thread Grant Edwards
On 2010-06-15, Tim Golden wrote: > On 15/06/2010 15:10, Grant Edwards wrote: >> On 2010-06-15, teja wrote: >> >>> I have a requirement that I want to log-in into a gmail account read >>> all unread mails, mark them as read and then archive them. >>> I am using libgmail (version 0.1.11) library to

Re: Archiving emails in Gmail

2010-06-15 Thread Tim Golden
On 15/06/2010 16:15, Grant Edwards wrote: On 2010-06-15, Tim Golden wrote: On 15/06/2010 15:10, Grant Edwards wrote: On 2010-06-15, teja wrote: I have a requirement that I want to log-in into a gmail account read all unread mails, mark them as read and then archive them. I am using libgmai

logging = logging.getLogger(__name__)

2010-06-15 Thread genkuro
Newbie here. I may be missing something obvious, in which case, please feel free to berate and laugh at me. Here's a dubious line of code: logging = logging.getLogger(__name__) How can I refer to the original logging package "logging" after this statement is run? Specifically, I'm trying to add

Re: Is there any module/utility like 'rsync' in python

2010-06-15 Thread Jonathan Fine
hiral wrote: Hi, Is there any module/utility like 'rsync' in python. Thank you in advance. Not exactly what you asked for, but Mercurial provides a Python interface. You might find this URL a good starting point: http://mercurial.selenic.com/wiki/MercurialApi -- Jonathan -- http://mail

Re: logging = logging.getLogger(__name__)

2010-06-15 Thread Mark Lawrence
On 15/06/2010 16:35, genkuro wrote: Newbie here. I may be missing something obvious, in which case, please feel free to berate and laugh at me. Here's a dubious line of code: logging = logging.getLogger(__name__) How can I refer to the original logging package "logging" after this statement is

Re: logging = logging.getLogger(__name__)

2010-06-15 Thread Peter Otten
genkuro wrote: > Newbie here. I may be missing something obvious, in which case, > please feel free to berate and laugh at me. > > Here's a dubious line of code: > logging = logging.getLogger(__name__) Dubious indeed. As a workaround you can import the module again, preferably under another na

Re: Is there any module/utility like 'rsync' in python

2010-06-15 Thread Paul Rudin
Jonathan Fine writes: > hiral wrote: >> Hi, >> >> Is there any module/utility like 'rsync' in python. >> >> Thank you in advance. > > Not exactly what you asked for, but Mercurial provides a Python > interface. You might find this URL a good starting point: >http://mercurial.selenic.com/wiki

Re: logging = logging.getLogger(__name__)

2010-06-15 Thread Paul Rudin
Peter Otten <__pete...@web.de> writes: > genkuro wrote: > >> Newbie here. I may be missing something obvious, in which case, >> please feel free to berate and laugh at me. >> >> Here's a dubious line of code: >> logging = logging.getLogger(__name__) > > Dubious indeed. As a workaround you can im

Re: logging = logging.getLogger(__name__)

2010-06-15 Thread genkuro
On Jun 15, 8:49 am, Mark Lawrence wrote: > On 15/06/2010 16:35, genkuro wrote: > > > Newbie here.  I may be missing something obvious, in which case, > > please feel free to berate and laugh at me. > > > Here's a dubious line of code: > > logging = logging.getLogger(__name__) > > > How can I refer

Re: logging = logging.getLogger(__name__)

2010-06-15 Thread Dave Angel
genkuro wrote: Newbie here. I may be missing something obvious, in which case, please feel free to berate and laugh at me. Here's a dubious line of code: logging = logging.getLogger(__name__) How can I refer to the original logging package "logging" after this statement is run? Specifically,

Re: Community (A Modest Proposal)

2010-06-15 Thread geremy condra
On Tue, Jun 15, 2010 at 7:08 AM, Shashwat Anand wrote: > IDEs are seriously over-rated. > Vim FTW. > The only issue for beginners is they should know touch typing to fully > utilize Vim and the initial curve is a bit high as compared to normal > editors/IDEs. Used to be vim-only. Then I got to kn

Re: logging = logging.getLogger(__name__)

2010-06-15 Thread Jean-Michel Pichavant
genkuro wrote: On Jun 15, 8:49 am, Mark Lawrence wrote: On 15/06/2010 16:35, genkuro wrote: Newbie here. I may be missing something obvious, in which case, please feel free to berate and laugh at me. Here's a dubious line of code: logging = logging.getLogger(__name__)

Re: logging = logging.getLogger(__name__)

2010-06-15 Thread Mark Lawrence
On 15/06/2010 17:03, genkuro wrote: On Jun 15, 8:49 am, Mark Lawrence wrote: On 15/06/2010 16:35, genkuro wrote: Newbie here. I may be missing something obvious, in which case, please feel free to berate and laugh at me. Here's a dubious line of code: logging = logging.getLogger(__name__)

Re: logging = logging.getLogger(__name__)

2010-06-15 Thread Stephen Hansen
On 6/15/10 9:03 AM, genkuro wrote: > I'm coming to Python from Java. I'm still getting a feel for scoping > limits. For the sake of curiosity, is there another way to refer to a > package besides name? The only way to refer to anything is by its name -- or, from a name and through subscript/dot

Re: pythonize this!

2010-06-15 Thread Ian Kelly
On Tue, Jun 15, 2010 at 6:21 AM, Alain Ketterlin wrote: > You compute i**2 too many times (7/5 times more than necessary) and > twice too many modulos. I suggest: > > c = { 0:1, 1:1, 2:1, 3:-1, 4:-1 } > #or, why not: c = lambda i : +1 if (i%5) < 3 else -1 > > s = 0 > for i in range(1,2011): >    s

Re: setprocname

2010-06-15 Thread Roel Schroeven
Op 2010-06-14 22:00, John Nagle schreef: > There's a way to do this in Windows. Look in Task Manager, > with a browser running, and the description for each Firefox > instance will show the page being displayed. Are you sure? I only see that on the Applications tab, which shows window titles;

Re: Will and Abe's "Guide to Pyjamas"

2010-06-15 Thread Stef Mientki
On 14-06-2010 17:53, lkcl wrote: >> oh look - there's a common theme, there: "web technology equals >> useless" :) >> > this is getting sufficiently ridiculous, i thought it best to > summarise the discussions of the past few days, from the perspective > of four-year-olds: > > http://pyjs.org

Re: pythonize this!

2010-06-15 Thread Paul Rubin
superpollo writes: > goal (from e.c.m.): evaluate > 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three > consecutive + must be followed by two - (^ meaning ** in this context) print sum([-1,1,1,1,-1][i%5]*i**2 for i in xrange(1,2011)) -- http://mail.python.org/mailman/listinfo

Re: Different byte-code in same major version (2.6.x)?

2010-06-15 Thread Paul Rubin
Hartmut Goebel writes: > I'm facing a curious problem: 2.6, 2.6.1 and 2.6.4 are generating > different byte-code for the same source. I can not find the reason for. Why should they generate the same bytecode? All that you should expect is that the same bytecode should be runnable on all three in

Re: pythonize this!

2010-06-15 Thread superpollo
Paul Rubin ha scritto: superpollo writes: goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-10^2+...-2010^2, where each three consecutive + must be followed by two - (^ meaning ** in this context) print sum([-1,1,1,1,-1][i%5]*i**2 for i in xrange(1,2011)) beautiful. thx -- h

Possible to make subprocess.Popen jobs run serially rather than in parallel?

2010-06-15 Thread Chris Seberino
Possible to make subprocess.Popen jobs run serially rather than in parallel? In other words, if a computer is low on memory and doesn't mind waiting.can Popen be configured to submit to a queue and run jobs *ONE AT TIME*?? That might be useful and avoid crashes and disk swapping. cs -- http

Re: Python Library Win7 -64 Bit

2010-06-15 Thread Martin v. Loewis
Has anyone had any prior experience with this sort of problem or can anyone point me in the right direction? My recommendation is to install the 32-bit version of Python, and use precompiled binaries of libxml. Failing that, install Visual Studio Express (or Visual Studio proper), and compile l

Re: Possible to make subprocess.Popen jobs run serially rather than in parallel?

2010-06-15 Thread Stephen Hansen
On 6/15/10 11:52 AM, Chris Seberino wrote: > Possible to make subprocess.Popen jobs run serially rather than in > parallel? > > In other words, if a computer is low on memory and doesn't mind > waiting.can Popen be configured to submit to a queue and run jobs > *ONE AT TIME*?? > > That might

Re: Python OpenSSL library

2010-06-15 Thread John Nagle
On 6/14/2010 11:58 AM, geremy condra wrote: On Mon, Jun 14, 2010 at 11:47 AM, Nobody wrote: On Mon, 14 Jun 2010 10:43:02 -0700, John Nagle wrote: The new SSL module in Python 2.6 There isn't an SSL module in Python 2.6. There is a module named "ssl" which pretends to implement SSL, but

Readability (html purifier) in Python

2010-06-15 Thread Дамјан Георгиевски
http://lab.arc90.com/experiments/readability/ Readability is a javascript bookmarklet that "makes reading on the Web more enjoyable by removing the clutter around what you're reading." Does anyone know of something similar in Python? -- дамјан ((( http://damjan.softver.org.mk/ ))) "Debug

Re: Readability (html purifier) in Python

2010-06-15 Thread Stefan Behnel
Дамјан Георгиевски, 15.06.2010 17:44: http://lab.arc90.com/experiments/readability/ Readability is a javascript bookmarklet that "makes reading on the Web more enjoyable by removing the clutter around what you're reading." Does anyone know of something similar in Python? Well, that sounds lik

Re: Python OpenSSL library

2010-06-15 Thread Antoine Pitrou
On Mon, 14 Jun 2010 19:47:49 +0100 Nobody wrote: > On Mon, 14 Jun 2010 10:43:02 -0700, John Nagle wrote: > > > The new SSL module in Python 2.6 > > There isn't an SSL module in Python 2.6. There is a module named "ssl" > which pretends to implement SSL, but in fact doesn't. What do you mean

Introducing - Pyaudiogen

2010-06-15 Thread Thomas Jollans
Hello list, Here's a little Python toy I've been hacking on, as I thought it might amuse some of you. [1] Python 3.1+ (not sure about 3.0) It's a package called 'audiogen' which includes bindings to libao for portable audio output and some functions/classes/... for generating audio. It grew from

Re: Python OpenSSL library

2010-06-15 Thread geremy condra
On Tue, Jun 15, 2010 at 1:27 PM, Antoine Pitrou wrote: > On Mon, 14 Jun 2010 19:47:49 +0100 > Nobody wrote: >> On Mon, 14 Jun 2010 10:43:02 -0700, John Nagle wrote: >> >> >     The new SSL module in Python 2.6 >> >> There isn't an SSL module in Python 2.6. There is a module named "ssl" >> which p

Re: Python OpenSSL library

2010-06-15 Thread Antoine Pitrou
Hello, > He's describing the lack of hostname checking, discussed here[0], > here[1], and in my pycon lightning talk last year, wherever those > are kept. Ok, thank you. I have tried to put some effort into the py3k ssl docs, so that security issues get mentioned: http://docs.python.org/dev/py3k

Can code objects outlive the interpreter that created them?

2010-06-15 Thread Andy Jost
Hi, I'm working on an application program that embeds Python using the C-API. Sometimes, I need to call functions written in pure Python from the C code, so I use Py_CompileString and PyEval_EvalCode. I would like to avoid compiling the same code over and over by storing the result of Py_Compi

Re: Python OpenSSL library

2010-06-15 Thread geremy condra
On Tue, Jun 15, 2010 at 1:57 PM, Antoine Pitrou wrote: > > Hello, > >> He's describing the lack of hostname checking, discussed here[0], >> here[1], and in my pycon lightning talk last year, wherever those >> are kept. > > Ok, thank you. > I have tried to put some effort into the py3k ssl docs, so

Re: Can code objects outlive the interpreter that created them?

2010-06-15 Thread Thomas Jollans
On 06/15/2010 10:51 PM, Andy Jost wrote: > Hi, > > > > I’m working on an application program that embeds Python using the > C-API. Sometimes, I need to call functions written in pure Python from > the C code, so I use Py_CompileString and PyEval_EvalCode. I'd recommend putting your Python code

Re: Python OpenSSL library

2010-06-15 Thread Antoine Pitrou
On Tue, 15 Jun 2010 14:14:08 -0700 geremy condra wrote: > > > > Ok, thank you. > > I have tried to put some effort into the py3k ssl docs, so that security > > issues get mentioned: > > http://docs.python.org/dev/py3k/library/ssl.html#security-considerations > > Any improvement or correction is we

Re: configuration setting for python server

2010-06-15 Thread David Zaslavsky
On Monday 14 June 2010 11:29:35 pm shanti bhushan wrote: > do we have some configuration file for python server?? No. As people have explained in reply to your other messages, Python's BaseHTTPServer does not use any configuration files. If you want a web server which uses a configuration file,

Re: Python OpenSSL library

2010-06-15 Thread Nobody
On Tue, 15 Jun 2010 22:57:24 +0200, Antoine Pitrou wrote: > Also, following issue1589 (certificate hostname checking), I think it > would be useful at least to provide the necessary helper functions in > order to check certificate conformity, even if they aren't called > implicitly. I would encour

Python Tkinter Linux Repair Question/ Python TCP Socket Example

2010-06-15 Thread My Python
I got to target my little GUI app that uses TCP sockets in Python 2.4.4 for Windows and Linux. Question 1 = Given the above, I installed 2.4.4 on Windows 7 and Tkinter import works like a charm. (the install is good) The Linux (Red Hat 4.1.2-46) though has python preinstalled with ver 2.

Re: setprocname

2010-06-15 Thread John Nagle
On 6/15/2010 9:27 AM, Roel Schroeven wrote: Op 2010-06-14 22:00, John Nagle schreef: There's a way to do this in Windows. Look in Task Manager, with a browser running, and the description for each Firefox instance will show the page being displayed. Are you sure? I only see that on the A

Re: Python Tkinter Linux Repair Question/ Python TCP Socket Example

2010-06-15 Thread Thomas Jollans
On 06/15/2010 11:35 PM, My Python wrote: > I got to target my little GUI app that uses TCP sockets in Python > 2.4.4 for Windows and Linux. > > > Question 1 > = > Given the above, I installed 2.4.4 on Windows 7 and Tkinter import > works like a charm. (the install is good) > > The Linux

INCONTROVERTIBLE PROOF of the Incompetence of FBI

2010-06-15 Thread nanothermite911fbibustards
This is all due to DISINFORMATION - FBI bustards are the cause of it. The prime suspect of ANTHRAX is beyond doubt a white or jew (american or israeli) and one name is Zack who worked at AIMES Iowa. The 911 is also a jew job or white job. If this bustard were knowledgeable, he would be hunting for

Scope (?) question

2010-06-15 Thread Peter
I am puzzled by what appears to be a scope issue - obviously I have something wrong :-) Why does this work: if __name__ == 'main': execfile('test-data.py') print data and yet this doesn't (I get "NameError: global name 'data' not defined"): def X(): execfile('test-data.py') print data

Re: Python Tkinter Linux Repair Question/ Python TCP Socket Example

2010-06-15 Thread Grant Edwards
On 2010-06-15, My Python wrote: > Question 2 > > Can some one post a URL (or a sample module itself) that shows how to > write basic TCP socket application? http://docs.python.org/library/socket.html#example http://docs.python.org/library/asyncore.html http://twistedmatrix.com/trac/ >

  1   2   >