Re: converting ISO8601 date and time string representations to datetime

2014-07-31 Thread Wolfgang Maier
On 08/01/2014 01:30 AM, Roy Smith wrote: In article , Albert-Jan Roskam wrote: In article , Wolfgang Maier wrote: Hi, I'm trying to convert ISO8601-compliant strings representing dates or dates and times into datetime.datetime objects. https://pypi.python.org/pypi/iso8601 Yikes, what

Second edition - Porting to Python 3

2014-07-31 Thread Frank Millman
Hi all Here is the blurb - Porting to Python 3 doesn't have to be daunting. This book guides you through the process of porting your Python 2 code to Python 3, from choosing a porting strategy to solving your distribution issues. Using plenty of code examples it takes you cross the hurdles and

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Ben Finney
Steven D'Aprano writes: > On Thu, 31 Jul 2014 20:12:12 -0700, Dan Stromberg wrote: > > > I removed some quotes, and noticed that 1 and 1.0 hash the same. > > That's a bit unexpected, but I suppose it's not completely > > unreasonable. I would expect it, for the reasons Steven explains. Why is it

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Steven D'Aprano
On Thu, 31 Jul 2014 20:12:12 -0700, Dan Stromberg wrote: > I removed some quotes, and noticed that 1 and 1.0 hash the same. That's > a bit unexpected, but I suppose it's not completely unreasonable. You should expect that two equal objects should hash to the same value in different versions of

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Terry Reedy
On 7/31/2014 5:15 PM, Ian Kelly wrote: On Thu, Jul 31, 2014 at 5:24 AM, Dilu Sasidharan wrote: Hi, I am wondering why the dictionary in python not returning multi value key error when i define something like p = {'k':"value0",'k':"value1"} key is string immutable and sometimes shares same id

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Dan Stromberg
On Thu, Jul 31, 2014 at 8:08 PM, Dan Stromberg wrote: >> p = {'1':"value0",'1.0':"value1"} > For 1 and 1.0 - they simply hash differently. Dictionaries are > resizeable hash tables. I removed some quotes, and noticed that 1 and 1.0 hash the same. That's a bit unexpected, but I suppose it's not

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Dan Stromberg
On Thu, Jul 31, 2014 at 4:24 AM, Dilu Sasidharan wrote: > Hi, > > I am wondering why the dictionary in python not returning multi value key > error when i define something like > > p = {'k':"value0",'k':"value1"} > > key is string immutable and sometimes shares same id. > > also if the key is immu

Re: How to loop through nodes of xml through xslt

