Re: Please don't make unfounded legalistic demands (was: [a, b, c, d] = 1, 2, 3, 4)

2015-08-26 Thread Jean-Michel Pichavant
- Original Message - From: Chris Angelico ros...@gmail.com Cc: python-list@python.org Sent: Wednesday, 26 August, 2015 6:11:51 PM Subject: Re: Please don't make unfounded legalistic demands (was: [a, b, c, d] = 1, 2, 3, 4) On Thu, Aug 27, 2015 at 1:09 AM, Terry Reedy

Re: [a,b,c,d] = 1,2,3,4

2015-08-26 Thread Jean-Michel Pichavant
- Original Message - From: Joel Goldstick joel.goldst...@gmail.com its called list unpacking or packing (?) the right side is considered a tuple because of the commas a = 1,2,3 a (1, 2, 3) a[1] 2 To add to Joel's answer, the right side can be *any* sequence, and is not

Re: [a,b,c,d] = 1,2,3,4

2015-08-26 Thread Jean-Michel Pichavant
- Original Message - From: Chris Angelico ros...@gmail.com Cc: python-list@python.org Sent: Wednesday, 26 August, 2015 3:04:05 PM Subject: Re: [a,b,c,d] = 1,2,3,4 On Wed, Aug 26, 2015 at 12:59 AM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: To add to Joel's answer

Re: Please don't make unfounded legalistic demands (was: [a, b, c, d] = 1, 2, 3, 4)

2015-08-26 Thread Jean-Michel Pichavant
- Original Message - From: Ben Finney ben+pyt...@benfinney.id.au The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any

Re: [a,b,c,d] = 1,2,3,4

2015-08-25 Thread Jean-Michel Pichavant
- Original Message - From: ast nom...@invalid.com To: python-list@python.org Sent: Tuesday, 25 August, 2015 4:16:17 PM Subject: [a,b,c,d] = 1,2,3,4 [a,b,c,d] = 1,2,3,4 a 1 b 2 c 3 d 4 I have never seen this syntax before. Is it documented. Is there a name for that ?

Re: Best strategy for testing class and subclasses in pytest?

2015-08-25 Thread Jean-Michel Pichavant
From: C.D. Reimer ch...@cdreimer.com Greetings, I'm writing a chess engine to learn about Python classes and inheritance, and using pytest for the unit test. [snip] I tried to create a separate class and/or module to import the common tests for each class and subclass. My attempts often

Re: Most Pythonic way to store (small) configuration

2015-08-04 Thread Jean-Michel Pichavant
- Original Message - From: Cecil Westerhof ce...@decebal.nl To: python-list@python.org Sent: Sunday, 2 August, 2015 12:11:28 PM Subject: Most Pythonic way to store (small) configuration There are a lot of ways to store configuration information: - conf file - xml file - database

Re: Python 3 May Become Relevant Now

2015-08-03 Thread Jean-Michel Pichavant
- Original Message - From: Mark Lawrence breamore...@yahoo.co.uk To: python-list@python.org Sent: Monday, 3 August, 2015 2:25:08 AM Subject: Python 3 May Become Relevant Now rr should have a field day with this one http://nafiulis.me/python-3-may-become-relevant-now.html -- My

Re: Optimal solution for coloring logging output

2015-08-03 Thread Jean-Michel Pichavant
Original Message - From: c buhtz c.bu...@posteo.jp To: python-list@python.org Sent: Monday, 3 August, 2015 11:13:37 AM Subject: Optimal solution for coloring logging output I don't want to ask how to do this because there are so many solutions about it.

Re: line error on no. 7

2015-07-29 Thread Jean-Michel Pichavant
- Original Message - From: ltc hotspot ltc.hots...@gmail.com To: python-list@python.org Python-list@python.org Sent: Tuesday, 28 July, 2015 10:21:59 PM Subject: line error on no. 7 Hi Everyone, I'm writing python code to read a data text file, split the file into a list of words

Re: Help Command Question

2015-07-29 Thread Jean-Michel Pichavant
- Original Message - From: ltc hotspot ltc.hots...@gmail.com To: python-list@python.org Python-list@python.org Sent: Tuesday, 28 July, 2015 6:59:13 PM Subject: Help Command Question Hi Everyone, I'm trying to print a command of list options by using the help command in the

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Jean-Michel Pichavant
- Original Message - From: Steven D'Aprano st...@pearwood.info 75% or 90% is not a vast majority. Vast majority implies more than 99%. You could not be more wrong. More than 99% is a stupendous majority, while within 95 to 99% is a tremendous majority. From the official Majority

