[issue44844] The command line of launching Edge on Linux hangs

2021-08-05 Thread Ray Luo


New submission from Ray Luo :

Launching Chrome on Linux from command line:

$ export BROWSER=google-chrome; python -m webbrowser 
https://httpbin.org/delay/10

It can successfully launch Chrome with the specified web page opened in a 
new tab.
And the console command line finishes BEFORE the web page being fully 
loaded in the browser. That is the desirable behavior.

Launching Edge on Linux from command line:

$ export BROWSER=microsoft-edge; python -m webbrowser 
https://httpbin.org/delay/10

The command line hangs until the Edge window is closed.

That hanging symptom can be resolved by writing a deliberate script to 
webbrowser.register("...", None, 
webbrowser.BackgroundBrowser("microsoft-edge")) and then use that registered 
browser. But it was not obvious, and it took trial-and-error to reach that 
solution.

Could it be possible to have the "BROWSER=microsoft-edge; python -m webbrowser 
https://httpbin.org/delay/10; work out of the box, without hanging?

Is it because Edge is not currently predefined and handled inside 
webbrowser.py? It seems not an easy decision to add new browser into 
webbrowser.py, though, based on the 2nd and 3rd comments in this old issue: 
https://bugs.python.org/issue42330

--
components: Library (Lib)
messages: 399030
nosy: rayluo
priority: normal
severity: normal
status: open
title: The command line of launching Edge on Linux hangs
type: behavior
versions: Python 3.7

___
Python tracker 
<https://bugs.python.org/issue44844>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44760] Turtle Documentation - Contents Hyperlink conflict

2021-07-28 Thread Ray Kinane


New submission from Ray Kinane :

In the Turtle module,
there are 2 methods named "clear",
one for turtle objects and one for screen objects.

In the Turtle module documentation, 
in the contents section, 
in the "Turtle methods" section, 
under "More drawing control"
the clear() method hyperlink 
does not point to the correct section in the article.
It points to the section for the clear method for screen objects.

There is another identical hyperlink issue in the same article due to 2 methods 
with the same name: "reset"

--
assignee: docs@python
components: Documentation
messages: 398361
nosy: docs@python, ray_giraffe
priority: normal
severity: normal
status: open
title: Turtle Documentation - Contents Hyperlink conflict
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 
<https://bugs.python.org/issue44760>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Ann: New Python curses book

2021-03-30 Thread William Ray Wing via Python-list
I’ve ordered the book (physical volume). It will fulfill a need I’ve had for 
some time.  Unfortunately, it is only available in the UK store, so the 
shipping cost by far outweighs the book’s cost.  Hope for other’s sake, it 
migrates to the other Amazon stores fairly quickly.

Thanks,
Bill

> On Mar 30, 2021, at 7:12 AM, Alan Gauld via Python-list 
>  wrote:
> 
> I've just published, in Kindle and paperback formats,
> my book on "Programming curses with Python".
> 
> https://www.amazon.co.uk/dp/B091B85B77/
> 
> (It should be available in most other Amazon stores too)

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread William Ray Wing via Python-list



> On Jan 26, 2021, at 2:00 PM, C W  wrote:
> 
> Hello everyone,
> 
> I'm a long time Matlab and R user working on data science. How do you
> troubleshooting/debugging in Python?
> 

Another approach is to run the code in an IDE.  I happen to use Wing, but that 
is a coincidence.  But almost ANY IDE will let you set a break point, then 
single-step through your code starting at the break point and examine the 
values of your variables at each step.  Sometimes this is an awfully big hammer 
for what is a head-slapping mistake.  But it has never failed me.

Good luck,
Bill

-- 
https://mail.python.org/mailman/listinfo/python-list


Why is Python deleting every time

2020-10-01 Thread Sai Shubham Ray
Sometimes when I try to run python program it says that python is not
installed and I have to repair it. Thank god there is a repair option in
python but still do something to get rid of this problem

Regards
Sai Shubham Ray
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread William Ray Wing via Python-list

> On Aug 1, 2020, at 10:35 AM, o1bigtenor  wrote:
> 
> On Sat, Aug 1, 2020 at 9:29 AM o1bigtenor  wrote:
>> 
>>> On Sat, Aug 1, 2020 at 6:58 AM Peter Otten <__pete...@web.de> wrote:
>>> 
>>> o1bigtenor wrote:
>>> 
>>> import calendar
>>> print (calendar.calendar(2024,1,1,2,8))
>>> 
 I would like to show something like 2024 through the end of 2028.
>>> 
>>> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
>> 
>> 
>> Sorry - - - - 1st response was to only Mr Peter - - - hopefully this is
>> useful to more than I so here is that to all.
>>> 
>>> 
>> 
> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
>> Traceback (most recent call last):
>>  File "", line 1, in 
>>  File "", line 1, in 
>> NameError: name 'cd' is not defined
>> 
>> so 'cd' seems to be a problem.
>> 
>> Tried changing 'cd' to calendar and that gives the desired response.
>> 
>> Except its a neat 3 months wide very very very many rows of calendar.
>> 
>> I'm trying to figure out how to do something like this:
>> 
>>November 2022  December 2022
>>January 2023February 2023
>> March 2023April 2023
>> May 2023
>>   Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa  Su Mo Tu
>> We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
>> Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
>> 1231  2  3  4  5 127  1  2  3
>>132  1  2  3  4  5  6  7  136   1  2  3  4  140
>> 1  2  3  4  1441  149 1  2  3  4  5  6
>> 124  6  7  8  9 10 11 12  128  4  5  6  7  8  9 10  133  8  9 10 11 12
>> 13 14  137  5  6  7  8  9 10 11  141  5  6  7  8  9 10 11  145  2  3
>> 4  5  6  7  8  150  7  8  9 10 11 12 13
>> 125 13 14 15 16 17 18 19  129 11 12 13 14 15 16 17  134 15 16 17 18 19
>> 20 21  138 12 13 14 15 16 17 18  142 12 13 14 15 16 17 18  146  9 10
>> 11 12 13 14 15  151 14 15 16 17 18 19 20
>> 126 20 21 22 23 24 25 26  130 18 19 20 21 22 23 24  135 22 23 24 25 26
>> 27 28  139 19 20 21 22 23 24 25  143 19 20 21 22 23 24 25  147 16 17
>> 18 19 20 21 22  152 21 22 23 24 25 26 27
>> 127 27 28 29 30   131 25 26 27 28 29 30 31  136 29 30 31
>>   140 26 27 28  144 26 27 28 29 30 31 148 23 24
>> 25 26 27 28 29  153 28 29 30 31
>> 
>>   149 30
>> 
>>   June 2023 July 2023August 2023
>>   September 2023 October 2023
>> November 2023 December 2023
>>Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th
>> Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo
>> Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
>> 153  1  2  3  1571  1621  2  3
>> 4  5  166 1  2  171  1  2  3  4  5  6  7  175
>>  1  2  3  4  179 1  2
>> 
>> The formatting here is a mess.
> 
> (Its an even bigger mess now when its truncated to 80 columns. Can't change
> the mess but I can tell you that it doesn't 'look that way'! Don't know how to
> include an example in the body and have it be even a bit accurate - - - please
> advise if there is a way.)
> 

If you want us to see it in its exact form, print to PDF, post/share It on 
Dropbox. 

>> The months are centered. The week numbers are consecutive from the
>> starting date.
>> The dates are centered under the weekday name. If you've ever used
>> ncal its like that except
>> that I can now have up to 7 months wide if the terminal is wide enough
>> (>180 columns IIRC).
>> A mentor was working on this in Perl but as he died some couple months
>> ago its up to me
>> to make what I want.
>> Because it seems like there are a lot of disparate things happening
>> its not very straight
>> forward trying to replicate and extend my friend's efforts except in
>> Python. (My friend
>> preferred to work in Perl rather than Python and I'm wanting to learn
>> Python. I understand
>> that this is not perhaps the easiest way to learn something but it
>> sure is interesting!)
>> 
>> TIA
> -- 
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2020-04-13 Thread Ray Donnelly


Ray Donnelly  added the comment:

I took the liberty of filing this: https://bugs.python.org/issue40263

Cheers.

--
nosy: +Ray Donnelly

___
Python tracker 
<https://bugs.python.org/issue26903>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40263] ValueError exception on _winapi.WaitForMultipleObjects

2020-04-13 Thread Ray Donnelly


Ray Donnelly  added the comment:

https://github.com/python/cpython/pull/19501

--

___
Python tracker 
<https://bugs.python.org/issue40263>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40263] ValueError exception on _winapi.WaitForMultipleObjects

2020-04-13 Thread Ray Donnelly


Change by Ray Donnelly :


--
nosy: +Ray.Donnelly
nosy_count: 5.0 -> 6.0
pull_requests: +18852
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19501

___
Python tracker 
<https://bugs.python.org/issue40263>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40263] Follow on bug from https://bugs.python.org/issue26903 (ValueError exception on _winapi.WaitForMultipleObjects)

2020-04-12 Thread Ray Donnelly


Change by Ray Donnelly :


--
keywords: +patch
Added file: 
https://bugs.python.org/file49057/-Fix-off-by-one-error-in-_winapi_WaitForMultipleObjec.patch

___
Python tracker 
<https://bugs.python.org/issue40263>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40263] Follow on bug from https://bugs.python.org/issue26903 (ValueError exception on _winapi.WaitForMultipleObjects)

2020-04-12 Thread Ray Donnelly


Change by Ray Donnelly :


Removed file: 
https://bugs.python.org/file49056/-bpo-26903-Limit-ProcessPoolExecutor-to-61-workers-on-Windows.patch.ref

___
Python tracker 
<https://bugs.python.org/issue40263>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40263] Follow on bug from https://bugs.python.org/issue26903 (ValueError exception on _winapi.WaitForMultipleObjects)

2020-04-12 Thread Ray Donnelly


Ray Donnelly  added the comment:

See my proposed patch. I am happy to make a PR on github for this too if people 
agree it's the right fix.

--
Added file: 
https://bugs.python.org/file49056/-bpo-26903-Limit-ProcessPoolExecutor-to-61-workers-on-Windows.patch.ref

___
Python tracker 
<https://bugs.python.org/issue40263>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40263] Follow on bug from https://bugs.python.org/issue26903 (ValueError exception on _winapi.WaitForMultipleObjects)

2020-04-12 Thread Ray Donnelly


New submission from Ray Donnelly :

See attached reproducer

--
components: Interpreter Core, Windows
files: ppe.py
messages: 366258
nosy: Ray Donnelly, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Follow on bug from https://bugs.python.org/issue26903 (ValueError 
exception on _winapi.WaitForMultipleObjects)
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file49055/ppe.py

___
Python tracker 
<https://bugs.python.org/issue40263>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: [Tutor] Questions

2019-04-08 Thread William Ray Wing via Python-list
Diana, I’m answering you via the Tutor list - please, the accepted protocol is 
to send all questions and answers to the list so answers can be seen by (and 
possibly help) others.

Having said that, I should have paid more attention to your original question, 
which is really going to require answers that are beyond the typical Tutor 
question level, so I’m also forwarding to the main Python list where you should 
be able to get pointers.

But let me ask, how much programming do you know? Python is a full-blown 
programming language, like Java or C.  Have you written programs before that, 
for example can accept a file name from a user, open that file, and read its 
contents?  If yes, then I apologize, and would point you at:


https://medium.freecodecamp.org/how-to-scrape-websites-with-python-and-beautifulsoup-5946935d93fe
 


https://towardsdatascience.com/how-to-web-scrape-with-python-in-4-minutes-bc49186a8460

https://realpython.com/python-web-scraping-practical-introduction/
or
https://docs.python-guide.org/scenarios/scrape/

The next steps would probably involve loading that scraped data into Pandas:


https://pandas.pydata.org/pandas-docs/stable/getting_started/tutorials.html


https://data36.com/pandas-tutorial-1-basics-reading-data-files-dataframes-data-selection/

https://www.tutorialspoint.com/python_pandas

On the other hand, if your answer to my question is: “no” - then you should 
take a look at any of the really vast
collection of web sites devoted to Python learning.  Note that Python was 
originally designed to be a language that would be easy for beginners to learn. 
 It still is - I’d claim it is about the easiest -

>>> print( "Hello world!" ) 
Hello world!

Those lines were lifted from Alan Gauld’s learn to program web site.

Let us know how we can help.

Bill


