Python 2.7.9, 3.4.2 won't verify SSL cert for "verisign.com"

2015-02-16 Thread John Nagle
Python 2.7.9, Windows 7 x64. (also 3.4.2 on Win7, and 3.4.0 on Ubuntu 14.04) There's something about the SSL cert for "https://www.verisign.com"; that won't verify properly from Python.The current code looks like this: def testurlopen(host, certfile) : port = httplib.HTTPS_PORT sk

Re: tempfile mktemp function

2015-02-16 Thread Cameron Simpson
On 16Feb2015 20:24, Skip Montanaro wrote: I can't offer an explanation, but you might open an issue in the tracker proposing that it be removed in 3.5. If nothing else, you should get an authoritative-ish explanation for why it has yet to be deleted. It may be as simple as still being in syste

Re: [Tutor] sql-like join on two lists or dictionaries

2015-02-16 Thread Joel Goldstick
On Mon, Feb 16, 2015 at 10:09 PM, Dave Angel wrote: > On 02/16/2015 09:26 PM, Joel Goldstick wrote: > >> On Sun, Feb 15, 2015 at 2:14 PM, Peter Otten <__pete...@web.de> wrote: >> >> Joel Goldstick wrote: >>> >>> You can dispense with the slicing if you use the str.split() method. It will

Re: [Tutor] sql-like join on two lists or dictionaries

2015-02-16 Thread Dave Angel
On 02/16/2015 09:26 PM, Joel Goldstick wrote: On Sun, Feb 15, 2015 at 2:14 PM, Peter Otten <__pete...@web.de> wrote: Joel Goldstick wrote: You can dispense with the slicing if you use the str.split() method. It will put each item in a list. Only if there are no whitespace chars in the fiel

Re: Printing to printer, windows 7

2015-02-16 Thread Dave Angel
On 02/16/2015 09:08 PM, ken.hes...@gmail.com wrote: Would seem to be a simple problem. I just want to print to my printer instead of the console using Python 2.7, Windows 7. Hours of looking through FAQ's and Google haven't yielded a solution. Any suggestions appreciated -- It is a simple

Re: [Tutor] sql-like join on two lists or dictionaries

2015-02-16 Thread Joel Goldstick
On Sun, Feb 15, 2015 at 2:14 PM, Peter Otten <__pete...@web.de> wrote: > Joel Goldstick wrote: > > > You can dispense with the slicing if you use the str.split() method. It > > will put each item in a list. > > Only if there are no whitespace chars in the field. > > OT: > > Joel, your comments ar

Re: tempfile mktemp function

2015-02-16 Thread Skip Montanaro
I can't offer an explanation, but you might open an issue in the tracker proposing that it be removed in 3.5. If nothing else, you should get an authoritative-ish explanation for why it has yet to be deleted. Skip -- https://mail.python.org/mailman/listinfo/python-list

Printing to printer, windows 7

2015-02-16 Thread ken . hessel
Would seem to be a simple problem. I just want to print to my printer instead of the console using Python 2.7, Windows 7. Hours of looking through FAQ's and Google haven't yielded a solution. Any suggestions appreciated -- -- https://mail.python.org/mailman/listinfo/python-list

tempfile mktemp function

2015-02-16 Thread Mark Lawrence
This has been deprecated since 2.3 but is still in the 3.4 code and docs. This strikes me as weird in the extreme so can anybody explain why? -- 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/mail

Re: Help setting up Sphinx

2015-02-16 Thread Mario Figueiredo
On Tue, 17 Feb 2015 00:55:29 +0100, Mario Figueiredo wrote: > >What am I missing in order to get item.py properly parsed by sphinx? Nevermind. I found the problem. In order to document the source code it needs to be used in conjunction with sphinx-apidoc. -- https://mail.python.org/mailman/listi

Help setting up Sphinx

2015-02-16 Thread Mario Figueiredo
Hello all, I'm at loss as to how properly setup sphinx to document my code. Getting a bit frustrated since I read everywhere it is an easy tool to use, but I'm either too dumb or I'm missing something very obvious. I setup sphinx with sphinx-quickstart. The following is how I answered the prompts

Re: Python implementations in JavaScript

2015-02-16 Thread Jonathan Hayward
@all, thanks. I think I have Brython to try out first and others to maybe fall back on, which is the kind of information I wanted. Thanks, On Mon, Feb 16, 2015 at 3:59 PM, Jonathan Hayward < jonathan.hayw...@pobox.com> wrote: > @all, thanks. I think I have Brython to try out first and others to

Re: line_profiler: what am I doing wrong?

2015-02-16 Thread Ethan Furman
On 02/16/2015 11:42 AM, Neal Becker wrote: > Robert Kern wrote: >> Ah, do you have the package `future` installed? >> >> https://github.com/rkern/line_profiler/issues/12 > > Yes, I do. What do you suggest as a workaround? I would think importing 'profile' directly would be the workaround. -- ~

Re: line_profiler: what am I doing wrong?

2015-02-16 Thread Neal Becker
Robert Kern wrote: > On 2015-02-13 13:35, Neal Becker wrote: >> Robert Kern wrote: >> >>> @profile >>> def run(): >>> pass >>> >>> run() >> >> No, this doesn't work either. Same failure >> >> kernprof -l test_prof.py >> Wrote profile results to test_prof.py.lprof >> Traceback (most recent call la

Re: A question about a list and subprocess.check_call()

2015-02-16 Thread Amirouche Boubekki
On Mon Feb 16 2015 at 7:40:42 PM Peter Otten <__pete...@web.de> wrote: > David Aldrich wrote: > > > Hi Peter > > > > Thanks very much for your reply. I have added one more question below. > > > >> The straightforward approach is to pass a list or tuple: > >> > >> def build(build_options=()): > >>

