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


Puzzling difference between lists and tuples

2020-09-17 Thread William Pearson
I am puzzled by the reason for this difference between lists and tuples.

A list of with multiple strings can be reduced to a list with one string with 
the expected results:

for n in ['first','second']:
print n

for n in ['first']:
print n

The first loop prints "first", "second", and the second prints "first".



This is not true for a tuple:

for n in ('first','second'):
print n

for n in ('first'):
print n


prints "first", "second" in the first case, but "f","i","r","s","t" in the 
second.

Where is this inconsistency explained?

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


[no subject]

2020-01-04 Thread William Johnsson
Hello! My name is William and im 14 years old and live in sweden.  Im pretty 
new to programing in python and i need some help with code, (That’s why i’m 
here). But i couldn’t really find what i was searching for on the internet. I’m 
trying to write code that can check only the first line in a .txt file and 
check if it’s the same as the int 1000.   I preferably want it to be an if 
satement but anything works, i just don’t know how i should write it. I’ve been 
browsing the internet for a solution but sadly can’t seem to find a solution to 
it.

I don’t really know if this is the right way to get help or even if this email 
is for something else. Hopefully i will get some kind of response.

Best regards, William
-- 
https://mail.python.org/mailman/listinfo/python-list


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


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


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: [pypy-dev] A quick question for you!

2018-06-19 Thread William ML Leslie
On 18 June 2018 at 22:18, Etienne Robillard  wrote:
> Hi,
>
> Quick question: Does anyone of you know what is the effect of enabling
> gc.enable() in sitecustomize.py when using PyPy? Can it reduce latency for
> long-lived WSGI applications?
>

gc is enabled by default.  you only need to use gc.enable() if you
have earlier run gc.disable().

-- 
William Leslie

Notice:
Likely much of this email is, by the nature of copyright, covered
under copyright law.  You absolutely MAY reproduce any part of it in
accordance with the copyright law of the nation you are reading this
in.  Any attempt to DENY YOU THOSE RIGHTS would be illegal without
prior contractual agreement.
-- 
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


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: Trace back error just trying to run a simple import of requests

2018-02-01 Thread William Sewell
It is allright.  I just cannot account for the sudden change.  In my usual path 
everything worked fine.  Now, I have to navigate to where the Python 
executable, even though I have added the path to the Windows path.

Please close my case.


Dr. William Sewell
Direct Line: 385.428.5377  Toll Free: 877.435.7948 ext 5377
Course Instructor, IT

WGU will be closed President's Day, February 19th.
Mountain Time Office hours: Sun 3:00 PM - 8:00 PM, Mon 6:30 AM - 3:30 PM, Tue 
9:30 AM - 6:30 PM, Wed 9:00 AM - 5:00 PM, Thu 6:30 AM - 3:30 PM
Your success is very important to me.  
IT MSDA and Database Team 
cmdatab...@wgu.edu
Toll Free: 1-877-435-7948
Student Services: 1-866-903-0110
WellConnect Counseling Services: 1-877-685-3269
Western Governors University
mailto:william.sew...@wgu.edu



More about WGU in Fast Company, CNN, NPR, NBC Nightly News, Money, The 
Atlantic, TIME, etc.
wgu.edu


-Original Message-
From: Cameron Simpson [mailto:c...@cskk.id.au] 
Sent: Thursday, February 01, 2018 8:08 PM
To: William Sewell 
Cc: python-list@python.org
Subject: Re: Trace back error just trying to run a simple import of requests

On 01Feb2018 20:26, William Sewell  wrote:
>My python script which I run daily just blew up.  So, I went into python to 
>diagnose and just typed in the first line - import requests.  I received 
>screenfulls of errors.  Why?  What could have happened when nothing changed on 
>my end?  The traceback is copied below.
>
>
>[cid:image001.png@01D39B71.014E8850]

Please followup to the list with a cut/paste of the error text. This list is 
text only and strips attachments as an aid to readability.

We want to help you, but we deal in plain text - it is far more useful to all.

Cheers,
Cameron Simpson  (formerly c...@zip.com.au)

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


RE: Trace back error just trying to run a simple import of requests

2018-02-01 Thread William Sewell
My python script which I run daily just blew up.  So, I went into python to 
diagnose and just typed in the first line - import requests.  I received 
screenfulls of errors.  Why?  What could have happened when nothing changed on 
my end?  The traceback is copied below.


[cid:image001.png@01D39B71.014E8850]


Dr. William Sewell
Direct Line: 385.428.5377  Toll Free: 877.435.7948 ext 5377
Course Instructor, IT

WGU will be closed President's Day, February 19th.
Mountain Time Office hours: Sun 3:00 PM - 8:00 PM, Mon 6:30 AM - 3:30 PM, Tue 
9:30 AM - 6:30 PM, Wed 9:00 AM - 5:00 PM, Thu 6:30 AM - 3:30 PM
Your success is very important to me.
IT MSDA and Database Team
cmdatab...@wgu.edu<mailto:cmdatab...@wgu.edu>
Toll Free: 1-877-435-7948
Student Services: 1-866-903-0110
WellConnect Counseling Services: 1-877-685-3269
Western Governors University
mailto:william.sew...@wgu.edu

[WGU]<https://timetrade.com/app/wgu-mentoring/workflows/WGU100/schedule/?locationId=course_mentoring&appointmentTypeGroupId=CM&resourceId=005a00CBjHbAAL>

More about WGU in Fast Company, CNN, NPR, NBC Nightly News, Money, The 
Atlantic, TIME, etc.<http://www.wgu.edu/>
wgu.edu<http://www.wgu.edu/>


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


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: Any good explanations on pd.merge(df,df2, on=['Code', 'Region'])

2017-11-08 Thread William Ayd
Assuming df and df2 are dataframes you are essentially doing a SQL-like join of 
the two objects where the records within match on both the Code and Region 
columns

Sent from my iPhone
-- 
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: How do I find what kind of exception is thrown.

2017-09-05 Thread William Ray Wing

> On Sep 5, 2017, at 4:50 AM, Antoon Pardon  wrote:
> 
> Python 2.6.4 on a solaris box.
> 
> I have a program in which all kind of excptions can be thrown and caugth.
> The main program is something like below:
> 
> try:
>do_stuff
> except Exception:
>log unexpected trouble
> 
> Now I found the following in the logs: [Errno 131] Connection reset by peer
> 

“Connection reset by peer” is a network problem.  It looks to your program as 
though the connection has been dropped.

> This is a problem I would like to catch earlier however I have no idea what
> exception I would have to catch in order to treat this case.
> 
> -- 
> Antoon Pardon
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


Re: The ternaery operator

2017-03-16 Thread William Mayor
> 
> I think it would be nice to have a way of getting the 'true'
> value as the return with an optional value if false.  The desire
> comes about when the thing I'm comparing is an element of a collection:
> 
>drugs['choice'] if drugs['choice'] else 'pot'
> 
> Then I'm tempted to do:
> 
>   chosen = drugs['choice']
>   chosen if chosen else 'pot'
> 
> I sometimes feel like doing:
> 
>   drugs['choice'] else 'pot'
> 

For the case where the element in the collection exists, but might be falsey 
you could do:

drugs[‘choice’] or ‘pot'

The ternary operator would be useful for something like:

drugs[‘choice’] if is_good_for_you(drugs[‘choice’]) else ‘nice cup of 
tea’

Most of the time I avoid the ternary stuff though, I don’t think it’s easy to 
read, no matter what language you’re writing in.

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


problems installing pylab

2017-02-21 Thread Robert William Lunnon
Dear Python

I am trying to install pylab alongside python 3.6. However when I type

python -m pip install pylab

I get the message

No module named site

In the documentation [documentation for installing python modules in
python 3.6.0 documentation] it says: The above example assumes that the
option to adjust the system PATH environment variable was selected when
installing python.

How do I do this?

I am running Windows 10

Looking forward to hearing from you

Bob




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


