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" > 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 > wrote: > > How abo

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" > > 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, us

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

2015-08-26 Thread Jean-Michel Pichavant
- Original Message - > From: "Chris Angelico" > 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 > wrote: > > To add to Joel

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

2015-08-26 Thread Jean-Michel Pichavant
- Original Message - > From: "Joel Goldstick" > 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 restricted

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

2015-08-25 Thread Jean-Michel Pichavant
- Original Message - > From: "ast" > 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

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

2015-08-25 Thread Jean-Michel Pichavant
> From: "C.D. Reimer" > 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 ended in fa

Re: Most Pythonic way to store (small) configuration

2015-08-04 Thread Jean-Michel Pichavant
- Original Message - > From: "Cecil Westerhof" > 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 > - js

Re: Optimal solution for coloring logging output

2015-08-03 Thread Jean-Michel Pichavant
Original Message - > From: "c buhtz" > 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: Python 3 May Become Relevant Now

2015-08-03 Thread Jean-Michel Pichavant
- Original Message - > From: "Mark Lawrence" > 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 fellow Pytho

Re: Help Command Question

2015-07-29 Thread Jean-Michel Pichavant
- Original Message - > From: "ltc hotspot" > To: "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 iPython interpreter. Read captured cop

Re: line error on no. 7

2015-07-29 Thread Jean-Michel Pichavant
- Original Message - > From: "ltc hotspot" > To: "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 using the split(function) and to pr

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

2015-07-17 Thread Jean-Michel Pichavant
- Original Message - > From: "Steven D'Aprano" > 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 rating" 2015 ed

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 w

Re: Catching exceptions with multi-processing

2015-06-19 Thread Jean-Michel Pichavant
- Original Message - > From: "Oscar Benjamin" > 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', math.sqrt(x) >

Re: Catching exceptions with multi-processing

2015-06-19 Thread Jean-Michel Pichavant
- Original Message - > From: "Fabien" > 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 operations on them. The

Re: ctypes and byte order

2015-06-19 Thread Jean-Michel Pichavant
- Original Message - > From: "Terry Reedy" > 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 c

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,

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 of

Re: for...else

2015-06-02 Thread Jean-Michel Pichavant
- Original Message - > From: "acdr" > To: "Jean-Michel Pichavant" > 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

Re: for...else

2015-06-02 Thread Jean-Michel Pichavant
- Original Message - > From: "acdr" > To: "Jean-Michel Pichavant" > 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 > th

Re: for...else

2015-06-02 Thread Jean-Michel Pichavant
- Original Message - > From: "acdr" > 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: 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_fil

Re: A question on the creation of list of lists

2015-04-22 Thread Jean-Michel Pichavant
- Original Message - > From: "subhabrata banerji" > 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 > put the results in

Re: Code critique please

2015-04-08 Thread Jean-Michel Pichavant
- Original Message - > From: "kai peters" > 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? Anything > terrib

Re: Logging Custom Levels?