2014-07-31 Thread Dan Stromberg
You're probably still better off finding an XSLT mailing list. On Thu, Jul 31, 2014 at 12:31 AM, varun bhatnagar wrote: > Hi Dan, > > Thanks a lot for the reply. I am using lxml for the transformation and I am > parsing xsl file using lxml module, that is why posted in this list. > Is there any w

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Roy Smith
In article , Ned Batchelder wrote: > On 7/31/14 5:15 PM, Ian Kelly wrote: > > On Thu, Jul 31, 2014 at 5:24 AM, Dilu Sasidharan > > wrote: > >> Hi, > >> > >> I am wondering why the dictionary in python not returning multi value key > >> error when i define something like > >> > >> p = {'k':"val

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Ned Batchelder
On 7/31/14 5:15 PM, Ian Kelly wrote: On Thu, Jul 31, 2014 at 5:24 AM, Dilu Sasidharan wrote: Hi, I am wondering why the dictionary in python not returning multi value key error when i define something like p = {'k':"value0",'k':"value1"} key is string immutable and sometimes shares same id.

Re: New to Python

2014-07-31 Thread Cameron Simpson
On 31Jul2014 17:54, kyil...@gmail.com wrote: Hello. Basically i found this to be the best free way to automatically like photos on instagram by hashtag however i am totally lost in how to use it. Help would be very much appreciated, thank you. When you say "this to be the best free way", to

Re: What is best way to learn Python for advanced developer?

2014-07-31 Thread Michael Torrie
On 07/30/2014 02:20 PM, guirec.cor...@gmail.com wrote: > Hello, > > I am a Ruby developer and I want to program in Python. I know how to > do simple things like create classes, methods, variables and all the > basics. I want to know more. I want to know what is the Python > philosophy, how to test

New to Python

2014-07-31 Thread kyillxy
Hello. Basically i found this to be the best free way to automatically like photos on instagram by hashtag however i am totally lost in how to use it. Help would be very much appreciated, thank you. -- https://mail.python.org/mailman/listinfo/python-list

Re: converting ISO8601 date and time string representations to datetime

2014-07-31 Thread Roy Smith
In article , Albert-Jan Roskam wrote: > >In article , > > Wolfgang Maier wrote: > > > >> Hi, > >> I'm trying to convert ISO8601-compliant strings representing dates or > >> dates and times into datetime.datetime objects. > > > >https://pypi.python.org/pypi/iso8601 > > Yikes, what a regex. It

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Chris Angelico
On Fri, Aug 1, 2014 at 7:29 AM, Emile van Sebille wrote: > And which is also how it works: > > Python 2.5 (r25:51908, Dec 18 2009, 14:22:21) > [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. def test():p = {'k':"va

Re: What is best way to learn Python for advanced developer?

2014-07-31 Thread Akira Li
guirec.cor...@gmail.com writes: > I am a Ruby developer and I want to program in Python. I know how to > do simple things like create classes, methods, variables and all the > basics. I want to know more. I want to know what is the Python > philosophy, how to test, how to create maintenable softwa

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Emile van Sebille
On 7/31/2014 2:16 PM, Ian Kelly wrote: On Thu, Jul 31, 2014 at 1:17 PM, Terry Reedy wrote: On 7/31/2014 7:24 AM, Dilu Sasidharan wrote: I am wondering why the dictionary in python not returning multi value key error when i define something like p = {'k':"value0",'k':"value1"} This is docu

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Ian Kelly
On Thu, Jul 31, 2014 at 1:17 PM, Terry Reedy wrote: > On 7/31/2014 7:24 AM, Dilu Sasidharan wrote: > >> I am wondering why the dictionary in python not returning multi value >> key error when i define something like >> >> p = {'k':"value0",'k':"value1"} > > > This is documented behavior: "you can

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Ian Kelly
On Thu, Jul 31, 2014 at 5:24 AM, Dilu Sasidharan wrote: > Hi, > > I am wondering why the dictionary in python not returning multi value key > error when i define something like > > p = {'k':"value0",'k':"value1"} > > key is string immutable and sometimes shares same id. > > also if the key is immu

Re: Bug with help (was Re: Getting a list of all modules)

2014-07-31 Thread Terry Reedy
On 7/31/2014 3:19 PM, Mark Lawrence wrote: On 31/07/2014 19:55, Akira Li wrote: Steven D'Aprano writes: I'm looking for a programmatic way to get a list of all Python modules and packages. Not just those already imported, but all those which *could* be imported. ... Is this problem already

Re: Is there a tracker target for this mailing list?

2014-07-31 Thread Terry Reedy
On 7/31/2014 3:11 PM, Anders Wegge Keller wrote: On Thu, 31 Jul 2014 14:57:36 -0400 Terry Reedy wrote: On 7/31/2014 9:38 AM, Anders Wegge Keller wrote: My spam filter have an issue with the way mails are sent to this list. If a mail sent to python-list is DKIM-signed, the DKIM-Signature he

Re: What is best way to learn Python for advanced developer?

2014-07-31 Thread Ethan Furman
On 07/31/2014 10:46 AM, Je Ph wrote: Ethan et al, has anyone completed the oreilly python 1 through python 4 training courses (part of their Python Certificate track)? Looks like it will take over 2 months to complete it and it's expensive. I have completed all four courses. The time it tak

Re: What is best way to learn Python for advanced developer?

2014-07-31 Thread Chris Angelico
On Fri, Aug 1, 2014 at 3:46 AM, Je Ph wrote: > Ethan et al, has anyone completed the oreilly python 1 through python 4 > training courses (part of their Python Certificate track)? Looks like it > will take over 2 months to complete it and it's expensive. > > I'm trying to decide if it's worth the

Re: Is there a tracker target for this mailing list?

2014-07-31 Thread Anders Wegge Keller
On Thu, 31 Jul 2014 14:57:36 -0400 Terry Reedy wrote: > On 7/31/2014 9:38 AM, Anders Wegge Keller wrote: > > My spam filter have an issue with the way mails are sent to this list. > > If a mail sent to python-list is DKIM-signed, the DKIM-Signature header > > is kept in the mail. Since the mang

Re: Getting a list of all modules

2014-07-31 Thread Terry Reedy
On 7/31/2014 6:41 AM, Steven D'Aprano wrote: I'm working on tab completion for module names. I have some alpha-quality code working, so if I hit TAB after typing "import ma" I get this: py> import ma macpath macurl2path mailbox mailcap mangle markupbase math This is an inte

Bug with help (was Re: Getting a list of all modules)

2014-07-31 Thread Mark Lawrence
On 31/07/2014 19:55, Akira Li wrote: Steven D'Aprano writes: I'm looking for a programmatic way to get a list of all Python modules and packages. Not just those already imported, but all those which *could* be imported. ... Is this problem already solved? Can anyone make any suggestions? L

Re: Dict when defining not returning multi value key error

2014-07-31 Thread Terry Reedy
On 7/31/2014 7:24 AM, Dilu Sasidharan wrote: I am wondering why the dictionary in python not returning multi value key error when i define something like p = {'k':"value0",'k':"value1"} This is documented behavior: "you can specify the same key multiple times in the key/datum list, and the f

multiprocessing vs. asyncio.SubprocessProtocol

2014-07-31 Thread Charles Hixson
What are the tradeoffs between using multiprocessing vs. using asyncio.SubprocessProtocol? This only one that I've noticed is that asyncio seems to require much more hands-on management of message queueing. OTOH, I'm no expert in either of them, and I might be missing something that will bite m

Re: converting ISO8601 date and time string representations to datetime

2014-07-31 Thread Albert-Jan Roskam
>In article , > Wolfgang Maier wrote: > >> Hi, >> I'm trying to convert ISO8601-compliant strings representing dates or >> dates and times into datetime.datetime objects. > >https://pypi.python.org/pypi/iso8601 Yikes, what a regex. It must have been painstaking to get that right. https://bitb

Re: converting ISO8601 date and time string representations to datetime

2014-07-31 Thread Albert-Jan Roskam
>In article , > Wolfgang Maier wrote: > >> Hi, >> I'm trying to convert ISO8601-compliant strings representing dates or >> dates and times into datetime.datetime objects. > >https://pypi.python.org/pypi/iso8601 Yikes, what a regex. It must have been painstaking to get that right. https://bitb

Re: Is there a tracker target for this mailing list?

2014-07-31 Thread Terry Reedy
On 7/31/2014 9:38 AM, Anders Wegge Keller wrote: My spam filter have an issue with the way mails are sent to this list. If a mail sent to python-list is DKIM-signed, the DKIM-Signature header is kept in the mail. Since the mangling happening during distribution to the list changes one of the si

Re: Getting a list of all modules

2014-07-31 Thread Akira Li
Steven D'Aprano writes: > I'm looking for a programmatic way to get a list of all Python modules > and packages. Not just those already imported, but all those which > *could* be imported. ... > Is this problem already solved? Can anyone make any suggestions? Look at how `help('modules')` is i

Re: What is best way to learn Python for advanced developer?

2014-07-31 Thread Je Ph
Ethan et al, has anyone completed the oreilly python 1 through python 4 training courses (part of their Python Certificate track)? Looks like it will take over 2 months to complete it and it's expensive. I'm trying to decide if it's worth the investment. With a full time job, it would take me a lo

Re: Is there a tracker target for this mailing list?

2014-07-31 Thread Chris “Kwpolska” Warrick
On Thu, Jul 31, 2014 at 3:38 PM, Anders Wegge Keller wrote: > My spam filter have an issue with the way mails are sent to this list. If a > mail sent to python-list is DKIM-signed, the DKIM-Signature header is kept > in the mail. Since the mangling happening during distribution to the list > chan

Reporting and data stats help

2014-07-31 Thread James P
I'm building a report builder for my Django app and could use a little advice. My reports are fairly simple where I accumulate scores of data (easy enough) but then I want to alter the report totals by varying dimensions (date ranges / split dates/weeks/months / owners / other metadata etc.). Si

Re: Is there a tracker target for this mailing list?

2014-07-31 Thread Skip Montanaro
On Thu, Jul 31, 2014 at 8:38 AM, Anders Wegge Keller wrote: > So where to report this issue? Perhaps postmas...@python.org? Skip -- https://mail.python.org/mailman/listinfo/python-list

RE: Skype

2014-07-31 Thread Deogratius Musiige
Yes, i picked up the skype4Py package where I can start up skype and place a call. But I want to have 2 clients which can call each other. Best regards / Med venlig hilsen Deogratius Musiige Sennheiser Communications A/S Direct +45 5618 0320 From: Joel Goldstick [mailto:joel.g

Is there a tracker target for this mailing list?

2014-07-31 Thread Anders Wegge Keller
My spam filter have an issue with the way mails are sent to this list. If a mail sent to python-list is DKIM-signed, the DKIM-Signature header is kept in the mail. Since the mangling happening during distribution to the list changes one of the signed header fields, rather a lot of the mails to the

Re: Subtracting two dates in python

2014-07-31 Thread MRAB
On 2014-07-31 17:08, eshwar...@gmail.com wrote: I would like to subtract two dates i.e I have entered a date into a textbox which is of type String like below type(waitForObject(":VWAP Calculator_LCDateTextField"), "07/24/14") I am capturing that date like below Current = (waitForObject(":VWA

Re: Subtracting two dates in python

2014-07-31 Thread John Gordon
In eshwar...@gmail.com writes: > I would like to subtract two dates > i.e I have entered a date into a textbox which is of type String like below > type(waitForObject(":VWAP Calculator_LCDateTextField"), "07/24/14") > I am capturing that date like below > Current = (waitForObject(":VWAP Calc

Subtracting two dates in python

2014-07-31 Thread eshwar080
I would like to subtract two dates i.e I have entered a date into a textbox which is of type String like below type(waitForObject(":VWAP Calculator_LCDateTextField"), "07/24/14") I am capturing that date like below Current = (waitForObject(":VWAP Calculator_LCDateTextField").text) so, now I wa

Guidance Regarding visualizing tf-idf scores

2014-07-31 Thread bhanu27
Hi, I have a hardware background and I wanted to perform some experiments for specifications in hardware domain. I have calculated tf-idf scores for document using a corpus of 52 documents, please let me know what will be best way to visulaize. Thank you -- https://mail.python.org/mailman/li

Re: Skype

2014-07-31 Thread Joel Goldstick
Have you checked googling 'skype python'? I just did. Looks like several libraries and a tutorial in the first couple of listings. I haven't tried, but it sounds interesting On Thu, Jul 31, 2014 at 8:43 AM, Deogratius Musiige < dmusi...@sennheisercommunications.com> wrote: > Hi guys, > > Has

Re: converting ISO8601 date and time string representations to datetime

2014-07-31 Thread Mark Lawrence
On 31/07/2014 10:11, Wolfgang Maier wrote: Hi, I'm trying to convert ISO8601-compliant strings representing dates or dates and times into datetime.datetime objects. I tried using the strptime method, but the problem here is that I can only specify one format argument, which can be used to parse e

Re: converting ISO8601 date and time string representations to datetime

2014-07-31 Thread Wolfgang Maier
On 31.07.2014 15:13, Roy Smith wrote: On Jul 31, 2014, at 8:59 AM, Skip Montanaro wrote: On Thu, Jul 31, 2014 at 6:52 AM, Roy Smith wrote: Sadly, the stdlib datetime really doesn't make life easy for dealing with ISO-8601. Dateutil is the classic answer, but it's slow. A useful feature for

Skype

2014-07-31 Thread Deogratius Musiige
Hi guys, Has anybody tried or have an idea how to: 1. start up skype from python, 2. simulate an incoming call. Thanks Deo -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting a list of all modules

2014-07-31 Thread Chris Angelico
On Thu, Jul 31, 2014 at 9:55 PM, Roy Smith wrote: > In article <53da1d5a$0$29974$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> I'm working on tab completion for module names. I have some alpha-quality >> code working, so if I hit TAB after typing "import ma" I get this: >> >

Re: converting ISO8601 date and time string representations to datetime

2014-07-31 Thread Roy Smith
On Jul 31, 2014, at 8:59 AM, Skip Montanaro wrote: > On Thu, Jul 31, 2014 at 6:52 AM, Roy Smith wrote: >> Sadly, the stdlib datetime really doesn't make life easy for dealing >> with ISO-8601. Dateutil is the classic answer, but it's slow. > > A useful feature for dateutil would be a "sniff" fu

Re: What is best way to learn Python for advanced developer?

2014-07-31 Thread guirec . corbel
Thanks for all you suggestions. The is a lot of good ressources. The official doc - Obviously very useful; Realpython - Seems to be good. I will try it; Udemy - Too much courses for beginners; Udacity - Seems to be good to see some examples for not for what I want now; O'reilly - A little bit expe

Re: converting ISO8601 date and time string representations to datetime

2014-07-31 Thread Skip Montanaro
On Thu, Jul 31, 2014 at 6:52 AM, Roy Smith wrote: > Sadly, the stdlib datetime really doesn't make life easy for dealing > with ISO-8601. Dateutil is the classic answer, but it's slow. A useful feature for dateutil would be a "sniff" function which, given a date string that dateutil.parser.parse

Re: Getting a list of all modules

2014-07-31 Thread Roy Smith
In article <53da1d5a$0$29974$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > I'm working on tab completion for module names. I have some alpha-quality > code working, so if I hit TAB after typing "import ma" I get this: > > > py> import ma > macpath macurl2path mailbox

Re: converting ISO8601 date and time string representations to datetime

2014-07-31 Thread Roy Smith
In article , Wolfgang Maier wrote: > Hi, > I'm trying to convert ISO8601-compliant strings representing dates or > dates and times into datetime.datetime objects. https://pypi.python.org/pypi/iso8601 or https://pypi.python.org/pypi/isodate There's also > I do know about the dateutil p

Dict when defining not returning multi value key error

2014-07-31 Thread Dilu Sasidharan
Hi, I am wondering why the dictionary in python not returning multi value key error when i define something like p = {'k':"value0",'k':"value1"} key is string immutable and sometimes shares same id. also if the key is immutable and have different ids. like p = {'1':"value0",'1.0':"value1"} P

Re: Getting a list of all modules

2014-07-31 Thread Steven D'Aprano
On Wed, 30 Jul 2014 21:22:18 +0800, Leo Jay wrote: > On Wed, Jul 30, 2014 at 3:43 PM, Steven D'Aprano > wrote: >> I'm looking for a programmatic way to get a list of all Python modules >> and packages. Not just those already imported, but all those which >> *could* be imported. >> >> > If you don

converting ISO8601 date and time string representations to datetime

2014-07-31 Thread Wolfgang Maier
Hi, I'm trying to convert ISO8601-compliant strings representing dates or dates and times into datetime.datetime objects. I tried using the strptime method, but the problem here is that I can only specify one format argument, which can be used to parse either a full date/time string or just a d

Re: Convert Python 3 ResourceWarnings into exception

2014-07-31 Thread Piotr Dobrogost
Terry Reedy udel.edu> writes: > > python -W error ... > "Raise an exception instead of printing a warning message." > > You can also turn this on with the warnings module. Assuming that this > works for ResourceWarning, which is should, please correct the SO record. Thanks for taking time to

Re: How to loop through nodes of xml through xslt

2014-07-31 Thread varun bhatnagar
Hi Dan, Thanks a lot for the reply. I am using lxml for the transformation and I am parsing xsl file using lxml module, that is why posted in this list. Is there any way out to achieve this? Thanks, BR, Varun On Thu, Jul 31, 2014 at 5:47 AM, Dan Stromberg wrote: > On Wed, Jul 30, 2014 at 5:16