Re: x=something, y=somethinelse and z=crud all likely to fail - how do i wrap them up

2016-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2016 05:29 pm, Veek. M wrote: > I'm using lxml.html Hmmm. Well, I've never used lxml, but the first obvious problem I see is that your lines: description = li_item.find_class('vip')[0].text_content() link = li_item.find_class('vip')[0].get('href') price_dollar = li_item.find_cl

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2016 02:48 pm, Cameron Simpson wrote: > I have. I've got one right here. It happens to be in perl, but it has been > in need of a recode in Python for a long time. It has about 3000 regexps. Wow. What's the code do? -- Steven -- https://mail.python.org/mailman/listinfo/python-

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Cameron Simpson
On 31Jan2016 20:23, Steven D'Aprano wrote: On Sun, 31 Jan 2016 02:48 pm, Cameron Simpson wrote: I have. I've got one right here. It happens to be in perl, but it has been in need of a recode in Python for a long time. It has about 3000 regexps. Wow. What's the code do? Adzapper. It has many

Re: x=something, y=somethinelse and z=crud all likely to fail - how do i wrap them up

2016-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2016 08:40 pm, Chris Angelico wrote: > On Sun, Jan 31, 2016 at 8:21 PM, Steven D'Aprano > wrote: >> Hmmm. Well, I've never used lxml, but the first obvious problem I see is >> that your lines: >> >> description = li_item.find_class('vip')[0].text_content() >> >> link = li_item.find

Re: x=something, y=somethinelse and z=crud all likely to fail - how do i wrap them up

