Re: Quick way to calculate lines of code/comments in a collection of Python scripts?

2016-10-24 Thread Stephen Tucker
Tomasz, How about using the command prompt command FIND /C on each of your source files as follows: FIND/C "#" >NumbersOfLinesContainingPythonComments.dat FIND/C /V "#" >NumbersOfLinesNotContainingPythonComments.dat You would end up with two files each with a column of line counts; Import thes

Re: exist loop by pressing esc

2016-10-24 Thread John Gordon
In <6e030fd0-93c1-4d23-8656-e06c411b6...@googlegroups.com> chris alindi writes: > simple while loop range(10) if user press esc exits loop range() is typically used with for loops, not while loops. what is your while condition? what use is the range() value? -- John Gordon

Re: multiprocess passing arguments double asterisks

2016-10-24 Thread pic8690
On Sunday, October 23, 2016 at 3:44:16 PM UTC-5, Thomas Nyberg wrote: > On 10/23/2016 03:12 AM, pic8...@gmail.com wrote: > > import multiprocessing as mp > > > > def bar(**kwargs): > >for a in kwargs: > > print a,kwargs[a] > > > > arguments={'name':'Joe','age':20} > > p=mp.Pool(processes=

Re: multiprocess passing arguments double asterisks

2016-10-24 Thread Thomas Nyberg
On 10/24/2016 12:45 PM, pic8...@gmail.com wrote: Thanks for the reply. The code snippet given by Peter is not very clear I would like to multiprocess a function which is written in python of the form bar(**kwargs) which returns a value. This example does not return anything Would you please

retain dimensions for numpy slice

2016-10-24 Thread duncan smith
Hello, I have several arrays that I need to combine elementwise in various fashions. They are basically probability tables and there is a mapping of axes to variables. I have code for transposing and reshaping that aligns the variables / axes so the usual broadcasting rules achieve the desire

Re: retain dimensions for numpy slice

2016-10-24 Thread Peter Otten
duncan smith wrote: > Hello, > I have several arrays that I need to combine elementwise in > various fashions. They are basically probability tables and there is a > mapping of axes to variables. I have code for transposing and reshaping > that aligns the variables / axes so the usual broadc

Why doesn't Python include non-blocking keyboard input function?

2016-10-24 Thread jladasky
After reading this rather vague thread... https://groups.google.com/forum/#!topic/comp.lang.python/FVnTe2i0UTY ... I find myself asking why Python doesn't include a standard, non-blocking keyboard input function. I have often wanted one myself. The only way that I've ever achieved this behavi

Re: Quick way to calculate lines of code/comments in a collection of Python scripts?

2016-10-24 Thread MrJean1
On Wednesday, October 5, 2016 at 1:57:14 PM UTC-4, Malcolm Greene wrote: > Looking for a quick way to calculate lines of code/comments in a > collection of Python scripts. This isn't a LOC per day per developer > type analysis - I'm looking for a metric to quickly judge the complexity > of a set of

Re: Signals and Threads in Python 3.5 or so

2016-10-24 Thread Dan Stromberg
On Mon, Oct 10, 2016 at 12:05 AM, dieter wrote: > Dan Stromberg writes: >> I have a program http://stromberg.dnsalias.org/~dstromberg/looper/ >> that I use and maintain. >> >> It's like GNU parallel or similar - yet another "run n processes, m at >> a time" implementation. Interestingly, I've on

Sphinx + autodoc + apidoc

2016-10-24 Thread Dan Stromberg
Hi folks. I'm attempting to set up Sphinx to document several API's based on docstrings. I've got something browseable for one example API using Sphinx + autodoc + apidoc. However, we aren't really a PEP8 shop; we use hard tabs expanded to 4 columns, and we use 120 columns total width (and somet

Re: sphinx (or other means to document python)

2016-10-24 Thread Dan Stromberg
On Sat, Sep 24, 2016 at 6:30 PM, Yann Kaiser wrote: > pydoctor may be something you're looking for. I don't know if it supports > exporting to PDF like Sphinx does. > > As you've no doubt figured out by now, Sphinx doesn't revolve around the > Python files themselves, but rather .rst files in whic

Re: Sphinx + autodoc + apidoc

2016-10-24 Thread Ned Batchelder
On Monday, October 24, 2016 at 5:00:47 PM UTC-4, Dan Stromberg wrote: > Hi folks. > > I'm attempting to set up Sphinx to document several API's based on docstrings. > > I've got something browseable for one example API using Sphinx + > autodoc + apidoc. > > However, we aren't really a PEP8 shop;

lxml and xpath(?)

2016-10-24 Thread Doug OLeary
Hey; Reasonably new to python and incredibly new to xml much less trying to parse it. I need to identify cluster nodes from a series of weblogic xml configuration files. I've figured out how to get 75% of them; now, I'm going after the edge case and I'm unsure how to proceed. Weblogic xml conf

Re: Internet Data Handling ยป mailbox

2016-10-24 Thread Adam Jensen
On 10/22/2016 11:56 PM, Jason Friedman wrote: >> >> for message in mailbox.mbox(sys.argv[1]): >> if message.has_key("From") and message.has_key("To"): >> addrs = message.get_all("From") >> addrs.extend(message.get_all("To")) >> for addr in add

Re: Quick way to calculate lines of code/comments in a collection of Python scripts?

2016-10-24 Thread Tomasz Rola
On Mon, Oct 24, 2016 at 10:03:29AM +0100, Stephen Tucker wrote: > Tomasz, > > How about using the command prompt command FIND /C on each of your source > files as follows: > > FIND/C "#" >NumbersOfLinesContainingPythonComments.dat > FIND/C /V "#" >NumbersOfLinesNotContainingPythonComments.dat >

Re: Sphinx + autodoc + apidoc

2016-10-24 Thread Dan Stromberg
On Mon, Oct 24, 2016 at 2:39 PM, Ned Batchelder wrote: > On Monday, October 24, 2016 at 5:00:47 PM UTC-4, Dan Stromberg wrote: >> However, we aren't really a PEP8 shop; we use hard tabs expanded to 4 >> columns, and we use 120 columns total width (and sometimes a little >> more :). >> Is there a

Re: retain dimensions for numpy slice

2016-10-24 Thread duncan smith
On 24/10/16 19:05, Peter Otten wrote: > duncan smith wrote: > >> Hello, >> I have several arrays that I need to combine elementwise in >> various fashions. They are basically probability tables and there is a >> mapping of axes to variables. I have code for transposing and reshaping >> that

System-wide module path

2016-10-24 Thread Rob Gaddi
On a Linux (Ubuntu) system, with no concerns for Python < 3.4, how do I a) Add a directory to the system-wide (rather than per-user) module path? b) Tell pip that I would like to install a given module to there. What's going on is that we're trying to set up an internal software distribution