Re: Python File as the Default PDF handler for Windows

2015-06-23 Thread Jean-Michel Pichavant
Just to update, you are correct, Chris, the file short name is passed into sys.argv. didn't need to add anything to the path. But a gotcha -- Windows didn't like my .py, clicking on the pdf causes Windows to complain about 'file x' is not a valid windows executable. I'm not an expert of

Re: ctypes and byte order

2015-06-19 Thread Jean-Michel Pichavant
- Original Message - From: Terry Reedy tjre...@udel.edu To: python-list@python.org Sent: Thursday, 18 June, 2015 7:02:16 PM Subject: Re: ctypes and byte order On 6/18/2015 5:39 AM, Jean-Michel Pichavant wrote: I'm currently writing python code that writes a small binary file

Re: Catching exceptions with multi-processing

2015-06-19 Thread Jean-Michel Pichavant
- Original Message - From: Oscar Benjamin oscar.j.benja...@gmail.com A simple way to approach this could be something like: #!/usr/bin/env python3 import math import multiprocessing def sqrt(x): if x 0: return 'error', x else: return 'success',

Re: Catching exceptions with multi-processing

2015-06-19 Thread Jean-Michel Pichavant
- Original Message - From: Fabien fabien.mauss...@gmail.com To: python-list@python.org Sent: Friday, 19 June, 2015 4:01:02 PM Subject: Catching exceptions with multi-processing Folks, I am developing a tool which works on individual entities (glaciers) and do a lot of

Re: ctypes and byte order

2015-06-18 Thread Jean-Michel Pichavant
- Original Message - From: Peter Otten __pete...@web.de becomes $ cat be2.py import ctypes, sys iarray_be = ctypes.c_uint32.__ctype_be__*5 class Foo_be(ctypes.BigEndianStructure): _fields_ = [('bar', iarray_be)] print sys.version f_be = Foo_be((0,1,2,3,0x11223344))

ctypes and byte order

2015-06-18 Thread Jean-Michel Pichavant
Hi list, I'm currently writing python code that writes a small binary file to be used by another device which code is written in C. The python code runs on a little endian CPU, and unfortunately, the other device is using a big endian MIPS. My problem is the following: I cannot make an array

Re: for...else

2015-06-02 Thread Jean-Michel Pichavant
- Original Message - From: acdr mail.a...@gmail.com To: Jean-Michel Pichavant jeanmic...@sequans.com Cc: python-list@python.org Sent: Tuesday, 2 June, 2015 2:52:21 PM Subject: Re: for...else That would work for my example, but it would only really work if all the calculations

Re: for...else

2015-06-02 Thread Jean-Michel Pichavant
- Original Message - From: acdr mail.a...@gmail.com To: python-list@python.org Sent: Tuesday, 2 June, 2015 1:26:42 PM Subject: for...else Hi, Currently, in various places in my code, I have the equivalent of: for x in it: if complicated_calculation_1(): cleanup()

Re: for...else

2015-06-02 Thread Jean-Michel Pichavant
- Original Message - From: acdr mail.a...@gmail.com To: Jean-Michel Pichavant jeanmic...@sequans.com Cc: python-list@python.org Sent: Tuesday, 2 June, 2015 4:00:12 PM Subject: Re: for...else The first solution in your e-mail (with a Cleanup exception) is definitely very close

Re: May I drop list bracket from list?

2015-04-23 Thread Jean-Michel Pichavant
- Original Message - From: Peter Otten __pete...@web.de To: python-list@python.org Sent: Thursday, 23 April, 2015 12:26:41 PM Subject: Re: May I drop list bracket from list? subhabrata.bane...@gmail.com wrote: Dear Group, list1=[] for file in list_of_files: print

Re: A question on the creation of list of lists

2015-04-22 Thread Jean-Michel Pichavant
- Original Message - From: subhabrata banerji subhabrata.bane...@gmail.com To: python-list@python.org Sent: Wednesday, 22 April, 2015 6:18:30 PM Subject: A question on the creation of list of lists Dear Group, I am trying to open a bunch of files from a directory and trying to

Re: Code critique please