2016-01-31 Thread Peter Otten
Veek. M wrote: > Chris Angelico wrote: > >> On Sun, Jan 31, 2016 at 3:58 PM, Veek. M wrote: >>> I'm parsing html and i'm doing: >>> >>> x = root.find_class(... >>> y = root.find_class(.. >>> z = root.find_class(.. >>> >>> all 3 are likely to fail so typically i'd have to stick it in a try. >>> T

Error : 0x80070570 file or directory is corrupted or unavailable

2016-01-31 Thread archi dsouza
Hi, I was trying to install Python.exe in windows 8.1. But got error mention in subject line. find attached log file. Regards, Archi Dsouza -- https://mail.python.org/mailman/listinfo/python-list

Re: The computer that mastered Go

2016-01-31 Thread Bernardo Sulzbach
On Fri, Jan 29, 2016 at 6:53 PM, Ian Kelly wrote: > > Given the game, and the fact that it's Google, I would be very > disappointed if it's not written in Go. > Then be disappointed. The AI field seems to have strong feelings for Lua. However using Go instead of C++ would have promoted their baby

ANN: distlib 0.2.2 released on PyPI

2016-01-31 Thread Vinay Sajip
I've just released version 0.2.2 of distlib on PyPI [1]. For newcomers, distlib is a library of packaging functionality which is intended to be usable as the basis for third-party packaging tools. The main changes in this release are as follows: * Fixed issue #81: Added support for detecting dist

Re: x=something, y=somethinelse and z=crud all likely to fail - how do i wrap them up

2016-01-31 Thread Chris Angelico
On Sun, Jan 31, 2016 at 8:21 PM, Steven D'Aprano wrote: > Hmmm. Well, I've never used lxml, but the first obvious problem I see is > that your lines: > > description = li_item.find_class('vip')[0].text_content() > > link = li_item.find_class('vip')[0].get('href') > > price_dollar = li_item.find_cl

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Cameron Simpson
On 30Jan2016 19:53, rusi wrote: On Sunday, January 31, 2016 at 9:18:31 AM UTC+5:30, Cameron Simpson wrote: On 30Jan2016 19:22, rusi wrote: >Have you ever seen a program that uses 512 re's? >I havent :-) I have. I've got one right here. It happens to be in perl, but it has been in need of a rec

Re: Unable to activate Python once installed, as far I am aware i have full permission. The download is in programs but does not show when i use run in windows start menu, any suggestions would be hel

2016-01-31 Thread Terry Reedy
On 1/30/2016 10:32 AM, Haydn James wrote: Please repost with a short subject line, about 40 chars. Put your messages in the body of the post, with adequate detail. What version of Windows. What version of Python. Where did you get it. How did you install it. How did you try to run it. 'run in

Re: Error : 0x80070570 file or directory is corrupted or unavailable

2016-01-31 Thread Terry Reedy
On 1/31/2016 2:26 AM, archi dsouza wrote: I was trying to install Python.exe in windows 8.1. But got error mention in subject line. Repeat such detail in the body of the message. But first try a web search. find attached log file. Nope. This is a no-attachment mail list. YOU should look

Re: The computer that mastered Go

2016-01-31 Thread Terry Reedy
On 1/30/2016 8:53 AM, Bernardo Sulzbach wrote: On Fri, Jan 29, 2016 at 6:53 PM, Ian Kelly wrote: Given the game, and the fact that it's Google, I would be very disappointed if it's not written in Go. Then be disappointed. The AI field seems to have strong feelings for Lua. However using Go

Re: carry **arguments through different scopes/functions

2016-01-31 Thread Terry Reedy
On 1/31/2016 7:19 AM, c.bu...@posteo.jp wrote: I am not sure what the problem is here, so I don't really know how I should call the subject for that question. Please offer a better subject. The code below is a extrem simplified example of the original one. But it reproduce the problem very nice.

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Rustom Mody
True... $ python Python 2.7.10 (default, Oct 14 2015, 16:09:02) [GCC 5.2.1 20151010] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> re._MAXCACHE 100 But 100 is still large enough that for most normal users/uses re-compilation is pointless. --

Re: carry **arguments through different scopes/functions

2016-01-31 Thread Joel Goldstick
On Sun, Jan 31, 2016 at 7:19 AM, wrote: > I am not sure what the problem is here, so I don't really know how I > should call the subject for that question. Please offer a better > subject. > > The code below is a extrem simplified example of the original one. But > it reproduce the problem very n

Unable to activate Python once installed, as far I am aware i have full permission. The download is in programs but does not show when i use run in windows start menu, any suggestions would be helpful

2016-01-31 Thread Haydn James
-- https://mail.python.org/mailman/listinfo/python-list

Re: The computer that mastered Go

2016-01-31 Thread Marko Rauhamaa
Bernardo Sulzbach : > On Fri, Jan 29, 2016 at 6:53 PM, Ian Kelly wrote: >> Given the game, and the fact that it's Google, I would be very >> disappointed if it's not written in Go. > > Then be disappointed. The AI field seems to have strong feelings for > Lua. However using Go instead of C++ woul

carry **arguments through different scopes/functions

2016-01-31 Thread c.buhtz
I am not sure what the problem is here, so I don't really know how I should call the subject for that question. Please offer a better subject. The code below is a extrem simplified example of the original one. But it reproduce the problem very nice. Please focus on the variable `return_code`. The

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Terry Reedy
On 1/30/2016 10:22 PM, Rustom Mody wrote: On Sunday, January 31, 2016 at 7:27:06 AM UTC+5:30, Steven D'Aprano wrote: On Sunday 31 January 2016 09:18, Gregory Ewing wrote: Correct. The re module keeps a cache of the last N regexes used, for some value of N (possibly 10?) so for casual use ther

Re: x=something, y=somethinelse and z=crud all likely to fail - how do i wrap them up

2016-01-31 Thread Chris Angelico
On Sun, Jan 31, 2016 at 9:14 PM, Steven D'Aprano wrote: >> Imagine taking a large and complex JSON blob >> and loading it into a Python structure with nested lists and dicts - >> it wouldn't violate software design principles to call up >> info["records"][3]["name"], even though that's three indir

Re: carry **arguments through different scopes/functions

2016-01-31 Thread Peter Otten
c.bu...@posteo.jp wrote: > I am not sure what the problem is here, so I don't really know how I > should call the subject for that question. Please offer a better > subject. > > The code below is a extrem simplified example of the original one. But > it reproduce the problem very nice. Please foc

Re: deb's for wheezy?

2016-01-31 Thread Mark Lawrence
On 31/01/2016 15:33, Gene Heskett wrote: Greetings; It seems I need python3-pil and python3-pil.imagetk for a camera display & control utility I would like to run for a machine vision application. Is there a URL where I can find wheezy versions of those? I have python3, V3.2.3 here. Thanks eve

Re: x=something, y=somethinelse and z=crud all likely to fail - how do i wrap them up

2016-01-31 Thread Veek. M
Thanks guys: you've given me some good ideas - I really need to re-read the lxml docs for xpath. (basically trying to scrape ebay and score a mobo - ebaysdk doesn't work) Also need to google those principles :) thanks! (i knew one shouldn't overly rely on chained attribute lookups - didn't fig

deb's for wheezy?

2016-01-31 Thread Gene Heskett
Greetings; It seems I need python3-pil and python3-pil.imagetk for a camera display & control utility I would like to run for a machine vision application. Is there a URL where I can find wheezy versions of those? I have python3, V3.2.3 here. Thanks everybody. Cheers, Gene Heskett -- "There

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Paul Rubin
Rustom Mody writes: > I would guess it needs more recoding than explicit compilation! > Maybe something like http://www.colm.net/open-source/ragel/ > Unfortunately no python binding so far :-( Neat, that looks kind of like lex/flex but with more backends. -- https://mail.python.org/mailman/listi

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Paul Rubin
Cameron Simpson writes: > Adzapper. It has many many regexps matching URLs. (Actually a more > globlike syntax, but it gets turned into a regexp.) You plug it into > your squid proxy. Oh cool, is that out there in circulation? It sounds like the approach of merging all the regexes into one and c

Re: show instant data on webpage

2016-01-31 Thread mustang
How about https://plot.ly/python/ ? Free versione: Create 1 private chart And if I've 3 sensor with 3 different plots? -- https://mail.python.org/mailman/listinfo/python-list

Re: x=something, y=somethinelse and z=crud all likely to fail - how do i wrap them up

2016-01-31 Thread Larry Hudson via Python-list
On 01/30/2016 10:29 PM, Veek. M wrote: [snip] Trivial comment (and irrelevant to your question)... Replace your print('-') with the shorter print('-' * 65) Of course, feel free to disagree if you think the longer version is

Re: create Email with multiple HTML blocks embedded

2016-01-31 Thread Thomas 'PointedEars' Lahn
kevind0...@gmail.com wrote: > Following your suggestions, I now have code that looks like the below. > I get the same result. First HTML is displayed in body of email and > second shows up as an attachment. Works as designed. The message structure is correct now, but there is no plain-text pa

Re: show instant data on webpage

2016-01-31 Thread Joel Goldstick
On Sun, Jan 31, 2016 at 2:19 PM, mustang wrote: > > How about https://plot.ly/python/ ? >> >> Free versione: Create 1 private chart > And if I've 3 sensor with 3 different plots? > -- > https://mail.python.org/mailman/listinfo/python-list > You need free and private? The price is low -- if this

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Cameron Simpson
On 31Jan2016 09:49, Paul Rubin wrote: Cameron Simpson writes: Adzapper. It has many many regexps matching URLs. (Actually a more globlike syntax, but it gets turned into a regexp.) You plug it into your squid proxy. Oh cool, is that out there in circulation? Yes: http://adzapper.sourcefo

Re: create Email with multiple HTML blocks embedded

2016-01-31 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > See RFC 5233 and RTFM for details. RFC _5322_ (“Internet Message Format”) -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte keine Kopien per E-Mail. -- https://mail.python.org/mailman/listinfo/python-lis

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Michael Torrie
On 01/31/2016 03:34 PM, Fillmore wrote: > On 01/30/2016 05:26 AM, wxjmfa...@gmail.com wrote: > >>> Python 2 vs python 3 is anything but "solved". >> >> >> Python 3.5.1 is still suffering from the same buggy >> behaviour as in Python 3.0 . > Can you elaborate? Sad to say jmf is a long-time troll o

Re: carry **arguments through different scopes/functions

2016-01-31 Thread Thomas 'PointedEars' Lahn
Terry Reedy wrote: > On 1/31/2016 7:19 AM, c.bu...@posteo.jp wrote: >> I am not sure what the problem is here, so I don't really know how I >> should call the subject for that question. Please offer a better >> subject. >> >> The code below is a extrem simplified example of the original one. But >

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Fillmore
On 01/30/2016 05:26 AM, wxjmfa...@gmail.com wrote: Python 2 vs python 3 is anything but "solved". Python 3.5.1 is still suffering from the same buggy behaviour as in Python 3.0 . Can you elaborate? -- https://mail.python.org/mailman/listinfo/python-list

ts.plot() pandas: No plot!

2016-01-31 Thread Paulo da Silva
Hi! I am learning pandas and following the tutorial I tried the following: ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', periods=1000)) ts = ts.cumsum() ts.plot() No plot is produced! Only the following output: Any clue on what is happening? I'm using kubuntu and python

Re: ts.plot() pandas: No plot!

2016-01-31 Thread Chris Angelico
On Mon, Feb 1, 2016 at 11:46 AM, Paulo da Silva wrote: > I am learning pandas and following the tutorial I tried the following: > ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', > periods=1000)) > ts = ts.cumsum() > ts.plot() > > No plot is produced! > Only the following outp

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Chris Angelico
On Mon, Feb 1, 2016 at 9:34 AM, Fillmore wrote: > On 01/30/2016 05:26 AM, wxjmfa...@gmail.com wrote: > >>> Python 2 vs python 3 is anything but "solved". >> >> >> >> Python 3.5.1 is still suffering from the same buggy >> behaviour as in Python 3.0 . > > > > Can you elaborate? This is jmf. His pos

Re: carry **arguments through different scopes/functions

2016-01-31 Thread Steven D'Aprano
On Sun, 31 Jan 2016 11:19 pm, c.bu...@posteo.jp wrote: > I am not sure what the problem is here, so I don't really know how I > should call the subject for that question. Please offer a better > subject. > > The code below is a extrem simplified example of the original one. But > it reproduce the

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Terry Reedy
On 1/31/2016 5:34 PM, Fillmore wrote: On 01/30/2016 05:26 AM, wxjmfa...@gmail.com wrote: Python 2 vs python 3 is anything but "solved". Python 3.5.1 is still suffering from the same buggy behaviour as in Python 3.0 . Can you elaborate? Please do not propagate jmf's repeated trolls to pytho

Re: ts.plot() pandas: No plot!

2016-01-31 Thread Paulo da Silva
Às 01:43 de 01-02-2016, Mark Lawrence escreveu: > On 01/02/2016 00:46, Paulo da Silva wrote: ... >> > > Is it as simple as adding a call to ts.show() ? > Thanks for the clue! Not so simple however. Needed to do import matplotlib.pyplot as plt plt.show() Thank you :-) Paulo -- https://mail.pyt

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Rustom Mody
On Monday, February 1, 2016 at 5:22:22 AM UTC+5:30, Terry Reedy wrote: > On 1/31/2016 5:34 PM, Fillmore wrote: > > On 01/30/2016 05:26 AM, wxjmfauth wrote: > > > >>> Python 2 vs python 3 is anything but "solved". > >> Python 3.5.1 is still suffering from the same buggy > >> behaviour as in Python 3

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Chris Angelico
On Mon, Feb 1, 2016 at 1:59 PM, Rustom Mody wrote: > On Saturday, January 30, 2016 at 3:57:28 PM UTC+5:30, wxjmf wrote: > >> Python 3.5.1 is still suffering from the same buggy >> behaviour as in Python 3.0 . > > is banned > > whereas this is not: > > On Saturday, January 30, 2016 at 3:01:09 AM UT

Re: ts.plot() pandas: No plot!

2016-01-31 Thread Paulo da Silva
Às 01:15 de 01-02-2016, Chris Angelico escreveu: > On Mon, Feb 1, 2016 at 11:46 AM, Paulo da Silva > wrote: ... > > Hmm. Normally I would expect matplotlib to pop up a graph there. Are > you running this from a terminal, or from some sort of GUI? It might > make a difference to how it brings up

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Rustom Mody
On Monday, February 1, 2016 at 8:45:38 AM UTC+5:30, Chris Angelico wrote: > There are a lot of people here who post good content but phrase things > poorly. And everyone has a bad day. (Terry Reedy, I'm hoping this was > just a bad day - there were several rather caustic posts from you. > Sorry to

Re: ts.plot() pandas: No plot!

2016-01-31 Thread Mark Lawrence
On 01/02/2016 00:46, Paulo da Silva wrote: Hi! I am learning pandas and following the tutorial I tried the following: ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', periods=1000)) ts = ts.cumsum() ts.plot() No plot is produced! Only the following output: Any clue on wha

Re: psss...I want to move from Perl to Python

2016-01-31 Thread Rustom Mody
On Sunday, January 31, 2016 at 11:15:50 PM UTC+5:30, Paul Rubin wrote: > Rustom Mody writes: > > I would guess it needs more recoding than explicit compilation! > > Maybe something like http://www.colm.net/open-source/ragel/ > > Unfortunately no python binding so far :-( > > Neat, that looks kind

Re: psss...I want to move from Perl to Python

2016-01-31 Thread MRAB
On 2016-02-01 03:15:10, "Chris Angelico" wrote: On Mon, Feb 1, 2016 at 1:59 PM, Rustom Mody wrote: On Saturday, January 30, 2016 at 3:57:28 PM UTC+5:30, wxjmf wrote: Python 3.5.1 is still suffering from the same buggy behaviour as in Python 3.0 . is banned whereas this is not: On