Re: How to log the output from the multiple telnet sessions to separate log file

2015-10-27 Thread dieter
manjunatha.mahalinga...@gmail.com writes: > ... > I created the my own class MyLogger and passing log file name to it. I'm > seeing no log is being written to passed log file instead everything is > written to the logfilename [actually logfilename is variable with file name] > I'm trying to cre

Re: How to make this simple code look better

2015-10-27 Thread Ben Finney
Dennis Lee Bieber writes: > Actually, if 0 is success, and you are testing for a failure, it > should probably just be > > if ret: > #do error That obscures the intent; there is nothing about “is ‘ret’ false?” that tells me what the meaning of that test is. It happens

Re: how to get python socket to use a specific interface

2015-10-27 Thread Cameron Simpson
On 27Oct2015 10:00, Robin Becker wrote: On 26/10/2015 22:29, Cameron Simpson wrote: On 26Oct2015 12:33, Robin Becker wrote: . $ ifconfig eth0 Link encap:Ethernet HWaddr 00:...4 GB) Interrupt:16 eth0:0Link encap:Ethernet HWa... Do you need t

Re: Paramiko SSHClient.connect() problem

2015-10-27 Thread Chris Angelico
On Wed, Oct 28, 2015 at 6:56 AM, Skip Montanaro wrote: > On Tue, Oct 27, 2015 at 1:40 PM, Chris Angelico wrote: >> >> If you hack your hosts file to have only one localhost, >> does the problem disappear? > > > Yes, that appears to solve the problem. Thanks. I hadn't even thought there > would be

Re: Building a python extension on Windows

2015-10-27 Thread Jeff Archer
Ken, I have been successful with building Python on Windows by downloading Python-3.5.0.tgz. Expand it and follow the instructions in Python-3.5.0\PCBuild\readme.txt. Basically, run get_externals.bat, then use build.bat. I have not however been successful building with VS2015 IDE. Can't remembe

Re: Building a python extension on Windows

2015-10-27 Thread Zachary Ware
On Mon, Oct 26, 2015 at 11:17 PM, Ken Brooks wrote: > I checked out a copy of svn.python.org/projects/stackless/trunk Sorry I don't have the time at the moment for a more complete answer, but I will point out that that is not the right repository for anything anymore. For one thing, it's very ou

Windows 10 pip2.7.exe uninstall fails

2015-10-27 Thread Mark Lawrence
Let's install something. C:\>Python27\Scripts\pip2.7.exe install tox Collecting tox Using cached tox-2.1.1-py2.py3-none-any.whl Collecting virtualenv>=1.11.2 (from tox) Using cached virtualenv-13.1.2-py2.py3-none-any.whl Collecting py>=1.4.17 (from tox) Using cached py-1.4.30-py2.py3-none-a

Re: Paramiko SSHClient.connect() problem

2015-10-27 Thread Skip Montanaro
On Tue, Oct 27, 2015 at 1:40 PM, Chris Angelico wrote: > If you hack your hosts file to have only one localhost, > does the problem disappear? > Yes, that appears to solve the problem. Thanks. I hadn't even thought there would be IPv4/IPv6 distinctions here. Interestingly enough, the box does s

RE: Building a python extension on Windows

2015-10-27 Thread Christopher Wilcox
If you are building c extensions on windows with 2.7 you need to get the matching compiler from http://aka.ms/vcpython27. You should also make sure you are running the latest setup tools. If you are using 2.7.10 you should have them already. Finally, I suggest using ‘pip install .’ instead of ‘p

Re: Paramiko SSHClient.connect() problem

