META email [was Re: Getting data out of Mozilla Thunderbird with Python?]

2015-12-08 Thread Steven D'Aprano
On Wednesday 09 December 2015 05:42, Thomas 'PointedEars' Lahn wrote: [snip] Thomas, your sig says: Please do not cc me. / Bitte keine Kopien per E-Mail. but you have a Reply-To set. That implies that you want replies to be sent directly to you by email, not to the list or newsgroup. Is th

Shadowing built-ins [was Re: filter a list of strings]

2015-12-08 Thread Steven D'Aprano
On Wednesday 09 December 2015 09:58, Thomas 'PointedEars' Lahn wrote: > Mark Lawrence wrote: > >> On 03/12/2015 01:15, c.bu...@posteo.jp wrote: >>> I would like to know how this could be done more elegant/pythonic. >>> >>> I have a big list (over 10.000 items) with strings (each 100 to 300 >>> ch

Re: storing test logs under /var/log/

2015-12-08 Thread Ganesh Pal
> Wrong question; if you want to use sys.exit() in a way similar to C display > the error message first and invoke sys.exit() afterwards with a numerical > argument. > > -- oh ok , got it thanks :) -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting data out of Mozilla Thunderbird with Python?

2015-12-08 Thread Cameron Simpson
On 08Dec2015 12:21, Anthony Papillion wrote: I have a TON of email (years) stored in my Thunderbird. [...] I've been thinking about bringing Python into the mix to build a bridge between Thunderbird and SQLite or MySQL (probably sqlite) where all mail would be backed up to a database where I cou

Re: storing test logs under /var/log/

2015-12-08 Thread Cameron Simpson
On 08Dec2015 13:24, Peter Otten <__pete...@web.de> wrote: Ganesh Pal wrote: [Cameron Simpson:] Finally. sys.exit accepts an integer, not a string. Most of code uses sys.exit("some error message") , I did notice that the error message is not displayed by sys .exit("some error message") ,

Re: Accessing container's methods

2015-12-08 Thread Chris Angelico
On Wed, Dec 9, 2015 at 10:41 AM, Ian Kelly wrote: > On Tue, Dec 8, 2015 at 3:37 PM, Erik wrote: >> On 08/12/15 19:02, Thomas 'PointedEars' Lahn wrote: >>> >>> Erik wrote: >>> >>> Please fix, Erik #75656. >> >> >> Fixed(*) > > [SNIP] > >> (*) In the sense that it's not going to change ;) > >

Re: Accessing container's methods

2015-12-08 Thread Ian Kelly
On Tue, Dec 8, 2015 at 3:37 PM, Erik wrote: > On 08/12/15 19:02, Thomas 'PointedEars' Lahn wrote: >> >> Erik wrote: >> >> Please fix, Erik #75656. > > > Fixed(*) [SNIP] > (*) In the sense that it's not going to change ;) Then I think you mean "Working as Intended", not "Fixed". B-) -- ht

Re: Accessing container's methods

2015-12-08 Thread Mark Lawrence
On 08/12/2015 22:52, Thomas 'PointedEars' Lahn wrote: Mark Lawrence wrote: On 08/12/2015 19:02, Thomas 'PointedEars' Lahn wrote: Erik wrote: Please fix, Erik #75656. Please fix what? You are not ready for the answer yet. I'll be all pointed ears when you actually manage to provide

Re: filter a list of strings