2015-04-08 Thread Jean-Michel Pichavant
- Original Message - From: kai peters kai.pet...@gmail.com To: python-list@python.org Sent: Wednesday, 8 April, 2015 12:43:23 AM Subject: Code critique please I just wrote this bit (coming from Pascal) and am wondering how seasoned Python programmers would have done the same?

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-31 Thread Jean-Michel Pichavant
- Original Message - From: Terry Reedy tjre...@udel.edu To: python-list@python.org Sent: Wednesday, 18 March, 2015 10:47:40 PM Subject: Re: A simple single line, triple-quoted comment is giving syntax error. Why? On 3/18/2015 3:53 PM, Thomas 'PointedEars' Lahn wrote: I must

Re: Logging Custom Levels?

2015-03-31 Thread Jean-Michel Pichavant
- Original Message - From: Didymus lynt...@gmail.com To: python-list@python.org Sent: Tuesday, 31 March, 2015 5:20:52 PM Subject: Logging Custom Levels? Hi, I've create a Python file called log.py and placed in the custom levels: # Performance Debug...

Re: How to Mock a mongodb

2015-02-09 Thread Jean-Michel Pichavant
- Original Message - From: Xavier Pegenaute xpegena...@poblenousensefils.net To: python-list@python.org Sent: Saturday, 7 February, 2015 11:09:10 PM Subject: How to Mock a mongodb Dear, I am trying to mock the use of a mongo db and I am having some trouble. Appears that I am

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Jean-Michel Pichavant
- Original Message - From: Neal Becker ndbeck...@gmail.com To: python-list@python.org Sent: Tuesday, 27 January, 2015 2:15:12 PM Subject: Is there a more elegant way to spell this? Is there a more elegant way to spell this? for x in [_ for _ in seq if some_predicate]: You could

Re: class-based class decorator

2015-01-13 Thread Jean-Michel Pichavant
- Original Message - From: Albert-Jan Roskam fo...@yahoo.com From: Jean-Michel Pichavant jeanmic...@sequans.com I don't really understand how you successfuly manage positional parameters, since the caller may not name them. I'm asking because if your intend to check only

Re: class-based class decorator

2015-01-12 Thread Jean-Michel Pichavant
- Original Message - From: Albert-Jan Roskam fo...@yahoo.com.dmarc.invalid import functools import inspect import warnings warnings.simplefilter(always) class check_deprecated_args(object): def __init__(self, deprecated_params, msg=None): self.deprecated_params =

Re: newbie: installing setuptools

2014-12-19 Thread Jean-Michel Pichavant
- Original Message - From: Surbhi Gupta surbhi.2...@gmail.com OK, the problem is now resolved: I just found out that we need to install from prompt instead of IDLE. Setuptools is installed, but I am not able to use easy_install from prompt. It says: easy_install : The term

Re: How to detect that a function argument is the default one

2014-12-11 Thread Jean-Michel Pichavant
- Original Message - From: Chris Angelico ros...@gmail.com c1 = Circle((0,0), 10, None) print c1.mass 20 c1.radius = 20 print c1.mass 40 I think that juust might count as scope creep :) ChrisA Here you go :p c1 = Circle((0,0), 10, None) print c1.mass 20

Re: How to detect that a function argument is the default one

2014-12-11 Thread Jean-Michel Pichavant
- Original Message - From: ast nom...@invalid.com Note : what is the mass of a circle ? In fact it's a ball moving in a plan. I will change that name. I would advise to remove the the mass parameter of your Sphere initialization. It could be inconsistent with the radius. To

Re: How to detect that a function argument is the default one

2014-12-10 Thread Jean-Michel Pichavant
- Original Message - From: ast nom...@invalid.com I have the idea to write: def __init__(center=(0,0), radius=10, mass=None)): if mass == None: self.mass = radius**2 else: self.mass = mass but maybe Python provides something clever. Thx If you

Re: serial data and web

2014-12-09 Thread Jean-Michel Pichavant
- Original Message - From: manduk nas...@nospamxxx.it A web page? Did you mean a Web server? not only upload in a folder of a webserver...I wish to see in real time the datas in a public html page. I get the data from serial port and then I put them in a remote page. Which is

Re: Maintaining Maximum Line Length When Using Tabs Instead of Spaces?