2015-10-27 Thread Chris Angelico
On Wed, Oct 28, 2015 at 12:23 AM, Skip Montanaro wrote: > Finally, there is also a "localhost" record in known_hosts. Connecting to > that fails with a different exception: > ssh = paramiko.SSHClient() conn = ssh.connect("localhost") > error getsockaddrarg: bad family > [||1] [paramiko/c

Re: Building a python extension on Windows

2015-10-27 Thread Chris Angelico
On Tue, Oct 27, 2015 at 3:17 PM, Ken Brooks wrote: > I checked out a copy of svn.python.org/projects/stackless/trunk because it > seems to have a good sample project (PC/example_nt) for building a Python > extension on Windows. That directory has a Microsoft Visual C++ solution > file which can be

Re: How to make this simple code look better

2015-10-27 Thread Ganesh Pal
On Tue, Oct 27, 2015 at 5:38 PM, Tim Chase wrote: > It reduces the redundant code and also brings all of the commands > together in one place to see the expected steps. Thanks your suggested code looks nice , I easily knocked off half the lines of my code :) -- https://mail.python.org/mailman/l

Re: Paramiko SSHClient.connect() problem

2015-10-27 Thread Skip Montanaro
On Tue, Oct 27, 2015 at 8:23 AM, Skip Montanaro wrote: > >>> ssh = paramiko.SSHClient() > >>> conn = ssh.connect("firefly") > SSHException Server 'firefly' not found in known_hosts > [||1] [paramiko/client.py|connect|288] > [paramiko/client.py|missing_host_key|570] > I figured out that I needed

Re: How to make this simple code look better

2015-10-27 Thread Ganesh Pal
> According to the format strings, 'ret' is a number. If that's the case, > it's not a string, so ret != "" will always be true. > > Why are you wrapping the command string literals in (...)? That's not > necessary. > > You're doing the same thing with each of the command strings, so why > not put

Paramiko SSHClient.connect() problem

2015-10-27 Thread Skip Montanaro
I'm trying to use paramiko (for the first time) to connect to both the localhost and a remote host as I read along in Jesse Noller's blog post . That host is listed in ~/.ssh/known_hosts three different ways:

Re: How to make this simple code look better

2015-10-27 Thread Tim Chase
On 2015-10-27 17:24, Ganesh Pal wrote: > from myPopen import run > > def configure_network(): > """ > Prepare network for test > """ > try: > cmd = ("netadm enable -p ncp DefaultFixed") > out, err, ret = run(cmd, timeout=60) > if ret != "": > log

Re: How to make this simple code look better