> On Apr 8, 2019, at 5:40 PM, Diana Katz  wrote:
> 
> Yes - data would need to be scraped from sec.gov <http://sec.gov/> website. 
> I want to be able to pull up segment data from 10-Q filings of individual 
> companies by putting in a ticker (preferably in excel, but an be done 
> elsewhere).  Trying to figure out how to even start setting this up. 
> 
> Thank you!
> 
> On Sun, Apr 7, 2019 at 8:57 PM William Ray Wing  <mailto:w...@mac.com>> wrote:
> 
> 
> > On Apr 5, 2019, at 8:01 PM, Diana Katz  > <mailto:diana.k...@gmail.com>> wrote:
> > 
> > 1) Can you use python from excel? Or just export to excel?
> 
> Simple answer: no.  Python can read and write excel files through libraries:
> 
>  https://www.datacamp.com/community/tutorials/python-excel-tutorial 
> <https://www.datacamp.com/community/tutorials/python-excel-tutorial> 
> 
> > 2) I am trying to see if there's a way using python to automate all of this
> > work that I need to do. I have to collect quarterly segment data for
> > hundreds of public companies and go back at least 12-16 quarters. We use an
> > aggregator like factset and they actually don't have this option available
> > in an automated way. So I'm trying to see if there's a way to build this.
> 
> We really need more information to be of any help.  Is the starting data 
> coming from a web site?
> Python scripts can interact with web sites, “scrape” data from them or read 
> data from files downloaded in response to the script's interaction with the 
> site. The python library Pandas (named by its originator in the financial 
> field where such data is referred to as “panel” data) is optimized for 
> manipulating spreadsheet-like tables of data (it includes a pivot operation).
> 
> > Basically, I get my data from sec.gov <http://sec.gov/> and they have 
> > interactive data - they
> > even have the data in excel (though it's a messy file and hard to read). I
> > attached some of the steps and the data that i'd want to see.
> > Basically i'd want the excel to look like:
> > old to new quarters - going back 12 to 16 quarters (more if possible but
> > not if it will stop the project).
> > Columns: 3/31/2017, 6/30/2017, 9/30/17, 12/31/17, 3/313/2018...
> > Rows:
> > Sales for segment A
> > Sales for Segment b
> > Sales for SEgment C
> > …(for as many segments as they have)
> > 
> > Earnings for Segment A
> > .Earnings for Segment B
> > 
> > Depreciation for Segment A
> > Depreciation for Segment B
> > Depreciation for Segment C...
> > 
> > I included where I get the data in the attached document.
> 
> Since attachments can contain unknown contents, this list drops them.
> 
> Bill
> 
> > 
> > All the best,
> > 
> > Diana Katz
> > ___
> > Tutor maillist  -  tu...@python.org <mailto:tu...@python.org>
> > To unsubscribe or change subscription options:
> > https://mail.python.org/mailman/listinfo/tutor 
> > <https://mail.python.org/mailman/listinfo/tutor>
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Levenberg-Marquardt non-linear least-squares fitting in Python [follow-on]

2019-03-28 Thread William Ray Wing via Python-list
Below I’ve included the code I ran, reasonably (I think) commented.  Note the 
reference to the example.  The data actually came from a pandas data frame that 
was in turn filled from a 100 MB data file that included lots of other data not 
needed for this, which was a curve fit to a calibration run.

Bill

PS:  If you want, I can probably still find a couple of the plots of the raw 
data and fitted result.
-
import numpy as np, matplotlib.pyplot as plt
#
#  Inverted exponential that axymptotically approaches "a" as x gets large
#
def func2fit(x,a,b,c):
return a - b * np.exp(-c * x)

# Curve fitting below from: 
https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html
  
from scipy.optimize import curve_fit
def fit(xdata, ydata, run_num):
ll = len(xdata)
#
#  The next four lines shift and scale the data so that the curve fit routine 
can
#  do its work without needing to use 8 or 16-byte precision. After fitting, we
#  will scale everything back.
#
ltemp = [ydata[i] - ydata[0] for i in range(ll)]
ytemp = [ltemp[i] * .001 for i in range(ll)]
ltemp = [xdata[i] - xdata[0] for i in range(ll)]
xtemp = [ltemp[i] * .001 for i in range(ll)]
#
#  popt is a list of the three optimized fittine parameters [a, b, c]
#  we are interested in the value of a.
#  cov is the 3 x 3 covariance matrix, the standard deviation (error) of the 
fit is
#  the square root of the diagonal.
#
popt,cov = curve_fit(func2fit, xtemp, ytemp)
#
#  Here is what the fitted line looks like for plotting
#
fitted = [popt[0] - popt[1] * np.exp(-popt[2] * xtemp[i]) for i in 
range(ll)]
#
#  And now plot the results to check the fit
#
fig1, ax1 = plt.subplots()
plt.title('Normalized Data ' + str(run_num))
color_dic = {0: "red", 1: "green", 2: "blue", 3: "red", 4: "green", 5: 
"blue"}
ax1.plot(xtemp, ytemp, marker = '.', linestyle  = 'none', color = 
color_dic[run_num])
ax1.plot(xtemp, fitted, linestyle = '-', color = color_dic[run_num])
plt.savefig('Normalized ' + str(run_num))
perr = np.sqrt(np.diag(cov))
return popt, cov, xdata[0], ydata[0], fitted, perr[0] 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Levenberg-Marquardt non-linear least-squares fitting in Python

2019-03-28 Thread William Ray Wing via Python-list


> On Mar 28, 2019, at 7:54 AM, Madhavan Bomidi  wrote:
> 
> Hi,
> 
> I have x and y variables data arrays. These two variables are assumed to be 
> related as y = A * exp(x/B). Now, I wanted to use Levenberg-Marquardt 
> non-linear least-squares fitting to find A and B for the best fit of the 
> data. Can anyone suggest me how I can proceed with the same. My intention is 
> to obtain A and B for best fit.
> 

Have you looked at the non-linear least-squares solutions in scicpy?
Specifically, a system I’ve had to solve several times in the past uses it and 
it works quite well.

from scipy.optimize import curve_fit

def func2fit(x,a,b,c):
return a - b * np.exp(-c * x)

Bill

> Look forward to your suggestions and sample code as an example.
> 
> Thanks and regards,
> Madhavan
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36354] Use CreateProcessW for Python 2.7 on Windows.

2019-03-18 Thread Ray Donnelly


Ray Donnelly  added the comment:

.. and alternative to my ACP idea would be to use `GetACP()` or 
`getfilesystemencoding()` .. or? Suggestions welcome!

--

___
Python tracker 
<https://bugs.python.org/issue36354>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36354] Use CreateProcessW for Python 2.7 on Windows.

2019-03-18 Thread Ray Donnelly


New submission from Ray Donnelly :

Hi all,

I'd like to entertain some discussion around the idea of calling CreateProcessW 
instead of CreateProcess on Windows.

I've written a patch as a proof of concept and I would love to get some 
feedback. I guess I've broken the normal ACP/getfilesystemencoding() 
expectation for byte strings here. My idea to fix this was to use 
CreateProcessW only when all arguments (program name, arguments, cwd, 
environment) are unicode already.

The reason we'd like to use it on Anaconda Distribution is that we would like 
for conda to be able to handle Unicode as well as possible in as many 
situations as possible, including running a Python2 conda and creating conda 
envs with all sorts of glyphs in it.

We run into bug reports quite frequently from people who try to install 
Miniconda2 or Anaconda2 in their home directories due to their username 
containing certain codepoints.

--
files: 0017-Use-CreateProcessW-to-support-Unicode.patch
keywords: patch
messages: 338270
nosy: Ray Donnelly, giampaolo.rodola, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Use CreateProcessW for Python 2.7 on Windows.
Added file: 
https://bugs.python.org/file48216/0017-Use-CreateProcessW-to-support-Unicode.patch

___
Python tracker 
<https://bugs.python.org/issue36354>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: the python name

2019-01-04 Thread William Ray Wing via Python-list

> On Jan 4, 2019, at 11:34 AM, Avi Gross  wrote:
> 
> 

[BYTE]

> As I joked in an earlier message, I remember using a version of FORTRAN 
> called WATFOR. Yes, there was a WATFIV. 
> 
> 

Yah - WATFOR was Waterloo FORTRAN, an interpreted FORTRAN that was used a lot 
in intro classes.  No matter what the student did (negative indexes in early 
FORTRAN would get you down into the OS), under WATFOR the mainframe (yup) 
wouldn’t crash.

Bill

PS:  I, for one will drop this now as it is getting further off topic.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the python name

2019-01-04 Thread William Ray Wing via Python-list
On 3/01/19 2:03 PM, Avi Gross wrote:
> Challenge: Can we name any computer language whose name really would suggest 
> it was a computer language?
> I think the name is the least important aspect of a computer language.

I’d like to propose that classic FORTRAN (FORmulaTRANslator) came/comes close.

Bill
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35644] venv doesn't work on Windows when no venvlauncher executable present

2019-01-03 Thread Ray Donnelly


Ray Donnelly  added the comment:

Thanks Steve, the sys.path value from the first comment can be discarded, it 
was running the wrong Python!

The 'old' mechanism (which my patch reverts to) does copy all the necessary 
DLLs already. I released builds with this patch now and venv works fine (tested 
with pyperformance which uses venv).

However, we are more than happy to switch to the venvlauncher method as not 
deviating from upstream unnecessarily is always a good thing!

Do you have any pointers about how to build venvlauncher? I'll try to schedule 
some time for that.

--

___
Python tracker 
<https://bugs.python.org/issue35644>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35644] venv doesn't work on Windows when no venvlauncher executable present

2019-01-02 Thread Ray Donnelly


Change by Ray Donnelly :


--
title: venv doesn't do what it claims to do (apears not to work at all?) -> 
venv doesn't work on Windows when no venvlauncher executable present

___
Python tracker 
<https://bugs.python.org/issue35644>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35644] venv doesn't do what it claims to do (apears not to work at all?)

2019-01-02 Thread Ray Donnelly


Ray Donnelly  added the comment:

The commit that my patch modifies is: 
https://github.com/python/cpython/commit/1c3de541e64f75046b20cdd27bada1557e550bcd

Cheers.

--

___
Python tracker 
<https://bugs.python.org/issue35644>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35644] venv doesn't do what it claims to do (apears not to work at all?)

2019-01-02 Thread Ray Donnelly


Ray Donnelly  added the comment:

Bit of an update to this, I'm re-opening it as there appears to be a regression 
from Python 3.7.1 to 3.7.2 for the case when there is no venvlauncher.exe 
present (i.e. when there are no python{w,}.exes in Lib\venv\scripts\nt). The 
old code of copying `sys.executable` is no longer run (on Windows only).

Currently Anaconda Distribution's venv is done this way. Should we change it to 
use the same method as official CPython Windows releases?

Here is a diff I think we need to apply for now, if you feel it is reasonable 
to make a PR then I'm happy to do so.

```
$ diff -urN Lib/venv/__init__.py.orig Lib/venv/__init__.py
--- Lib/venv/__init__.py.orig   2019-01-02 20:56:45.015131800 +
+++ Lib/venv/__init__.py2019-01-02 20:56:55.330130800 +
@@ -188,9 +188,9 @@
 binpath = context.bin_path
 path = context.env_exe
 copier = self.symlink_or_copy
+copier(context.executable, path)
 dirname = context.python_dir
 if os.name != 'nt':
-copier(context.executable, path)
 if not os.path.islink(path):
 os.chmod(path, 0o755)
 for suffix in ('python', 'python3'):
```

--
status: closed -> open

___
Python tracker 
<https://bugs.python.org/issue35644>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35644] venv doesn't do what it claims to do (apears not to work at all?)

2019-01-02 Thread Ray Donnelly


Ray Donnelly  added the comment:

I found the executable is in the `Scripts` directory, closing. The real issue 
I'm facing is on Anaconda Distribution's build of Python 3 which I'm updating 
to 3.7.2.

Closing,

Cheers!

--
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue35644>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35644] venv doesn't do what it claims to do (apears not to work at all?)

2019-01-02 Thread Ray Donnelly

New submission from Ray Donnelly :

Happy New Year!

I'm not sure if this is a misunderstanding on my part, a docs bug or a code bug.

At https://docs.python.org/3/library/venv.html we see:

"The solution for this problem is to create a virtual environment, a 
self-contained directory tree that contains a Python installation for a 
particular version of Python, plus a number of additional packages"

and

"This will create the tutorial-env directory if it doesn’t exist, and also 
create directories inside it containing a copy of the Python interpreter, the 
standard library, and various supporting files."

However, when testing with 
https://www.python.org/ftp/python/3.7.2/python-3.7.2-amd64.exe I see no Python 
interpreter (nor DLL) in my venv directory:

```
python.exe -m venv %TEMP%\venv
%TEMP%\venv\Scripts\activate.bat
dir %TEMP%\venv
```

gives:

```
 Directory of C:\Users\RDONNE~1\AppData\Local\Temp\venv

02/01/2019  19:38  .
02/01/2019  19:38  ..
02/01/2019  19:38  Include
02/01/2019  19:38  Lib
02/01/2019  19:38   121 pyvenv.cfg
02/01/2019  19:38  Scripts
   1 File(s)121 bytes
   5 Dir(s)  912,281,780,224 bytes free
```

pyvenv.cfg contains:

```
home = C:\Users\rdonnelly\AppData\Local\Programs\Python\Python37
include-system-site-packages = false
version = 3.7.2
```

Further to this, after activating, I do not see the `venv` directory in 
`sys.path`:

```
python -c "import sys; print(sys.path)"
['',
 
'C:\\Users\\rdonnelly\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip',
 'C:\\Users\\rdonnelly\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
 'C:\\Users\\rdonnelly\\AppData\\Local\\Programs\\Python\\Python37\\lib',
 'C:\\Users\\rdonnelly\\AppData\\Local\\Programs\\Python\\Python37',
 
'C:\\Users\\rdonnelly\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages']
```

>From past experience, the old `virtualenv` project would copy the interpreter 
>and DLL across.

Any help here would be appreciated!

--
components: Windows
messages: 332892
nosy: Ray Donnelly, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: venv doesn't do what it claims to do (apears not to work at all?)
type: behavior
versions: Python 3.7

___
Python tracker 
<https://bugs.python.org/issue35644>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: [Python-Dev] [RELEASE] Python 3.7.1rc2 and 3.6.7rc2 now available for testing

2018-10-14 Thread Ray Donnelly
Hi Ned,

I tried to report this on bpo, but it's not letting me log in for some reason.

I ran into a problem trying to build 3.7.1-rc2 on macOS for Anaconda
Distribution. I debugged it a little so hopefully this is useful?

The error is:

checking whether float word ordering is bigendian... unknown

This happens because by default, clang on macOS still generates 'fat'
binaries so the greps introduced in
https://github.com/python/cpython/commit/2a9c3805ddedf282881ef7811a561c70b74f80b1
find both noonsees and seesnoon.

If we add `-arch x86_64` to our `CFLAGS` then we get a successful
build, so perhaps this should be added in the configure stuff when we
detect macOS?

Best regards,

Ray Donnelly,
Anaconda Inc,
On Sat, Oct 13, 2018 at 10:51 PM Ned Deily  wrote:
>
> Python 3.7.1rc2 and 3.6.7rc2 are now available. 3.7.1rc2 is a release
> preview of the first maintenance release of Python 3.7, the latest
> feature release of Python. 3.6.7rc2 is a release preview of the next
> maintenance release of Python 3.6, the previous feature release of
> Python. Assuming no further critical problems are found prior to
> 2018-10-20, no code changes are planned between these release
> candidates and the final releases. These release candidates are
> intended to give you the opportunity to test the new security and bug
> fixes in 3.7.1 and 3.6.7. We strongly encourage you to test your
> projects and report issues found to bugs.python.org as soon as
> possible. Please keep in mind that these are preview releases and,
> thus, their use is not recommended for production environments.
>
> You can find these releases and more information here:
> https://www.python.org/downloads/release/python-371rc2/
> https://www.python.org/downloads/release/python-367rc2/
>
> --
>   Ned Deily
>   n...@python.org -- []
>
> ___
> Python-Dev mailing list
> python-...@python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: 
> https://mail.python.org/mailman/options/python-dev/mingw.android%40gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Creating Win .exe file from *.py on Linux

2018-10-02 Thread William Ray Wing via Python-list


> On Oct 2, 2018, at 3:03 PM, John Doe  wrote:
> 
> Hello World
> 
> Is it possible to create on Linux win .exe file from *.py file?
> -- 
> https://mail.python.org/mailman/listinfo/python-list

As was pointed out here a day or so ago, the answer is yes, but it is a two 
step process.  First step is to use Cython to compile the python file to C 
source, then compile that to a binary executable.  The link given was:


https://medium.com/@xpl/protecting-python-sources-using-cython-dcd940bb188e 

Where the focus is keeping the python source away from prying eyes, but it 
generates exactly what you want.

Bill
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to change '\\' to '\'

2018-10-01 Thread William Ray Wing via Python-list


> On Oct 1, 2018, at 10:17 PM, Jach Fong  wrote:
> 
> Thanks for your info about how Windows supports the forward slash.
> 
> I don't quit sure what is the meaning of "top posting" in your mail.
> If its meaning (forgive me if I was wrong) is where the reply was put
> in mail, I have reason of standing on the opposite side.
> 

Yes, exactly correct 

> It was supposed that most discussant want to see the reply message
> instantly when they open the mail. They already know what is going on
> and no need to pass through all those previous message. "top posting"
> seems more reasonable to me:-)
> 

The problem is that it is comparatively rare for there to be a singleton Q and 
immediate A.  Even seemingly simple questions frequently trigger fairly long 
discussions, which assume familiarity with the earlier discussion. AND this 
list is pretty much the place of record for people researching python IFAQs 
(infrequently asked questions). So, six months from now a Google search that 
turns up a relevant thread will make sense only if it can be read as in-lined 
comments like this. 