2014-12-08 Thread Jean-Michel Pichavant
- Original Message - From: Aahan Krish kr...@aahan.me To: python-list@python.org Sent: Monday, 8 December, 2014 3:15:43 AM Subject: Maintaining Maximum Line Length When Using Tabs Instead of Spaces? My understanding from talking to different people is that many do use tabs (instead

Re: module import questions and question about pytest and module imports

2014-12-08 Thread Jean-Michel Pichavant
- Original Message - From: sam pendleton samp4...@gmail.com Having to put the garage package on the sys.path seems a little off, why wouldn't relative imports work? Do most people somehow put their packages in sys.path when bundling their python packages up to be shared with

Re: [newbie] how to make program suggest to install missing modules

2014-12-08 Thread Jean-Michel Pichavant
- Original Message - From: sohcahto...@gmail.com try: import someModule except ImportError: print Module is missing # handle it! Just make sure to attempt to import it again after making the call to pip to install it. Note that ImportError may be raised for other

Re: Most gratuitous comments

2014-12-04 Thread Jean-Michel Pichavant
- Original Message - From: sohcahto...@gmail.com I was trying to illustrate the point that some professors would demand you write code like this... # increment the line count lineCount += 1 # Check if line count is over 10 if lineCount 10 # Tell the user there are too many

Re: Style question: Importing modules from packages - 'from' vs 'as'

2014-12-04 Thread Jean-Michel Pichavant
- Original Message - From: Chris Angelico ros...@gmail.com To: python-list@python.org Sent: Wednesday, 3 December, 2014 12:02:17 PM Subject: Style question: Importing modules from packages - 'from' vs 'as' When importing a module from a subpackage, it's sometimes convenient to

Re: Can you use self in __str__

2014-12-04 Thread Jean-Michel Pichavant
- Original Message - From: Seymore4Head Seymore4Head@Hotmail.invalid To: python-list@python.org Sent: Friday, 28 November, 2014 4:31:50 AM Subject: Re: Can you use self in __str__ On Thu, 27 Nov 2014 21:49:29 -0500, Dave Angel da...@davea.name wrote: class Hand: def

Re: Code review

2014-11-05 Thread Jean-Michel Pichavant
- Original Message - From: C Smith illusiontechniq...@gmail.com I read that with 2.7 that I had to initialize class variables to immutable types. I think because I was working with the lists before they had been altered and were still empty lists. I will mess around tomorrow with the

Re: Understanding help command description syntax - explanation needed

2014-11-05 Thread Jean-Michel Pichavant
Original Message - From: Ivan Evstegneev webmailgro...@gmail.com To: python-list@python.org Sent: Wednesday, 5 November, 2014 12:00:16 PM Subject: Understanding help command description syntax - explanation needed So here is the question itself: If I use the help command to check

Re: generating unique variable name via loops

2014-11-04 Thread Jean-Michel Pichavant
- Original Message - From: Fatih Güven mfthgu...@gmail.com I have a structured and repetitive data. I want to read a .txt file line by line and classified it to call easily. For example employee1 has a name, a salary, shift, age etc. and employee2 and other 101 employee have all of

Re: Code review

2014-11-04 Thread Jean-Michel Pichavant
- Original Message - From: C Smith illusiontechniq...@gmail.com To: python-list@python.org Sent: Tuesday, 4 November, 2014 4:28:33 PM Subject: Code review I was wondering if I could get some feedback on the biggest thing I have done as an amateur Python coder. The sidepots

Re: Classes

2014-11-03 Thread Jean-Michel Pichavant
- Original Message - From: Gregory Ewing greg.ew...@canterbury.ac.nz Steven D'Aprano wrote: Like all good Pythonistas[1], we hate Java and think that getter/setter methods are pointless. But come on, they're not *wrong*, What's wrong is the statement that getters and setters

Re: When using a decorator exceptions raised reference the decorator not the function

2014-10-30 Thread Jean-Michel Pichavant
- Original Message - From: Peter Otten __pete...@web.de To: python-list@python.org Sent: Thursday, 30 October, 2014 1:45:42 PM Subject: Re: When using a decorator exceptions raised reference the decorator not the function Néstor Boscán wrote: I'm using Python 2.7 and I'm

Re: Callback functions arguments

2014-10-27 Thread Jean-Michel Pichavant
- Original Message - From: ast nom...@invalid.com To: python-list@python.org Sent: Monday, 27 October, 2014 9:16:26 AM Subject: Callback functions arguments Hi In this web site at example n°5 http://fsincere.free.fr/isn/python/cours_python_tkinter.php A program is using the

Re: Classes and the command line

2014-10-27 Thread Jean-Michel Pichavant
- Original Message - From: Seymore4Head Seymore4Head@Hotmail.invalid To: python-list@python.org Sent: Monday, 27 October, 2014 3:27:18 AM Subject: Classes and the command line I am trying to learn classes. I am currently using Python 2.7 at the command line. If you try to type

Re: (test) ? a:b

2014-10-22 Thread Jean-Michel Pichavant
- Original Message - From: ast nom...@invalid.com To: python-list@python.org Sent: Wednesday, 22 October, 2014 10:29:43 AM Subject: (test) ? a:b Hello Is there in Python something like: j = (j = 10) ? 3 : j+1; as in C language ? thx j = 3 if j =10 else j+1 Cheers JM

Re: (-1)**1000

2014-10-22 Thread Jean-Michel Pichavant
- Original Message - From: ast nom...@invalid.com To: python-list@python.org Sent: Wednesday, 22 October, 2014 10:27:34 AM Subject: (-1)**1000 Hello If i am writing (-1)**1000 on a python program, will the interpreter do (-1)*(-1)*...*(-1) or something clever ? In fact i have

Re: Permissions on files installed by pip?

2014-10-17 Thread Jean-Michel Pichavant
- Original Message - From: Adam Funk a24...@ducksburg.com To: python-list@python.org Sent: Thursday, 16 October, 2014 9:29:46 PM Subject: Permissions on files installed by pip? I've been using the python-nltk package on Ubuntu, but I need ntlk 3.0 now. I used 'sudo aptitude purge

Re: virtualenv question: include just a few site packages

2014-10-10 Thread Jean-Michel Pichavant
- Original Message - From: Gelonida N gelon...@gmail.com To: python-list@python.org Sent: Thursday, 9 October, 2014 5:55:44 PM Subject: Re: virtualenv question: include just a few site packages You could build a virtual machine, installing only your VIP modules, and create virtual

Re: CLI framework using python

2014-10-10 Thread Jean-Michel Pichavant
- Original Message - From: vijna...@gmail.com Hi, I need to develop a python CLI framework. [snip] 3. There are other such commands for which i will be using python scripts. I came across pyCLI, but it doesn't have much documentation, so couldn't figure out how to move

Re: virtualenv question: include just a few site packages

2014-10-09 Thread Jean-Michel Pichavant
- Original Message - From: Gelonida N gelon...@gmail.com To: python-list@python.org Sent: Thursday, 9 October, 2014 12:09:50 AM Subject: virtualenv question: include just a few site packages virtualenv has the switch --system-site-packages (including all system site pacgaes) and

Re: Python code in presentations

2014-10-01 Thread Jean-Michel Pichavant
- Original Message - From: Wolfgang Keller felip...@gmx.net To: python-list@python.org Sent: Wednesday, 1 October, 2014 11:42:34 AM Subject: Re: Python code in presentations Right now the method I'm using is write the code in notepad++, use a plugin (NppExport) to copy paste

Python code in presentations

2014-09-30 Thread Jean-Michel Pichavant
Hello list, I'm currently writing a presentation to help my co-workers ramp up on new features of our tool (written in python (2.7)). I have some difficulties presenting code in an efficient way (with some basic syntax highlights). I need to be catchy about the code I'm presenting otherwise

Re: Python code in presentations

2014-09-30 Thread Jean-Michel Pichavant
- Original Message - From: Joel Goldstick joel.goldst...@gmail.com Cc: python-list@python.org Sent: Tuesday, 30 September, 2014 3:01:38 PM Subject: Re: Python code in presentations I'm a little at a loss that you are concentrating on showing code to users. Are you also showing how

Re: Flask and Python 3

2014-09-26 Thread Jean-Michel Pichavant
- Original Message - From: Chris Angelico ros...@gmail.com Cc: Python python-list@python.org Sent: Friday, 26 September, 2014 1:55:51 AM Subject: Re: Flask and Python 3 On Fri, Sep 26, 2014 at 4:35 AM, Juan Christian juan0christ...@gmail.com wrote: when I say video tutorial, it's

Re: PyCli : Need some reference to good books or tutorials on pycli

2014-09-26 Thread Jean-Michel Pichavant
- Original Message - From: vijna...@gmail.com To: python-list@python.org Sent: Friday, 26 September, 2014 2:54:48 PM Subject: PyCli : Need some reference to good books or tutorials on pycli Hi Folks, I need to develop a CLI (PyCli or similar)on Linux. To be more specific to

Re: how to write a html to automatically display the dictionary?

2014-09-24 Thread Jean-Michel Pichavant
- Original Message - From: luofeiyu elearn2...@gmail.com To: Joel Goldstick joel.goldst...@gmail.com, python-list@python.org Sent: Wednesday, 24 September, 2014 1:06:25 AM Subject: Re: how to write a html to automatically display the dictionary? how can i create the proper html

Re: Class Inheritance from different module

2014-09-22 Thread Jean-Michel Pichavant
class User(Inheritance from API): def __init__(self, ID): steamapi.core.APIConnection(api_key = KEY) super( Inheritance SteamUser (ID)) # creates the user using the API [...] So that in my code when I need to create a new user, I just call 'usr = User(XXX)' instead of calling

Re: Class Inheritance from different module

2014-09-22 Thread Jean-Michel Pichavant
- Original Message - From: Jean-Michel Pichavant jeanmic...@sequans.com To: Juan Christian juan0christ...@gmail.com Cc: Python python-list@python.org Sent: Monday, 22 September, 2014 1:37:41 PM Subject: Re: Class Inheritance from different module class User(Inheritance from API

Re: Love to get some feedback on my first python app!!!

2014-09-22 Thread Jean-Michel Pichavant
- Original Message - From: Chris Angelico ros...@gmail.com Cc: python-list@python.org Sent: Saturday, 20 September, 2014 4:58:44 PM Subject: Re: Love to get some feedback on my first python app!!! [snip] #search API rawData =

Re: Love to get some feedback on my first python app!!!

2014-09-22 Thread Jean-Michel Pichavant
- Original Message - From: Chris Angelico ros...@gmail.com Cc: python-list@python.org Sent: Monday, 22 September, 2014 4:50:15 PM Subject: Re: Love to get some feedback on my first python app!!! On Tue, Sep 23, 2014 at 12:32 AM, Jean-Michel Pichavant jeanmic...@sequans.com wrote

Re: Love to get some feedback on my first python app!!!

2014-09-22 Thread Jean-Michel Pichavant
Original Message - From: Chris Angelico ros...@gmail.com Cc: python-list@python.org Sent: Monday, 22 September, 2014 6:04:43 PM Subject: Re: Love to get some feedback on my first python app!!! On Tue, Sep 23, 2014 at 1:52 AM, Jean-Michel Pichavant jeanmic...@sequans.com wrote

Re: Keeping python code and database in sync

2014-08-29 Thread Jean-Michel Pichavant
- Original Message - From: Roy Smith r...@panix.com Yeah, schema migration is an ugly problem. There's a number of tools to help here, most of which reduce the suckitude, but don't eliminate it completely. Some things you might want to look at: * SQLAlchemy Migrate * South

Re: [RELEASE] Nevow 0.11.1

2014-06-23 Thread Jean-Michel Pichavant
- Original Message - Hello, I'm pleased to announce the release of Nevow 0.11.1. Nevow is a web application construction kit written in Python and based on Twisted. It is designed to allow the programmer to express as much of the view logic as desired in Python, and includes a

Re: pyflakes best practices?

2014-06-04 Thread Jean-Michel Pichavant
- Original Message - We've recently started using pyflakes. The results seem to be similar to most tools of this genre. It found a few real problems. It generated a lot of noise about things which weren't really wrong, but were easy to fix (mostly, unused imports), and a few plain

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Jean-Michel Pichavant
- Original Message - One of my roles on this newsgroup is to periodically whine about stupidities in the Python datetime module. This is one of those times. I have some code which computes how long ago the sun set. Being a nice pythonista, I'm using a timedelta to represent this

Re: How do we pass default argument value to create thread object?

2014-03-12 Thread Jean-Michel Pichavant
- Original Message - Hi, I am using Thread class to create threads. CODE thread = threading.Thread(target=Fun, args=[arg1, arg2, arg3=val]) thread.start() /CODE This code is throwing compilation error(Ipython). In [19]: import threading In [20]: def Fun(agr1, arg2,

Re: Need help in writing some code so i can re-use it in every module or class

2014-02-26 Thread Jean-Michel Pichavant
- Original Message - Hello Experts, I have requirement, like i want to use below command in python script. command --username username --password password Command line arguments now my requirement is i want to write some class so i can re-use command --username username

Re: Functions help

2014-02-24 Thread Jean-Michel Pichavant
- Original Message - On Feb 23, 2014, at 1:44 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Sorry, I don't really understand your question. Could you show an example of what you are doing? Do you mean add 5 or *5? Add *5 doesn't really mean anything

Re: Problem with the console on the new python.org site

2014-02-24 Thread Jean-Michel Pichavant
- Original Message - On Sun, 23 Feb 2014 10:20:15 -0800, Pierre Quentel wrote: The new home page of python.org is very nice, congratulations ! The best I can say about it is that I'm extremely underwhelmed by the design, which is far more busy and colourful than the old design

Re: Mac vs. Linux for Python Development

2014-02-24 Thread Jean-Michel Pichavant
- Original Message - Hello, I'm sure this is a common question but I can't seem to find a previous thread that addresses it. If one one exists, please point me to it. I've been developing with python recreationally for a while on Ubuntu but will soon be transitioning to

Re: Using virtualenv to bypass sudoer issues

2014-02-10 Thread Jean-Michel Pichavant
Thank you all for you insights. I'll probably go with virtualenv, I'll be able to distribute it among the team. There's still one point worrying me though: We're doing a lot a remote execution. We're using execnet http://codespeak.net/execnet/, and I'm not sure it can be compatible with

Re: Using virtualenv to bypass sudoer issues

2014-02-10 Thread Jean-Michel Pichavant
Call the venv version of python and activation is handled. E.g. in a fabfile myenv/bin/python myscript.py -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list wow, the solution is so nice and simple. JM -- IMPORTANT NOTICE: The contents of this email and

Using virtualenv to bypass sudoer issues

2014-02-06 Thread Jean-Michel Pichavant
Greetings, Assuming I have a debian workstation for which I don't have any sudo rights, i n order to be able to install / remove python packages, should I be using virtualenv ? Is it a suited solution ? JM -- IMPORTANT NOTICE: The contents of this email and any attachments are

Re: generator slides review and Python doc (+/- text bug)

2014-02-03 Thread Jean-Michel Pichavant
- Original Message - generator slides review and Python doc I do not know what tool is used to produce such slides. When the mouse is over a a text like a title (H* ... \H* ???) the text get transformed and a colored eol is appearing. Used to get a link to the given

Re: Pyro4 - reading files

2014-01-29 Thread Jean-Michel Pichavant
- Original Message - Hello there. I am currently working on a project involving the use of Pyro4. I have a scenario. We have the pc named A, and a pc named B. On pc B lies a python script, that includes pyro, and a method for reading files. On pc A, we create an instance

Re: interactive help on the base object

2014-01-17 Thread Jean-Michel Pichavant
- Original Message - On 17/01/2014 01:00, Terry Reedy wrote: On 12/6/2013 8:35 PM, Terry Reedy wrote: On 12/6/2013 12:03 PM, Mark Lawrence wrote: Is it just me, or is this basically useless? help(object) Help on class object in module builtins: class object | The

Re: Building and accessing an array of dictionaries

2014-01-16 Thread Jean-Michel Pichavant
- Original Message - I would like to build an array of dictionaries. Most of the dictionary example on the net are for single dictionary. dict = {'a':'a','b':'b','c':'c'} dict2 = {'a':'a','b':'b','c':'c'} dict3 = {'a':'a','b':'b','c':'c'} arr = (dict,dict2,dict3) What is the

Re: a web UI to invoke a python script at server side

2014-01-14 Thread Jean-Michel Pichavant
- Original Message - Hey guys, I'm working on to provide a lightweight web UI for providing an interface to invoke a python script(a sequential script which could involve some system calls) at the server side. The UI should collect some parameters for input into this python

Re: Editor for Python

2014-01-09 Thread Jean-Michel Pichavant
- Original Message - On Jan 8, 2014, at 10:53 AM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: -- IMPORTANT NOTICE: too late you have sent this to a public forum No pb with that, the python list is the intended recipient :) I tried to negotiate this with my

Re: Editor for Python

2014-01-08 Thread Jean-Michel Pichavant
- Original Message - On Friday, 23 November 2001 04:13:40 UTC+5:30, MANUEL FERNANDEZ PEREZ wrote: Hello, I'm looking for an editor for Python.I' m interested it works on Windows.Can anybody help me? Thank you Manuel http://lmgtfy.com/?q=python+editor+windows

Re: Editor for Python

2014-01-08 Thread Jean-Michel Pichavant
- Original Message - I've been pleased with Komodo, and certainly prefer it over Notepad++. Komodo: http://www.activestate.com/komodo-ide?gclid=COHE4eLj7rsCFQISMwodOUQAiw Komodo is an IDE and costs 385$. I certainly expect it to better than notepad++. JM -- IMPORTANT NOTICE:

Re: Editor for Python

2014-01-08 Thread Jean-Michel Pichavant
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or

Re: nested dictionaries and functions in data structures.

2014-01-07 Thread Jean-Michel Pichavant
- Original Message - Hello all. I have some questions again. :-) I wish to be able to place a function within a data structure. I would like to use a dictionary because I could pass it a key and then the function could be called. I couldn't find anything on the net to show me

Re: nested dictionaries and functions in data structures.

2014-01-07 Thread Jean-Michel Pichavant
- Original Message - Thanks for that. It resolved the issue and it was so simple compared to everything else I saw on the net. Only outstanding thing I have to work out is how to execute functions from a dictionary. I will continue searching on the net. Sean This may help you

Re: word replacing in a paragraph

2014-01-06 Thread Jean-Michel Pichavant
- Original Message - Hey guys, I'm trying to automate a process by initially creating a standard template and then replace some text fields with variable values. [for example, DATE in the paragraph will be replaced by the current date value. it doesn't have to be a literal word

Re: Variables in a loop, Newby question

2013-12-24 Thread Jean-Michel Pichavant
- Original Message - Hello, for the first time I'm trying te create a little Python program. (on a raspberri Pi) I don't understand the handling of variables in a loop with Python. Lets say i want something like this. x = 1 while x 10 var x = x x = x + 1 The

Re: how to develop code using a mix of an existing python-program and console-commands

2013-12-23 Thread Jean-Michel Pichavant
- Original Message - Am 18.12.13 21:17, schrieb Jean Dubois: I have a python-program which I want to perform its task first, then switch to the python console to experiment with further commands, using what was already defined in the python-program. Excellent way to

Re: Logger module in python

2013-12-18 Thread Jean-Michel Pichavant
Original Message - On Wednesday, December 18, 2013 8:52:11 AM UTC+5:30, smileso...@gmail.com wrote: Hi, I am a newbie in python. I am looking for a existing module which I can import in my program to log the objects to a file? I know there is a module Data::Dumper in perl

Re: Struggling for inspiration with lists

2013-12-18 Thread Jean-Michel Pichavant
- Original Message - Hi I have a list of data that presents as: timestamp: value Timestamps are used solely to determine the sequence of items in the list. I want to find the longest repeated sequence of values in the list. Example, in the following list: data = { 0: d,

Re: seeking a framework to automate router configurations

2013-12-18 Thread Jean-Michel Pichavant
- Original Message - Hi Pythoners, I'm looking for a tool or framework in which I can do a slight modification to achieve the following task: Asynchronously reset a large number of cisco routers back to their original configurations and push prepared initial configurations to them

Re: How to import Wave files into python?

2013-12-18 Thread Jean-Michel Pichavant
- Original Message - How exactly do I import a .wav file and run it? also is it possible to run it inside a while loop if so or it just start playing when its run? - Tom 14 -- https://mail.python.org/mailman/listinfo/python-list I think the pygame module should be able to do so. JM

Re: [newbie] trying socket as a replacement for nc

2013-12-17 Thread Jean-Michel Pichavant
I'm a newbie in Python programming that is very much true, and contrary to what you seem to suggest I did my homework At no point that was my intention, my apologies. If you fixed the syntax error, you should be pretty close to the solution though. JM -- IMPORTANT NOTICE: The contents of

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
Such equipment often implements a telnet protocol. Have use try using the telnetlib module ? http://docs.python.org/2/library/telnetlib.html t = Telnet(host, port) t.write('*IDN?') print t.read_until('Whateverprompt') # you can use read_very_eager also JM Could you tell me

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
Did you try import telnetlib ? Note that in the code above I forgot the EOF, which is very much dependent of the equipment itself. You may have to write t.write('*IDN?\n') or t.write('IDN?\n\r') JM Additionally, here's the code we're using for our signal generators, just to

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
Here is the code: #!/usr/bin/env python import telnetlib host = '10.128.59.63' port = 7000 t = Telnet(host, port) t.write('*IDN?\n') print t.read_until('Whateverprompt') # you can use read_very_eager also and this is the result of executing the code(from which I deduce I have to

  1   2   3   4   5   6   7   8   9   10   >