2015-10-27 Thread MRAB
On 2015-10-27 11:54, Ganesh Pal wrote: from myPopen import run def configure_network(): """ Prepare network for test """ try: cmd = ("netadm enable -p ncp DefaultFixed") out, err, ret = run(cmd, timeout=60) if ret != "": logging.error("

Re: Detection of a specific sound

2015-10-27 Thread John O'Hagan
On Sun, 25 Oct 2015 17:17:28 -0700 Montana Burr wrote: > I'm looking for a library that will allow Python to listen for the > shriek of a smoke alarm. Once it detects this shriek, it is to notify > someone. Ideally, specificity can be adjusted for the user's > environment. I've used python to d

Re: Python Version 3.5 required which was not found in the registry

2015-10-27 Thread MRAB
On 2015-10-27 01:18, luyijie wrote: python-list: when i install pop "Python Version 3.5 required which was not found in the registry" I do not know how to do... Have you installed Python 3.5? -- https://mail.python.org/mailman/listinfo/python-list

Re: Detection of a specific sound

2015-10-27 Thread Chris Angelico
On Tue, Oct 27, 2015 at 11:06 PM, Dennis Lee Bieber wrote: > It would almost be faster to attach a thin, high-impedance (since one > doesn't want to weaken the actual sounder) wire to the Piezo buzzer, and > poll for activity. No false positive from an alarm clock or microwave > chirping.

Re: Python Version 3.5 required which was not found in the registry

2015-10-27 Thread Michiel Overtoom
> On 27 Oct 2015, at 02:18, luyijie wrote: > > when i install > pop "Python Version 3.5 required which was not found in the registry" > I do not know how to do... Wat version of Windows are you using? Greetings, -- https://mail.python.org/mailman/listinfo/python-list

Re: Fw: Python 3.5.0 (32-bit) won't install to Windows XP

2015-10-27 Thread Laura Creighton
Python.org is not supporting XP for 3.5 and beyond. You need to upgrade your OS, or stick with 3.4 Laura Creighton -- https://mail.python.org/mailman/listinfo/python-list

Building a python extension on Windows

2015-10-27 Thread Ken Brooks
I checked out a copy of svn.python.org/projects/stackless/trunk because it seems to have a good sample project (PC/example_nt) for building a Python extension on Windows. That directory has a Microsoft Visual C++ solution file which can be updated to my Visual C++ version (8, of 2005). First I

Fw: Python 3.5.0 (32-bit) won't install to Windows XP

2015-10-27 Thread Richard Hinerfeld via Python-list
--- On Fri, 10/23/15, Richard Hinerfeld wrote: > From: Richard Hinerfeld > Subject: Python 3.5.0 (32-bit) won't install to Windows XP > To: "python-list@python.org" > Date: Friday, October 23, 2015, 9:10 PM > I am > sending you the log with all the errors. > Python 3.5.0 (32-bit)_2015102321

Python Version 3.5 required which was not found in the registry

2015-10-27 Thread luyijie
python-list: when i install pop "Python Version 3.5 required which was not found in the registry" I do not know how to do... Best regards 武汉天喻信息产业股份有限公司 终端技术研发部 卢义杰 手机 13437109862 地址 武汉市东湖开发区庙山小区华工大学科技园创新基地18号楼B座5楼 邮编:430223 --

How to make this simple code look better

2015-10-27 Thread Ganesh Pal
from myPopen import run def configure_network(): """ Prepare network for test """ try: cmd = ("netadm enable -p ncp DefaultFixed") out, err, ret = run(cmd, timeout=60) if ret != "": logging.error("Can't run %s got %s (%d)!" % (cmd, err, ret))

Re: UNABLE TO GET IDLE TO RUN

2015-10-27 Thread Terry Reedy
On 10/27/2015 4:15 AM, Peter Otten wrote: Terry Reedy wrote: When one runs a program with 'python somepath/file.py', python prepends somepath to sys.path. If /foo/bar contains a string.py (for example) module and you run the following sequence $ cd /foo/bar $ python3 /usr/bin/idle3 I am c

Re: how to get python socket to use a specific interface

2015-10-27 Thread Robin Becker
On 26/10/2015 22:29, Cameron Simpson wrote: On 26Oct2015 12:33, Robin Becker wrote: . $ ifconfig eth0 Link encap:Ethernet HWaddr 00:...4 GB) Interrupt:16 eth0:0Link encap:Ethernet HWa... Do you need to bind to the device itself? Using the co

Re: UNABLE TO GET IDLE TO RUN

2015-10-27 Thread Peter Otten
Terry Reedy wrote: > On 10/26/2015 9:55 AM, Peter Otten wrote: > >> The "bug" or misfeature is that idle automatically adds the working >> directory to sys.path. > > I am not sure what you mean by 'working directory' here. After $ cd /foo/bar the working directory is /foo/bar > When one ru

Re: Error while launching python idle.

2015-10-27 Thread Terry Reedy
On 10/26/2015 7:28 PM, Terry Reedy wrote: On 10/24/2015 3:00 PM, Vijay kumar wrote: Hi, I recently installed python 2.7 on my windows 10 laptop. When i launch python by clicking the python idle the following error appears In attached image. You should also type the text so it appears in respo

Re: Detection of a specific sound

2015-10-27 Thread Chris Angelico
On Mon, Oct 26, 2015 at 1:54 PM, Dennis Lee Bieber wrote: > One difficulty -- there is no standard "smoke alarm" sound... While > they are using piezo-electric buzzers, the control processor may cycle the > buzzer in different patterns from maker to maker, or slightly different > pitches.