> --Jach
> 
> mm0fmf at 2018/10/2 AM 05:05 wrote:
>>> On 01/10/2018 10:19, Jach Fong wrote:
>>> Hmmm...strange, I didn't see Rick's mail:-(
>>> 
>>> Sure the forward slash is better, not to cause this confusion.
>>> But I am curious, since when, I mean, since which version
>>> Windows start to accept forward slash?
>>> 
>> First, stop top posting.
>> Second, ISTR that all Windows NT versions and versions derived from the NT 
>> codebase support forward slash in pathnames given to functions. It may go 
>> back further, but anything derived from NT works.  I can't remember which 
>> Windows command shells support it, probably PowerShell does.
> 
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Matplotlib 3D limitations, please recommend alternative

2018-07-04 Thread William Ray Wing via Python-list

> On Jul 4, 2018, at 5:53 PM, John Ladasky  wrote:
> 
> I'm a regular Matplotlib user.  Normally, I graph functions.  I just 
> attempted to graph an icosahedral surface using the plot_trisurf() methods of 
> Matplotlib's Axes3D. I have discovered that Matplotlib is basically 
> hard-wired for graphing functions, and therefore will not work for 
> general-purpose 3D rendering.
> 
> If I have repeated X and Y values in my arrays, it doesn't matter that the Z 
> values might be different.  Matplotlib raises a ValueError, with the message 
> "x and y arrays must consist of at least 3 unique points."  If I break down 
> my polyhedron into individual triangles, I can get 16 of the 20 faces to 
> render, but not all of them.  Here's some minimal example code, which also 
> catches and prints the cause of the ValueError.
> 
> 

[big byte]


> # 
> 
> I explored Python OpenGL bindings about three years ago, and quickly got 
> bogged down.  Even with Python to assist, dealing with OpenGL was like trying 
> to program Java.  Of course, OpenGL can do EVERYTHING.  Far more than I need.
> 

The Python Open GL bindings have apparently changed fairly dramatically.  I’m 
no expert, I’m working my way through the on-line book here:

http://www.labri.fr/perso/nrougier/python-opengl/

But the author DOES lay things out in a nice step by step fashion - and with 
particular emphasis on scientific 3D plotting (which is what
I’m after).


> I would like to render polyhedra, preferably with uniformly colored faces (I 
> understand that color is a property that is associated with vertices in 
> OpenGL).  I would appreciate a simple interface.  The rendering doesn't have 
> to be especially fast or high quality.  The Matplotlib visualization is 
> acceptable, except of course for the missing faces.
> 
> There are many 3D graphics packages on PyPI.  Some appear to be quite 
> specialized.  I would appreciate your recommendations.  Thanks!
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Scanner freakishness [was Re: Python list vs google group]

2018-06-16 Thread William Ray Wing

> On Jun 16, 2018, at 9:10 AM, Steven D'Aprano 
>  wrote:
> 
> On Sat, 16 Jun 2018 11:54:15 +1000, Chris Angelico wrote:
> 
>> On Sat, Jun 16, 2018 at 11:00 AM, Jim Lee  wrote:
> 
>>> I once had a Mustek color scanner that came with a TWAIN driver.  If
>>> the room temperature was above 80 degrees F, it would scan in color -
>>> otherwise, only black & white.  I was *sure* it was a hardware problem,
>>> but then someone released a native Linux driver for the scanner.  When
>>> I moved the scanner to my Linux box, it worked fine regardless of
>>> temperature.
>>> 
>>> 
>> I would be mind-blown if I did not have the aforementioned too many
>> hours. Sadly, I am merely facepalming. Wow.
> 
> 

Let me add one more story (true) to the list.  Concerns an old IBM mainframe 
installed in a bank in New York City, that crashed rarely, and only night, 
never during the day.  They called IBM; repair man spent the night with it - no 
crash; same story the next night and the next.  Finally on the forth night he 
left around 10:00 PM to get something to eat and some coffee.  Came back to 
find the computer had crashed.  Spent the next night - no crash.  Left the next 
again for coffee, came back to find the computer down.  Obviously it was only 
crashing when he wasn't watching.  Next night he left, but only took the 
elevator down to the ground floor, didn’t go outside.  Computer crashed.  He 
rebooted, restarted the job stream, left the computer room for the same length 
of time, but didn’t leave the floor.  No crash.

To make a long story short, it was the motor-generator set that ran the 
elevators.  During the day, there was enough constant elevator traffic so that 
the MG set never shut down and even it it did, there was enough load elsewhere 
in the building to make the start-up transient a relatively small perturbation. 
 At night it would time out, shut down, and when he called for the elevator 
late at night, the start-up transient was too much for the computer’s power 
regulators.

Earlier crashes turned out to be coincident with janitorial staff working extra 
late after special events.

Bill


> 
> -- 
> Steven D'Aprano
> "Ever since I learned about confirmation bias, I've been seeing
> it everywhere." -- Jon Ronson
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33232] Segmentation fault in operator.attrgetter

2018-04-05 Thread Ray Donnelly

Change by Ray Donnelly <rdonne...@anaconda.com>:


--
nosy: +Ray Donnelly

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33232>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: please test the new PyPI (now in beta)

2018-03-30 Thread William Ray Wing

> On Mar 28, 2018, at 10:50 AM, sumana.hariharesw...@gmail.com wrote:
> 
> 

[byte]


> : I ask you the usual list of troubleshooting questions. What OS and browser 
> are you using, what plugins and particularly interesting preferences are you 
> using, and so on. (When I turn off JavaScript in my browser, I see a list of 
> clickable category headings like "By Programming Language" but clicking on 
> them causes no response.) A screenshot in an issue at 
> https://github.com/pypa/warehouse/issues would be helpful. (Reminder that 
> participating in Warehouse development, including by filing an issue, 
> requires abiding by the PyPA Code of Conduct 
> https://www.pypa.io/en/latest/code-of-conduct/ .)
> 

Sumana, I want to be sure we aren’t just talking past each other.  I notice 
that the URL you seem to always reference is: 

https://pypi.org/search/

and if I go there, I get the filter list immediately.  The place I don’t see it 
is the home page:

https://pypi.org/

where I’m invited to “Search” or “Browse”, but where there is no filter list.  
The filter list only appears after I’ve performed my first search.

Thanks,
Bill


> -Sumana Harihareswara
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: please test the new PyPI (now in beta)

2018-03-28 Thread William Ray Wing

> On Mar 28, 2018, at 10:50 AM, sumana.hariharesw...@gmail.com wrote:
> 
> 

[byte]

> 
> People who literally don't see the list of ways to filter on the left-hand 
> side of https://pypi.org/search/

I do see the list of filters, but I only get it AFTER I’ve entered my first 
search term.  I may be an outlier here, but I find that an unfortunate bit of 
UI design.  I suppose it is deliberate in that the filters can then be used to 
narrow search results, but if I know going in that I’m only interested in a 
particular set of results, I’d like to be able to apply that filter to my first 
search.

Thanks,
Bill


> : I ask you the usual list of troubleshooting questions. What OS and browser 
> are you using, what plugins and particularly interesting preferences are you 
> using, and so on. (When I turn off JavaScript in my browser, I see a list of 
> clickable category headings like "By Programming Language" but clicking on 
> them causes no response.) A screenshot in an issue at 
> https://github.com/pypa/warehouse/issues would be helpful. (Reminder that 
> participating in Warehouse development, including by filing an issue, 
> requires abiding by the PyPA Code of Conduct 
> https://www.pypa.io/en/latest/code-of-conduct/ .)
> 
> -Sumana Harihareswara
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread William Ray Wing

> On Dec 30, 2017, at 7:46 AM, Peter J. Holzer  wrote:
> 
> On 2017-12-29 19:09:35 -0500, Dennis Lee Bieber wrote:
>> On Fri, 29 Dec 2017 23:12:22 +, bartc  declaimed the
>> following:
>>> Looking at 14 million lines of Linux kernel sources, which are in C, 
>>> over 100,000 of them use 'goto'. About one every 120 lines.
>>> 
>> 
>>  C is a language that predates the "structured programming" concepts of
>> the late 70/early 80.
> 
> I don't think this is correct. Structured programming is much older:
> ALGOL 60 was already a block structured language and Dijkstra wrote
> "goto considered harmful" in the late 1960s. Pascal appeared in 1970, C
> in 1974. To me (who learned to program in BASIC on a CP/M machine), C
> is very much a structured programming language. If structured
> programming gained traction around 1980, it might even have been because
> structured languages like C with good performance became widely
> available.
> 
> That said, C lacks exception handling (well, there is setjmp/longjmp,
> but ...) and multi-level break/continue, so goto is often the cleanest
> way to abort what you are doing and start to clean up. Python has
> exception handling, and that removes most of the cases where you would
> use goto in C (the rest is probably mostly in micro-optimizations: If
> you care about the run-time difference between a goto and a subroutine
> call, you probably shouldn't use Python in the first place).
> 
>hp
> 

I’ve been watching this discussion ebb and flow - and finally can’t resist 
pointing folks here at the famous essay: “Real Programmers Don’t Use Pascal”.  
It has its own Wikipedia article at this point:

 https://en.wikipedia.org/wiki/Real_Programmers_Don't_Use_Pascal

A copy of the original essay appears here: 
https://www.ee.ryerson.ca/~elf/hack/realmen.html

Hopefully fun reading over a beer.

Bill


-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32457] Windows Python cannot handle an early PATH entry containing ".." and python.exe

2017-12-30 Thread Ray Donnelly

Ray Donnelly <rdonne...@anaconda.com> added the comment:

.. though I will also ask the scons people to change this to use pushd and %CD% 
instead. Even if you were to make Python capable of handling such bad input, 
who knows what other programs will fail, and build systems should be extra 
careful not to mess the environment up like this.

--

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32457>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32457] Windows Python cannot handle an early PATH entry containing ".." and python.exe

2017-12-30 Thread Ray Donnelly

New submission from Ray Donnelly <rdonne...@anaconda.com>:

Over on the Anaconda Distribution we received a (private) bug report about a 
crash when trying to use scons. I thought initially it was due to one of our 
patches but I tested it out with official CPython and also with WinPython and 
ran into the same crash.

To reproduce this, from cmd.exe on CPython (here I installed CPython as part of 
Visual Studio 2017, then updated it to the latest 3.6.4 release):

```
set "PATH=C:\Program Files (x86)\Microsoft Visual 
Studio\Shared\Python36_64\Scripts\..;%PATH%"

python.exe

..

python
Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0328 (most recent call first):
```

The trigger for this bug is the following batch code in scons.bat:

https://bitbucket.org/scons/scons/src/c0172db149b1a151eeb76910d55c81746bfede05/src/script/scons.bat?at=default=file-view-default#scons.bat-19

My current thinking is that the best fix here is to modify 
get_progpath()/get_program_full_path() so that it uses PathCchCanonicalizeEx() 
at 
https://github.com/python/cpython/blob/9bee329130aae5a13050c08dab9d349b76e66835/PC/getpathp.c#L558-L559

--
components: Windows
messages: 309242
nosy: Ray Donnelly, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows Python cannot handle an early PATH entry containing ".." and 
python.exe
type: crash
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32457>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: plot map wit box axes

2017-12-24 Thread William Ray Wing

> On Dec 23, 2017, at 3:27 PM, breamore...@gmail.com wrote:
> 
> On Friday, December 22, 2017 at 3:42:58 PM UTC, jorge@cptec.inpe.br wrote:
>> Hi,
>> 
>> I use the PYTHON and IDL. In IDL I can plot a grid map like a this 
>> figure (mapa.png). Please, I would like know how can I plot my figure 
>> using PYTHON with the box around the figure. Like this that I plot using 
>> the IDL.
>> 
>> Thanks
> 
> Sorry but we can't see the image as it gets stripped off this text only 
> mailing list.  What are you using to do the plot, matplotlib or smething 
> else?  Can you show us the code you've used or your interactive session in 
> IDLE?
> 

I’m 90% sure the OP really meant IDL, not IDLE.  IDL (Interactive Data 
Language) is a long-time competitor to MatLab, and is widely used in various 
parts of the scientific community.  (Don’t know if it is still true, but for 
years ALL the published images from the Hubble telescope had been processed 
through IDL.)

Bill

> --
> Kindest regards.
> 
> Mark Lawrence.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Recommended pypi caching proxy?

2017-12-18 Thread Ray Cote
On Mon, Dec 18, 2017 at 1:00 PM, Matt Wheeler <m...@funkyhat.org> wrote:

> On Mon, 18 Dec 2017, 15:45 Ray Cote, <rgac...@appropriatesolutions.com>
> wrote:
>
>> Looking to deploy a locally cached pypi proxy service.
>>
>> Is there a recommended/preferred pypi caching tool?
>> I’ve found:
>>   - proxypypy
>>   - Flask-Pypi-Proxy
>>   - pypicache
>>
>> All of which seem to have generally the same functionality and all of
>> which
>> are a few years old.
>> Recommendations from the crowd?
>>
>
> In the past I've used https://github.com/devpi/devpi
> It may have many features you don't need if all you're after is a caching
> proxy, but I found it does that well and it appears to still be pretty
> active.
>
>> --
>
> --
> Matt Wheeler
> http://funkyh.at
>

Thanks for the recommendation.
Will take a look at it.
—Ray


-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
Schedule a meeting: https://calendly.com/ray_cote/60min/
-- 
https://mail.python.org/mailman/listinfo/python-list


Recommended pypi caching proxy?

2017-12-18 Thread Ray Cote
Hello list:

Looking to deploy a locally cached pypi proxy service.

Is there a recommended/preferred pypi caching tool?
I’ve found:
  - proxypypy
  - Flask-Pypi-Proxy
  - pypicache

All of which seem to have generally the same functionality and all of which
are a few years old.
Recommendations from the crowd?
—Ray


-- 
Raymond Cote, President
Tokenize What Matters®
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
Schedule a meeting: https://calendly.com/ray_cote/60min/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python noob having a little trouble with strings

2017-10-28 Thread William Ray Wing
OSX has been shipping with Python 2.7 for several years.  I’m not sure why you 
are seeing 2.6.

Bill

> On Oct 27, 2017, at 2:48 AM, Lutz Horn  wrote:
> 
> On Thu, Oct 26, 2017 at 07:59:10PM -0700, randyli...@gmail.com wrote:
>> Hi Bob, thanks for responding. I'm not sure where to do so, my
>> professor had us download Pycharm for mac's which uses python 2.6
> 
> The code from your question is not specific to Python 2 or 3. Just try
> it in the Python installation you have available.
> 
> Lutz
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Let's talk about debuggers!

2017-10-25 Thread William Ray Wing

> On Oct 25, 2017, at 9:07 AM, Thomas Jollans  wrote:
> 
> 

[byte]

> What options are there for Python (that work)? What text editors (and
> IDEs) have a decent integrated debugger or debugging plugin?

I rather like WingIDE (the name is a coincidence).  It allows insertion/removal 
of break points while the code is running.  While execution is stopped, it 
allows direct inspection of the stack (no surprise), but in addition allows 
execution of python statements or program elements typed into an auxiliary 
window - including importing things like matplotlib and plotting the current 
state of data arrays.  Its editor is syntax-aware and highlights accidental 
syntax errors as they are typed.  Lots of other features, those just happen to 
be the ones I use most often.

Bill
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to track usage within a desktop python application

2017-10-08 Thread William Ray Wing

> On Oct 8, 2017, at 8:38 PM, Ryan Holmes  wrote:
> 
> I maintain a desktop python application that is used by a decent number of 
> folks (I would assume 10k+, though it's hard to know since it's based on 
> number of downloads rather than number of unique users). I would like to 
> integrate some sort of usage tracking that would enable me to determine 
> number of users along with startups, which features are used/not used, 
> performance metrics, exceptions, etc. Since it's an open-source project, I am 
> looking for a free service (or a service that provides free licenses to open 
> source projects) that has a python client library. 
> 