Re: ImportError: The ``fake-factory`` package is now called ``Faker``.

2016-12-20 Thread William Mayor
I came across this error this morning.

In my case I was running a script that did this: “pip install fake-factory”

The install worked properly but then I couldn’t import the library (with the 
same error message as you).

I had to update the pip install command to say “pip install Faker” and then 
everything worked as before.

The authors appear to have forced a name change: 
https://github.com/joke2k/faker/blob/fake-factory/faker/__init__.py 


I’ve just checked and if you pin your requirements (e.g. pip install 
fake-factory==0.7.4) then it still works.


> On 20 Dec 2016, at 16:57, Uri Even-Chen  wrote:
> 
> Hi, we get this error with Python 3.4 and 3.5:
> https://travis-ci.org/urievenchen/speedy-net/jobs/185497863
> 
> 
> --
> 
> ImportError: Failed to import test module:
> speedy.net.accounts.tests.test_factories
> 
> Traceback (most recent call last):
> 
>  File "/opt/python/3.5.2/lib/python3.5/unittest/loader.py", line 428,
> in _find_test_path
> 
>module = self._get_module_from_name(name)
> 
>  File "/opt/python/3.5.2/lib/python3.5/unittest/loader.py", line 369,
> in _get_module_from_name
> 
>__import__(name)
> 
>  File 
> "/home/travis/build/urievenchen/speedy-net/speedy/net/accounts/tests/test_factories.py",
> line 4, in 
> 
>import factory
> 
>  File 
> "/home/travis/virtualenv/python3.5.2/lib/python3.5/site-packages/factory/__init__.py",
> line 46, in 
> 
>from .faker import Faker
> 
>  File 
> "/home/travis/virtualenv/python3.5.2/lib/python3.5/site-packages/factory/faker.py",
> line 41, in 
> 
>import faker
> 
>  File 
> "/home/travis/virtualenv/python3.5.2/lib/python3.5/site-packages/faker/__init__.py",
> line 7, in 
> 
>raise ImportError(error)
> 
> ImportError: The ``fake-factory`` package is now called ``Faker``.
> 
> Please update your requirements.
> 
> 
> What is the problem? We didn't update our requirements recently.
> 
> Thanks,
> Uri.
> 
> *Uri Even-Chen*
> [image: photo] Phone: +972-54-3995700
> Email: u...@speedy.net
> Website: http://www.speedysoftware.com/uri/en/
>   
>    
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


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


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


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: [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: 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: 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 1:09 PM, Bernardo Sulzbach  
> wrote:
> 
> On Fri, Jan 15, 2016 at 3:02 PM, William Ray Wing  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


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: 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: Windows 10 and PYODBC

2015-12-16 Thread William Abdo
issue 25875 created

I put it in the wrong area the first time.

First time bug tracker user errors.


Respectfully,

William Abdo
Software App Engineer II
NTT America, an NTT Communications Company
Office:   +1 561.912.2434
Email:w.a...@ntta.com<mailto:w.a...@ntta.com>
[https://rvip.team-center.net/externals/images/email/ntta.png]<http://www.us.ntt.com/index.html>
[https://rvip.team-center.net/externals/images/email/ntta-twitter.png]<http://www.twitter.com/NTT_America>
  [https://rvip.team-center.net/externals/images/email/ntta-linkedin.png] 
<http://www.linkedin.com/company/ntt-america>   
[https://rvip.team-center.net/externals/images/email/ntta-facebook.png] 
<http://www.facebook.com/nttamerica>   
[https://rvip.team-center.net/externals/images/email/ntta-youtube.png] 
<http://www.youtube.com/user/NTTCommunicationsEN>





From: paul.hermeneu...@gmail.com [mailto:paul.hermeneu...@gmail.com]
Sent: Tuesday, December 15, 2015 3:09 PM
To: William Abdo
Cc: python-list@python.org
Subject: RE: Windows 10 and PYODBC


On Dec 15, 2015 12:00 PM, "William Abdo" 
mailto:w.a...@ntta.com>> wrote:
>
> As you wish,
>
> [issue577] PYODBC will not talk to Oracle under Windows 10.

Where is this issue filed? I do not see it on http://bugs.python.org/


This email message is intended for the use of the person to whom it has been 
sent, and may contain information that is confidential or legally protected. If 
you are not the intended recipient or have received this message in error, you 
are not authorized to copy, distribute, or otherwise use this message or its 
attachments. Please notify the sender immediately by return e-mail and 
permanently delete this message and any attachments. NTT America makes no 
warranty that this email is error or virus free. Thank you.


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


RE: Windows 10 and PYODBC

2015-12-16 Thread William Abdo
As you wish,
[issue577] PYODBC will not talk to Oracle under Windows 10.

Respectfully,

William Abdo
Software App Engineer II
NTT America, an NTT Communications Company
Office:   +1 561.912.2434
Email:w.a...@ntta.com<mailto:w.a...@ntta.com>
[https://rvip.team-center.net/externals/images/email/ntta.png]<http://www.us.ntt.com/index.html>
[https://rvip.team-center.net/externals/images/email/ntta-twitter.png]<http://www.twitter.com/NTT_America>
  [https://rvip.team-center.net/externals/images/email/ntta-linkedin.png] 
<http://www.linkedin.com/company/ntt-america>   
[https://rvip.team-center.net/externals/images/email/ntta-facebook.png] 
<http://www.facebook.com/nttamerica>   
[https://rvip.team-center.net/externals/images/email/ntta-youtube.png] 
<http://www.youtube.com/user/NTTCommunicationsEN>





From: paul.hermeneu...@gmail.com [mailto:paul.hermeneu...@gmail.com]
Sent: Tuesday, December 15, 2015 1:41 PM
To: William Abdo
Cc: python-list@python.org
Subject: RE: Windows 10 and PYODBC


On Dec 15, 2015 10:34 AM, "William Abdo" 
mailto:w.a...@ntta.com>> wrote:
>
> Yes Paul Hermeneutic , that is correct.
>
> I tried everything I could  however,  I was unable to make PYODBC  talk to 
> Oracle under Windows 10.

It would be of help to everyone if you would file a bug report on the issue 
tracker. http://bugs.python.org/


This email message is intended for the use of the person to whom it has been 
sent, and may contain information that is confidential or legally protected. If 
you are not the intended recipient or have received this message in error, you 
are not authorized to copy, distribute, or otherwise use this message or its 
attachments. Please notify the sender immediately by return e-mail and 
permanently delete this message and any attachments. NTT America makes no 
warranty that this email is error or virus free. Thank you.


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


RE: Windows 10 and PYODBC

2015-12-16 Thread William Abdo
Yes Paul Hermeneutic , that is correct.
I tried everything I could  however,  I was unable to make PYODBC  talk to 
Oracle under Windows 10.
Maybe there are smarter than me that can make this work. For me it was easier 
to just use cx_Oracle for the Oracle connection.



Respectfully,

William Abdo
Software App Engineer II
NTT America, an NTT Communications Company
Office:   +1 561.912.2434
Email:w.a...@ntta.com<mailto:w.a...@ntta.com>
[https://rvip.team-center.net/externals/images/email/ntta.png]<http://www.us.ntt.com/index.html>
[https://rvip.team-center.net/externals/images/email/ntta-twitter.png]<http://www.twitter.com/NTT_America>
  [https://rvip.team-center.net/externals/images/email/ntta-linkedin.png] 
<http://www.linkedin.com/company/ntt-america>   
[https://rvip.team-center.net/externals/images/email/ntta-facebook.png] 
<http://www.facebook.com/nttamerica>   
[https://rvip.team-center.net/externals/images/email/ntta-youtube.png] 
<http://www.youtube.com/user/NTTCommunicationsEN>





From: paul.hermeneu...@gmail.com [mailto:paul.hermeneu...@gmail.com]
Sent: Tuesday, December 15, 2015 11:34 AM
To: William Abdo
Cc: python-list@python.org
Subject: RE: Windows 10 and PYODBC


On Dec 15, 2015 9:22 AM, "William Abdo" 
mailto:w.a...@ntta.com>> wrote:
>
> So I started a search for an Oracle based ODBC client since PYODBC is still 
> working with the Microsoft DB’s, I tried cx_Oracle and it worked perfectly 
> after I managed to get the parameters correct on the call,

It sounds like PYODBC cannot connect to Oracle on Windows 10. Is that correct?


This email message is intended for the use of the person to whom it has been 
sent, and may contain information that is confidential or legally protected. If 
you are not the intended recipient or have received this message in error, you 
are not authorized to copy, distribute, or otherwise use this message or its 
attachments. Please notify the sender immediately by return e-mail and 
permanently delete this message and any attachments. NTT America makes no 
warranty that this email is error or virus free. Thank you.


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


RE: Windows 10 and PYODBC

2015-12-15 Thread William Abdo
Hi Paul Hermeneutic,
The issue was it could not establish a connection , it threw  an error 
ORA-01019 (1019) .
So after some research it began to look like it was unable to connect via the 
TNS Names. I was unable to verify this since it was just dying and not logging 
the issue.
So I started a search for an Oracle based ODBC client since PYODBC is still 
working with the Microsoft DB’s, I tried cx_Oracle and it worked perfectly 
after I managed to get the parameters correct on the call,
It utilized all the syntax for the most part of PYODBC calls so only the 
connection information needed to be altered.
Using parts of a snippet found on the internet that helped me.
Since I still needed PYODBC to talk to SQL Server I found that it worked best 
if cx_Oracle’s import statement is Place before other ODBC clients. At least it 
appeared that way to me in my testing.
See Below:
import cx_Oracle #Place before other ODBC Clients
pconnObj  = cx_Oracle.connect('User/Password@TNSname')  #replace with your 
settings
pcur = pconnObj.cursor()
if pcur.execute('select * from dual'):
print "Yeah, it works!!!"
else:
print "Failure"
pcur.close()


I named the cursor the same as I had with PYODBC and no other changes were 
necessary
.fetchall()
.fetchone()
All worked

Returnd values requested also as PYODBC did:
prows = pcur.execute("SELECT name,TableID,LastAlteredDate  FROM myTable where 
tableType = '1' order by name").fetchall()
print "#rows=" + str(len(prows)) + '\n'
tscnt = len(prows)

Good Luck!
If you have more questions just ask.

Respectfully,

William Abdo
Software App Engineer II
NTT America, an NTT Communications Company
Office:   +1 561.912.2434
Email:w.a...@ntta.com<mailto:w.a...@ntta.com>
[https://rvip.team-center.net/externals/images/email/ntta.png]<http://www.us.ntt.com/index.html>
[https://rvip.team-center.net/externals/images/email/ntta-twitter.png]<http://www.twitter.com/NTT_America>
  [https://rvip.team-center.net/externals/images/email/ntta-linkedin.png] 
<http://www.linkedin.com/company/ntt-america>   
[https://rvip.team-center.net/externals/images/email/ntta-facebook.png] 
<http://www.facebook.com/nttamerica>   
[https://rvip.team-center.net/externals/images/email/ntta-youtube.png] 
<http://www.youtube.com/user/NTTCommunicationsEN>





From: paul.hermeneu...@gmail.com [mailto:paul.hermeneu...@gmail.com]
Sent: Tuesday, December 15, 2015 10:43 AM
To: William Abdo
Cc: python-list@python.org
Subject: RE: Windows 10 and PYODBC


On Dec 13, 2015 7:20 AM, "William Abdo" 
mailto:w.a...@ntta.com>> wrote:
>
> Problem Resolved.
> I have fixed the Oracle connection issue under Windows 10 with cx_Oracle .
> PYODBC was only failing on the Oracle connection and worked fine on MS SQL 
> under Windows 10.

Please tell us what the fix is. Thanks.


This email message is intended for the use of the person to whom it has been 
sent, and may contain information that is confidential or legally protected. If 
you are not the intended recipient or have received this message in error, you 
are not authorized to copy, distribute, or otherwise use this message or its 
attachments. Please notify the sender immediately by return e-mail and 
permanently delete this message and any attachments. NTT America makes no 
warranty that this email is error or virus free. Thank you.


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


RE: Windows 10 and PYODBC

2015-12-13 Thread William Abdo
Problem Resolved.
I have fixed the Oracle connection issue under Windows 10 with cx_Oracle .
PYODBC was only failing on the Oracle connection and worked fine on MS SQL 
under Windows 10.
Thank You for your time in this matter.

Respectfully,

William Abdo
Software App Engineer II
NTT America, an NTT Communications Company
Office:   +1 561.912.2434
Email:w.a...@ntta.com<mailto:w.a...@ntta.com>
[https://rvip.team-center.net/externals/images/email/ntta.png]<http://www.us.ntt.com/index.html>
[https://rvip.team-center.net/externals/images/email/ntta-twitter.png]<http://www.twitter.com/NTT_America>
  [https://rvip.team-center.net/externals/images/email/ntta-linkedin.png] 
<http://www.linkedin.com/company/ntt-america>   
[https://rvip.team-center.net/externals/images/email/ntta-facebook.png] 
<http://www.facebook.com/nttamerica>   
[https://rvip.team-center.net/externals/images/email/ntta-youtube.png] 
<http://www.youtube.com/user/NTTCommunicationsEN>







This email message is intended for the use of the person to whom it has been 
sent, and may contain information that is confidential or legally protected. If 
you are not the intended recipient or have received this message in error, you 
are not authorized to copy, distribute, or otherwise use this message or its 
attachments. Please notify the sender immediately by return e-mail and 
permanently delete this message and any attachments. NTT America makes no 
warranty that this email is error or virus free. Thank you.


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


Windows 10 and PYODBC

2015-12-09 Thread William Abdo
Hi All,
I am not sure if anyone has asked this question already or not but I will again.
Hopefully someone else has had and found a fix for this issue.
I'm grateful for any and all assistance.

I have recently upgraded to Windows 10 and I have an issue with PYODBC 
connecting to Oracle 11g.

It was working OK in Windows 7,  till I upgraded to Windows 10, Anyone have any 
IDEAS?
I have tried setting it to Windows 7 compatibility mode .
I have updated the drivers to the latest (Which I think I already had).

The actual error I get is
 Traceback (most recent call last):
  File "oraclecountsDec1.py", line 32, in 
pconnObj =  pyodbc.connect( pconnString )
pyodbc.Error: ('NA000', "[NA000] [Microsoft][ODBC driver for 
Oracle][Oracle]Error while trying to retrieve text for error ORA-01019 (1019) 
(SQLDriverConnect); [01000] [Microsoft][ODBC Driver Manager] The driver doesn't 
support the version of ODBC behavior that the application requested (see 
SQLSetEnvAttr). (0)")

SQL Log file states:
Fatal NI connect error 12560, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oracleORCX)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))(CONNECT_DATA=(SID=ORCX)(CID=(PROGRAM=D:\Python26\python.exe)(HOST=xxx-)(USER=xx

  VERSION INFORMATION:
TNS for 32-bit Windows: Version 12.1.0.2.0 - Production
Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 
12.1.0.2.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: 
Version 12.1.0.2.0 - Production
  Time: 06-AUG-2015 17:12:31
  Tracing not turned on.
  Tns error struct:
ns main err code: 12560
TNS-12560: Message 12560 not found; No message file for product=NETWORK, 
facility=TNS
ns secondary err code: 0
nt main err code: 530
TNS-00530: Message 530 not found; No message file for product=NETWORK, 
facility=TNS
nt secondary err code: 126
nt OS err code: 0


Respectfully,

William Abdo
Software App Engineer II
NTT America, an NTT Communications Company
Office:   +1 561.912.2434
Email:w.a...@ntta.com<mailto:w.a...@ntta.com>
[https://rvip.team-center.net/externals/images/email/ntta.png]<http://www.us.ntt.com/index.html>
[https://rvip.team-center.net/externals/images/email/ntta-twitter.png]<http://www.twitter.com/NTT_America>
  [https://rvip.team-center.net/externals/images/email/ntta-linkedin.png] 
<http://www.linkedin.com/company/ntt-america>   
[https://rvip.team-center.net/externals/images/email/ntta-facebook.png] 
<http://www.facebook.com/nttamerica>   
[https://rvip.team-center.net/externals/images/email/ntta-youtube.png] 
<http://www.youtube.com/user/NTTCommunicationsEN>









This email message is intended for the use of the person to whom it has been 
sent, and may contain information that is confidential or legally protected. If 
you are not the intended recipient or have received this message in error, you 
are not authorized to copy, distribute, or otherwise use this message or its 
attachments. Please notify the sender immediately by return e-mail and 
permanently delete this message and any attachments. makes no warranty that 
this email is error or virus free. Thank you.

This email message is intended for the use of the person to whom it has been 
sent, and may contain information that is confidential or legally protected. If 
you are not the intended recipient or have received this message in error, you 
are not authorized to copy, distribute, or otherwise use this message or its 
attachments. Please notify the sender immediately by return e-mail and 
permanently delete this message and any attachments. NTT America makes no 
warranty that this email is error or virus free. Thank you.

-- 
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: 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  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  wrote:
> 
> 
> On May 28, 2015, at 11:47 PM, Laura Creighton  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  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



>  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  wrote:
> 
> Steven D'Aprano  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  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  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


Re: python traceroute

2015-01-21 Thread William Ray Wing

> On Jan 21, 2015, at 12:06 AM, Denis McMahon  wrote:
> 
> On Tue, 20 Jan 2015 19:37:26 -0800, Chandrakant Tiwari wrote:
> 
>> in the program below i want it to make it work  the same way as TRACERT 
>> command.
> 
> As an observation, you're re-inventing a wheel that already works 
> perfectly well, in that any failings of tracert tend to be more down to 
> the way routers are configured to handle icmp than the tracert 
> application itself. Unless you're doing this purely as an exercise in 
> socket programming with python, it might be better to find a new problem 
> to solve.
> 
> -- 
> Denis McMahon, denismfmcma...@gmail.com
> -- 
> https://mail.python.org/mailman/listinfo/python-list

I’d further add that as a security measure these days, many (soon to be most) 
hosts are configured to throw icmp packets away without acknowledging them in 
any way.

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


Re: Run Programming ?????

2014-12-12 Thread William Ray Wing

> On Dec 12, 2014, at 8:03 AM, Chris Warrick  wrote:
> 
> 
> On Dec 12, 2014 1:40 PM, "Delgado Motto"  > wrote:
> >
> > I travel alot, if not just interested in things of pocketable portability, 
> > and was curious if you can tell me if Python can be LEARNED from beginner 
> > on an IOS device ( with interest of being able to test my code, possibly 
> > even if a free website is capable of reviewing scripts ) but if not then I 
> > prefer if you can suggest a language that can be used from such a machine. 
> > My ultimate goal is to be able to create web pages and internet bots 
> > capable of searching specific things for me, simply to save me time in my 
> > day as little as crawling Youtube for a song that fails to be uploaded or 
> > other related examples. Please advise me. Thanks.  
> > --
> > https://mail.python.org/mailman/listinfo/python-list 
> > 
> >
> 
> Get a real computer. An iOS device won't work, unless you care to buy a vps, 
> use ssh and can stand the onscreen keyboard. It's easier to buy a notebook.
> 
> -- 
> Chris Warrick >
> Sent from my Galaxy S3.
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Second the motion.  Apple’s sandbox policies on iOS devices mean that while you 
can run Python on them (there are several versions available), the sandbox  
pretty much guarantees that at some point you will need a library you can’t 
import, and you won’t be able to test your web pages as you go.

A MacBook Air is within a fraction of being as portable as an iPad, and can 
easily do everything you want.  If you are currently traveling with an iPad, 
you _might_ even discover you prefer traveling with the MacBook.

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


Re: Do you like the current design of python.org?

2014-12-05 Thread William Ray Wing

> On Dec 5, 2014, at 5:43 AM, Steven D'Aprano 
>  wrote:
> 
> Peter Otten wrote:
> 
>> Did you ever hit the "Socialize" button? Are you eager to see the latest
>> tweets when you are reading a PEP? Do you run away screaming from a page
>> where nothing moves without you hitting a button? Do you appreciate the
>> choice between ten or so links to the documentation?
> 
> I dislike the new design of python.org.
> 
> The formatting of long text essays get completely mangled towards the bottom
> of the page, e.g.:
> 
> https://www.python.org/download/releases/2.2/descrintro

I’m not sure what you are referring to here.  That page looks fine all the way 
to the bottom of the footer on my system, looking at it with either Firefox or 
Safari.

-Bill

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


Re: Python handles globals badly.

2014-12-04 Thread William Ray Wing

> On Dec 4, 2014, at 8:56 PM, Dennis Lee Bieber  wrote:
> 
> On Thu, 04 Dec 2014 14:51:14 +0200, Marko Rauhamaa 
> declaimed the following:
> 
>> Chris Angelico :
>> 
>>> A lot of programs don't use threads, and therefore cannot have thread
>>> safety problems - or, looking at it the other way, do not care about
>>> thread safetiness. It's like having Neil Armstrong wear water wings to
>>> make sure he won't drown in the Sea of Tranquility.
>> 
>> The water wings would be too unwieldy since they'd have to be six times
>> as large on the moon. It's all about risk/benefit analysis.
> 
>   Actually, since the pull of gravity is 1/6th that of earth, but the
> density of the "water" is the Sea is the same, the water wings should be
> smaller to provide the same degree of lift.
> 
>   Of course, the lack of atmospheric pressure is going to result in the
> water wings expanding, perhaps to the bursting point...
> -- 
>   Wulfraed Dennis Lee Bieber AF6VN
>wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Wrong, again I’m afraid.  Assume for a moment you are under a dome pressurized 
to one standard atmosphere in some future moon colony and are in a swimming 
pool.  Both you AND the water are under 1/6th as much gravitational pull.  
Neither your density nor the water’s density has changed. Density is a function 
of the atomic weight of the elements making up both you and the water and the 
inter-atomic/molecular spacing of those elements.  Neither has changed.  
Therefore the volume of buoyant material (in the case of water wings, air) 
necessary to keep you above water is the same on earth as it would be on the 
moon.  

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


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

2014-11-07 Thread William Ray Wing
On Nov 7, 2014, at 7:42 AM, Dave Angel  wrote:
> 
> Bob Martin  Wrote in message:
>> in 730867 20141107 093651 c...@isbd.net wrote:
>>> Darren Chen  wrote:
 在 
 2014年11月5日星期三UTC+8下午8时17分11秒,larry@gmail.com写道:
> On Wed, Nov 5, 2014 at 7:13 AM, Ivan Evstegneev  
> wrote:
>> Firtst of all thanks for reply.
>> 
 brackets [] means that the argument is optional.
>> 
>> That's what I'm talking about (asking actually), where do you know it 
>> from?
> 
> I know it because I've been a programmer for 39 years.
 

But, to get back to the OP’s original question.  The earliest manuals that I 
remember looking at (from DEC, remember them) all had sections in the front 
that listed the typological conventions used throughout the manual.  Those 
included the use of square brackets to indicate optional arguments.  Eventually 
some of those conventions, including [ ] and the use of a fixed width font to 
indicate screen output, became so wide spread as to be simply part of the 
cultural context.  

A fair number of “Introduction to . . .” programming books still have such a 
section.

Bill

 that's awesome!!
>>> 
>>> Well I started in 1971 or thereabouts.
>> 
>> 1959 for me ;-)
>> 
> 
> Approximately 1968 for me. I wrote programs in 1967, but didn't
> get to run them till 1968.
> -- 
> DaveA
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-06 Thread William Ray Wing

> On Nov 5, 2014, at 6:14 PM, Clayton Kirkwood  wrote:
> 
> Yeah, the 11 was mesmerizing. You didn't need no stinkin' program to see how
> busy the system was, you just checked the lights. You could really tell when
> somebody was compiling or link/loading. As I've done many times since those
> days, I am amazed how many users could be using the system simultaneously
> (yes, general editing, but still...) and it wasn't a quick machine by any
> stretch. We had a whopping 384K memory and big multi-platter disks with a
> whopping 65MB. Still think in terms of PIP sometimes…
> 

And TECO. . .

> Clayton

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


Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread William Ray Wing
On Oct 11, 2014, at 3:20 PM, Dennis Lee Bieber  wrote:

> On Sat, 11 Oct 2014 16:26:43 +0100, duncan smith 
> declaimed the following:
> 
> 
>> The media have their own quirks when it comes to English. The BBC
>> regularly use "top of" / "bottom of" in the sense of "start of" / "end
>> of", but I don't know any British people who would (currently) use that
>> in conversation. (This only started a few years ago, and the first time
>> I heard it I had to work out what it meant from context.)
>> 
> 
>   That usage I think is ancient... I'm sure I've heard it back when there
> was a reasonable BBC World Service (along with VOA, Radio Netherlands, and
> etc. running on Short Wave"...
> 
>   Top of the Hour…

Of course, musicians have used it for years, as in “Take it from the top.”

And (with reference to the earlier discussion), just because something is 
specified in the Oxford English Dictionary, doesn’t mean it is universally 
approved of.  Take the “Oxford Comma” for example.

-Bill

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


Re: python script monitor

2014-09-15 Thread William Ray Wing
On Sep 15, 2014, at 8:07 PM, Nicholas Cannon  wrote:

> I have made an app that is not fully stable and I would like to monitor the 
> performance of the app and try and improve the speed of it. I tried to use 
> the activity monitor on the mac but what I want I'm to see how much ram, cup 
> and other stats on what resources that app is using. Is there any apps to 
> specifically monitor a certain app. I am on Mac is so any suggestions that 
> could work with that would be great.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Have you investigated the (long) list of options to the “top” command?  I’ve 
noticed that most Mac users seem to assume that top won’t show anything that 
Apple’s Activity Monitor doesn’t show.  In fact top is WAY more powerful.  It 
should do pretty much what you want.

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


Re: running a python program

2014-08-27 Thread William Ray Wing
On Aug 27, 2014, at 9:42 AM, ngangsia akumbo  wrote:

> i have written a small scripts in python that inputs two values and prints 
> out the sum.
> 
> Ok i want to be able to install this program on a windows 8 machine and run 
> it as a normal program.
> 
> i want to be able to run it to any windows machine without necessarily 
> installing python on that machine.
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

You might try Googling Python to exe.

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


Re: Small World Network model random data generation

2014-08-26 Thread William Ray Wing
On Aug 26, 2014, at 9:23 AM, Dennis Lee Bieber  wrote:

> On Tue, 26 Aug 2014 12:16:33 +0200, lavanya addepalli 
> declaimed the following:
> 
>> How can i generate a random data that is identical to my realworld data
>> 
> 
>   By definition, "random data" will be unlikely to ever be "identical" to
> your "realworld data".
> 
> 
>> i am supposed to refer the attached paper
>> 
>> Real Data
>> 
>> node pairs and the time they spend together connected
>> 
>> node node time in seconds
>> 4391 2814 16.0

[byte]

>> 1885 1158 351.0
>> 1349 1174 6375.0
>> 
> 
>   Since I see no cases of duplicate node /pairs/ it is difficult to
> figure out just what that data really represents...
> 
>   With enough data, with duplicate pairs having different times, I'd
> likely group by pairs, generate mean and standard deviation for the times
> of the matching pairs, then generate some count of the pairs to develop
> weights... Finally, using the weights I'd attempt to generate random node
> pairs and then use the mean/SD of the result pair to generate a time from
> the gaussian distribution.
> 
>   With only the data you have, I'd end up with a sparse 2D matrix
> M[first_node, second_node] = time
> 
>   And then selecting random samples from that...
> -- 
>   Wulfraed Dennis Lee Bieber AF6VN
>wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/

I think the OP wanted to create some sort of test file that was formatted
like his real-world data, but was filled with artificial data.  That, of
course simply becomes an exercise in creating lists of random 4-digit integers
and floats, then arranging them as lines and writing out the data.

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


Re: Python makes Dilbert's list

2014-08-24 Thread William Ray Wing
On Aug 24, 2014, at 7:18 PM, Terry Reedy  wrote:

> For Sunday, Aug 24, 2014.
> http://www.dilbert.com/dyn/str_strip/0//000/20/2/5000/500/225504/225504.strip.sunday.gif
> — 
And at the risk of straying a bit OT, here is what Dilbert should have pointed 
his boss at wrt string theory.
(And by the way - the physics is bang on.)

http://www.npr.org/blogs/krulwich/2013/09/18/223716891/mama-mia-mama-mia-a-canadian-bohemian-rhapsodizes-about-string-theory

-Bill

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


Re: newbee

2014-08-13 Thread William Ray Wing
On Aug 13, 2014, at 9:57 AM, alister  wrote:

> On Wed, 13 Aug 2014 15:13:34 +0200, Mok-Kong Shen wrote:
> 
>> Am 13.08.2014 13:55, schrieb alister:
>> [snip]
>> 
>> A related question: How could one write a Python program and have it run
>> on a mobile phone in general (independent of a PC)?
>> 
>> M. K. Shen
> 
> you would need a python interpreter for that device, IIRC there is one 
> available for android, I do not know about IOS
> 

There are several for iOS, but because of Apple’s sandboxing they don’t have as 
much reach as you might want.

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


Re: Does python support ATL Modelling Language?

2014-07-09 Thread William Ray Wing
On Jul 9, 2014, at 4:38 AM, varun bhatnagar  wrote:

> Hi,
> 
> I am trying to shift my application from JAVA to Python and in JAVA I am 
> using ATL Transformations (modelling techniques). Is it possible to do that 
> with Python, does python support ATL Transformations. If not is there any 
> API/library/module which supports this?
> 
> Any kind of help will be appreciated! :)
> 
> Thanks,
> BR,
> Varun
> -- 
> https://mail.python.org/mailman/listinfo/python-list

I know next to nothing about model transformation languages.  However, a few 
seconds in Wikipedia and Google turned up:

http://www.lfd.uci.edu/~gohlke/code/transformations.py.html

If you Google for “python model transformation” you will get a fair list of 
other possibilities.

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


Re: cx_freeze and temporary files - security related question

2014-07-06 Thread William Ray Wing

On Jul 6, 2014, at 9:21 AM, Richard Damon  wrote:

> On 5/21/14, 12:42 PM, Nagy László Zsolt wrote:
>> I need to create an application for Windows 7 that runs from a flash
>> drive. This program would be used to create remote backups of the
>> pendrive. The pendrive contains sensitive data, so when I plug in the
>> pendrive and run the program to make a backup, it should not leave any
>> trace of operation on the windows system. The information is so
>> sensitive that I was forbidden to use cloud storage. I was also
>> forbidden to make backups to a local drive, or leave any trace on the
>> host windows system.
>> 
>> The question is this: if I create this program with Python 3.4 and
>> cx_Freeze, then what should I expect. When the user starts the
>> cx_freeze-d program from the flash drive, will it create temporary files
>> on the system drive? Will it leave log files or store any permanent or
>> temporary data on the system drive (maybe in the user's tmp folder) that
>> can later be used to tell what drive was mounted, with what parameters
>> the program was started etc.
>> 
>> Thanks
>> 
> 
> I am not sure about what temp files python might leave around, but if you are 
> being ultimately paranoid about this, one risk that will be present is the 
> possibility of leaving traces of data in the swap file. If the program 
> doesn't specifically prohibit it, anything that is brought into memory (and 
> the act of reading the pendrive will do this) might end up in the swap file.
> 
> I can't imagine python having a run time option to force it to disable the 
> swap file.
> 
> If the data is as sensitive as they seem to want to treat it, perhaps you 
> should follow the procedures of classified computing, which says that any 
> storage medium "exposed" to classified computing becomes classified. This 
> would say that you would use a dedicated machine to do these backups, and 
> after doing them, you remove the hard disk from the machine and lock it up, 
> only to be taken out for later backups. This level of paranoia says you don't 
> need to be as concerned about figuring out what traces might be left, you 
> assume they are and lock them up.
> — 

Furthermore, I don’t know about Windows, but on many UNIX-like OSs, the file 
system preserves the time the file was last accessed.  If the goal is truly to 
leave no traces of the fact that the a group of files was backed up, this 
pretty well would be a red flag that they had been.

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


Re: What use with Python

2014-07-01 Thread William Ray Wing
On Jul 1, 2014, at 6:56 PM, rxjw...@gmail.com wrote:

> Hi,
> 
> I am new to Python. Weeks ago, I was asked about Python questions on an 
> interview.
> Now I want to learn Python, but I do not know what I can do with it on a PC. 
> Especially I would like to do something interesting instead of some text 
> search etc.
> Python may can do more than I realize now. Could you tell me something on a 
> PC?
> 
> Thanks,
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Python is a completely general purpose programming language.  It has extensive 
libraries that adapt it to tackle almost any programming problem (with the 
possible exception of device drivers).  Those libraries include several 
graphics packages and GUI frameworks, libraries for doing network programming, 
for performing heavy-duty numerical analysis (number crunching) and scientific 
data analysis, as well as web applications, semantic analysis, statistical 
analysis, and which will interface it to any of several databases.

Examples of well-known Python programs running “in the wild” include YouTube 
and Bit Torrent.

Well written Python programs (that is, those that use Python’s abstracted OS 
services) run equally well on a PC, a Mac, UNIX, and Linux.

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


Re: Python ORM library for distributed mostly-read-only objects?

2014-06-23 Thread William Ray Wing
On Jun 23, 2014, at 12:26 AM, smur...@gmail.com wrote:

> On Sunday, June 22, 2014 3:49:53 PM UTC+2, Roy Smith wrote:
> 
>> Can you give us some more quantitative idea of your requirements?  How 
>> many objects?  How much total data is being stored?  How many queries 
>> per second, and what is the acceptable latency for a query?
> 
> Not yet, A whole lot, More than fits in memory, That depends.
> 
> To explain. The data is a network of diverse related objects. I can keep the 
> most-used objects in memory but not all of them. Indeed, I _need_ to keep 
> them, otherwise this will be too slow, even when using Mongo instead of 
> SQLAlchemy. Which objects are "most-used" changes over time.
> 

Are you sure it won’t fit in memory?  Default server memory configs these days 
tend to start at 128 Gig, and scale to 256 or 384 Gig.

-Bill


> I could work with MongoEngine by judicious hacking (augment DocumentField 
> dereferencing with a local cache), but that leaves the update problem.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


Re: IDE for python

2014-05-28 Thread William Ray Wing
On May 28, 2014, at 6:43 AM, Sameer Rathoud  wrote:

> Hello everyone,
> 
> I am new to python.
> 
> I am currently using python 3.3
> 
> With python I got IDLE, but I am not very comfortable with this.
> 
> Please suggest, if we have any free ide for python development.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

There are several comparison tables and reviews of Python IDEs on the web.
You should check the following and see what suits you best:

http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#Python

http://www.pythoncentral.io/comparison-of-python-ides-development/

https://wiki.python.org/moin/IntegratedDevelopmentEnvironments

http://stackoverflow.com/questions/81584/what-ide-to-use-for-python

http://pedrokroger.net/choosing-best-python-ide/

http://spyced.blogspot.com/2005/09/review-of-6-python-ides.html

Good Luck,
-Bill

PS: As it happens, I use (and like) Wing IDE, but have NO relation to the 
development company,
other than as a satisfied user.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Can Python do this? First steps, links to resources or complete software referals appreciated.

2014-05-22 Thread William Ray Wing
On May 22, 2014, at 6:03 AM, ed.cot...@gmail.com wrote:

> Hi, I'm an academic and I want to find/adapt/create a script that will grab 
> abstracts (150-250 words of text) from Google Scholar search results and sort 
> them by relevance (e.g. keywords, keyword combinations, anything other way 
> you can think of). 
> 
> Any of you guys know of a script that does this already? Preferably open 
> source? If not, any resources you could bring to my attention? I' a complete 
> Newb!
> 
> Thanks for your help. 
> 
> Ed
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Well, you might take a look at scholar.py, located here:  
http://www.icir.org/christian/scholar.html

Also, there is this at stackoverflow:  
http://stackoverflow.com/questions/13200709/extract-google-scholar-results-using-python-or-r

One of these may provide what you want, or serve as a jumping off point.

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


Re: Significant digits in a float?

2014-05-01 Thread William Ray Wing
On May 1, 2014, at 12:16 AM, Mark H Harris  wrote:

> On 4/30/14 10:56 PM, Paul Rubin wrote:
> 
>> There is a nice Javascript simulation of the N4-ES here:
>> 
>> http://www.antiquark.com/sliderule/sim/n4es/virtual-n4es.html
>> 
> 
> Thank you!
> 
> The N4-ES and the N4-T (mine) are essentially the same rule. The N4-ES on the 
> site is yellow (mine is white) and the site rule indicates Picket & Eckel 
> Inc. (that's where the E comes from)  Also the the ES states Chicage Ill USA 
> where the T states Made in USA.
> 

I’ve resisted - but finally have to jump into this discussion...

Picket used to talk a lot about their yellow background being optimized for the 
color the human eye was most sensitive to and therefore produced the sharpest 
focus and allowed the most precise reading of the scales.  Nice theory, but at 
least on MY Picket rule the scales were printed not engraved and the result 
negated any possible advantage the color might have given.

I’m surprised no one has jumped in to defend/tout the Dietzgen slide rules 
(which I always thought were the ultimate).  Mine (their Vector Log Log) is one 
of their Microglide series that had teflon rails inserted in the body and is 
still totally stick-free after nearly 50 years.

Taking it one step further, I _ALSO_ have a Curta Type II calculator 
http://en.wikipedia.org/wiki/Curta_calculator - which still operates as 
smoothly as it did the day I bought it.

-Bill

> The only technical difference is the T scale (which is folded-expanded on 
> both). On the ES the T scale is listed only once in the margin.  On the N4-T 
> the T scale is listed 'twice'!--  once for each part of the fold.  Well, that 
> gives (2) scales instead of one --for T...  increasing the number of scales 
> on the rule from 34 to 35... if I'm counting right.  Which makes the N4-T 
> more valuable... supposedly.  I don't plan are parting with it... till I 
> croak, then my son (who is studying engineering this fall) will inherit it... 
>  heh   he won't have a clue what to do with it !
> 
> The simulated rule on the site above is fabulous... especially if viewed from 
> a large wide LED.  ... simply fabulouso/:)
> 
> 
> 
> marcus
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


Re: "Latching" variables in function

2014-04-09 Thread William Ray Wing
On Apr 9, 2014, at 12:35 AM, Terry Reedy  wrote:

> On 4/8/2014 4:09 PM, Grawburg wrote:
>> 
>> I've probably used the wrong term - I'm thinking of what I do when writing 
>> PLC code - so I can't find how to do this in my reference books.
>> This is part of a project I'm working on with a Raspberry Pi and an MCP23017 
>> port expander.
>> I have a N/O pushbutton that I want to "latch" a value to a variable when 
>> it's been pressed.  I have this function that gets called periodically in
>> a 'while True' statement:
>> 
>> def button():
>>pushbutton = 0
>>   button_value = 0
>>pushbutton=bus.read_byte_data(address,GPIOB)
>>if pushbutton > 0:
>> button_value = 1
>>return button_value
>> 
>> I need button_value to become '1' when the button is pressed and to remain 
>> '1' until the entire program (only about 25 lines) ends with a sys.exit()
>> 
>> What do I use to 'latch' button_value?
> 
> It depends on whether you can set up your system so that pushing the button 
> generates an interrupt. But I know little about R.Pi and less about the 'port 
> expander'. If there were an interrupt, you would just have to write an 
> interrupt handler. When possible, this is much better than polling.
> 
> -- 
> Terry Jan Reedy
> 

I think what the OP was asking for was a way in standard Python to “lock" the 
value of an instance variable, which of course, you really can’t do. However, 
what he (I assume it’s a he) could do is arrange his calling program so that 
after the button method returns a “1”, the method isn’t called again.  That is, 
test for truth of button = 1 in the calling program, and if true, skip the 
call.  The next time the program runs, the button value will be re-initialized 
to zero and everything is back to square one.

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


Re: Switching between cmd.CMD instances

2014-04-02 Thread William Ray Wing
On Apr 2, 2014, at 1:03 AM, Josh English  wrote:

> I have a program with several cmd.Cmd instances. I am trying to figure out 
> what the best way to organize them should be.
> 
> I've got my BossCmd, SubmissionCmd, and StoryCmd objects.
> 
> The BossCmd object can start either of the other two, and this module allows 
> the user switch back and forth between them. Exiting either of the 
> sub-command objects returns back to the BossCmd.
> 
> I have defined both a do_done and do_exit method on the sub-commands.
> 
> Is it possible to flag BossCmd so when either of the other two process 
> do_exit, the BossCmd will also exit?
> 
> Josh
> 

I am anything BUT a super experienced Python programmer, but if it were my 
problem - and if BossCmd has anything like an event loop in it, then certainly 
one way to handle this would be to have a Status.py module that contained 
status flags for each of the modules.  All three modules would "import status” 
and do_done and do_exit would set status flags in status.py on their way out.

I’m sure there are better answers.  I’ll be interested to see what else is 
suggested.

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


Re: Python programming

2014-03-07 Thread William Ray Wing
On Mar 7, 2014, at 1:03 PM, John Ladasky  wrote:

> 
> As for FORTRAN?  This week, I actually downloaded an application which 
> required a FORTRAN compiler.  This is the only FORTRAN application I've ever 
> needed.  It's not old code, the first revision came out about 10 years ago.  
> More than once, I have queried Google with the phrase "Why isn't FORTRAN dead 
> yet?"  For some reason, it lives on.  I can't say that I understand why.  
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Well, I’d claim that for what it was designed for (FORTRAN stands for FORmula 
TRANslator after all), it is still pretty da*mn good.  It generates extremely 
fast, robust code that requires much less debugging effort than the equivalent 
C or C++ requires.  Most of the physicists I know still write FORTRAN, although 
they no longer do so exclusively.

Of course, as has been pointed out, the HUGE code base of scientific and 
numerical analysis code that already exists in FORTRAN makes rewriting sort of 
a waste of grant (or company) money.

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


Re: Python programming

2014-03-06 Thread William Ray Wing

On Mar 6, 2014, at 8:24 PM, Roy Smith  wrote:

> In article ,
> Dennis Lee Bieber  wrote:
> 
>> On 06 Mar 2014 02:51:54 GMT, alb...@spenarnc.xs4all.nl (Albert van der
>> Horst) declaimed the following:
>> 
>>> In article ,
>>> Roy Smith   wrote:
 In article ,
 Grant Edwards  wrote:
 
> On 2014-02-13, Dennis Lee Bieber  wrote:
> 
>>   An S-100 wire-wrap board.
> 
> Yup, been there done that!
 
 Never did S-100, but I did do a custom Unibus card (wirewrap).
 
 You know you're working with a Real Computer (tm) when the +5V power
 supply can deliver as much current as an arc welder.
>>> 
>>> I've a 64 node Parsytec transputer system in the hall way with
>>> dual 5V 100A power supplies. Does that count?
>> 
>>  I spotted a device on the table of the company calibration office...
>> 
>>  As I recall, it was a 100A capable resistor... 0.10 OHM.
>> 
>>  No idea what it was meant for; big binding posts at one end, and a slab
>> of sheet steel in a "W" shape (smooth curves, not sharp bends).
> 
> External shunt for an ammeter?
>  

More likely a dummy load for power supply testing.  (Normally, ammeter shunts 
are sized to dissipate as little power as possible.)

-Bill

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


Re: Coding a simple state machine in python

2014-02-24 Thread William Ray Wing

On Feb 24, 2014, at 8:30 PM, Ronaldo  wrote:

> How do I write a state machine in python? I have identified the states and 
> the conditions. Is it possible to do simple a if-then-else sort of an 
> algorithm? Below is some pseudo code:
> 
> if state == "ABC":
>   do_something()
>   change state to DEF
> 
> if state == "DEF"
>   perform_the_next_function()
> ...
> 
> I have a class to which certain values are passed from a GUI and the 
> functions above have to make use of those variables. How do I go about doing 
> this? I have the following algorithm:
> 
> class TestClass():
>def __init__(self, var1, var2): #var1 and var2 are received from a GUI
>   self.var1 = var1
> ...
>if state == "ABC"
>   doSomething(var1, var2)
> ..
> 
> Could someone point me in the right direction? Thank you!
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

And, to extend Tim's suggestion of a dictionary just a bit, note that since 
Python functions are happy to pass function names as arguments, you can use a 
dictionary to make a really nice compact dispatch table.  That is, function A 
does its thing, gets to a new state, and returns as one of its return arguments 
the key into the dictionary that points to the next function_name to be called 
based on that new state.

Stackoverflow has a couple of compact examples here:  

http://stackoverflow.com/questions/715457/how-do-you-implement-a-dispatch-table-in-your-language-of-choice

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


Re: Mac vs. Linux for Python Development

2014-02-24 Thread William Ray Wing
On Feb 23, 2014, at 3:43 AM, twiz  wrote:

> Hello,
> 
> I'm sure this is a common question but I can't seem to find a previous thread 
> that addresses it.   If one one exists, please point me to it.
> 
> I've been developing with python recreationally for a while on Ubuntu but 
> will soon be transitioning to full-time python development.  I have the 
> option of using a Mac or Ubuntu environment and I'd like to hear any thoughts 
> on the pros and cons of each. Specifically, how's the support for numpy and 
> scipy?  How are the IDEs?
> 
> Since I generally like working with a Mac, I'd like to hear if there are any 
> significant downsides to python dev on OsX.  
> 
> Thanks
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

In addition to the other excellent answers you've received, I'd point you to

http://stackoverflow.com/questions/81584/what-ide-to-use-for-python

where there is a fairly extensive comparison chart of IDEs, features, and 
supported OSes.

And, by the way, I'm a very happy camper using BBEdit and WingIDE (the name 
collision is purely coincidental).

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


Re: Just For Inquiry

2014-02-20 Thread William Ray Wing
On Feb 20, 2014, at 5:48 PM, John Gordon  wrote:

> In  shivang patel 
>  writes:
> 
>> So, I kindly request to you please, give me a very brief info regarding
>> *Role of Project Manager*.
> 
> In my organization, a project manager does these things (and a lot more):
> Ensure that a requirements document exists, and is approved by both the
>  customer and the developer.
> Work with developers to create a list of all work steps necessary to
>  complete the project.
> Create a project schedule from developer estimates for each item on the
>  work list, and update the schedule as needed if additional steps are added
>  or a step takes longer than anticipated.
> Communicate with customers to keep them informed of the project's progress.
> Schedule meetings with the customer as needed.
> Ensure that a test plan exists and is carried out.
> Coordinate project delivery and installation.
> Coordinate bug reports and bugfixes.
> 
> -- 
> John Gordon Imagine what it must be like for a real medical doctor to
> gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'.

An excellent list, I would add that frequently the project manager has 
significant budget responsibilities as well.

In an informal sense, the project manager is the point person for keeping a 
project on track, on budget, and completed in a timely fashion.

Software engineers, working FOR a project manager, frequently feel that the 
project manager is providing no added value.  This is NOT true.

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


Re: SSH/Telnet program to Router/switch

2014-02-19 Thread William Ray Wing
On Feb 19, 2014, at 3:14 AM, Sujith S  wrote:

> Hi,
> 
> I am new to programming and python. I am looking for a python script to do 
> ssh/telnet to a network equipment ? I know tcl/perl does this using 
> expect/send. 
> 
> Do we have expect available in python as well or need to use some other 
> method ?
> 
> Regards
> Sujith
> -- 
> https://mail.python.org/mailman/listinfo/python-list

In addition to the other answers you've received (and noting that you are 
familiar with "expect"), you might want to investigate the pexpect module. 
Google will give you quite a long list of references to it, but you could start 
here:  http://pexpect.readthedocs.org/en/latest/

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


Re: Python programming

2014-02-12 Thread William Ray Wing
On Feb 12, 2014, at 10:04 PM, Roy Smith  wrote:

> In article ,
> Grant Edwards  wrote:
> 
>> On 2014-02-13, Dennis Lee Bieber  wrote:
>> 
>>> An S-100 wire-wrap board.
>> 
>> Yup, been there done that!
> 
> Never did S-100, but I did do a custom Unibus card (wirewrap).
> 
> You know you're working with a Real Computer (tm) when the +5V power 
> supply can deliver as much current as an arc welder.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

OK, and how many of you remember the original version of the tongue-in-cheek 
essay "Real Programmers Don't Use Pascal" from the back page of Datamation?

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


Re: Newcomer Help

2014-02-10 Thread William Ray Wing
On Feb 10, 2014, at 11:10 AM, Walter Hughey  wrote:

> I am new to Python programming, actually new to any programming language. I 
> sent the email below to the "pythonmac-...@python.org a few days ago. So far 
> I have not seen a reply, actually, I have not seen anything from pythonmac in 
> any emails although I am supposed to be a member.
> 
> I don't know if I am sending these to the correct place or if I am not 
> receiving emails from the pythonmac list. I would appreciate any assistance 
> either in how do I get to the pythonmac list or answers to the issue below. I 
> went to the pythonmac list because I am trying to run Python 3.3 on a Mac 
> computer.
> 
> Thank you,
> 
> Walter

Walter, I'm one of the (relatively few) people on this list who develops using 
Macs and therefore also subscribes to pythonmac-sig.  I don't know what may 
have happened to your e-mail, but I can assure you that if you didn't get 
answers from the pythonmac list it wasn't because people were ignoring you.  
I've looked back through the last six months of pythonmac and saw nothing with 
your name in it.

I assume you signed up here:  
https://mail.python.org/mailman/listinfo/pythonmac-sig if not, that would 
explain things.

I see others are providing the help you need, so I won't attempt any other 
comments.

-Bill

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


Re: [RELEASED] Python 3.3.4 release candidate 1

2014-01-27 Thread William Ray Wing
On Jan 27, 2014, at 8:55 AM, Mark Lawrence  wrote:

> On 27/01/2014 07:36, Georg Brandl wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>> 
>> On behalf of the Python development team, I'm reasonably happy to announce 
>> the
>> Python 3.3.4 release candidate 1.
>> 
> 
> "Reasonably" happy?  Is there a smiley missing there, or what? :)
> 
> -- 
> My fellow Pythonistas, ask not what our language can do for you, ask what you 
> can do for our language.
> 
> Mark Lawrence

I'm guessing it is an editorial comment about Mac users/developers.
But maybe I'm being defensive...   ;-)
-Bill
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Learning python networking

2014-01-15 Thread William Ray Wing
On Jan 15, 2014, at 7:52 AM, Chris Angelico  wrote:

[megabyte]

> One of the fundamentals of the internet is that connections *will*
> break. A friend of mine introduced me to Magic: The Gathering via a
> program that couldn't handle drop-outs, and it got extremely
> frustrating - we couldn't get a game going. Build your server such
> that your clients can disconnect and reconnect, and you protect
> yourself against half the problem; allow them to connect and kick the
> other connection off, and you solve the other half. (Sometimes, the
> server won't know that the client has gone, so it helps to be able to
> kick like that.) It might not be an issue when you're playing around
> with localhost, and you could even get away with it on a LAN, but on
> the internet, it's so much more friendly to your users to let them
> connect multiple times like that.

But note VERY carefully that this can open HUGE security holes if not done with 
extreme care.

Leaving a dangling connection (not session, TCP closes sessions) open is an 
invitation so bad things happening.

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


Re: Learning python networking

2014-01-15 Thread William Ray Wing
On Jan 15, 2014, at 11:31 AM, Chris Angelico  wrote:

> On Thu, Jan 16, 2014 at 3:25 AM, William Ray Wing  wrote:
>> On Jan 15, 2014, at 7:52 AM, Chris Angelico  wrote:
>>> One of the fundamentals of the internet is that connections *will*
>>> break. A friend of mine introduced me to Magic: The Gathering via a
>>> program that couldn't handle drop-outs, and it got extremely
>>> frustrating - we couldn't get a game going. Build your server such
>>> that your clients can disconnect and reconnect, and you protect
>>> yourself against half the problem; allow them to connect and kick the
>>> other connection off, and you solve the other half.
>> 
>> But note VERY carefully that this can open HUGE security holes if not done 
>> with extreme care.
>> 
>> Leaving a dangling connection (not session, TCP closes sessions) open is an 
>> invitation so bad things happening.
> 
> Not sure what you mean here. I'm assuming an authentication system
> that stipulates one single active connection per authenticated user
> (if you reauthenticate with the same credentials, it'll disconnect the
> other one on the presumption that the connection's been lost). In
> terms of resource wastage, there's no difference between disconnecting
> now and letting it time out, and waiting the ten minutes (or whatever)
> and then terminating cleanly. Or do you mean another user gaining
> access? It's still governed by the same authentication.
> 

I was assuming another user picking up the connection using sniffed credentials 
(and yes, despite all the work on ssh, not all man-in-the-middle attacks have 
been killed).

-Bill

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

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


Re: How to get Mac address of ethernet port?

2014-01-13 Thread William Ray Wing
On Jan 11, 2014, at 11:34 AM, Michael Torrie  wrote:

> On 01/11/2014 07:35 AM, Andriy Kornatskyy wrote:
>> Sam,
>> 
>> How about this?
>> 
>> from uuid import getnode as get_mac
>> '%012x' % get_mac()
> 
> This seems to work if you have only one ethernet adapter.  Most
> computers have two (wired and wireless) adapters.
> 
> Getting a mac address is platform-specific, and the OP has not specified
> what OS he is using.
> 
> On Windows I imagine you'd have to access the WMI subsystem in Windows.
> 
> On Linux you could access the /sys/devices/virtual/net/
> file in the sysfs filesystem.  I'm sure there are other ways.
> 
> No idea on OS X.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

There are probably several ways in OS-X, just as there are in any other UNIX 
system.  The one I've used is to spawn a subprocess and run the "ifconfig" 
command with no arguments (which doesn't require any special privileges).  This 
will return a string of all the network interfaces (including the loopback and 
firewire interfaces in addition to Ethernet and WiFi) and their config specs.  
The OP would then parse this string looking for the location of the phrase 
"status: active" and then back up to the mac address that precedes it.  More 
work than using uuid, but this guarantees a current and correct answer.

>>> import string
>>> import subprocess
>>> mac_result = subprocess.Popen(['ifconfig'], stderr = subprocess.PIPE, 
>>> stdout = subprocess.PIPE).communicate()[0]
>>> mac_loc = string.find(mac_result, "status: active")

...and so on.

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


  1   2   3   4   5   6   >