Trelby (was: Any other screenwriters?)

2013-03-09 Thread W. Martin Borgert
On 2013-03-08 13:07, Rick Dooling wrote: > However, most of these programs are "apps" with closed GUIs, and of course > I'm looking for a way to do the same thing with Python and call it from the > command-line or from within Vim You should consider taking a look at Trelby. It is free software (

Re: IMAP4_SSL and OpenSSL compatibility

2013-02-26 Thread W. Martin Borgert
Quoting "Antoine Pitrou" : W. Martin Borgert debian.org> writes: When I add an ssl_version argument to the call to ssl.wrap_socket() in imaplib.IMAP4_SSL.open(), I can connect to the Exchange server without problems: self.sslobj = ssl.wrap_socket(self.sock, self.keyfile,

IMAP4_SSL and OpenSSL compatibility

2013-02-25 Thread W. Martin Borgert
Hi, after an upgrade from Debian squeeze to Debian wheezy, I could not connect to a Microsoft Exchange Server 2003 anymore, because the OpenSSL library, Python is linked with, changed from version 0.9.8o to 1.0.1e, which has different defaults. The code is: >>> import imaplib >>> IMAP4_SSL("192.1

Re: How to dump a Python 2.6 dictionary with UTF-8 strings?

2011-01-11 Thread W. Martin Borgert
On 2011-01-12 00:27, Martin v. Loewis wrote: > This will work. I doubt you can get it much simpler > in 2.x; in 3.x, your code will work out of the box > (with proper syntactical adjustments). Thanks, this works like a charm. I tried pprint before for this task and failed. Now I know why :~) -- h

How to dump a Python 2.6 dictionary with UTF-8 strings?

2011-01-11 Thread W. Martin Borgert
Hi, naively, I thought the following code: #!/usr/bin/env python2.6 # -*- coding: utf-8 -*- import codecs d = { u'key': u'我爱中国人' } if __name__ == "__main__": with codecs.open("ilike.txt", "w", "utf-8") as f: print >>f, d would produce a file ilike.txt like this: {u'key': u'我爱中国人'}

Re: Use eval() safely?

2010-02-28 Thread W. Martin Borgert
Gregory Ewing wrote: > I posted a demonstration of this earlier in this thread. As you wrote, your example does not work when using eval() like in my original post with second and third parameter to eval(): >>> import math >>> eval("[c for c in (0).__class__.__bases__[0].__subclasses__() if c.__n

Use eval() safely?

2010-02-21 Thread W. Martin Borgert
Hi, I know that this issue has been discussed before, but most of the time using only one argument to eval(). Is it possible to use the following code, e.g. run as part of a web application, to break in and if so, how? import math def myeval(untrustedinput): return eval(untrustedinput, {"__

Re: web application for scientific puposes

2009-04-02 Thread W. Martin Borgert
On 2009-04-02 11:30, Saurabh Kabra wrote: > Can you guys recommend packages or > combination of packages for such an application. Apache + mod_wsgi + Django + matplotlib. -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross platform installer builder for Python? (like IzPack for Java)

2009-03-29 Thread W. Martin Borgert
Hola Gabriel: On 2009-03-25 19:19, Gabriel Genellina wrote: > To distribute complete applications, py2exe + InnoSetup (Windows). That's the point: IzPack (Java) creates installers, that work at least on Windows and Linux, create menu entries in Windows and Gnome/KDE etc. Only one .jar file to dis

Iterating over readlines() and map()

2009-03-25 Thread W. Martin Borgert
Hi, if I understand correctly, this code would not read the complete file into the memory: for line in myfile.readlines(): dosomethingwith(line) Is this also true for this code? for line in map(myfunction, myfile.readlines()): dosomethingwith(line) Or would use of map() mean, that the

Re: Iterating over readlines() and map()

2009-03-25 Thread W. Martin Borgert
On 2009-03-26 01:41, Christian Heimes wrote: > No, you are wrong. file.readlines() reads the entire file into memory > and returns a list of strings. If you want to iterate over the lines of > a text file you can simply write: > > for line in myfile: > dosomethingwith(line) > > It won't work fo

Re: Iterating over readlines() and map()

2009-03-25 Thread W. Martin Borgert
(Resend, because of funny error message: > Your mail to 'Python-list' with the subject > Iterating over readlines() and map() > Is being held until the list moderator can review it for approval. Whatever this means.) Hi, if I understand correctly, this code would not read the complete file in

Cross platform installer builder for Python? (like IzPack for Java)

2009-03-25 Thread W. Martin Borgert
Hi, I'm looking for an installer builder similar to IzPack (which is based on Java). Isn't there anything like that in the Python world? Extra points, if GTK+ or wxWindows is used... TIA! -- http://mail.python.org/mailman/listinfo/python-list