You do know, of course, that most folks frown on applications that “phone home” 
without asking first, and if you do ask your users for permission, many of them 
(perhaps most) will say no.  So, you still won’t really have good statistics.

Bill

> Can anyone recommend something?
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: API Help

2017-06-14 Thread Ray Cote
On Wed, Jun 14, 2017 at 6:14 PM, Erik <pyt...@lucidity.plus.com> wrote:

> On 14/06/17 22:54, Ray Cote wrote:
>
>> Definitely JSON:
>>
>>>
>>>>> json.loads(“""[{"itemNumber":"75-5044","inventory":[{"wareho
>> useCode":"UT-1-US","quantityAvailable":0.0},{"wa
>> rehouseCode":"KY-1-US","quantityAvailable":0.0},
>> {"warehouseCode":"TX-1-US","quantityAvailable":14.00
>> 000},{"warehouseCode":"CA-1-US","quantityAvailable":4.
>> 0},{"warehouseCode":"AB-1-CA","quantityAvailable":
>> 1.0},{"warehouseCode":"WA-1-US","quantityAvailab
>> le":0.0},{"warehouseCode":"PO-1-CA","quantityAva
>> ilable":0.0}]}]""")
>>
>> [{u’itemNumber': u'75-5044', u'inventory': [{u'quantityAvailable': 0.0,
>> u'warehouseCode': u'UT-1-US'}, {u'quantityAvailable': 0.0,
>> u'warehouseCode': u'KY-1-US'}, {u'quantityAvailable': 14.0,
>> u'warehouseCode': u'TX-1-US'}, {u'quantityAvailable': 4.0,
>> u'warehouseCode': u'CA-1-US'}, {u'quantityAvailable': 1.0,
>> u'warehouseCode': u'AB-1-CA'}, {u'quantityAvailable': 0.0,
>> u'warehouseCode': u'WA-1-US'}, {u'quantityAvailable': 0.0,
>> u'warehouseCode': u'PO-1-CA'}]}]
>>
>>>
>>>>>
> If that makes it definitely JSON, then this makes it definitely Python ;) :
>
> >>> [{"itemNumber":"75-5044","inventory":[{"warehouseCode":"UT-
> 1-US","quantityAvailable":0.0},{"warehouseCode
> ":"KY-1-US","quantityAvailable":0.0},{"warehouse
> Code":"TX-1-US","quantityAvailable":14.0},{"ware
> houseCode":"CA-1-US","quantityAvailable":4.0},{"
> warehouseCode":"AB-1-CA","quantityAvailable":1.0
> },{"warehouseCode":"WA-1-US","quantityAvailable":0.0
> },{"warehouseCode":"PO-1-CA","quantityAvailable":0.0}]}]
> [{'itemNumber': '75-5044', 'inventory': [{'quantityAvailable': 0.0,
> 'warehouseCode': 'UT-1-US'}, {'quantityAvailable': 0.0, 'warehouseCode':
> 'KY-1-US'}, {'quantityAvailable': 14.0, 'warehouseCode': 'TX-1-US'},
> {'quantityAvailable': 4.0, 'warehouseCode': 'CA-1-US'},
> {'quantityAvailable': 1.0, 'warehouseCode': 'AB-1-CA'},
> {'quantityAvailable': 0.0, 'warehouseCode': 'WA-1-US'},
> {'quantityAvailable': 0.0, 'warehouseCode': 'PO-1-CA'}]}]
>
>
>
> So, I think we're agreed that it's definitely one or the other.
>

Well, that is the Python output from the json.loads() call; so yes…


-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
Schedule a meeting: https://calendly.com/ray_cote/60min/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: API Help

2017-06-14 Thread Ray Cote
On Wed, Jun 14, 2017 at 4:33 PM, Bradley Cooper  wrote:

> I am working with an API and I get a return response in this format.
>
>
> [{"itemNumber":"75-5044","inventory":[{"warehouseCode":"
> UT-1-US","quantityAvailable":0.0},{"warehouseCode":"KY-1-US","
> quantityAvailable":0.0},{"warehouseCode":"TX-1-US","
> quantityAvailable":14.0},{"warehouseCode":"CA-1-US","
> quantityAvailable":4.0},{"warehouseCode":"AB-1-CA","
> quantityAvailable":1.0},{"warehouseCode":"WA-1-US","
> quantityAvailable":0.0},{"warehouseCode":"PO-1-CA","
> quantityAvailable":0.0}]}]
>
> What is the best way to read through the data?
>

Definitely JSON:
>>>
json.loads(“""[{"itemNumber":"75-5044","inventory":[{"warehouseCode":"UT-1-US","quantityAvailable":0.0},{"warehouseCode":"KY-1-US","quantityAvailable":0.0},{"warehouseCode":"TX-1-US","quantityAvailable":14.0},{"warehouseCode":"CA-1-US","quantityAvailable":4.0},{"warehouseCode":"AB-1-CA","quantityAvailable":1.0},{"warehouseCode":"WA-1-US","quantityAvailable":0.0},{"warehouseCode":"PO-1-CA","quantityAvailable":0.0}]}]""")

[{u’itemNumber': u'75-5044', u'inventory': [{u'quantityAvailable': 0.0,
u'warehouseCode': u'UT-1-US'}, {u'quantityAvailable': 0.0,
u'warehouseCode': u'KY-1-US'}, {u'quantityAvailable': 14.0,
u'warehouseCode': u'TX-1-US'}, {u'quantityAvailable': 4.0,
u'warehouseCode': u'CA-1-US'}, {u'quantityAvailable': 1.0,
u'warehouseCode': u'AB-1-CA'}, {u'quantityAvailable': 0.0,
u'warehouseCode': u'WA-1-US'}, {u'quantityAvailable': 0.0,
u'warehouseCode': u'PO-1-CA'}]}]
>>>

-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
Schedule a meeting: https://calendly.com/ray_cote/60min/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Ciphers in SSL library python.

2017-06-14 Thread Ray Cote
On Wed, Jun 14, 2017 at 4:40 PM,  wrote:

> Hey, I'm "the server(I've written using ssl/socket)" and my client is
> using RC4-SHA, but I can't make the server to use it. I make "
> ciphers='RC4-SHA' " in the ssl.wrap_socket. Do I need to modify SSL file or
> something to make it work?


Had not realized you were the server.

Been a long time since I used SSL, but here’s a few thoughts.
1: What version of Python are you using?
2: What version of OpenSSL are you using? RC4-SHA is considered insecure
and might be disabled at the OpenSSL/OS level.
3: You say you set ciphers=. I found some old code that used the
set_ciphers context call. That might be the approach.
—R


-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
Schedule a meeting: https://calendly.com/ray_cote/60min/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Ciphers in SSL library python.

2017-06-14 Thread Ray Cote
1: Are you 100% sure the server to which you are trying to connect supports
RC4-SHA?

2: If you have access to the server, turn on SSH debug mode to watch your
client try and connect.
I find that to be helpful in debugging many connection issues.


On Wed, Jun 14, 2017 at 4:16 PM,  wrote:

> Hey, I want to use RC4-SHA in python, but when I try to use it, it doesn't
> get used (If I do cipher() it says none(and handshake fails too)), I've
> tried to modify the SSL library, but it didn't help at all(Maybe I did
> something wrong, any help will be appreciated). Is there a way to use the
> RC4-SHA cipher(0x05). Please, I need help, I've been looking for an answer
> for days.
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
Schedule a meeting: https://calendly.com/ray_cote/60min/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: New to python and programming

2017-05-17 Thread Ray Cote
On Wed, May 17, 2017 at 4:43 PM, justin walters <walters.justi...@gmail.com>
wrote:

> On Wed, May 17, 2017 at 12:59 PM, BT <jub8j...@gmail.com> wrote:
>
> > Hi guys,
> > I am fairly new to programming. I was just trying to understand how this
> > group works. Am i allowed to ask any questions that I may have when i get
> > stuck? I mean is this group for new programmers as well..?
> > Thanks
>
> You might want to check out the Python Tutors list:
   https://mail.python.org/mailman/listinfo/tutor

It is friendly towards beginner questions.
—Ray
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: closing image automatically in for loop , python

2017-04-12 Thread William Ray Wing

> On Apr 12, 2017, at 7:18 AM, Masoud Afshari  wrote:
> 
> Dear all
> 
> I have several *.sfd files which created by a simulation code. I wrote a 
> program containing a for Loop which reads  each time one .sfd file  and plot 
> the requested Parameters. I have two request:
> 
> 1- my Problem is that for Showing successive Images in for Loop I have to 
> Close the Image MANAULLY each time to read next sdf file. can anyone please 
> tell me which command do I have to use so the code Close the Images 
> automatically.
> 

I normally run matplolib in interactive mode, so this may not be quite correct, 
BUT I think you only need to add a call to:

close()

After your call to plt.show()

Bill


> 2- more over, can anyone please tell me how can I create a movie with this 
> code.
> 
> in the following you can see my code
> 
> 
> #
> # in this program, PYTHON reads the reduced files and plot the variables .
>  
>  
> import sys 
> import sdf
> import numpy as np
> import matplotlib.pyplot as plt 
> from matplotlib.font_manager import FontProperties
> fp = FontProperties('Symbola')
>  
> # information from EPOCH input.deck
> nx,ny= 1200, 1600
>  
> xmin=-100e-6
> xmax = 50e-6
> ymin = -100e-6
> ymax = 100e-6
>  
> X =np.linspace(xmin,xmax,nx) #Generate linearly spaced vector. The spacing 
> between the points is (x2-x1)/(n-1).
> Y =np.linspace(ymin,ymax,ny)
>  
> #
> for n in range(0,27):
> nstr = str(n)#.zfill(4)
> #print nstr
>  
> ##
> fig = plt.figure() #plot several figures simultaneously 
> 
> . reading Ex
>  
> filename ="Ex_resample" +'_sdf_'+ str(n)+'.dat'
> with open(filename, 'rb') as f: #read binary file
> data = np.fromfile(f, dtype='float64', count=nx*ny) #float64 for Double 
> precision float numbers
> Ex = np.reshape(data, [ny, nx], order='F')
> #print Ex.max()
>  
> #Display image with scaled colors:
> plt.subplot(222)
> fig1=plt.imshow(Ex, extent=[X.min()*1e6, X.max()*1e6, Y.min()*1e6, 
> Y.max()*1e6], vmin=0, vmax=2e12, cmap='brg', aspect='auto') #cmap='jet', 
> 'nipy_spectral','hot','gist_ncar'
> #plt.suptitle('Ex')
> plt.title('sdf '+ str(n)+ '; Time= ' +str(n*50)+ 'ps',color='green', 
> fontsize=15)
> plt.xlabel('x($\mu$m)')
> plt.ylabel('y($\mu$m)')
> plt.text(40,80,'Ex',color='red', fontsize=15)
> plt.colorbar()
> plt.show()
> #fig.savefig('test.jpg')
> sys.exit()
> -- 
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and the need for speed

2017-04-10 Thread William Ray Wing

> On Apr 10, 2017, at 8:25 AM, Mikhail V  wrote:
> 
> On 10 April 2017 at 02:21, Gregory Ewing  wrote:
>> 
>> 
>> 
>> My take on the idea of making Python less dynamic in order
>> to improve speed is that you'll end up with a language that,
>> while it may superficially resemble Python, doesn't
>> really feel like Python.
>> 
>> Boo is an example of that. It has a Python-like syntax, but
>> to get any speed advantage you need to add static type
>> delarations, and then it feels more like programming in
>> C# than Python. At that point, you wonder whether you might
>> just be better off writing your program in C# to begin with.
>> 
>> That's not to say this kind of approach isn't worth pursuing,
>> but like the JIT attempts mentioned in the article, it has
>> also been tried before, with varying levels of success.
> 
> Agree. python is python and I suppose that performance issues
> has much to do with types and OOP.
> When I first started with python I thought - no, it is not possible
> without types, if I'll write something more complicated than
> hello world, it will all break at some point.
> But hell, this works and works good.
> 
> Still I miss some old school features in Python, e.g. "goto" statement would
> be very useful in some cases. I know it is considered bad style
> to use goto, but in some cases it is just most natural thing to use.
> 
> What I am (and probably many people) missing is a good tool for
> performance middle- and low-level applications.
> For me it would be a coding tool, sort of minimalist IDE, with simple
> readable syntax which generates compilable C code.
> And it would not be necessarily python-like syntax,
> but I tend to agree that for today python's syntax is
> most readable.

Have you considered Swift, now that it is open source?

Bill

> 
> The problem that many are overlooking still is that the
> possibilities for syntaxes are very limited in pure text-mode
> presentation.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.6 printing crashing on OS X 10.12.4

2017-04-10 Thread Ray Cote
On Wed, Apr 5, 2017 at 3:40 PM, Python <python@example.invalid> wrote:

> Le 05/04/2017 à 20:14, Ray Cote a écrit :
>
>> Hello:
>>
>> Python 3.6 crashing when trying to print from the environment.
>>
>> $ python
>> Python 3.6.1 (default, Mar 22 2017, 15:53:21)
>> [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>>
>>> print("hello")
>>>>>
>>>>
>> Python(53390,0x7fffdd9e63c0) malloc: *** error for object 0x10dde4110:
>> pointer being freed was not allocated
>> *** set a breakpoint in malloc_error_break to debug
>> Abort trap: 6
>>
>>
>> Pastebin link to OS X crash report if that’s helpful:
>> https://pastebin.com/t1j3nz5L
>>
>>
>> 1: Python installed via ports.
>> 2: OS X 10.12.4.
>> 3: Python 3.6.1 (though I also had this problem with 3.6.0).
>> 4: Have successfully run python 3.5 for months.
>> 5: Running under standard terminal program.
>> 6: I have py36-readline installed.
>> 7: Have tried uninstalling and re-installing Python.
>>
>> Any thoughts on what I could have wrong?
>>
>> Regards
>> —Ray
>>
>>
> Mac OS X 10.12.3, Python 3 installed by brew
>
> mac:~$ uname -r
> 16.4.0
> mac:~$ python3
> Python 3.6.0 (default, Mar  4 2017, 12:32:34)
> [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> print("hello")
> hello
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>


Follow up:

Never did find out why the macports Python was crashing.
Switched over to brew and it is working fine.
—R
-- 
https://mail.python.org/mailman/listinfo/python-list


Python 3.6 printing crashing on OS X 10.12.4

2017-04-05 Thread Ray Cote
Hello:

Python 3.6 crashing when trying to print from the environment.

$ python
Python 3.6.1 (default, Mar 22 2017, 15:53:21)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print("hello")

Python(53390,0x7fffdd9e63c0) malloc: *** error for object 0x10dde4110:
pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6


Pastebin link to OS X crash report if that’s helpful:
https://pastebin.com/t1j3nz5L


1: Python installed via ports.
2: OS X 10.12.4.
3: Python 3.6.1 (though I also had this problem with 3.6.0).
4: Have successfully run python 3.5 for months.
5: Running under standard terminal program.
6: I have py36-readline installed.
7: Have tried uninstalling and re-installing Python.

Any thoughts on what I could have wrong?

Regards
—Ray
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Who are the "spacists"?

2017-03-17 Thread William Ray Wing

> On Mar 17, 2017, at 8:52 PM, Mikhail V  wrote:
> 
> So Python supports both spaces and tabs for indentation.
> 
> I just wonder, why not forbid spaces in the beginning of lines?
> How would one come to the idea to use spaces for indentation at all?
> 

That convention dates all the way back to the IBM 026 and 029 card punches and 
FORTRAN.

> Space is not even a control/format character, but a word separator.
> And when editors will be proportional font based, indenting with
> spaces will not make *any* sense so they are just annoyance.
> Neither makes it sense in general case of text editing.
> I think it would be a salvation to forbid spaces for indentation,
> did such attemps take place?
> -- 
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


python3.5m vs libpython3.5m on CentOS6

2017-02-24 Thread Ray Cote
Hello:

Attempting to install latest psycopg2 (2.6.2) on current CentOS6 with a
custom install Python3.5.

Getting the error:
/usr/bin/ld: cannot find -lpython3.5m

Don’t have a python3.5m library on the system.
Do have libpython3.5m.so.1.0 with a soft link to libpython3.5m.so.

Thought adding a new python3.5m.so softlink to  libpython3.5m.so.1.0 and
re-running ldconfig would do the trick, but still get the same error.

Any hints appreciated.
—Ray
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Context

2017-02-03 Thread William Ray Wing

> On Feb 3, 2017, at 8:10 AM, Antonio  wrote:
> 
> From: Antonio
> Sent: Friday, February 3, 2017 1:02 PM
> To: python-list@python.org
> Subject: Context
> 
> I have python version 3.6.0 installed into my desktop)windows 7) but the 
> menu/context (file,edit..etc) is missing.
> 
> How to fix this problem?
> 

python, is not a GUI program, it doesn’t have a menu of actions.  If you want 
to surround python with a GUI you would have to install any of several IDEs 
(Integrated Development Environments) which will let you create python 
programs, edit them, and test them interactively.  Not being a Windows user, I 
shouldn't recommend any particular one.

Bill

> 
> Thanks
> 
> 
> Antonio
> 
> 
>  
> [cid:36574bcd-0958-41f0-a1b3-2c34586b236a]
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Need reviews for my book on introductory python

2017-01-27 Thread Ray Cote
On Fri, Jan 27, 2017 at 4:18 PM, mm0fmf  wrote:

> On 27/01/2017 20:17, bob gailer wrote:
>
>> On 1/25/2017 9:25 PM, Sandeep Nagar wrote:
>>
>>> Hi,
>>>
>>> A few month ago I wrote a book on introductory python based on my
>>> experinces while teaching python to Bachelor students of engineering.
>>> It is now available in e-book and paperback format at Amazon.
>>>
>>> https://www.amazon.com/dp/1520153686
>>>
>>> The book is written for beginners of python programming language and
>>> written in learn-by-doing manner. If some group members can review the
>>> same, it will be useful for myself to come up with an improved version.
>>>
>> Who is the publisher of this book?
>>
>> I just took a look at the pages that can be viewed on Amazon. Many
>> reactions. it is hard for me to write this, as it seems it would sound
>> harsh, judgemental, unappreciative. But you did ask for a review, and
>> this is my honest reaction.
>>
>> I find it hard to read a book written by a non-native speaker of
>> English. I an constantly having to overlook what to me are spelling,
>> grammatical and vocabulary errors. I HIGHLY recommend you find an editor
>> who can fix these errors.
>>
>> Snap. I found it impossible to read and never got to the Python parts. It
> is not written in English. Most of the pronouns and conjunctions are
> missing. It looks like it has not been proof-read as words loose
> capitalisation, many are mis-spelt and grammar rules regarding plural cases
> and agreement are just ignored.
>
>
In addition to what other’s have said:
- congrats on taking the time to write a book and put it out for others.
- Introduction to Python section 2.1 starts with C example. Seems out of
place.
- Search inside the book has 0 results for iterator -- how do you do Python
without iterators?
- Two references to generator, but they are random number generator
references.
- Was confused by the switching in and out of numpy usage.
- And yes, Python3 is the way to go. Been writing Python since 1.5 and
about 90% of my new code is Python 3.5.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Choosing a Python IDE. what is your Pythonish recommendation? I do

2017-01-06 Thread William Ray Wing

> On Jan 4, 2017, at 3:44 PM, Dietmar Schwertberger <maill...@schwertberger.de>
wrote:
>
> On 04.01.2017 15:41, William Ray Wing wrote:
>> I use Wing, and I think you will like it.  It *is* pythonic, and for what it
is worth, offers remote debugging as one of its more recently added features.
> Obviously, you had no other choice than using Wing ;-)

I should have said something.  First, and to the best of my knowledge, I have 
no relationship with the Wing developers other than being a satisfied customer. 
Second, seven years ago, when I was reading IDE reviews and testing the more 
highly rated products, Wing just bubbled up to the top of the sieve I was using 
(features, ease of use, and the way it fit my idea of â £naturalâ Ø, pretty 
much everyone's standard list).

>
> The remote debugging has been around for some years. I have been using it
quite often to debug on my Raspberry Pi, Nokia N900 and Jolla Phone, all 
running some Linux system. It works well. It is or was a bit complicated to set 
up. I think this has been improved with Wing 6, but I did not need it in the 
last weeks, so I don't know.

They claim it has been, but like you, I havenâ Öt had need to test it on the 
new release.

Thanks,
Bill

>
> Regards,
>
> Dietmar
> --
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Choosing a Python IDE. what is your Pythonish recommendation? I do

2017-01-06 Thread William Ray Wing

> On Jan 4, 2017, at 1:54 AM, Antonio Caminero Garcia 
wrote:
>
> On Tuesday, January 3, 2017 at 4:12:34 PM UTC-8, Dietmar Schwertberger wrote:
>> On 02.01.2017 12:38, Antonio Caminero Garcia wrote:
>> You did not try Wing IDE? It looks less like a spacecraft. Maybe you
>> like it.
>> Maybe the difference is that Wing is from Python people while the ones
>> you listed are from Java people.
>
> That sounds interesting. By the look of it I think I am going to give it a
try.
>
>

[byte]


> I want editor with those IDE capabilities and git integration, with
optionally  cool stuff as for example remote debugging.

I use Wing, and I think you will like it.  It *is* pythonic, and for what it is 
worth, offers remote debugging as one of its more recently added features.

-Bill

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Choosing a Python IDE. what is your Pythonish recommendation? I do not know what to choose.

2017-01-04 Thread William Ray Wing

> On Jan 4, 2017, at 3:44 PM, Dietmar Schwertberger <maill...@schwertberger.de> 
> wrote:
> 
> On 04.01.2017 15:41, William Ray Wing wrote:
>> I use Wing, and I think you will like it.  It *is* pythonic, and for what it 
>> is worth, offers remote debugging as one of its more recently added features.
> Obviously, you had no other choice than using Wing ;-)

I should have said something.  First, and to the best of my knowledge, I have 
no relationship with the Wing developers other than being a satisfied customer. 
Second, seven years ago, when I was reading IDE reviews and testing the more 
highly rated products, Wing just bubbled up to the top of the sieve I was using 
(features, ease of use, and the way it fit my idea of “natural”, pretty much 
everyone's standard list).

> 
> The remote debugging has been around for some years. I have been using it 
> quite often to debug on my Raspberry Pi, Nokia N900 and Jolla Phone, all 
> running some Linux system. It works well. It is or was a bit complicated to 
> set up. I think this has been improved with Wing 6, but I did not need it in 
> the last weeks, so I don't know.

They claim it has been, but like you, I haven’t had need to test it on the new 
release.

Thanks,
Bill

> 
> Regards,
> 
> Dietmar
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Choosing a Python IDE. what is your Pythonish recommendation? I do not know what to choose.

2017-01-04 Thread William Ray Wing

> On Jan 4, 2017, at 1:54 AM, Antonio Caminero Garcia  
> wrote:
> 
> On Tuesday, January 3, 2017 at 4:12:34 PM UTC-8, Dietmar Schwertberger wrote:
>> On 02.01.2017 12:38, Antonio Caminero Garcia wrote:
>> You did not try Wing IDE? It looks less like a spacecraft. Maybe you 
>> like it.
>> Maybe the difference is that Wing is from Python people while the ones 
>> you listed are from Java people.
> 
> That sounds interesting. By the look of it I think I am going to give it a 
> try.
> 
> 

[byte]


> I want editor with those IDE capabilities and git integration, with 
> optionally  cool stuff as for example remote debugging. 

I use Wing, and I think you will like it.  It *is* pythonic, and for what it is 
worth, offers remote debugging as one of its more recently added features.

-Bill


-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28938] match_hostname treats SAN IP address as DNS name and fails to check CN then

2016-12-11 Thread Ray Satiro

Changes by Ray Satiro <raysat...@yahoo.com>:


--
nosy: +raysatiro

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28938>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread William Ray Wing

> On Aug 12, 2016, at 7:07 AM, Steven D'Aprano  
> wrote:
> 
> 

[megabyte]

> 
> 
> [1] Are there programming language aware spell checkers? If not, there
> should be.
> 
> 

There are programming language-aware editors with built-in spell checkers (and 
syntax coloring, but that’s a different matter).

-Bill

> -- 
> Steve
> “Cheer up,” they said, “things could be worse.” So I cheered up, and sure
> enough, things got worse.
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Live analog plotting - python

2016-06-24 Thread Prabhakar Ray
Hi Guys,

I'm reading a continuous analog value using python and plotting it using 
drawnow(). Since the plot is moving it's getting difficult to note down the 
coordinates of any specific point. I intend to implement a moving data cursor 
which can follow the graph and can give me real time coordinates of the point 
without the need of clicking or hovering over a point.

can anyone help me with this ?

Regards,
Prabhakar
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GoPiGo distence sensor

2016-06-15 Thread William Ray Wing

> On Jun 15, 2016, at 10:59 AM, Joel Goldstick  wrote:
> 
> On Wed, Jun 15, 2016 at 10:15 AM,   wrote:
>> I have a small robot on wheels named the GoPiGo.
>> What I want is if the distence sensor read the same distence for let say 5 
>> seconds then the GoPiGo go's backward.
>> 

When I look at the API, I see two functions related to distance traveled.  An 
encoder target function that presumably reads the numbers from an angular 
encoder on the drive shaft and allows you to specify a number for the encoder 
to seek, and a “us_dist” function that seems to read the proximity to an object 
from an ultrasonic sensor.  I’m going to assume you are referring to the 
numbers from this ultrasonic distance sensor.  So, I think what you are saying 
is that if the numbers from the distance sensor are unchanged for 5 seconds (as 
would be the case if the GoPiGo were being blocked by something) then you want 
it to back up. 

As MRAB has commented, what you need to do is set up a delay loop that wakes up 
every second (or more frequently if you want more time resolution) and reads 
the number returned by the us_dist function.  Compare it to the previous 
reading and if unchanged increment a counter.  If it has changed, the robot has 
moved so clear the counter.  If the counter reaches your five second trigger 
point, call a go_back function you write.

-Bill


>> But I don't now how to program this in python.
>> The Api functions for the GoPiGo are here: 
>> http://www.dexterindustries.com/GoPiGo/programming/python-programming-for-the-raspberry-pi-gopigo/
>> 
>> Can someone help me with this.
>> 
>> --
>> https://mail.python.org/mailman/listinfo/python-list
> 
> You can start here: https://www.python.org/about/gettingstarted/
> 
> 
> -- 
> Joel Goldstick
> http://joelgoldstick.com/blog
> http://cc-baseballstats.info/stats/birthdays
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue27017] Python3.5.1: type().startswith()

2016-05-14 Thread Ray

New submission from Ray:

This doesn't look like proper functionality

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> type('')

>>> type('').startswith('s')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: startswith() takes at least 1 argument (0 given)
>>> type('').startswith('s', 's')
True

--
components: Windows
messages: 265505
nosy: VertigoRay, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python3.5.1: type().startswith()
type: behavior
versions: Python 3.5

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27017>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: pylint woes

2016-05-07 Thread Ray Cote
On Sat, May 7, 2016 at 2:52 PM, Christopher Reimer <
christopher_rei...@icloud.com> wrote:

> On 5/7/2016 9:51 AM, DFS wrote:
>
>> Has anyone ever in history gotten 10/10 from pylint for a non-trivial
>> program?
>>
>
> I routinely get 10/10 for my code. While pylint isn't perfect and
> idiosyncratic at times, it's a useful tool to help break bad programming
> habits.
>

I’m impressed with 10/10.
My approach is to ensure flake8 (a combination of pyflakes and pep8
checking) does not report any warnings and then run pyLint as a final
check.
Code usually ends up in the 9.0 to 9.5 range, sometimes a bit higher.
Also find it useful to add some additional short names we use to the
 allowed names list.

Biggest issue I have with pyLint is that it complains when function
parameters are indented twice vs. once. pyFlakes likes the twice.
Example:
def function_name(
parm_1,
long_parm_name,
….
end_of_long_list_of params)
parm_1 = long_parm_name

—Ray




-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [beginner] What's wrong?

2016-04-01 Thread William Ray Wing

> On Apr 1, 2016, at 6:57 PM, Mark Lawrence via Python-list 
>  wrote:
> 
>> On 01/04/2016 23:44, sohcahto...@gmail.com wrote:
>>> On Friday, April 1, 2016 at 3:10:51 PM UTC-7, Michael Okuntsov wrote:
>>> Nevermind. for j in range(1,8) should be for j in range(8).
>> 
>> I can't tell you how many times I've gotten bit in the ass with that 
>> off-by-one mistake whenever I use a range that doesn't start at zero.
>> 
>> I know that if I want to loop 10 times and I either want to start at zero or 
>> just don't care about the actual number, I use `for i in range(10)`.  But if 
>> I want to loop from 10 to 20, my first instinct is to write `for i in 
>> range(10, 20)`, and then I'm left figuring out why my loop isn't executing 
>> the last step.
> 
> "First instinct"?  "I expected"?  The Python docs might not be perfect, but 
> they were certainly adequate enough to get me going 15 years ago, and since 
> then they've improved.  So where is the problem, other than failure to RTFM?
> 
I've always found it vaguely amusing that the server(s) for just about all the 
technical info at MIT reside behind http://rtfm.mit.edu

Bill

> -- 
> 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/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Adding run_in_executor task to already existing loop.

2016-03-25 Thread Ray Cote
On Fri, Mar 25, 2016 at 5:00 PM, Zachary Ware <zachary.ware+pyl...@gmail.com
> wrote:

> I'm assuming you're doing `await process_request()` elsewhere, which
> is what's producing your error: you're trying to start the loop within
> a coroutine running on that loop.  loop.run_in_executor() returns a
> Future just like any other coroutine, so process_request just needs
> this:
>
>async def process_request():
>loop = asyncio.get_event_loop()
>results = await loop.run_in_executor(None, blocking_func, 'hello')
>

Yes, that was precisely the directive I needed. This is now working
perfectly.
Thanks
—Ray



-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
-- 
https://mail.python.org/mailman/listinfo/python-list


Adding run_in_executor task to already existing loop.

2016-03-25 Thread Ray Cote
Hello:

I’m trying to perform an synchronous task while using asyncio.
I understand the solution is to use run_in_executor.
I’m not clear on how to add this into an already running event loop.

I’ve found lots of examples showing how to set up a loop and run this, but
I’m blocked in regards to doing this when the loop is already established.


Example code:

def blocking_func(param1):
# call the blocking call here.
return results

async def process_request():
loop = asyncio.get_event_loop()
block = loop.run_in_executor(None, blocking_func, “hello”)
results = await loop.run_until_complete(asyncio.gather(*[block, ])

The above code says “loop already running.” because we’re already in an
async ask that has been awaited. What is the proper method of adding in
this new synchronous task?

Regards
—Ray
-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-03-03 Thread William Ray Wing

> On Mar 3, 2016, at 3:20 PM, alister  wrote:
> 
> On Thu, 03 Mar 2016 11:03:55 -0700, Ian Kelly wrote:
> 
>> On Thu, Mar 3, 2016 at 10:21 AM, alister 
>> wrote:
>>> On Thu, 03 Mar 2016 13:35:12 +1100, Chris Angelico wrote:
 1) No physical object can have negative mass.
 2) I am a part of the universe and have positive mass.
 3) I am not Kenneth.
 4) The sum of my mass and Kenneth's mass must exceed Kenneth's mass
 alone.
 
 Unless someone wants to dispute 1 or 2, we can be logically certain.
 
 ChrisA
>>> 
>>> Anti Matter?
>> 
>> Antimatter has positive mass.
> 
> Are you sure?

The ALPHA experiment at CERN is attempting a direct measurement of the mass of 
anti-hydrogen by trapping atoms of the stuff in a penning trap at high vacuum. 
The answer isn’t definitive yet as the error bars are huge and extend past 
zero, but are centered on the positive side.

-Bill


> mix 1 atom of hydrogen + 1 of anti hydrogen & you end up with 0 mass (+ 
> LOTTS of energy)
> 
> To be honest it is all over my head
> 
> 
> 
> -- 
> I used to be Snow White, but I drifted.
>   -- Mae West
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Looking for examples of using aiopg with aiohttp and non-async startup.

2016-02-26 Thread Ray Cote
Answer (obvious after a refreshing sleep):
Just run a separate async pool connection prior to kicking off the aiohttp
web application.
The startup now looks like:

async def connect():
return await aiopg.create_pool(…)

if __name__ == “__main__”:
loop = asyncio.get_event_loop()
pool = loop.run_until_complete(connect())
app = web.Application()
app["pool"] = pool
app.router.add_route(‘POST', '/pv/v1/', handle_v1)
web.run_app(app)


Then, in the handle_v1 code:
pool = request.app["pool"]
connection = await pool.acquire()
cursor = await connection.cursor()
—r

On Thu, Feb 25, 2016 at 5:23 PM, Ray Cote <rgac...@appropriatesolutions.com>
wrote:

> Hello:
>
> I have an aiohttp project that starts in the usual way:
>
> app = web.Application()
> app.router.add_route(‘POST”, ‘/‘, handler)
> web.run_app(app)
>
> My question is, how do I work with an aiopg.pool with aiohttp?
> There only seems to be async interfaces into aiopg — but I don’t want to
> create the pool in my handler since that requires a connection on each
> transaction.
>
> I found one example that was
>   app[“db”] = await aiopg.create_pool(dsn)
> but that doesn’t seen correct since we’re not yet in a loop.
>
> Can someone please provide an example showing the proper way to integrate
> aiopg pool into an aiohttp web application?
>
> Regards
> —Ray
>
> --
> Raymond Cote, President
> voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
> ray.cote
>
>
>


-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
-- 
https://mail.python.org/mailman/listinfo/python-list


Looking for examples of using aiopg with aiohttp and non-async startup.

2016-02-25 Thread Ray Cote
Hello:

I have an aiohttp project that starts in the usual way:

app = web.Application()
app.router.add_route(‘POST”, ‘/‘, handler)
web.run_app(app)

My question is, how do I work with an aiopg.pool with aiohttp?
There only seems to be async interfaces into aiopg — but I don’t want to
create the pool in my handler since that requires a connection on each
transaction.

I found one example that was
  app[“db”] = await aiopg.create_pool(dsn)
but that doesn’t seen correct since we’re not yet in a loop.

Can someone please provide an example showing the proper way to integrate
aiopg pool into an aiohttp web application?

Regards
—Ray

-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tcp networking question (CLOSE_WAIT)

2016-02-25 Thread Ray
On Thursday, February 25, 2016 at 1:56:21 PM UTC-5, Martin A. Brown wrote:
> Hello again Ray,
> 
> >> >I'm new to python networking. I am waiting TCP server/client app by 
> >> >using python built-in SocketServer. My problem is if client get 
> >> >killed, then the tcp port will never get released, in CLOSE_WAIT
> >> 
> >> I did not thoroughly review your code (other than to see that you 
> >> are not using SO_REUSEADDR).  This is the most likely problem.
> >>
> >> Suggestion:
> >> 
> >>   man 7 socket
> >> 
> >> Look for SO_REUSEADDR.  Then, apply what you have learned to your 
> >> code.
> >
> >it's not I can't bind the address, my problem is: server is long 
> >run. if client die without "disconnect" then server will leak one 
> >socket.
> 
> Sorry for my trigger-happy, and incorrect reply.
> 
> After so many years, I should know better than to reply without 
> completely processing questions.  Apologies.
> 
> >by using the built-in thread socket server. the extra tcp port are 
> >opened by built-in class itself. if the handler() is finish 
> >correctly (the line with break) then this socket will get cleaned 
> >up. but if client dies, then I am never get out from that True 
> >loop. so the socket will keep in close_wait
> >
> >I fond the issue. it's my own stupid issue.
> >i did "continue" if no data received.
> >just break from it then it will be fine
> 
> Well, I'm glad you found the issue.
> 
> Best of luck,
> 
> -Martin
> 
> -- 
> Martin A. Brown
> http://linux-ip.net/


Thank you very much for reply and help.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tcp networking question (CLOSE_WAIT)

2016-02-25 Thread Ray
On Thursday, February 25, 2016 at 12:56:10 PM UTC-5, Ray wrote:
> hi,
> 
> I'm new to python networking. I am waiting TCP server/client app by using 
> python built-in SocketServer. My problem is if client get killed, then the 
> tcp port will never get released, in CLOSE_WAIT
> 
> maybe I didn't do the handler right? or anyway I can catch the client get 
> killed?
> 
> I wrote following simple code to explain the issue I have, server listen on 
> 127.0.0.1:1234
> client need to send multi-messages (I am sending 2 in this test) if client 
> get killed (I just do kill client_pid) then if I check lsof, I will see the 
> new allocated tcp do not get released 
> 
> server.py
> 
> #!/usr/bin/python
> import threading
> import SocketServer
> import time
> 
> class TCPServerRequestHandler(SocketServer.BaseRequestHandler):
> 
> def handle(self):
> while True:
> data=self.request.recv(1024)
> if not data:
> time.sleep(0.1)
> continue
> print data
> self.request.send(data)
> if data=='end':
> break
> 
> def main():
> server = TCPServer(('127.0.0.1', 1234), TCPServerRequestHandler)
> ip, port = server.server_address
> server_thread = threading.Thread(target=server.serve_forever)
> server_thread.daemon = True
> server_thread.start()
> time.sleep(600)
> server.shutdown()
> server.server_close()
> if __name__=='__main__':
> main()
> 
> client.py
> import socket
> import time
> 
> def client():
> sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> sock.connect(('127.0.0.1', 1234))
> sock.sendall('hello')
> response=sock.recv(1024)
> print "Received:", response
> time.sleep(60)
> sock.sendall('end')
> response=sock.recv(1024)
> print "Received:", response
> sock.close()
> 
> if __name__=='__main__':
> client()
> 
> 
> when I run it, client has 60 seconds sleep, so I just kill the process from OS
> kill 93948
> 
> then I'm running lsof to find my TCP/UDP 
> lsof -n -p $(ps -ef|grep serve[r]|awk '{print $2}')|egrep '(TCP|UDP)'|awk 
> '{print $NF}'
> 
> TCP 127.0.0.1:search-agent (LISTEN)
> TCP 127.0.0.1:search-agent->127.0.0.1:59411 (CLOSE_WAIT)
> 
> I will see the CLOSE_WAIT, this is where the client get killed.
> 
> 
> any help would be great!
> 
> Thanks a lot!


I fond the issue. it's my own stupid issue.
i did "continue" if no data received.
just break from it then it will be fine
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tcp networking question (CLOSE_WAIT)

2016-02-25 Thread Ray
On Thursday, February 25, 2016 at 1:18:05 PM UTC-5, Martin A. Brown wrote:
> >I'm new to python networking. I am waiting TCP server/client app by 
> >using python built-in SocketServer. My problem is if client get 
> >killed, then the tcp port will never get released, in CLOSE_WAIT
> 
> I did not thoroughly review your code (other than to see that you 
> are not using SO_REUSEADDR).  This is the most likely problem.
> 
> Suggestion:
> 
>   man 7 socket
> 
> Look for SO_REUSEADDR.  Then, apply what you have learned to your 
> code.
> 
> -Martin
> 
> -- 
> Martin A. Brown
> http://linux-ip.net/

it's not I can't bind the address, my problem is: server is long run. if client 
die without "disconnect" then server will leak one socket. 

by using the built-in thread socket server. the extra tcp port are opened by 
built-in class itself.
if the handler() is finish correctly (the line with break) then this socket 
will get cleaned up. but if client dies, then I am never get out from that True 
loop. so the socket will keep in close_wait 
-- 
https://mail.python.org/mailman/listinfo/python-list


tcp networking question (CLOSE_WAIT)

2016-02-25 Thread Ray
hi,

I'm new to python networking. I am waiting TCP server/client app by using 
python built-in SocketServer. My problem is if client get killed, then the tcp 
port will never get released, in CLOSE_WAIT

maybe I didn't do the handler right? or anyway I can catch the client get 
killed?

I wrote following simple code to explain the issue I have, server listen on 
127.0.0.1:1234
client need to send multi-messages (I am sending 2 in this test) if client get 
killed (I just do kill client_pid) then if I check lsof, I will see the new 
allocated tcp do not get released 

server.py

#!/usr/bin/python
import threading
import SocketServer
import time

class TCPServerRequestHandler(SocketServer.BaseRequestHandler):

def handle(self):
while True:
data=self.request.recv(1024)
if not data:
time.sleep(0.1)
continue
print data
self.request.send(data)
if data=='end':
break

def main():
server = TCPServer(('127.0.0.1', 1234), TCPServerRequestHandler)
ip, port = server.server_address
server_thread = threading.Thread(target=server.serve_forever)
server_thread.daemon = True
server_thread.start()
time.sleep(600)
server.shutdown()
server.server_close()
if __name__=='__main__':
main()

client.py
import socket
import time

def client():
sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('127.0.0.1', 1234))
sock.sendall('hello')
response=sock.recv(1024)
print "Received:", response
time.sleep(60)
sock.sendall('end')
response=sock.recv(1024)
print "Received:", response
sock.close()

if __name__=='__main__':
client()


when I run it, client has 60 seconds sleep, so I just kill the process from OS
kill 93948

then I'm running lsof to find my TCP/UDP 
lsof -n -p $(ps -ef|grep serve[r]|awk '{print $2}')|egrep '(TCP|UDP)'|awk 
'{print $NF}'

TCP 127.0.0.1:search-agent (LISTEN)
TCP 127.0.0.1:search-agent->127.0.0.1:59411 (CLOSE_WAIT)

I will see the CLOSE_WAIT, this is where the client get killed.


any help would be great!

Thanks a lot!
 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-19 Thread William Ray Wing

> On Feb 19, 2016, at 8:13 PM, Steven D'Aprano  wrote:
> 
> On Sat, 20 Feb 2016 12:27 am, Dennis Lee Bieber wrote:
> 
> 
>> Then the best suggestion I have would be to take a weekend and just
>> read the language reference manual (it used to be about an 80-page PDF
>> file, but has no doubt grown into some less handy dynamically linked
>> HTML/"help" file). Then add the section of the library reference manual
>> that discusses data types. And while in that manual, scan the table of
>> contents -- you may find there are modules in the standard library that
>> already do what you need.
> 
> Surely you should start with the tutorial, not the reference manual.
> 
> 
> 
> -- 
> Steven
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Plus +1.  The ref manual would be like learning English from a dictionary

Bill

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread William Ray Wing

> On Feb 18, 2016, at 10:33 AM, wrong.addres...@gmail.com wrote:
> 
> torstai 18. helmikuuta 2016 17.21.32 UTC+2 Oscar Benjamin kirjoitti:
>> On 18 February 2016 at 11:32, Chris Angelico  wrote:
>> 

[byte]

>> It sounds to me as if all of your needs can be solved in pure Python
>> code possibly using some of the popular extension modules from PyPI.
>> In this case it's actually very easy to package/install. You can
>> package your code simply by zipping it up with a __main__.py file.
>> Someone who wants to install it will simply have a two step process:
>> first install Python (and possibly a few dependencies) and then obtain
>> the zip file with your code in it.
>> 
>> --
>> Oscar
> 
> This form of packing is not desirable. I can't ask other people to install 
> Python on their machines, and I also would not want show most of the code 
> doing the calculations.
> 

Now things get tricky.  I can understand you not wanting to force people to 
pre-install Python in order for your code to run, but just how deeply do you 
want to hide or obfuscate it?  Is this potentially a commercial application to 
be sold, or are you simply trying to keep things clean and tidy within various 
divisions of your company.  I’d hope not the former, because even VB can get 
you into tricky licensing issues (and in any case - even fully compiled code in 
any language these days can be de-compiled into logically correct source code, 
although with less than obvious variable names).  At the other extreme, there 
are packaging programs (py2exe comes to mind, although I have no experience 
with it).  These wrap the whole python interpreter, your code, and any needed 
libraries into an executable (clickable) package.  Their only downside is that 
the output packages they produce tend to be large.  However, any sophisticated 
user who digs into them WILL be able to find your source code, possibly only 
slightly obfuscated by being zipped.

> Another question I have is regarding reading numerical data from text files. 
> Is it necessary to read one character at a time, or can one read like in 
> Fortran and Basic (something like Input #5, X1, X2, X3)?

Python can read lines of text or whole blocks of text from source files.  If 
those files are in more or less well-understood form (csv for example) it has 
libraries specifically designed for reading and extracting data from them 
(including VERY nice facilities for doing arithmetic and otherwise manipulating 
time and date data).

Bill

> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread William Ray Wing

> On Feb 17, 2016, at 2:49 PM, wrong.addres...@gmail.com wrote:
> 
> I am mostly getting positive feedback for Python.
> 
> It seems Python is used more for web based applications. Is it equally fine 
> for creating stand-alone *.exe's? Can the same code be compiled to run on 
> Linux or Android or web-based?
> 
> Is it possible to create GUI elements with a good IDE? Can they be defined 
> like in Visual Basic with given sizes, fonts, visible/invisible, etc.?
> 
> Is it easy to do matrix operations in Python? Or do I need to write 
> subroutines like in Visual Basic?
> 
> Could someone kindly tell me advantages and disadvantages of Python? Or any 
> better options? I have like 40-50 VB Forms and may be around 2 lines of 
> code. It will be a task to learn a new language and translate/re-write that 
> code.
> 

At this point you’ve probably heard more than you wanted to *about* Python.  
The next step really ought to be simply to invest a few minutes in looking at 
the language itself.
Start here by downloading a copy of the Python interpreter:

https://www.python.org/downloads/windows/

Then, there is an extensive list of on-line tutorial material here:

https://wiki.python.org/moin/BeginnersGuide/Programmers

I’d recommend simply picking one and diving in. If you have questions (and you 
surely will), come back here or, at least initially, send them to the Python 
Tutor list (tu...@python.org).

Good luck and have fun,
Bill


> Thanks for your responses. 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-17 Thread William Ray Wing

> On Feb 17, 2016, at 2:49 PM, wrong.addres...@gmail.com wrote:
> 
> I am mostly getting positive feedback for Python.
> 

I would be surprised if you weren’t.

> It seems Python is used more for web based applications. Is it equally fine 
> for creating stand-alone *.exe's? Can the same code be compiled to run on 
> Linux or Android or web-based?
> 

I’m not sure where you got that idea.  Python has been and is being used for an 
extremely broad range of applications.  At one extreme, the popular YouTube 
site is based on Python (and yes, that is a web application), at the other 
extreme much (most?) of the data analysis of the recent LIGO data leading up to 
the discovery of gravitational waves was done in Python, and numpy (a python 
numerical library); with the results displayed in matplotlib (a python library 
for scientific-engineering graphics).

The basic python language and its libraries are completely cross-platform 
(Linux, OS-X, Windows, iOS, and Android).  The same source code will run on all 
of them.  However, because it is an Interpreted language, the step to a 
bundled, self-contained image is platform dependent. There python compliers (as 
opposed to interpreters) for some, but not all platforms, and there is a very 
active JiT compiler project that would fall somewhere in between. 

> Is it possible to create GUI elements with a good IDE? Can they be defined 
> like in Visual Basic with given sizes, fonts, visible/invisible, etc.?
> 

There are several GUI libraries for Python.  You might check out TK (which 
comes built-in), but there are also libraries like wxPython, Kivi (which is 
completely cross platform), and PyQt.  Note that these are the GUI libraries 
themselves, not IDE’s which tend to be independent.  There are too many IDE’s 
to list here - check with Google.

> Is it easy to do matrix operations in Python? Or do I need to write 
> subroutines like in Visual Basic?

Matrix (and similar operations) can be done in Python directly, but if you need 
maximum performance you should use the optimized vector routines available in 
numpy, these are typically pre-compiled with C or FORTRAN and squeeze out the 
maximum speed your hardware is capable of.  (There is work being done to 
migrate them to GPUs, but is VERY hardware dependent at this point.) If you 
need to do scientific/engineering analysis, you should also check out scipy, 
which is built on top of it and is also vector optimized.

> 
> Could someone kindly tell me advantages and disadvantages of Python?

If you are completely satisfied with VB, there is no reason to change (other 
than the enjoyable exercise of learning a new and more powerful language).

On the other hand, Python has often been referred to as “executable pseudo 
code” - in other words, the english-like steps you might sketch out to outline 
the solution to a programming problem in another language is to all intents and 
purposes Python itself.  This makes for very fast and productive code 
generation with typically fewer errors than are made in other languages. In 
addition, and as has been implied above, it is cross platform.  The same python 
source code (with the appropriate libraries) will run on all the platforms 
mentioned above. One of the biggest productive features of Python is the fact 
that it is interpreted (in its most common instantiation).  Thus, you can have 
two windows open side by side, with the source code in one and running code in 
the other.  Changes in the source code can instantly be reflected in the output.

> Or any better options? I have like 40-50 VB Forms and may be around 2 
> lines of code. It will be a task to learn a new language and 
> translate/re-write that code.
> 

Not necessarily better, but at least worth looking into would be the Swift 
language, which shares much of Python’s modern structure, is now also open 
source, and has been ported to most flavors of Linux.  A Window’s port is 
promised, but I don’t know how far along it is.  It *is* a compiled language, 
so you would then be back in the edit, compile, link, and run loop as you debug 
your code.

I’m sure you will get lots of other answers - Google each of the things I’ve 
mentioned and you will get a truck-load of info.  You might start with 
Wikipedia and read there about Python and Swift.

> Thanks for your responses. 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-17 Thread Ray Cote
On Wed, Feb 17, 2016 at 3:54 PM, Rob Gaddi <
rgaddi@highlandtechnology.invalid> wrote:

> > It seems Python is used more for web based applications. Is it equally
> fine for creating stand-alone *.exe's? Can the same code be compiled to run
> on Linux or Android or web-based?
>
> Standalone EXEs are hit and miss.  I've had best luck deploying just as
> Python scripts to machines with an expectation that the environment is
> already configured (i.e. Python already installed).
>
> You don't compile, you interpret.  So long as you've got the
> interpreter on the target platform you're set.  The EXE tools out there
> do so by bundling your plain-text source up with the interpreter
> environment.
>
> Packaging/distribution remains one of the real pain points in Python.
>

Python is used for much more then web based applications.
The latest versions of pyInstaller (http://www.pyinstaller.org) are
incredibly good at generating single-file binaries for both Windows and
Linux.
We’re using pyInstaller to distribute applications based on some fairly
complex frameworks—including wxPython (http://www.wxpython.org)
which is one option for building GUI applications.

—Ray




-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Daemon strategy

2016-02-05 Thread Ray Cote
We’ve recently stopped building Windows services (Python or any other type)
and started using the NSSM service manager.
Takes a normal Windows application and runs it as a service.
The NSSM service manager provides great command-line support for
installing, configuring, and controlling Windows services.
Has greatly reduced our development time and test time since we no longer
need to test both app and service executables.

<http://www.nssm.cc>

Downside is that it is a separate tool to install.
Upside is that it has features such as :
  - run-once at startup.
  - auto-restart failed services
  - setting service dependences (don’t start until another service is up
and running)
  - set processor dependencies

—Ray


On Fri, Feb 5, 2016 at 1:39 PM, <paul.hermeneu...@gmail.com> wrote:

> It appears that python-deamon would be exactly what I need. Alas,
> appears not to run on Windows. If I am wrong about that, please tell
> me.
>
> To what tools should I turn?
>
> I am not eager to produce a "service" on Windows unless it cannot be
> avoided.
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Raymond Cote, President
voice: +1.603.924.6079 email: rgac...@appropriatesolutions.com skype:
ray.cote
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stop writing Python 4 incompatible code

2016-01-16 Thread William Ray Wing

> On Jan 16, 2016, at 9:48 AM, Bernardo Sulzbach  
> wrote:
> 
> On Sat, Jan 16, 2016 at 12:41 PM, Alister  wrote:
>> it was exactly the scenario described
>> 
>> A company had developed a means of impo=roving the Fat file system (IIRC by
>> using a pseudo file system on top to eliminate the wasted space caused by
>> incomplete blocks & the end of files)
>> 
>> Microsoft engaged in negotiations to include the technique in MSDOS
>> the pulled out at the last minute (after obtaining all the technical
>> details) & introduced their own version which operated almost identically.
>> 
>> heck PCDos was initially written by a 3rd party who was ripped of by
>> Microsoft.
>> 
>> Microsoft are the goto example fro the three 'E' approach to development.
>> 
>> Embrace
>> Extend
>> Extinguish
> 
> Did people know this back then or it just surfaced years later?

It was known at the time. It was certainly known by the companies that were 
ripped off, but they were typically small to really small and couldn’t get 
traction for their stories in a press that was in thrall to Micro$oft.  It was 
pretty much only mentioned by contrarian writers like Cringely, and for the 
most part was lost in the noise over the browser war.

Bill

> I
> suppose that at the beginning MS was more "vulnerable" than it is
> today.
> 
> -- 
> Bernardo Sulzbach
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stop writing Python 4 incompatible code

2016-01-15 Thread William Ray Wing

> On Jan 15, 2016, at 9:52 AM, Emile van Sebille  wrote:
> 
> On 1/14/2016 3:55 PM, Rick Johnson wrote:
>> But, when you have almost infinitely deep pockets, like
>> Google, you don't need to create *everything* yourself, no,
>> you simply wait for someone else to build it, then wait a
>> little longer for them to market it successfully, and when
>> it's jt starting to turn a profit, you swoop in,
>> purchase it, and then you drive that "money train" at full
>> speed until its wheels fall off!
>> 
>> And if the owners refuse to sell, no problem, you offer
>> their customers the same services at bargain basement
>> discounts -- then they'll have no choice but to sell, or
>> face bankruptcy. Yep, just another tactic of economic
>> warfare.
> 
> Hmm, sounds like they're stealing plays from Micro$oft.
> 
> Emile
> 

What Micro$oft was actually sued for was worse.  They would approach a small 
company: “We like your product/technology, we think we are interested in buying 
you out, but we want to see your code to be sure it is 
modular/well-documented/etc.”  Then, after looking over the code: “Well, it 
actually doesn’t fit our plans.  Sorry.”  Six months or so later, essentially 
identical stuff would turn up in a Micro$soft product.

-Bill
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stop writing Python 4 incompatible code

2016-01-15 Thread William Ray Wing

> On Jan 15, 2016, at 1:09 PM, Bernardo Sulzbach <mafagafogiga...@gmail.com> 
> wrote:
> 
> On Fri, Jan 15, 2016 at 3:02 PM, William Ray Wing <w...@mac.com> wrote:
>> 
>> What Micro$oft was actually sued for was worse.  They would approach a small 
>> company: “We like your product/technology, we think we are interested in 
>> buying you out, but we want to see your code to be sure it is 
>> modular/well-documented/etc.”  Then, after looking over the code: “Well, it 
>> actually doesn’t fit our plans.  Sorry.”  Six months or so later, 
>> essentially identical stuff would turn up in a Micro$soft product.
>> 
> 
> More out of curiosity than anything else, do you have a source?
> 
> -- 
> Bernardo Sulzbach
> -- 
> https://mail.python.org/mailman/listinfo/python-list

It came out of a Cringely column several years ago, I don’t remember the date.  
What I do remember (and failed to add to my note before) was that Micro$soft 
counted on the mismatch in legal department sizes to pretty much prevent any 
one small company from suing (or bankrupted them if they tried).  It was 
typically a footnote in the press stories about the government suit and another 
bullet point in the unfair competition/tactics alleged.

Bill



-- 
https://mail.python.org/mailman/listinfo/python-list


I can not install matplotlib, numpy, scipy, and pandas.

2016-01-06 Thread Omar Ray via Python-list
I have version 3.5 of Python for Windows.  I have MS Visual C++ and also MS
Visual Studio 2015.

When I enter into the command window "pip install matplotlib", it reads this
below (this is not the full version of it): 

 

Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

 

C:\windows\system32>pip install matplotlib

Collecting matplotlib

  Using cached matplotlib-1.5.0-cp35-none-win32.whl

Requirement already satisfied (use --upgrade to upgrade): pytz in
c:\users\---\a

ppdata\local\programs\python\python35-32\lib\site-packages (from matplotlib)

Requirement already satisfied (use --upgrade to upgrade):
pyparsing!=2.0.4,>=1.5

.6 in
c:\users\---\appdata\local\programs\python\python35-32\lib\site-packages (

from matplotlib)

Requirement already satisfied (use --upgrade to upgrade): python-dateutil in
c:\

users\---\appdata\local\programs\python\python35-32\lib\site-packages (from
matp

lotlib)

Requirement already satisfied (use --upgrade to upgrade): cycler in
c:\users\---

\appdata\local\programs\python\python35-32\lib\site-packages (from
matplotlib)

Collecting numpy>=1.6 (from matplotlib)

  Using cached numpy-1.10.2.tar.gz

Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in
c:\users\-

--\appdata\local\programs\python\python35-32\lib\site-packages (from
python-date

util->matplotlib)

Installing collected packages: numpy, matplotlib

  Running setup.py install for numpy

Complete output from command
c:\users\---\appdata\local\programs\python\pyth

on35-32\python.exe -c "import setuptools,
tokenize;__file__='C:\\Users\\---\\App

Data\\Local\\Temp\\pip-build-yrpyslwq\\numpy\\setup.py';exec(compile(getattr
(tok

enize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__,
'exec'))"

install --record
C:\Users\---\AppData\Local\Temp\pip-o2xr7r52-record\install-re

cord.txt --single-version-externally-managed --compile:

blas_opt_info:

blas_mkl_info:

  libraries mkl,vml,guide not found in
['c:\\users\\---\\appdata\\local\\pro

grams\\python\\python35-32\\lib', 'C:\\',
'c:\\users\\---\\appdata\\local\\progr

ams\\python\\python35-32\\libs']

  NOT AVAILABLE

 

How do I download matplotlib and the other packages mentioned in the subject
line?

 

-Omar Ray

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: imshow keeps crashhing

2016-01-06 Thread William Ray Wing

> On Jan 6, 2016, at 6:10 PM, darren.mcaf...@gmail.com wrote:
> 
> Thanks for the quick reply! 
> 
> So scipy is making temporary files in /private/vars/folders/w4/ name>/

Is this a typo or did you really mean /private/vars?  That is, did your create 
a “vars” directory under /private at some point in the past (pre-Yosemite)?  
The usual directory there would be /var

In any case, the whole /private directory tree is now part of the SIP (System 
Integrity Protection) system under Yosemite, and to open and manipulate files 
there you will have to either turn SIP off or jump through hoops.  If you do a 
ls -al in /private, you will see that var is

drwxr-xr-x 29 root wheel 986 Oct 23 11:20 var

note the “root” and “wheel” owner and group names. I’d suggest moving your 
tests to a different directory that isn’t part of SIP, and debug there. If you 
MUST work under /private, you will have your work cut out for you.

-Bill

> 
> 1. When in the correct folder within Terminal, on the command line I can do: 
>open  
> And it will open it in Preivew.
> 
> 2. However, when opening Preview first, it is impossible (for me) to navigate 
> to the /private directory to open the file that way, even with: 
>defaults write com.apple.Finder AppleShowAllFiles YES
> turned on.
> 
> 3. When I run imshow() (my attempt to 'launch Preview from scipy as you 
> suggested). The UID of the process is 501, which is the same as when I do 
> echo $UID. So I'm assuming the launched Preview is running as myself.
> 
> 4. When the temporary file is originally created its permissions are -rw--
> 
> Does any of that information help? Thanks again.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Mac Question

2016-01-01 Thread William Ray Wing

> On Jan 1, 2016, at 5:56 AM, tdspe...@gmail.com wrote:
> 
> Hi All
> 
> I am trying to create a directory on a windows drive from my macbook air with 
> python but get a permissions error because the windows ntfs drive is read 
> only - does anyone know away to overcome this issue - I have looked for a 
> utility but have yet to find an answer.
> 
> Regards and Happy New Year
> 
> Colin
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

OS-X can read NTFS drives, but by default cannot write to them, hence the 
read-only mount.  If you have control over that external drive you can format 
it (on OS-X) as ExFAT, and it can then be written to and read from by both OS-X 
and Windows.  If the drive must be formatted NTFS, you can turn on writing via 
terminal commands (which works ONLY on a volume-by-volume basis) or using a 
third party utility.  There is a pretty good summary here:

  http://www.cnet.com/news/how-to-manually-enable-ntfs-read-and-write-in-os-x/

-Bill

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Writing a Financial Services App in Python

2015-11-19 Thread William Ray Wing

> On Nov 19, 2015, at 6:59 AM, Cai Gengyang  wrote:
> 
> 
> From YCombinator's new RFS, This is the problem I want to solve as it is a 
> severe problem I face myself and something I need. I want to write this app 
> in Python as I heard that Python is a great language that many programmers 
> use ... How / where do I start ? The problem is detailed below :
> 
> FINANCIAL SERVICES
> 

[Big edit]

You might enjoy reading the note here:  
http://www.wsj.com/articles/an-algo-and-a-dream-for-day-traders-1439160100?mod=djem10point

Which, among other things, points out that DIY algorithmic trading is the 
latest DIY craze.

Bill


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What does “grep” stand for?

2015-11-06 Thread William Ray Wing

> On Nov 5, 2015, at 10:36 PM, Larry Hudson via Python-list 
>  wrote:
> 
> On 11/05/2015 05:18 PM, Dennis Lee Bieber wrote:
>> On Thu, 5 Nov 2015 20:19:39 + (UTC), Grant Edwards
>>  declaimed the following:
>> 
>>> Though I used a line-editor for a while on VMS, I was never very good
>>> at it, and abanded it for a full-screen editor at he first
>>> opportunity.  But, if you ever get a chance to watching somebody who
>>> _is_ good at 'ed', it's something you'll remember...
>> 
>>  I didn't convert to EDT until DEC dropped SOS... And then shortly later
>> I keymapped the Blaise ([Alcor] Pascal) editor on the TRS-80 Mod-III to
>> replicate EDT (as much as possible, given only three function keys on the
>> numeric pad)
>> 
>>  The Amiga used to have two standard editors -- a screen editor and a
>> line editor; as I recall the line editor supported a file window, so one
>> could edit large files by making a single direction pass using a smaller
>> window and a script. Later the screen editor gained ARexx support, so one
>> could script it using ARexx. (And by then they also included a form of
>> microEMACS, my C compiler had a look-alike vi editor... and a later C
>> compiler had another editor integrated to the compiler so that error
>> message reports could trigger the editor to open the file and move to the
>> error position)
>> 
> Anyone besides me remember the CP/M editor Mince (Mince Is Not Complete 
> EMACS)?
> It was an emacs-like editor, without any e-Lisp or other way of extending it. 
>  I believe it was my first exposure to a screen-oriented editor.  I quite 
> liked it at that time (but that was a looonnng time ago!)
> 
> -=- Larry -=-
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

You’re not REALLY an old timer unless you’ve used TECO.

-Bill

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Detection of a specific sound

2015-11-03 Thread William Ray Wing

> On Oct 25, 2015, at 8:17 PM, 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. For example, I expect 
> to need moderate specificity as I live in a quiet neighborhood, but an 
> apartment dweller might need more.
> 
> I'm thinking of recording a smoke alarm and having the program try to find 
> the recorded sound in the stream from the microphone.
> 

I’ve been watching this thread and finally decided to jump in.

First off, we REALLY need to know a bit more about what you are trying to 
accomplish, in what sort of environment, and under what constraints (legal and 
otherwise).  That last bit is crucial.  Is this simply a heads up e-mail 
message to be sent or is it a way of notifying a backup (second tier) 
monitoring service.  Is it for your personal use, or do you expect to sell it 
(again crucial).  Does the computer you expect to run this on have a good UPS 
system (in a typical fire, AC power frequently fails early, sometimes it is the 
*cause* of the fire).  How are you going to get that notification out?  Does 
your network have battery backup?  Are you going to buy a station-service cell 
phone transmitter? If you are thinking of sending a cell phone msg, how do you 
guarantee the receiver is on?  LOTS of issues here.  Then, having said that, 
and in no particular order:

1) the sounders in most smoke alarms use over-driven pizeo-electric 
annunciators, their output has a VERY complex frequency spectrum with LOTS of 
harmonics.  Spectral analysis (combined with threshold analysis) MIGHT be a 
good way to go, but doing so in real time with Python would consume most, if 
not all the resources of the host computer;

2) You would (personal opinion), be much better off using hardwired or 
semi-hardwired detection.  There are several ways to go, including a detector 
microphone and transmitter such as is used to run a remote doorbell system 
(mount the microphone next to the smoke detector, then tap into the doorbell 
receiver box). These have adjustable sensitivity and would basically be a 
threshold detector.  Alternatively, almost all smoke detectors these days are 
designed to be chained to each other via three-wire (plus ground) AC wiring.  
Two of the wires carry power, the third triggers all the detectors in the 
system to sound when if of them sound.  Don’t try to tap the signal wire 
(liability issues), but you could add another detector to the system which 
would act as your monitor if you tap *its* driver output.

3) Finally, how do you guarantee the computer on which the program is to run 
will be up at all times?  Does it auto-restart after a power failure, does the 
program auto-reload as part of the boot-up sequence, and finally, is the 
program going to have absolutely bullet proof error recovery?

-Bill





> Any help is greatly appreciated!
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Recover data over the network

2015-10-09 Thread William Ray Wing

> On Oct 9, 2015, at 10:44 PM, Arshpreet Singh  wrote:
> 
>> On Saturday, 10 October 2015 04:40:27 UTC+5:30, Steven D'Aprano  wrote:
>> 
>> What do you mean, "recover data from a server"? What has happened to the
>> server? Can it boot or is it in an unbootable state? Are the hard drives
>> physically damaged? What sort of hard drives? (Solid state, or magnetic
>> media?)
> 
> Server is booting up. We are using SSD. Disk is not physically Damaged. I 
> can't reach to server Physically. 
> 
> 
>> What makes you think this will be a "small" Python application? Do you have
>> limits on the maximum size? (Does the application have to fit on a floppy
>> disk?) Are you expecting a GUI? What OS do you want the application to run
>> on? (Windows, Linux, Mac OS, Android, embedded systems, something else?)
> 
> From the small I was meaning a simple Python command Line application. That I 
> will be able to execute from shell. Server is on Ubuntu Linux.
> 
>>> For the 2nd part I can use scp(secure copy), Please let me know if any
>>> data-recovery library is available in Python to do 1st task.
>> 
>> Depends on what you mean by data recovery.
> 
> My main aim is to recover user accounts mostly data present in /home 
> partition of the disk.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

I hesitate to mention this, but there _may_ be a communication problem here. 
When American-English speakers refer to data recovery, they usually are 
discussing reading data from a disk that has suffered some catastrophic event, 
say a head crash or an inadvertent wholesale data deletion. In either case 
physical access to the hardware is assumed (and required). Based on what you've 
said so far, you don't have physical access, the disk (SSD) is operating 
normally, and you simply want remote read access to the /home directory tree. 
Is this correct?  If the answer is yes, then the discussion will head off in an 
entirely different direction. 

Bill
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A little test for you Guys

2015-09-22 Thread Ray Cote
On Tue, Sep 22, 2015 at 7:32 PM, Mark Lawrence 
wrote:

>
>> 2 Lists
>>
>
> Tut, tut, tut.


That is not a list, that is a tutple.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python handles globals badly.

2015-09-09 Thread William Ray Wing

> On Sep 9, 2015, at 1:22 PM, Steven D'Aprano  wrote:
> 
> 

[byte]

> 
> I think my favourite is the guy who claims that the reason natural languages
> all count from 1 is because the Romans failed to invent zero. (What about
> languages that didn't derive from Latin, say, Chinese?)

Right.  Note that the Arabs, who DID invent zero, still count from one.

Bill

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Need assistance

2015-07-18 Thread William Ray Wing

 On Jul 18, 2015, at 1:34 PM, Mark Lawrence breamore...@yahoo.co.uk wrote:
 
 

[byte]

 What is an {HP calculator} roll operation?
 

The original Hewlett Packard “Scientific” calculators (HP-35, 45, 65, etc) that 
used Polish notation (operand, operand, operation; with no “=“ sign) had a 
stack.  That stack itself could be manipulated (e.g., interchange X and Y). One 
of the stack manipulation commands was “Roll” which moved the top entry into X 
and pushed remaining elements up one.  Later versions had both Roll-up and 
Roll-down, Roll-down moved the X entry to the top of the stack and dropped the 
other elements.

Bill  (Who still uses an HP-45 emulator on his iPhone)

 -- 
 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/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fixing Python install on the Mac after running 'CleanMyMac'

2015-05-29 Thread William Ray Wing

 On May 29, 2015, at 9:12 AM, Cem Karan cfkar...@gmail.com wrote:
 
 
 On May 28, 2015, at 11:47 PM, Laura Creighton l...@openend.se wrote:
 
 webmas...@python.org just got some mail from some poor embarrased
 soul who ran this program and broke their Python install.
 
 They are running Mac OSX 10.7.5
 
 They are getting:
 
Utility has encountered a fatal error, and will now terminate.  A
Python runtime could not be located. You may need to install a
framework build of Python or edit the PyRuntimeLocations array in this
applications info.plist file.  Then there are two oblong circles. One
says Open Console. The other says Terminate.
 
 So https://docs.python.org/2/using/mac.html says:
 
  The Apple-provided build of Python is installed in
  /System/Library/Frameworks/Python.framework and /usr/bin/python,
  respectively. You should never modify or delete these, as they are
  Apple-controlled and are used by Apple- or third-party software.
 
 So, I assume this poor soul has done precisely that.
 
 What do I tell her to do now?

As a minor addendum - you can point out that “Clean My Mac” is a well-known 
piece of crap-ware that is so badly written as to be labeled by most people as 
malware.  Best possible solution would be a clean boot and restore from a 
recent clone (either CarbonCopy Cloner or SuperDuper) followed by a restore of 
intervening files from Time Machine.  Failing that, Cem’s suggestions are good.

-Bill

 
 Does she have a recent Time Machine backup that she can restore from?  
 Otherwise the solutions are all fairly painful:
 
 1) Install Python 2.7 from scratch (easy).  Then figure out where to put 
 symlinks that point back to the install (mildly annoying/hard).  Note that 
 Python 3 won't work; none of the built-in scripts expect it.
 
 2) OS X recovery - 
 http://www.macworld.co.uk/how-to/mac/how-reinstall-mac-os-x-using-internet-recovery-3593641/
  I've never had to do that, so I have no idea how easy/reliable it is.  I 
 **think** its supposed to save all the data on the drive, but again, I've not 
 done this, so I can't make any guarantees.
 
 3) Wipe it clean and reinstall from scratch.
 
 Honestly, I hope she has a time machine backup.  I've had to do recoveries a 
 couple of times, and it can really save you.
 
 Good luck,
 Cem Karan
 -- 
 https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Accessing DataSocket Server with Python

2015-05-29 Thread William Ray Wing

 On May 28, 2015, at 6:17 PM, Dan Stromberg drsali...@gmail.com wrote:
 
 I have no idea about the protocol used by NI DataSockets, but you
 might be able to reverse engineer the protocol by using the official
 client with a sniffer.
 
 Also, be aware that TCP/IP guarantees that you get the correct data in
 the correct order, but it doesn't guarantee anything about the sizes
 of the chunks in which that data arrives.  So you could send 100
 bytes, 100 bytes, 100 bytes, but on the other end receive 100 bytes,
 50 bytes, 75 bytes, 75 bytes.  When you catenate them all together,
 it's still the same data though.
 
 HTH.
 
 On Wed, May 27, 2015 at 4:30 AM, Garrone, Corrado

While that’s certainly possible in a routed network (and even then can be 
overridden with the “do not fragment” bit), it won’t happen in a LAN or 
self-contained instrument set-up.  These days, even routed networks tend to 
deliver anything less than a 1500 byte packet as a single entity.  With fiber 
backbones and high-speed LANs, it is more work for a router to fragment a 
packet then to simply pass it on.  The days of 480 byte packets pretty much 
went away with dial-up modems.

Bill



 corrado.garr...@roche.com wrote:
 Dear Python Team,
 
 currently I am working on a research project for my bachelor degree. A
 LabVIEW application is used for current and power measurements, whereas the
 measured data are sent to DataSocket Server, a technology by National
 Instruments used for data exchange between computers and applications.
 DataSocket is based on TCP/IP and thus requesting data from DataSocket
 should be similar to an internet request.
 I know with the socket library in Python it is possible with to establish
 sockets, send internet requests and communicate between clients and servers.
 Is there a possibility to access NI DataSocket and get measurement data with
 Python on the same computer where Python is installed and the codes are
 executed? Can you maybe send me an example code where such a connection with
 DataSocket is established?
 
 If you got any queries, please do not hesitate to contact me.
 
 Thank you very much for your efforts.
 
 Kind regards,
 
 Corrado Garrone
 DH-Student Fachrichtung Elektrotechnik / Co-op Student B.Eng. Electrical
 Engineering
 
 Roche Diagnostics GmbH
 DFGHMV8Y6164
 Sandhofer Strasse 116
 68305 Mannheim / Germany
 
 Phone: apprentice
 mailto:corrado.garr...@roche.com
 
 Roche Diagnostics GmbH
 Sandhofer Straße 116; D‑68305 Mannheim; Telefon +49‑621‑759‑0; Telefax
 +49‑621‑759‑2890
 Sitz der Gesellschaft: Mannheim - Registergericht: AG Mannheim HRB 3962 -
 Geschäftsführung: Dr. Ursula Redeker, Sprecherin; Edgar Vieth -
 Aufsichtsratsvorsitzender: Dr. Severin Schwan
 
 Confidentiality Note
 This message is intended only for the use of the named recipient(s) and may
 contain confidential and/or privileged information. If you are not the
 intended recipient, please contact the sender and delete the message. Any
 unauthorized use of the information contained in this message is prohibited.
 
 
 --
 https://mail.python.org/mailman/listinfo/python-list
 
 -- 
 https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: New to Python - block grouping (spaces)

2015-04-16 Thread William Ray Wing

 On Apr 16, 2015, at 2:11 AM, Paul Rubin no.email@nospam.invalid wrote:
 
 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes:
 I'm aware that Coffeescript provides a brace-free wrapper around Javascript; 
 I'm not aware of any wrapper that *adds* braces to a language without them. 
 
 You're not old enough to remember Ratfor ;-)
 -- 
 https://mail.python.org/mailman/listinfo/python-list

HO Boy - Rational FORTRAN!  Right up there with WatFOR (Waterloo FORTRAN for 
you youngsters).  It was interpreted FORTRAN.  Used teaching new programmers 
back in the day because it kept them from crashing the system.

Bill
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ANN: Wing IDE 5.1.2 released

2015-02-26 Thread William Ray Wing

 On Feb 26, 2015, at 2:04 PM, Jim Mooney cybervigila...@gmail.com wrote:
 
 Hey, can I run Py 2.7 and 3.4 side by side without a lot of hassle, using 
 Wing? I run both since I'm migranting and so far the free IDEs just seem to 
 choke on that.
 -- 
 https://mail.python.org/mailman/listinfo/python-list

I assume you just mean that you would like to have different Python projects 
that open in Wing with the correct associated version of Python.
Yes, you can specify a python executable in the Project Properties - 
Environment tab.  Click on the “Custom button in the Python Executable entry 
and enter the path to the version of Python you want. 

If this isn’t what you are after, let us know.

-Bill

PS: I’ve found that the Wing e-mail support is VERY responsive.  No relation, 
just a happy user.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python 2 to python 3

2015-02-25 Thread William Ray Wing

 On Feb 24, 2015, at 9:55 PM, Audrey McFarlane bryceod...@icloud.com wrote:
 
 I am using Wing101 v.5 and it is using Python2, but I want to make it use 
 Python3 instead because  need Python3 for a uni lab.  How do I change it?
 -- 
 https://mail.python.org/mailman/listinfo/python-list

Assuming you have Python3 installed on your system. The most straightforward 
way to make Wing use it is to go to the Project menu, select Project 
Properties, and under the Environment tab, Python Executable, click the custom 
button, then enter the path to the Python3 executable in the path window.

Have fun,
Bill

-- 
https://mail.python.org/mailman/listinfo/python-list


  1   2   3   4   5   >