2015-03-31 Thread Jean-Michel Pichavant
- Original Message - > From: "Didymus" > 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... > logging.addLevelName(PDE

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" > 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 strongl

Re: How to Mock a mongodb

2015-02-09 Thread Jean-Michel Pichavant
- Original Message - > From: "Xavier Pegenaute" > 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 not able to return a de

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

2015-01-27 Thread Jean-Michel Pichavant
- Original Message - > From: "Neal Becker" > 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 use a gene

Re: class-based class decorator

2015-01-13 Thread Jean-Michel Pichavant
- Original Message - > From: "Albert-Jan Roskam" > > From: Jean-Michel Pichavant > > I don't really understand how you successfuly manage positional > > parameters, > > since the caller may not name them. > > I'm asking because if

Re: class-based class decorator

2015-01-12 Thread Jean-Michel Pichavant
- Original Message - > From: "Albert-Jan Roskam" > import functools > import inspect > import warnings > > warnings.simplefilter("always") > > class check_deprecated_args(object): > > def __init__(self, deprecated_params, msg=None): > self.deprecated_params = deprecated_para

Re: newbie: installing setuptools

2014-12-19 Thread Jean-Michel Pichavant
- Original Message - > From: "Surbhi Gupta" > 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 'easy_install' is not re

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

2014-12-11 Thread Jean-Michel Pichavant
- Original Message - > From: "ast" > > > >> 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 compute

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

2014-12-11 Thread Jean-Michel Pichavant
- Original Message - > From: "Chris Angelico" > > 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 c1.gr

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

2014-12-10 Thread Jean-Michel Pichavant
- Original Message - > From: "ast" > 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 like on

Re: serial data and web

2014-12-09 Thread Jean-Michel Pichavant
- Original Message - > From: "manduk" > > "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 the best

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

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

2014-12-08 Thread Jean-Michel Pichavant
- Original Message - > From: "sam pendleton" > 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 setuptools or othe

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

2014-12-08 Thread Jean-Michel Pichavant
- Original Message - > From: "Aahan Krish" > 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 of sp

Re: Can you use self in __str__

2014-12-04 Thread Jean-Michel Pichavant
- Original Message - > From: "Seymore4Head" > 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 > wrote: > > class Hand: > def __init__(self): > self.hand = []

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

2014-12-04 Thread Jean-Michel Pichavant
- Original Message - > From: "Chris Angelico" > 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 refer to it

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 ar

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Jean-Michel Pichavant
Original Message - > From: "Ivan Evstegneev" > 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 the “range” c

Re: Code review

2014-11-05 Thread Jean-Michel Pichavant
- Original Message - > From: "C Smith" > 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 classes you suggested

Re: Code review

2014-11-04 Thread Jean-Michel Pichavant
- Original Message - > From: "C Smith" > 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 algorithm isn't > correct ye

Re: generating unique variable name via loops

2014-11-04 Thread Jean-Michel Pichavant
- Original Message - > From: "Fatih Güven" > 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 it. > > Call e

Re: Classes

2014-11-03 Thread Jean-Michel Pichavant
- Original Message - > From: "Gregory Ewing" > 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 > are necessary to

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

Re: Classes and the command line

2014-10-27 Thread Jean-Michel Pichavant
- Original Message - > From: "Seymore4Head" > 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 commands at the comman

Re: Callback functions arguments

2014-10-27 Thread Jean-Michel Pichavant
- Original Message - > From: "ast" > 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 "Scale"

Re: (-1)**1000

2014-10-22 Thread Jean-Michel Pichavant
- Original Message - > From: "ast" > 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 (-1)*

Re: (test) ? a:b

2014-10-22 Thread Jean-Michel Pichavant
- Original Message - > From: "ast" > 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: Permissions on files installed by pip?

2014-10-17 Thread Jean-Michel Pichavant
- Original Message - > From: "Adam Funk" > 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 python-nlt

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-10 Thread Jean-Michel Pichavant
- Original Message - > From: "Gelonida N" > 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 environme

Re: virtualenv question: include just a few site packages

2014-10-09 Thread Jean-Michel Pichavant
- Original Message - > From: "Gelonida N" > 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 the switch

Re: Python code in presentations

2014-10-01 Thread Jean-Michel Pichavant
- Original Message - > From: "Wolfgang Keller" > 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 code i

Re: Python code in presentations

2014-09-30 Thread Jean-Michel Pichavant
- Original Message - > From: "Joel Goldstick" > 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 your tool works

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 th

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

Re: Flask and Python 3

2014-09-26 Thread Jean-Michel Pichavant
- Original Message - > From: "Chris Angelico" > Cc: "Python" > 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 > wrote: > > when I say video tutorial, it's implied that every video that I > > talked about

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

2014-09-24 Thread Jean-Michel Pichavant
- Original Message - > From: "luofeiyu" > To: "Joel Goldstick" , 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 file with Jinjia 2 or other temple?

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

2014-09-22 Thread Jean-Michel Pichavant
Original Message - > From: "Chris Angelico" > 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 > wrote:

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

2014-09-22 Thread Jean-Michel Pichavant
- Original Message - > From: "Chris Angelico" > 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 Pichavan

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

2014-09-22 Thread Jean-Michel Pichavant
- Original Message - > From: "Chris Angelico" > 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 = > > urllib.urlopen('http://ajax.googleapis.com/ajax

Re: Class Inheritance from different module

2014-09-22 Thread Jean-Michel Pichavant
- Original Message - > From: "Jean-Michel Pichavant" > To: "Juan Christian" > Cc: "Python" > Sent: Monday, 22 September, 2014 1:37:41 PM > Subject: Re: Class Inheritance from different module > > > > cl

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")' ins

Re: Keeping python code and database in sync

2014-08-29 Thread Jean-Michel Pichavant
- Original Message - > From: "Roy Smith" > > 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 (djan

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 incl

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 pl

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

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. > > thread = threading.Thread(target=Fun, args=[arg1, arg2, arg3="val"]) > thread.start() > > This code is throwing compilation error(Ipython). > In [19]: import threading > In [20]: def Fun(agr1, arg2, arg3=No

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. > --username --password arguments> > now my requirement is i want to write some class so i can re-use > " --username --password " part via > importing as module or clas

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: 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 de

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

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 emai

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 virtua

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 con

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*> ???) > the text get transformed and a colored eol is appearing. Used to get a link to the given chap

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

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: > >>>

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

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 sc

Re: Editor for Python

2014-01-09 Thread Jean-Michel Pichavant
- Original Message - > > On Jan 8, 2014, at 10:53 AM, Jean-Michel Pichavant > wrote: > > >>> -- IMPORTANT NOTICE: > >>> > >> > >> too late you have sent this to a public forum > > > > No pb with that, the python li

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 purp

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
- 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+

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 hel

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 s

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

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 =

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. > > Excell

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.

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

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

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::Dumpe

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
- Original Message - > On Tue, Dec 17, 2013 at 5:26 AM, Jean Dubois > wrote: > >> Try something simple first: > >> import telnetlib > >> host = '10.128.59.63' > >> port = 7000 > >> t = Telnet(host, port) > >> def flush() > >> t.read_very_eager() > >> def sendCmd(cmd) > >> t.write('%s

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

2013-12-16 Thread Jean-Michel Pichavant
> This is what I got using telnet: > [jean:~] $ telnet 10.128.59.63 7000 > Trying 10.128.59.63... > Connected to 10.128.59.63. > Escape character is '^]'. > *IDN? > KEITHLEY INSTRUMENTS INC.,MODEL 2425,1078209,C32 Oct 4 2010 > 14:20:11/A02 /E/ >

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

2013-12-16 Thread Jean-Michel Pichavant
- Original Message - > Op maandag 16 december 2013 13:05:41 UTC+1 schreef Jean-Michel > Pichavant: > > > Here is the code: > > > #!/usr/bin/env python > > > import telnetlib > > > host = '10.128.59.63' > > > port = 7000 >

  1   2   3   4   5   6   7   8   9   10   >