2015-12-08 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > On 03/12/2015 01:15, c.bu...@posteo.jp wrote: >> I would like to know how this could be done more elegant/pythonic. >> >> I have a big list (over 10.000 items) with strings (each 100 to 300 >> chars long) and want to filter them. >> >> list = . >> […] > > targets = ['Ba

Re: Accessing container's methods

2015-12-08 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > On 08/12/2015 19:02, Thomas 'PointedEars' Lahn wrote: >> Erik wrote: >> >> Please fix, Erik #75656. > > Please fix what? You are not ready for the answer yet. -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte keine Kopien per E-Mail. -- https://ma

Re: Accessing container's methods

2015-12-08 Thread Thomas 'PointedEars' Lahn
Vincent Vande Vyvre wrote: > Le 08/12/2015 20:02, Thomas 'PointedEars' Lahn a écrit : >> Erik wrote: >>> Amongst other things, you can't put the object into multiple containers >> You can. Quickhack: ^ >> class Child: >> self._parents = [] >> >> def add_to_parent (s

Re: Accessing container's methods

2015-12-08 Thread Erik
Annoyingly, there seemed to be no responses to the original question when I wrote that and then shortly after, I saw all the others (and we all pretty much said the same thing - so I'm not sure why I was singled out for special attention ;)). On 08/12/15 19:02, Thomas 'PointedEars' Lahn wrote:

Re: Getting data out of Mozilla Thunderbird with Python?

2015-12-08 Thread Mark Lawrence
On 08/12/2015 18:42, Thomas 'PointedEars' Lahn wrote: Anthony Papillion wrote: -BEGIN PGP SIGNED MESSAGE- Please don’t do that again. Says who? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail

Re: Accessing container's methods

2015-12-08 Thread Mark Lawrence
On 08/12/2015 19:02, Thomas 'PointedEars' Lahn wrote: Erik wrote: Please fix, Erik #75656. Please fix what? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Accessing container's methods

2015-12-08 Thread Vincent Vande Vyvre
Le 08/12/2015 20:02, Thomas 'PointedEars' Lahn a écrit : Erik wrote: Please fix, Erik #75656. On 07/12/15 18:10, Tony van der Hoff wrote: A highly contrived example, where I'm setting up an outer class in a Has-a relationship, containing a number of Actors. The inner class needs to access

Re: Accessing container's methods

2015-12-08 Thread Thomas 'PointedEars' Lahn
Erik wrote: Please fix, Erik #75656. > On 07/12/15 18:10, Tony van der Hoff wrote: >> A highly contrived example, where I'm setting up an outer class in a >> Has-a relationship, containing a number of Actors. The inner class needs >> to access a method of the outer class; here the method get_

Re: Getting data out of Mozilla Thunderbird with Python?

2015-12-08 Thread Thomas 'PointedEars' Lahn
Anthony Papillion wrote: > -BEGIN PGP SIGNED MESSAGE- Please don’t do that again. > I have a TON of email (years) stored in my Thunderbird. My backup > strategy for the last few years has been to periodically dump it all > in a tar file, encrypt that tar file, and move it up to the cloud

Getting data out of Mozilla Thunderbird with Python?

2015-12-08 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello Everyone, I have a TON of email (years) stored in my Thunderbird. My backup strategy for the last few years has been to periodically dump it all in a tar file, encrypt that tar file, and move it up to the cloud. That way, if my machine ever cr

Re: manually build a unittest/doctest object.

2015-12-08 Thread Peter Otten
Vincent Davis wrote: > On Tue, Dec 8, 2015 at 2:06 AM, Peter Otten <__pete...@web.de> wrote: > >> >>> import doctest >> >>> example = doctest.Example( >> ... "print('hello world')\n", >> ... want="hello world\n") >> >>> test = doctest.DocTest([example], {}, None, None, None, None) >> >>>

Re: Problem

2015-12-08 Thread Laura Creighton
In a message of Tue, 08 Dec 2015 16:11:53 +0100, Fabien writes: >On 12/08/2015 04:03 PM, Namrah Anwar wrote: >> Dear Administration, >> >> I am Namrah Anwar writing to you from Pakistan. I downloaded Python version >> 3.5.1 and 2.7 and after installation at first, upon opening again it asked >(snip

Re: Problem

2015-12-08 Thread Fabien
On 12/08/2015 04:03 PM, Namrah Anwar wrote: Dear Administration, I am Namrah Anwar writing to you from Pakistan. I downloaded Python version 3.5.1 and 2.7 and after installation at first, upon opening again it asked (snip) -- *Regards,Namrah Anwar* *PhD Student (Fellowship) - Cancer Biology -

Can one use Python 3.4 lzma library to initialize file_reader for a 7z file?

2015-12-08 Thread Anmol Dalmia
Hello all. I am trying to read lines from a compressed xml file in a 7z format contained archive. The native lzma library of Python 3.4 allows to do so, but I am not sure it does so for 7z files. I explored many threads and found very unsatisfactory answers such as this one. https://groups.goo

Re: Problem

2015-12-08 Thread Laura Creighton
In a message of Tue, 08 Dec 2015 20:03:27 +0500, Namrah Anwar writes: >Dear Administration, > >I am Namrah Anwar writing to you from Pakistan. I downloaded Python version >3.5.1 and 2.7 and after installation at first, upon opening again it asked >for Modify, repair or uninstall options. I tried to

Problem

2015-12-08 Thread Namrah Anwar
Dear Administration, I am Namrah Anwar writing to you from Pakistan. I downloaded Python version 3.5.1 and 2.7 and after installation at first, upon opening again it asked for Modify, repair or uninstall options. I tried to fix it but could not. Can you please help me out how to fix this and why i

Re: Help on for loop understanding

2015-12-08 Thread Robert
On Monday, December 7, 2015 at 10:24:09 PM UTC-5, Chris Angelico wrote: > On Tue, Dec 8, 2015 at 1:36 PM, Erik wrote: > > So, you can write your class's iterator to do anything that makes sense when > > someone says "for i in myclassinstance:". > > > > If your class is a subclass of a class ("is-a

Re: manually build a unittest/doctest object.

2015-12-08 Thread Vincent Davis
On Tue, Dec 8, 2015 at 7:30 AM, Laura Creighton wrote: > >-- > >https://mail.python.org/mailman/listinfo/python-list > > Check out this: > https://pypi.python.org/pypi/pytest-ipynb > ​Thanks Laura, I think I read the descript as saying I could run untittests on source code from a jupyter noteboo

Re: manually build a unittest/doctest object.

2015-12-08 Thread Vincent Davis
On Tue, Dec 8, 2015 at 2:06 AM, Peter Otten <__pete...@web.de> wrote: > >>> import doctest > >>> example = doctest.Example( > ... "print('hello world')\n", > ... want="hello world\n") > >>> test = doctest.DocTest([example], {}, None, None, None, None) > >>> runner = doctest.DocTestRunner(v

Re: manually build a unittest/doctest object.

2015-12-08 Thread Laura Creighton
In a message of Tue, 08 Dec 2015 07:04:39 -0700, Vincent Davis writes: >On Tue, Dec 8, 2015 at 2:06 AM, Peter Otten <__pete...@web.de> wrote: > >> But why would you want to do that? > > >Thanks Peter, I want to do that because I want to test jupyter notebooks. >​The notebook is in JSON and I can ge

Re: manually build a unittest/doctest object.

2015-12-08 Thread Chris Angelico
On Wed, Dec 9, 2015 at 1:04 AM, Vincent Davis wrote: > I also tried something like: > assert exec("""print('hello word')""") == 'hello word' I'm pretty sure exec() always returns None. If you want this to work, you would need to capture sys.stdout into a string: import io import contextlib outpu

Re: Is Python a good choice for a data logger?

2015-12-08 Thread Chris Angelico
On Wed, Dec 9, 2015 at 12:30 AM, wrote: > Is Python a good choice for the following: > > 1) The data-loggers to pole data and/or receive data from the UDP devices and > send the data to the server? > > 2) The daemon/application running on the server which receives the data from > the data-logge

Re: manually build a unittest/doctest object.

2015-12-08 Thread Vincent Davis
On Tue, Dec 8, 2015 at 2:06 AM, Peter Otten <__pete...@web.de> wrote: > But why would you want to do that? Thanks Peter, I want to do that because I want to test jupyter notebooks. ​The notebook is in JSON and I can get the source and result out but it was unclear to me how to stick this into a

Re: Accessing container's methods [solved]

2015-12-08 Thread Tony van der Hoff
Hum, sorry about the empty reply; just finger trouble! Anyway I wasn't expecting such a great response; thanks to all. On 07/12/15 23:47, Erik wrote: [snip] As you can't sensibly put the object into more than one container at a time anyway, then you can pass the container object to the Actor o

Is Python a good choice for a data logger?

2015-12-08 Thread villascape
Let's say there are multiple data-loggers (PCs probably running Linux) behind various firewalls which communicate to other devices on their respective LAN via a proprietary protocol using UDP/IP to collect data. On perhaps a sixty second periodic basis, the data-loggers will send the data to a

Re: Python Script - Windows Task Scheduler - Logging

2015-12-08 Thread Laura Creighton
In a message of Mon, 07 Dec 2015 23:53:10 +, Raheel Rao writes: >Hello there,I created a python script that connects to an ftp and downloads >files to a specifed folder and logs each event in a log file. This script >works perfectly fine as i want it to however when i put this in a task >sch

Re[2]: Packages installing problem

2015-12-08 Thread lalith
Thank for reply.. some packages does not exist for windows. Thanks, Lalith. -- Original Message -- From: "Laura Creighton" To: "lalith" Cc: python-list@python.org; l...@openend.se Sent: 12/7/2015 9:21:19 PM Subject: Re: Packages installing problem In a message of Mon, 07 Dec 2015 00:

Python Script - Windows Task Scheduler - Logging

2015-12-08 Thread Raheel Rao
Hello there,I created a python script that connects to an ftp and downloads files to a specifed folder and logs each event in a log file. This script works perfectly fine as i want it to however when i put this in a task scheduler, the script runs and downloads the file just fine except that the

ANN: eGenix pyOpenSSL Distribution 0.13.12

2015-12-08 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com pyOpenSSL Distribution Version 0.13.12 An easy-to-install and easy-to-use distribution of the pyOpenSSL Python interface for OpenS

Re: Accessing container's methods

2015-12-08 Thread Tony van der Hoff
On 07/12/15 23:47, Erik wrote: Hi Tony, On 07/12/15 18:10, Tony van der Hoff wrote: A highly contrived example, where I'm setting up an outer class in a Has-a relationship, containing a number of Actors. The inner class needs to access a method of the outer class; here the method get_name. Ge

Re: storing test logs under /var/log/

2015-12-08 Thread Peter Otten
Ganesh Pal wrote: [Cameron Simpson:] >> Finally. sys.exit accepts an integer, not a string. > Most of code uses sys.exit("some error message") , I did notice > that the error message is not displayed by sys .exit("some error > message") , do u mean that using string is not advisable with >

Re: storing test logs under /var/log/

2015-12-08 Thread Ganesh Pal
> Finally. sys.exit accepts an integer, not a string. > Most of code uses sys.exit("some error message") , I did notice that the error message is not displayed by sys .exit("some error message") , do u mean that using string is not advisable with sys.exit ? How to I display error messages wi

Re: writing an email.message.Message in UTF-8

2015-12-08 Thread Adam Funk
On 2015-12-07, Terry Reedy wrote: > On 12/7/2015 9:57 AM, Adam Funk wrote: >> I'm trying to write an instance of email.message.Message, whose body >> contains unicode characters, to a UTF-8 file. (Python 2.7.3 & 2.7.10 >> again.) > > The email package was rewritten for, I believe, 3.3. I believe

Re: writing an email.message.Message in UTF-8

2015-12-08 Thread Adam Funk
On 2015-12-08, dieter wrote: > Adam Funk writes: > >> I'm trying to write an instance of email.message.Message, whose body >> contains unicode characters, to a UTF-8 file. (Python 2.7.3 & 2.7.10 >> again.) >> >> reply = email.message.Message() >> reply.set_charset('utf-8') >> ... # s

Re: Understanding Python from a PHP coder's perspective

2015-12-08 Thread Chris Angelico
On Tue, Dec 8, 2015 at 8:24 PM, Peter Otten <__pete...@web.de> wrote: > Chris Angelico wrote: > >> On Tue, Dec 8, 2015 at 8:59 AM, Ian Kelly wrote: >>> On Mon, Dec 7, 2015 at 2:40 PM, Chris Angelico wrote: So that's a quick potted summary of why the URLs don't reflect the language used.

Re: Understanding Python from a PHP coder's perspective

2015-12-08 Thread Peter Otten
Chris Angelico wrote: > On Tue, Dec 8, 2015 at 8:59 AM, Ian Kelly wrote: >> On Mon, Dec 7, 2015 at 2:40 PM, Chris Angelico wrote: >>> So that's a quick potted summary of why the URLs don't reflect the >>> language used. Python is event-driven, but instead of defining events >>> at the file level

Re: manually build a unittest/doctest object.

2015-12-08 Thread Peter Otten
Vincent Davis wrote: > If I have a string that is python code, for example > mycode = "print('hello world')" > myresult = "hello world" > How can a "manually" build a unittest (doctest) and test I get myresult > > I have attempted to build a doctest but that is not working. > e = doctest.Example(