Re: Python & Peewee Query Example Needed

2015-02-16 Thread Travis VanDame
On Monday, February 16, 2015 at 12:35:00 PM UTC-6, Travis VanDame wrote: > I'm new to python and peewee and was looking for an example on how to query a > mysql table with a datetime column only returning rows that are 30 days old. Well this is what I've come up with @classmethod def

RE: A question about a list and subprocess.check_call()

2015-02-16 Thread Peter Otten
David Aldrich wrote: > Hi Peter > > Thanks very much for your reply. I have added one more question below. > >> The straightforward approach is to pass a list or tuple: >> >> def build(build_options=()): >> subprocess_check_call(("make",) + build_options) >> >> build(("flagA=true", "flagB=

Python & Peewee Query Example Needed

2015-02-16 Thread Travis VanDame
I'm new to python and peewee and was looking for an example on how to query a mysql table with a datetime column only returning rows that are 30 days old. -- https://mail.python.org/mailman/listinfo/python-list

Re: A question about a list and subprocess.check_call()

2015-02-16 Thread MRAB
On 2015-02-16 17:07, David Aldrich wrote: Hi Peter Thanks very much for your reply. I have added one more question below. The straightforward approach is to pass a list or tuple: def build(build_options=()): subprocess_check_call(("make",) + build_options) build(("flagA=true", "flagB=tru

RE: A question about a list and subprocess.check_call()

2015-02-16 Thread David Aldrich
Hi Peter Thanks very much for your reply. I have added one more question below. > The straightforward approach is to pass a list or tuple: > > def build(build_options=()): > subprocess_check_call(("make",) + build_options) > > build(("flagA=true", "flagB=true")) This looks fine - I am tryi

Re: Flagging classes as not intended for direct initialization

2015-02-16 Thread Chris Angelico
On Tue, Feb 17, 2015 at 2:00 AM, Mario Figueiredo wrote: > On Tue, 17 Feb 2015 01:11:01 +1100, Chris Angelico > wrote: > >>So what you have here is not "super() is weird", but "multiple >>inheritance is messy, and this is how Python handles it". >> > > I'd say the diamond pattern is messy. MI is

Re: A question about a list and subprocess.check_call()

2015-02-16 Thread Peter Otten
David Aldrich wrote: > Hi > > I wonder if someone could help me with this problem please. I am writing > a Python script that builds and tests a C++ program on Linux. The build > options depend on the test, so I have encapsulated the 'make' call in a > Python function: > > def build(build_opti

Re: Flagging classes as not intended for direct initialization

2015-02-16 Thread Mario Figueiredo
On Tue, 17 Feb 2015 01:11:01 +1100, Chris Angelico wrote: >So what you have here is not "super() is weird", but "multiple >inheritance is messy, and this is how Python handles it". > I'd say the diamond pattern is messy. MI is otherwise a pretty peaceful kid without it. I don't find the C3 line

A question about a list and subprocess.check_call()

2015-02-16 Thread David Aldrich
Hi I wonder if someone could help me with this problem please. I am writing a Python script that builds and tests a C++ program on Linux. The build options depend on the test, so I have encapsulated the 'make' call in a Python function: def build(build_options=''): if len(build_option

Re: Flagging classes as not intended for direct initialization

2015-02-16 Thread Chris Angelico
On Tue, Feb 17, 2015 at 12:47 AM, Mario Figueiredo wrote: > The following is quoted from Learning Python, 5th Edition: > >>Java programmers may especially be interested to know that Python also has a >>super >>built-in function that allows calling back to a superclass’s methods more >>genericall

Re: Flagging classes as not intended for direct initialization

2015-02-16 Thread Mario Figueiredo
On Mon, 16 Feb 2015 08:14:00 -0500, Roy Smith wrote: >In article , > Mario Figueiredo wrote: > >> It's not been an easy ride trying to decide whether or not to use super. >> I started learning python from a Mark Lutz book that advised me against >> it. > >I'm curious, what were the arguments

Re: Flagging classes as not intended for direct initialization

2015-02-16 Thread Roy Smith
In article , Mario Figueiredo wrote: > It's not been an easy ride trying to decide whether or not to use super. > I started learning python from a Mark Lutz book that advised me against > it. I'm curious, what were the arguments against it? -- https://mail.python.org/mailman/listinfo/python

Re: Flagging classes as not intended for direct initialization

2015-02-16 Thread Ian Kelly
On Mon, Feb 16, 2015 at 3:55 AM, Mario Figueiredo wrote: > In article <54e14cfe$0$12997$c3e8da3$54964...@news.astraweb.com>, > steve+comp.lang.pyt...@pearwood.info says... >> Unless you have good reason not to, you should use super rather than >> directly call the superclass. >> >> https://rhettin

Re: line_profiler: what am I doing wrong?

2015-02-16 Thread Robert Kern
On 2015-02-13 13:35, Neal Becker wrote: Robert Kern wrote: @profile def run(): pass run() No, this doesn't work either. Same failure kernprof -l test_prof.py Wrote profile results to test_prof.py.lprof Traceback (most recent call last): File "/home/nbecker/.local/bin/kernprof", line 9,

Re: Flagging classes as not intended for direct initialization

2015-02-16 Thread Mario Figueiredo
In article <54e14cfe$0$12997$c3e8da3$54964...@news.astraweb.com>, steve+comp.lang.pyt...@pearwood.info says... > > If this is a type error, why aren't you using TypeError? Or at least > inheriting from TypeError? > Yeah. It's not that I'm gaining much from that abstraction. It's not even an ab