Re: Sphinx + autodoc + apidoc

2016-10-24 Thread Ned Batchelder
On Monday, October 24, 2016 at 7:02:11 PM UTC-4, Dan Stromberg wrote: > On Mon, Oct 24, 2016 at 2:39 PM, Ned Batchelder > wrote: > > On Monday, October 24, 2016 at 5:00:47 PM UTC-4, Dan Stromberg wrote: > > >> However, we aren't really a PEP8 shop; we use hard tabs expanded to 4 > >> columns, an

Re: System-wide module path

2016-10-24 Thread Zachary Ware
On Mon, Oct 24, 2016 at 6:49 PM, Rob Gaddi wrote: > On a Linux (Ubuntu) system, with no concerns for Python < 3.4, how do I > a) Add a directory to the system-wide (rather than per-user) module > path? This is the trickier part. There are a couple of ways to do it, but which is better is a mat

Re: Why doesn't Python include non-blocking keyboard input function?

2016-10-24 Thread Steven D'Aprano
On Tuesday 25 October 2016 05:14, jlada...@itu.edu wrote: > After reading this rather vague thread... > > https://groups.google.com/forum/#!topic/comp.lang.python/FVnTe2i0UTY > > ... I find myself asking why Python doesn't include a standard, non-blocking > keyboard input function. I have often