Re: Question(s)

2023-10-27 Thread Greg Ewing via Python-list

On 25/10/23 2:32 pm, Chris Angelico wrote:

Error correcting memory, redundant systems, and human
monitoring, plus the ability to rewrite the guidance software on the
fly if they needed to.


Although the latter couldn't actually be done with the AGC,
as the software was in ROM. They could poke values into RAM
to change its behaviour to some extent, and that got them out
of trouble a few times, but they couldn't patch the code.

It might have been possible with the Gemini computer, since
it loaded its code from tape. I don't know if it was ever
done, though.

--
Greg

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


Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list

On 10/26/2023 10:52 PM, avi.e.gr...@gmail.com wrote:

Thomas,

It looks like much of our discussion and attempts at help are not going to
be that helpful to Tenor as we may be way off bass about what he wants to do
and certainly RSTUDIO and quite a few other suggestions may not be available
in his microcontroller.

As I see it, some of his objective involves sampling a sensor in real time.
I have not heard what he wants to do with the data gathered and this may be
an example of where code needs to be running fast enough to keep up. Proving
the code will work, especially if you add logging or print statements or run
it in a monitored mode so you can follow what it is doing, presents special
challenges.

Now if he ever wants to read in a .CSV file and analyze the data and make
graphs and so on, I might chime in. For now, I am dropping out.



Avi


I'm there.  It's like someone is insisting on being instructed how to 
drive a race car in a race when he's only got a learner's permit.  You 
just have to go through the experience of actually driving on streets 
and in traffic first.  There is no substitute.


TomP


-Original Message-
From: Python-list  On
Behalf Of Thomas Passin via Python-list
Sent: Thursday, October 26, 2023 6:50 PM
To: python-list@python.org
Subject: Re: Question(s)

On 10/26/2023 6:36 PM, AVI GROSS via Python-list wrote:

I am not one for IDLE worship, Tenor. But if you have been getting a

message here, it is that there are an amazing number of programs that
support your use of python during the development phase and perhaps later. I
actually often use an environment called RSTUDIO (now part of a new name of
POSIT) because it has been expanded beyond supporting R and supports Python
and a growing number of other languages or combos that combine word
processing with inserts from multiple languages.

Excellent! I didn't know about this development.

[snip]




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


RE: Question(s)

2023-10-26 Thread AVI GROSS via Python-list
Thomas,

It looks like much of our discussion and attempts at help are not going to
be that helpful to Tenor as we may be way off bass about what he wants to do
and certainly RSTUDIO and quite a few other suggestions may not be available
in his microcontroller.

As I see it, some of his objective involves sampling a sensor in real time.
I have not heard what he wants to do with the data gathered and this may be
an example of where code needs to be running fast enough to keep up. Proving
the code will work, especially if you add logging or print statements or run
it in a monitored mode so you can follow what it is doing, presents special
challenges.

Now if he ever wants to read in a .CSV file and analyze the data and make
graphs and so on, I might chime in. For now, I am dropping out.

Avi

-Original Message-
From: Python-list  On
Behalf Of Thomas Passin via Python-list
Sent: Thursday, October 26, 2023 6:50 PM
To: python-list@python.org
Subject: Re: Question(s)

On 10/26/2023 6:36 PM, AVI GROSS via Python-list wrote:
> I am not one for IDLE worship, Tenor. But if you have been getting a
message here, it is that there are an amazing number of programs that
support your use of python during the development phase and perhaps later. I
actually often use an environment called RSTUDIO (now part of a new name of
POSIT) because it has been expanded beyond supporting R and supports Python
and a growing number of other languages or combos that combine word
processing with inserts from multiple languages.

Excellent! I didn't know about this development.

[snip]


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

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


Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list

On 10/26/2023 6:36 PM, AVI GROSS via Python-list wrote:

I am not one for IDLE worship, Tenor. But if you have been getting a message 
here, it is that there are an amazing number of programs that support your use 
of python during the development phase and perhaps later. I actually often use 
an environment called RSTUDIO (now part of a new name of POSIT) because it has 
been expanded beyond supporting R and supports Python and a growing number of 
other languages or combos that combine word processing with inserts from 
multiple languages.


Excellent! I didn't know about this development.

[snip]


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


RE: Question(s)

2023-10-26 Thread AVI GROSS via Python-list
I am not one for IDLE worship, Tenor. But if you have been getting a message 
here, it is that there are an amazing number of programs that support your use 
of python during the development phase and perhaps later. I actually often use 
an environment called RSTUDIO (now part of a new name of POSIT) because it has 
been expanded beyond supporting R and supports Python and a growing number of 
other languages or combos that combine word processing with inserts from 
multiple languages. I have not used it for other languages like C/C++ and 
Javascript but the point is that like some others, it is not specific to Python 
but provides support for it. And, somewhat amusingly, you can write programs 
that combine parts in R and in Python that inter-operate with each other.

Since you are taking a fairly overwhelming challenge of trying to learn 
everything at once while also developing something you want to be perfect and 
with few if any flaws, it may make sense to start with more of an ASCII editor 
or something with a few features but a simple interface, and a bit later when 
some parts of your code are working and you have some experience, you can move 
the code up a few notches to tools that perform a lot more validation for you.

Please consider that resources trying to teach you the language, besides often 
showing simpler scenarios, often are not going to tell you EVERYTHING else you 
may need or that is usable let alone teach you all available modules and so on.


-Original Message-
From: Python-list  On 
Behalf Of o1bigtenor via Python-list
Sent: Thursday, October 26, 2023 8:34 AM
To: Michael Torrie 
Cc: python-list@python.org
Subject: Re: Question(s)

On Wed, Oct 25, 2023 at 10:19 AM Michael Torrie via Python-list
 wrote:
>
> On 10/25/23 05:51, o1bigtenor via Python-list wrote:
> > Looks like I have another area to investigate. (grin!)
> > Any suggestions?
>
> Seems to me you're trying to run before you have learned to walk.
>
> Slow down, go to the beginning and just learn python, write some code,
> see if it runs.  Go through the tutorial at
> https://docs.python.org/3/tutorial/index.html

Interesting - - - -  ". . . see if it runs." - - - that's the issue!
When the code is accessing sensors there isn't an easy way to
check that the code is working until one has done the all of the
physical construction. If I'm trying to control a pulsation system
using square waves with distinct needs for timing etc I hadn't
seen any way of 'stepping through the code' (phrase you use later).

>
> Your first and most basic tool is the python interpreter.  It will tell
> you when you try to run your code if you have syntax errors.  It's true
> that some errors the linters will catch won't show up as syntax errors,
> but cross the bridge when you get to it.  Once you have a basic grasp of
> Python syntax, you can begin using some of the tools Python has for
> organizing code: Functions and modules (eventually packages).
> Eventually when your logic is placed neatly into functions, you can then
> write other python programs that import those functions and feed
> different parameters to them and test that the output is what you
> expect. That is known as a test.
>
> Nothing wrong with geany as an editor.  However, you might find the
> Python Idle IDE useful (it usually installs with Python), as it lets you
> work more interactively with your code, inspecting and interacting with
> live python objects in memory.  It also integrates debugging
> functionality to let you step through your code one line at a time and
> watch variables and how they change.

I have been following this list for some time. Don't believe that I've ever
seen anything where anyone was referred to 'Idle'.  In reading other user
group threads I have heard lots about java and its ide - - - don't remember,
again, any re: an ide for python.
Even in maker threads - - - say for arduino - - its 'use this cut and
paste method
of programming' with no mention of any kind of ide when it was microPython - -
although being a subset of python it Idle may not work with it.
>
> When you encounter isses with your code (syntax or logical) that you
> can't solve, you can come to the list, show your code and the full
> output of the interpreter that shows the complete error message and back
> trace and I think you'll get a lot of helpful responses.
> --

That was the plan.

My problem is that I'm needing to move quite quickly from 'hello, world' to
something quite a bit more complex. Most of the instruction stuff I've run
into assumes that one is programming only for the joy of learning to
program where I've got things I want to do and - - - sadly - - - they're
not sorta like the run of the mill stuff.

Oh well - - - I am working on things!

Thanks for the ideas and the assistance!

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

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


Re: Question(s)

2023-10-26 Thread Dan Purgert via Python-list
On 2023-10-26, o1bigtenor wrote:
> On Wed, Oct 25, 2023 at 10:19 AM Michael Torrie via Python-list
> wrote:
>>
>> On 10/25/23 05:51, o1bigtenor via Python-list wrote:
>> > Looks like I have another area to investigate. (grin!)
>> > Any suggestions?
>>
>> Seems to me you're trying to run before you have learned to walk.
>>
>> Slow down, go to the beginning and just learn python, write some code,
>> see if it runs.  Go through the tutorial at
>> https://docs.python.org/3/tutorial/index.html
>
> Interesting - - - -  ". . . see if it runs." - - - that's the issue!
> When the code is accessing sensors there isn't an easy way to
> check that the code is working until one has done the all of the
> physical construction. If I'm trying to control a pulsation system
> using square waves with distinct needs for timing etc I hadn't
> seen any way of 'stepping through the code' (phrase you use later).

You use a hardware debugger then ... and if you're talking hardware,
chances are you're also not talking Python (yes, yes, I know
"CircuitPython" is a thing, or was it MicroPython?)

> [...]
> Even in maker threads - - - say for arduino - - its 'use this cut and
> paste method of programming' with no mention of any kind of ide when
> it was microPython - - although being a subset of python it Idle may
> not work with it.

Bearing in mind, of course, that "Arduino" is basically "Programming for
dummies" level of stuff usually (i.e. people just getting their feet
wet).  It's meant to be a relatively "easy" introduction for students /
hobbiests / non-programmers into the world of programming for
microcontrollers.

> [...]
> My problem is that I'm needing to move quite quickly from 'hello, world' to
> something quite a bit more complex. Most of the instruction stuff I've run
> into assumes that one is programming only for the joy of learning to
> program where I've got things I want to do and - - - sadly - - - they're
> not sorta like the run of the mill stuff.

Sounds like you've been reading instructables :)

-- 
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1  E067 6D65 70E5 4CE7 2860
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list

On 10/26/2023 4:25 PM, o1bigtenor via Python-list wrote:

On Thu, Oct 26, 2023 at 11:43 AM Michael Torrie via Python-list
 wrote:


On 10/26/23 06:34, o1bigtenor wrote:

Interesting - - - -  ". . . see if it runs." - - - that's the issue!
When the code is accessing sensors there isn't an easy way to
check that the code is working until one has done the all of the
physical construction. If I'm trying to control a pulsation system
using square waves with distinct needs for timing etc I hadn't
seen any way of 'stepping through the code' (phrase you use later).


Having dabbled in embedded electronics, all I can say is you will just
have to build it and try to get it working.  Failure is always an
option.  If I understand you correctly, this is for a hobby interest, so
go at it and have fun.

Stepping through code is a basic part of debugging in any language.
They all have tools for it. Google for python debugging.

"distinct needs for timing?"  Did you forget to tell us you need to use
MicroPython?  Certainly MicroPython running on a microcontroller with
help from hardware timers certainly can do it, but this mailing list is
not the place to ask about it.  Instead you'll have to visit a forum on
MicroPython or CircuitPython.  By the way you definitely can step
through MicroPython code one line at a time with a remote debugger, say
with Visual Studio Code.


Its one of the reasons to use micropython - - - it is a subset of python.
I didn't think I was asking about micropython here though. The project with
the square wave stuff has lots going on so its more likely that regular python
will be used. Part of the challenge is trying to figure out if I need to be
running a real time kernel or even a real time OS. Independent information
is quite hard to find - - - seems like most of the information is by someone
with skin in the game and then without a background its hard to figure out
if what they're saying tells enough so that I can make a good decision or
not.


[snip]

Maybe see -

pyvisa (https://pyvisa.readthedocs.io/en/latest/)
https://github.com/mick001/Instruments-Control
http://justinbois.github.io/bootcamp/2021/lessons/l40_serial.html
https://chaserhkj.gitbooks.io/ivi-book/content/

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


Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Thu, Oct 26, 2023 at 11:47 AM Michael Torrie via Python-list
 wrote:
>
> On 10/26/23 10:41, Michael Torrie wrote:
> > By the way you definitely can step
> > through MicroPython code one line at a time with a remote debugger, say
> > with Visual Studio Code.
>
> I meant to edit that bit out.   After doing a bit more research, it
> appears remote debugging with MicroPython may not be possible or easy.
> But the MicroPython lists and forums will know more about that than I
> do.  But there are some nice IDEs for developing code in MicroPython and
> deploying it to devices.
> --
Even here - - - I now have a first step and a direction!

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


Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Thu, Oct 26, 2023 at 11:43 AM Michael Torrie via Python-list
 wrote:
>
> On 10/26/23 06:34, o1bigtenor wrote:
> > Interesting - - - -  ". . . see if it runs." - - - that's the issue!
> > When the code is accessing sensors there isn't an easy way to
> > check that the code is working until one has done the all of the
> > physical construction. If I'm trying to control a pulsation system
> > using square waves with distinct needs for timing etc I hadn't
> > seen any way of 'stepping through the code' (phrase you use later).
>
> Having dabbled in embedded electronics, all I can say is you will just
> have to build it and try to get it working.  Failure is always an
> option.  If I understand you correctly, this is for a hobby interest, so
> go at it and have fun.
>
> Stepping through code is a basic part of debugging in any language.
> They all have tools for it. Google for python debugging.
>
> "distinct needs for timing?"  Did you forget to tell us you need to use
> MicroPython?  Certainly MicroPython running on a microcontroller with
> help from hardware timers certainly can do it, but this mailing list is
> not the place to ask about it.  Instead you'll have to visit a forum on
> MicroPython or CircuitPython.  By the way you definitely can step
> through MicroPython code one line at a time with a remote debugger, say
> with Visual Studio Code.

Its one of the reasons to use micropython - - - it is a subset of python.
I didn't think I was asking about micropython here though. The project with
the square wave stuff has lots going on so its more likely that regular python
will be used. Part of the challenge is trying to figure out if I need to be
running a real time kernel or even a real time OS. Independent information
is quite hard to find - - - seems like most of the information is by someone
with skin in the game and then without a background its hard to figure out
if what they're saying tells enough so that I can make a good decision or
not.
>
> > I have been following this list for some time. Don't believe that I've ever
> > seen anything where anyone was referred to 'Idle'.  In reading other user
> > group threads I have heard lots about java and its ide - - - don't remember,
> > again, any re: an ide for python.
>
> Idle has been mentioned on several occasions, but probably more on the
> python-tutor list.  I find it hard to believe that searching for Python
> IDEs really came up blank.  There are even IDEs for MicroPython and
> embedded devices.  I found a nice list with a quick search.

I didn't say that I had done any searching for a python ide. I have only
spent time looking for information on coding. There's lots on make a led
blink and other simple stuff but when you want to get at least a couple
orders more complicated - - - there is precious little and that's what I've
been looking for (and finding any stuff very hard to find!).
>
> > Even in maker threads - - - say for arduino - - its 'use this cut and
> > paste method
> > of programming' with no mention of any kind of ide when it was microPython 
> > - -
> > although being a subset of python it Idle may not work with it.
>
> You keep dropping little details that, had you included them in the
> first post, would have helped avoid a lot of answers that ultimately
> aren't going to be useful to you.  Are you working MicroPython or with
> regular Python on a PC?  That makes a big difference in where you go to
> get help and what kind of help we can provide here.
>
I didn't even really know how to ask the question(s). Likely I could have asked
better but until I got some of the answers did it make sense for me to add
further. I did not want an answer for one 'problem'. I was more looking for a
way of doing things (which is quite different).

> > Oh well - - - I am working on things!
>
> That is good.  I wish you success.
>
Thank you.

I'll likely be back with more questions (grin!).

(Lost a great mentor some almost 4 years ago now so its a lot more flail
around than if my buddy were still available.)

Thanking you for your ideas and tips!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-26 Thread Michael Torrie via Python-list
On 10/26/23 10:41, Michael Torrie wrote:
> By the way you definitely can step
> through MicroPython code one line at a time with a remote debugger, say
> with Visual Studio Code.

I meant to edit that bit out.   After doing a bit more research, it
appears remote debugging with MicroPython may not be possible or easy.
But the MicroPython lists and forums will know more about that than I
do.  But there are some nice IDEs for developing code in MicroPython and
deploying it to devices.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-26 Thread Michael Torrie via Python-list
On 10/26/23 06:34, o1bigtenor wrote:
> Interesting - - - -  ". . . see if it runs." - - - that's the issue!
> When the code is accessing sensors there isn't an easy way to
> check that the code is working until one has done the all of the
> physical construction. If I'm trying to control a pulsation system
> using square waves with distinct needs for timing etc I hadn't
> seen any way of 'stepping through the code' (phrase you use later).

Having dabbled in embedded electronics, all I can say is you will just
have to build it and try to get it working.  Failure is always an
option.  If I understand you correctly, this is for a hobby interest, so
go at it and have fun.

Stepping through code is a basic part of debugging in any language.
They all have tools for it. Google for python debugging.

"distinct needs for timing?"  Did you forget to tell us you need to use
MicroPython?  Certainly MicroPython running on a microcontroller with
help from hardware timers certainly can do it, but this mailing list is
not the place to ask about it.  Instead you'll have to visit a forum on
MicroPython or CircuitPython.  By the way you definitely can step
through MicroPython code one line at a time with a remote debugger, say
with Visual Studio Code.

> I have been following this list for some time. Don't believe that I've ever
> seen anything where anyone was referred to 'Idle'.  In reading other user
> group threads I have heard lots about java and its ide - - - don't remember,
> again, any re: an ide for python.

Idle has been mentioned on several occasions, but probably more on the
python-tutor list.  I find it hard to believe that searching for Python
IDEs really came up blank.  There are even IDEs for MicroPython and
embedded devices.  I found a nice list with a quick search.

> Even in maker threads - - - say for arduino - - its 'use this cut and
> paste method
> of programming' with no mention of any kind of ide when it was microPython - -
> although being a subset of python it Idle may not work with it.

You keep dropping little details that, had you included them in the
first post, would have helped avoid a lot of answers that ultimately
aren't going to be useful to you.  Are you working MicroPython or with
regular Python on a PC?  That makes a big difference in where you go to
get help and what kind of help we can provide here.

> Oh well - - - I am working on things!

That is good.  I wish you success.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list

On 10/26/2023 7:50 AM, o1bigtenor via Python-list wrote:

On Wed, Oct 25, 2023 at 9:10 AM Dieter Maurer  wrote:


o1bigtenor wrote at 2023-10-25 08:29 -0500:

...
It would appear that something has changed.

Went to the Eclipse download page, downloaded and verified (using sha-512).
Expanded software to # opt .
There is absolutely NO mention of anything python - - - java, c and
its permutations,
'scientific computing', and some others but nothing python.

I may be missing something due to an extreme lack of knowledge.

Please advise as to where I might find the 'python' environment in eclipse.


I entered "eclipse python download" in my favorite search engine
(=> "ecosia.org") and the second hit gave:
"https://marketplace.eclipse.org/content/pydev-python-ide-eclipse;.


Using Duckduckgo I had tried eclipse + python  which I would have
thought should have spit out something useful - - - but that just took
me to the general page and the download - - - well it did NOT offer
any python anything!

Thank you for the tip!


Eclipse is a huge complicated ecosystem.  I'd stay away from it and go 
with something smaller and simpler. (having said that, it's quite a few 
years since I gave up on Eclipse the last time).  Something like pyzo, 
for instance.

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


Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 3:56 PM Jim Schwartz  wrote:

> Does this link help?  It seems to have a Linux package here.
>
> Eclipse Packages | The Eclipse Foundation - home to a global community,
> the Eclipse IDE, Jakarta EE and over 350 open source projects...
> 
> eclipse.org 
> [image: favicon.ico] 
> 
>
> I was looking at this page and absoulutely couldn't find anything python
related.
A previous poster (between my ask and this) pointed out a better location.

Thanks for the assistance.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 11:58 AM Michael F. Stemper via Python-list
 wrote:
>
> On 25/10/2023 05.45, o1bigtenor wrote:
> > On Tue, Oct 24, 2023 at 8:35 PM Chris Angelico via Python-list
> >  wrote:
>
> >> 3. Catch the failure before you commit and push. Unit tests are great for 
> >> this.
> >
> > Where might I find such please.
>
> You don't "find" unit tests; you write them. A unit test tests
> a specific function or program.
>
> Ideally, you write each unit test *before* you write the function
> that it tests.
>
> For instance, suppose that you were writing a function to calculate
> the distance between two points. We know the following things about
> distance:
> 1. The distance from a point to itself is zero.
> 2. The distance between two distinct points is positive.
> 3. The distance from A to B is equal to the distance from B to A.
> 4. The distance from A to B plus the distance from B to C is at
> least as large as the distance from A to C.
>
> You would write unit tests that generate random points and apply
> your distance function to them, checking that each of these
> conditions is satisfied. You'd also write a few tests of hard-coded
> points,such as:
> - Distance from (0,0) to (0,y) is y
> - Distance from (0,0) to (x,0) is x
> - Distance from (0,0) to (3,4) is 5
> - Distance from (0,0) to (12,5) is 13
>
> The python ecosystem provides many tools to simplify writing and
> running unit tests. Somebody has already mentioned "unittest". I
> use this one all of the time. There are also "doctest", "nose",
> "tox", and "py.test" (none of which I've used).
>

Very useful information - - - thanks!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 10:19 AM Michael Torrie via Python-list
 wrote:
>
> On 10/25/23 05:51, o1bigtenor via Python-list wrote:
> > Looks like I have another area to investigate. (grin!)
> > Any suggestions?
>
> Seems to me you're trying to run before you have learned to walk.
>
> Slow down, go to the beginning and just learn python, write some code,
> see if it runs.  Go through the tutorial at
> https://docs.python.org/3/tutorial/index.html

Interesting - - - -  ". . . see if it runs." - - - that's the issue!
When the code is accessing sensors there isn't an easy way to
check that the code is working until one has done the all of the
physical construction. If I'm trying to control a pulsation system
using square waves with distinct needs for timing etc I hadn't
seen any way of 'stepping through the code' (phrase you use later).

>
> Your first and most basic tool is the python interpreter.  It will tell
> you when you try to run your code if you have syntax errors.  It's true
> that some errors the linters will catch won't show up as syntax errors,
> but cross the bridge when you get to it.  Once you have a basic grasp of
> Python syntax, you can begin using some of the tools Python has for
> organizing code: Functions and modules (eventually packages).
> Eventually when your logic is placed neatly into functions, you can then
> write other python programs that import those functions and feed
> different parameters to them and test that the output is what you
> expect. That is known as a test.
>
> Nothing wrong with geany as an editor.  However, you might find the
> Python Idle IDE useful (it usually installs with Python), as it lets you
> work more interactively with your code, inspecting and interacting with
> live python objects in memory.  It also integrates debugging
> functionality to let you step through your code one line at a time and
> watch variables and how they change.

I have been following this list for some time. Don't believe that I've ever
seen anything where anyone was referred to 'Idle'.  In reading other user
group threads I have heard lots about java and its ide - - - don't remember,
again, any re: an ide for python.
Even in maker threads - - - say for arduino - - its 'use this cut and
paste method
of programming' with no mention of any kind of ide when it was microPython - -
although being a subset of python it Idle may not work with it.
>
> When you encounter isses with your code (syntax or logical) that you
> can't solve, you can come to the list, show your code and the full
> output of the interpreter that shows the complete error message and back
> trace and I think you'll get a lot of helpful responses.
> --

That was the plan.

My problem is that I'm needing to move quite quickly from 'hello, world' to
something quite a bit more complex. Most of the instruction stuff I've run
into assumes that one is programming only for the joy of learning to
program where I've got things I want to do and - - - sadly - - - they're
not sorta like the run of the mill stuff.

Oh well - - - I am working on things!

Thanks for the ideas and the assistance!

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


Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 9:10 AM Dieter Maurer  wrote:
>
> o1bigtenor wrote at 2023-10-25 08:29 -0500:
> > ...
> >It would appear that something has changed.
> >
> >Went to the Eclipse download page, downloaded and verified (using sha-512).
> >Expanded software to # opt .
> >There is absolutely NO mention of anything python - - - java, c and
> >its permutations,
> >'scientific computing', and some others but nothing python.
> >
> >I may be missing something due to an extreme lack of knowledge.
> >
> >Please advise as to where I might find the 'python' environment in eclipse.
>
> I entered "eclipse python download" in my favorite search engine
> (=> "ecosia.org") and the second hit gave:
> "https://marketplace.eclipse.org/content/pydev-python-ide-eclipse;.

Using Duckduckgo I had tried eclipse + python  which I would have
thought should have spit out something useful - - - but that just took
me to the general page and the download - - - well it did NOT offer
any python anything!

Thank you for the tip!
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Question(s)

2023-10-25 Thread AVI GROSS via Python-list
Just want to add that even when you can prove that an algorithm works 
absolutely positively, it will often fail on our every finite computers. 
Consider families of algorithms that do hill climbing to find a minimum and 
maximum and are guaranteed to get ever closer to a solution given infinite 
time. In real life, using something like 64 bit or 128 bit floating point 
representations, you can end up with all kinds of rounding errors and 
inexactness on some inputs so it goes into a loop of constantly bouncing back 
and forth between the two sides and never gets any closer to the peak. It may 
work 99.99% of the time and then mysteriously lock up on some new data.

Or consider an algorithm some use in places like Vegas that is absolutely 100% 
guaranteed to win. If you bet $1 and lose, simply double your bet as many times 
as needed and eventually, you should win. Of course, one little problem is that 
all you ever win is $1. And you might lose 50 times in a row and spend hours 
and risk ever larger amounts to just win that dollar. Sure, you could just 
start betting a larger amount like a million dollars and eventually win a 
million dollars but how long can anyone keep doubling before they have to stop 
and lose it all. After enough doublings the vet is for billions of dollars and 
soon thereafter, more than the worth of everything on the planet.

The algorithm is mathematically sound but the result given other realities is 
not.

A last analogy is the division by zero issue. If your algorithm deals with 
infinitesimally smaller numbers, it may simply be rounded or truncated to 
exactly zero. The next time the algorithm does a division, you get a serious 
error. 

So perhaps a PROOF that a real computer program will work would require quite a 
few constraints. Python already by default supports integers limited only in 
size by available memory. This can avoid some of the overflow problems when all 
you are allowed is 64 bits but it remains a constraint and a danger as even a 
fairly simple algorithm you can PROVE will work, will still fail if your 
program uses these large integers in ways that make multiple such large 
integers on machines not designed to extend their memory into whole farms of 
machines or generates numbers like Googolplex factorial divided by googolplex 
raised to the log(Googolplex ) power.

Some problems like the above are manageable as in setting limits and simply 
returning failure without crashing. Many well-designed programs can be trusted 
to work well as long as certain assumptions are honored. But often it simply is 
not true and things can change. 

Python actually is a good choice for quite a bit and often will not fail where 
some other environment might but there are few guarantees and thus people often 
program defensively even in places they expect no problems. As an example, I 
have written programs that ran for DAYS and generated many millions of files as 
they chugged along in a simulation and then mysteriously died. I did not bother 
trying to find out why one program it called failed that rarely to produce a 
result. I simply wrapped the section that called the occasional offender in the 
equivalent try/catch for that language and when it happened, did something 
appropriate and continued. The few occasional errors were a bug in someone 
else's code that should have handled whatever weird data I threw at it 
gracefully but didn't, so I added my overhead so I could catch it. The rare 
event did not matter much given the millions that gave me the analysis I 
wanted. But the point is even if my code had been certified as guaranteed to be 
bug free, any time I stepped outside by calling code from anyone else in a 
library, or an external program, it is no longer guaranteed.

We are now spending quite a bit of time educating someone who seems to have 
taken on a task without really being generally knowledgeable about much outside 
the core language and how much of the answer to making the code as reliable as 
it can be may lie somewhat outside the program as just seen by the interpreter. 

And unless this is a one-shot deal, in the real world, programs keep getting 
modified and new features ofteh added and just fixing one bug can break other 
parts so you would need to verify things over and over and then freeze.


-Original Message-
From: Python-list  On 
Behalf Of Michael F. Stemper via Python-list
Sent: Wednesday, October 25, 2023 9:34 AM
To: python-list@python.org
Subject: Re: Question(s)

On 24/10/2023 18.15, o1bigtenor wrote:


> What is interesting about this is the absolute certainty that it is impossible
> to program so that that program is provably correct.

Not entirely true. If I was to write a program to calculate Fibonacci
numbers, or echo back user input, that program could be proven correct.
But, there is a huge set of programs for which it is not possible to
prove correctness.

In fact, there is a huge (countably infinite) set of pr

Re: Question(s)

2023-10-25 Thread Jim Schwartz via Python-list
   Does this link help?  It seems to have a Linux package here.

   [1]Eclipse Packages | The
   Eclipse Foundation - home to
   a global community, the
   Eclipse IDE, Jakarta EE and  [2]favicon.ico
   over 350 open source
   projects...
   eclipse.org

   Sent from my iPhone

 On Oct 25, 2023, at 7:55 AM, o1bigtenor via Python-list
  wrote:

 On Wed, Oct 25, 2023 at 7:00AM Dieter Maurer 
 wrote:

   o1bigtenor wrote at 2023-10-25 06:44 -0500:

 On Wed, Oct 25, 2023 at 6:24?AM Dieter Maurer 
 wrote:

 ...

   There are different kinds of errors.

   Some can be avoided by using an integrated development environment

   (e.g. misspellings, type mismatches, ...).

 Haven't heard of a python IDE - - - doesn't mean that there isn't
 such - -

 just that I haven't heard of such. Is there a python IDE?

   There are several.

   Python comes with "IDLE".

 Interesting - - - started looking into this.

   There are several others,

   e.g. "ECLIPSE" can be used for Python development.

 Is 'Eclipse' a Windows oriented IDE?
 (Having a hard time finding linux related  information on the
 website.)

   Search for other alternatices.

 Will do.
 Thanks for the assistance.
 --
 https://mail.python.org/mailman/listinfo/python-list

References

   Visible links
   1. https://www.eclipse.org/downloads/packages/
   2. https://www.eclipse.org/downloads/packages/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-25 Thread Dan Purgert via Python-list
On 2023-10-25, o1bigtenor wrote:
> On Wed, Oct 25, 2023 at 7:00 AM Dieter Maurer  wrote:
>> [...]
>> There are several others,
>> e.g. "ECLIPSE" can be used for Python development.
>
> Is 'Eclipse' a Windows oriented IDE?
> (Having a hard time finding linux related  information on the
> website.)

Not at all.  As I recall, it's entirely written in Java, so basically
entirely platform-independent already.


-- 
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1  E067 6D65 70E5 4CE7 2860
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-25 Thread Thomas Passin via Python-list

On 10/25/2023 9:20 AM, Michael F. Stemper via Python-list wrote:

On 24/10/2023 17.50, Thomas Passin wrote:


   The programming team for the Apollo moon mission developed a system 
which,> if you would write your requirements in a certain way, could 
generate correct

C code for them.
Since the last Apollo mission was in 1972, when C was first being 
developed, I

find this hard to believe.


Yes, sorry, see my previous post.  It's the current-day evolution of the 
tools that can output C.


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


Re: Question(s)

2023-10-25 Thread Thomas Passin via Python-list

On 10/25/2023 8:50 AM, o1bigtenor via Python-list wrote:

On Wed, Oct 25, 2023 at 7:00 AM Dieter Maurer  wrote:


o1bigtenor wrote at 2023-10-25 06:44 -0500:

On Wed, Oct 25, 2023 at 6:24?AM Dieter Maurer  wrote:
...

There are different kinds of errors.

Some can be avoided by using an integrated development environment
(e.g. misspellings, type mismatches, ...).


Haven't heard of a python IDE - - - doesn't mean that there isn't such - -
just that I haven't heard of such. Is there a python IDE?


There are several.

Python comes with "IDLE".


Interesting - - - started looking into this.


There are several others,
e.g. "ECLIPSE" can be used for Python development.


Is 'Eclipse' a Windows oriented IDE?
(Having a hard time finding linux related  information on the
website.)


Search for other alternatices.


Will do.

Thanks for the assistance.


Pyzo is one possibility - https://pyzo.org

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


Re: Question(s)

2023-10-25 Thread Alan Gauld via Python-list
On 25/10/2023 12:44, o1bigtenor via Python-list wrote:

> Haven't heard of a python IDE - - - doesn't mean that there isn't such - -

There are literally dozens with varying degrees of smartness.
The big 4 all have Python plugins/environments:
Eclipse, Netbeans, VisualStudio, IntelliJ

And of course the Apple XCode toolset has a python environment.

There are also several Python specific IDEs around too.
Most of them are multi-platform:

https://www.simplilearn.com/tutorials/python-tutorial/python-ide

gives a small sample

And of course the old favourites vi/vim and emacs both have
comprehensive Python support.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


Re: Question(s)

2023-10-25 Thread Michael F. Stemper via Python-list

On 25/10/2023 05.45, o1bigtenor wrote:

On Tue, Oct 24, 2023 at 8:35 PM Chris Angelico via Python-list
 wrote:



3. Catch the failure before you commit and push. Unit tests are great for this.


Where might I find such please.


You don't "find" unit tests; you write them. A unit test tests
a specific function or program.

Ideally, you write each unit test *before* you write the function
that it tests.

For instance, suppose that you were writing a function to calculate
the distance between two points. We know the following things about
distance:
1. The distance from a point to itself is zero.
2. The distance between two distinct points is positive.
3. The distance from A to B is equal to the distance from B to A.
4. The distance from A to B plus the distance from B to C is at
   least as large as the distance from A to C.

You would write unit tests that generate random points and apply
your distance function to them, checking that each of these
conditions is satisfied. You'd also write a few tests of hard-coded
points,such as:
- Distance from (0,0) to (0,y) is y
- Distance from (0,0) to (x,0) is x
- Distance from (0,0) to (3,4) is 5
- Distance from (0,0) to (12,5) is 13

The python ecosystem provides many tools to simplify writing and
running unit tests. Somebody has already mentioned "unittest". I
use this one all of the time. There are also "doctest", "nose",
"tox", and "py.test" (none of which I've used).

--
Michael F. Stemper
Life's too important to take seriously.

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


RE: Question(s)

2023-10-25 Thread AVI GROSS via Python-list
I am replying to this which is heading into another topic:

"(Tongue in cheek) Except doesn't one make more  when software in
hidden in an unreadable state? (That forces the user to go back to the
original dev or group - - yes?)"

Like some of us, I come from a time when much software was compiled. Sure, you 
could play interactively with the BASIC interpreter, but much else could be 
delivered to you as an executable and it was not easy to know what it did 
without trying it and certainly it was not easy to make changes to it and 
resell it as your own.

Where does python fit in?

On the one hand, it is completely visible as the software and modules you use 
tend to be stored on the machine being used in a readable state. If you come up 
with some nifty algorithm, it is there for anyone to see and copy or even alter 
if they have permissions. You can freely search a corpus of code to pick up 
interesting tidbits and that can be a plus but if your livelihood is based on 
selling your code or services, ...

So do some people do things to make that harder? Can you deliver only files 
already converted to bytecode, for example? Could you have an interpreter that 
has special changes such as being able to take encrypted code and decrypt 
before using or perhaps have read privileges that normal users will not have?

Obviously if your code is on a server that users can only access indirectly and 
in a controlled manner, this is not as much of an issue. 

I will skip the anecdotes, but point out how sometimes compiled code may have a 
whole bunch of other problems, including when a user can sneak in your office 
and modify the source code behind your back or when a virus can insert itself.

So to return to the main point, not that I am selling anything, what do 
developers using Python do to try to make sure they get properly paid and 
others do not just use their work without permission?

-Original Message-
From: o1bigtenor  
Sent: Wednesday, October 25, 2023 6:59 AM
To: avi.e.gr...@gmail.com
Cc: Chris Angelico ; python-list@python.org
Subject: Re: Question(s)

On Tue, Oct 24, 2023 at 9:36 PM AVI GROSS via Python-list
 wrote:
>
> Agreed, Chris. There are many methods way better than the sort of RAID
> architecture I supplied as AN EXAMPLE easy to understand. But even so, if a
> hard disk or memory chip is fried or a nuclear bomb takes out all servers in
> or near a city, you would need  some truly crazy architectures with info not
> only distributed across the globe but perhaps also to various space
> satellites or servers kept ever further out and eventually in hyperspace or
> within a black hole (might be write-only, alas).
>
> The point many of us keep saying is there can not easily or even with great
> difficult, any perfect scheme that guarantees nothing will go wrong with the
> software, hardware, the people using it and so on. And in the real world, as
> compared to the reel world, many programs cannot remain static. Picture a
> program that includes many tax laws and implementations that has to be
> changed at least yearly as laws change. Some near-perfect code now has to
> either be patched with lots of errors possible, or redesigned from scratch
> and if it takes long enough, will come out after yet more changes and thus
> be wrong.
>
> A decent question you can ask is if the language this forum is supposed to
> be on, is better in some ways to provide the kind of Teflon-coated code he
> wants. Are there features better avoided? How do you make sure updates to
> modules you use and trust are managed as they may break your code. Stuff
> like that is not as abstract.

The above are very interesting questions - - - - anyone care to tackle
one, or some?
>
> In my view, one consideration can be that when people can examine your
> source code in the original language, that can open up ways others might
> find ways to break it, more so than a compiled program that you only can
> read in a more opaque way.
>
(Tongue in cheek) Except doesn't one make more  when software in
hidden in an unreadable state? (That forces the user to go back to the
original dev or group - - yes?)

TIA

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


Re: Question(s)

2023-10-25 Thread Michael Torrie via Python-list
On 10/25/23 05:51, o1bigtenor via Python-list wrote:
> Looks like I have another area to investigate. (grin!)
> Any suggestions?

Seems to me you're trying to run before you have learned to walk.

Slow down, go to the beginning and just learn python, write some code,
see if it runs.  Go through the tutorial at
https://docs.python.org/3/tutorial/index.html

Your first and most basic tool is the python interpreter.  It will tell
you when you try to run your code if you have syntax errors.  It's true
that some errors the linters will catch won't show up as syntax errors,
but cross the bridge when you get to it.  Once you have a basic grasp of
Python syntax, you can begin using some of the tools Python has for
organizing code: Functions and modules (eventually packages).
Eventually when your logic is placed neatly into functions, you can then
write other python programs that import those functions and feed
different parameters to them and test that the output is what you
expect. That is known as a test.

Nothing wrong with geany as an editor.  However, you might find the
Python Idle IDE useful (it usually installs with Python), as it lets you
work more interactively with your code, inspecting and interacting with
live python objects in memory.  It also integrates debugging
functionality to let you step through your code one line at a time and
watch variables and how they change.

When you encounter isses with your code (syntax or logical) that you
can't solve, you can come to the list, show your code and the full
output of the interpreter that shows the complete error message and back
trace and I think you'll get a lot of helpful responses.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-25 Thread Michael F. Stemper via Python-list

On 24/10/2023 18.15, o1bigtenor wrote:



What is interesting about this is the absolute certainty that it is impossible
to program so that that program is provably correct.


Not entirely true. If I was to write a program to calculate Fibonacci
numbers, or echo back user input, that program could be proven correct.
But, there is a huge set of programs for which it is not possible to
prove correctness.

In fact, there is a huge (countably infinite) set of programs for which it
is not even possible to prove that the program will halt.

Somebody already pointed you at a page discussing "The Halting Problem".
You really should read up on this.


Somehow - - - well - - to me that sounds that programming is illogical.

If I set up a set of mathematical problems (linked) I can prove that the
logic structure of my answer is correct.


Exactly the same situation. There are many (again, countably infinite)
mathematical statements where it is not possible to prove that the statement
is either true or false. I want to be clear that this is not the same as
"we haven't figured out how to do it yet." It is a case of "it is mathematically
possible to show that we can't either prove or disprove statement ."

Look up Kurt Gödel's work on mathematical incompleteness, and some of the
statements that fall into this category, such as the Continuum Hypothesis
or the Parallel Postulate.

As I said at the beginning, there are a lot of programs that can be
proven correct or incorrect. But, there are a lot more that cannot.

--
Michael F. Stemper
Outside of a dog, a book is man's best friend.
Inside of a dog, it's too dark to read.

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


Re: Question(s)

2023-10-25 Thread Michael F. Stemper via Python-list

On 24/10/2023 17.50, Thomas Passin wrote:



   The programming team for the Apollo moon mission developed a system which,> 
if you would write your requirements in a certain way, could generate correct
C code for them.

Since the last Apollo mission was in 1972, when C was first being developed, I
find this hard to believe.

--
Michael F. Stemper
Outside of a dog, a book is man's best friend.
Inside of a dog, it's too dark to read.

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


Re: Question(s)

2023-10-25 Thread Dan Purgert via Python-list
On 2023-10-24, o1bigtenor wrote:
> On Tue, Oct 24, 2023 at 5:28 PM Rob Cliffe  wrote:
>>
>> There is no general way to prove that a program is "correct".  Or even
>> whether it will terminate or loop endlessly.
>> [...]
>> When you come to run your program "for real", and you have to
>> troubleshoot it (as in real life you probably will), you will have
>> eliminated simple bugs in your program, and can concentrate on the more
>> likely sources of problems (e.g. misbehaving hardware).
>>
> Interesting - - - hopefully taken in the same vein as your second
> statement - - I sorta sounds like programmers keep running around in
> the forest looking for trees. (Grin!)

No, you tend to know what parts of the spec are "wrong(tm)" (either in
the language you're working in, or the hardware). 

If it comes to working with customers (as mentioned in one response),
you start to learn the questions to get at what they really want (but
that's better left to the architect :) )

>
> So how does one test software then?

You write unit tests (usually scripts or other software that can
interact with the main program to twiddle the knobs and such, and ensure
it's doing what was specified).  Alternatively, you have to program your
hardware and test directly on that.


-- 
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1  E067 6D65 70E5 4CE7 2860
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-25 08:29 -0500:
> ...
>It would appear that something has changed.
>
>Went to the Eclipse download page, downloaded and verified (using sha-512).
>Expanded software to # opt .
>There is absolutely NO mention of anything python - - - java, c and
>its permutations,
>'scientific computing', and some others but nothing python.
>
>I may be missing something due to an extreme lack of knowledge.
>
>Please advise as to where I might find the 'python' environment in eclipse.

I entered "eclipse python download" in my favorite search engine
(=> "ecosia.org") and the second hit gave:
"https://marketplace.eclipse.org/content/pydev-python-ide-eclipse;.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-25 Thread Thomas Passin via Python-list

On 10/25/2023 9:21 AM, Thomas Passin wrote:

On 10/25/2023 8:50 AM, o1bigtenor via Python-list wrote:
On Wed, Oct 25, 2023 at 7:00 AM Dieter Maurer  
wrote:


o1bigtenor wrote at 2023-10-25 06:44 -0500:
On Wed, Oct 25, 2023 at 6:24?AM Dieter Maurer  
wrote:

...

There are different kinds of errors.

Some can be avoided by using an integrated development environment
(e.g. misspellings, type mismatches, ...).


Haven't heard of a python IDE - - - doesn't mean that there isn't 
such - -

just that I haven't heard of such. Is there a python IDE?


There are several.

Python comes with "IDLE".


Interesting - - - started looking into this.


There are several others,
e.g. "ECLIPSE" can be used for Python development.


Is 'Eclipse' a Windows oriented IDE?
(Having a hard time finding linux related  information on the
website.)


Search for other alternatices.


Will do.

Thanks for the assistance.


Pyzo is one possibility - https://pyzo.org


The Leo editor is excellent, as long as you are prepared for a steep 
learning curve - https://github.com/leo-editor/leo-editor


It's installable via pip (though there can be fixable install glitches 
on some Linux distros).




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


Re: Question(s)

2023-10-25 Thread Grant Edwards via Python-list
On 2023-10-25, o1bigtenor via Python-list  wrote:

> Haven't heard of a python IDE - - - doesn't mean that there isn't such - -
> just that I haven't heard of such. Is there a python IDE?

Seriously?  Now you're just trolling.

google.com/search?q=python+ide=python+ide

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


Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 7:56 AM Dieter Maurer  wrote:
>
> o1bigtenor wrote at 2023-10-25 07:50 -0500:
> >> There are several others,
> >> e.g. "ECLIPSE" can be used for Python development.
> >
> >Is 'Eclipse' a Windows oriented IDE?
>
> No.
> ==> "https://en.wikipedia.org/wiki/Eclipse_(software)"

It would appear that something has changed.

Went to the Eclipse download page, downloaded and verified (using sha-512).
Expanded software to # opt .
There is absolutely NO mention of anything python - - - java, c and
its permutations,
'scientific computing', and some others but nothing python.

I may be missing something due to an extreme lack of knowledge.

Please advise as to where I might find the 'python' environment in eclipse.

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


Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-25 07:50 -0500:
>> There are several others,
>> e.g. "ECLIPSE" can be used for Python development.
>
>Is 'Eclipse' a Windows oriented IDE?

No.
==> "https://en.wikipedia.org/wiki/Eclipse_(software)"
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 7:00 AM Dieter Maurer  wrote:
>
> o1bigtenor wrote at 2023-10-25 06:44 -0500:
> >On Wed, Oct 25, 2023 at 6:24?AM Dieter Maurer  wrote:
> > ...
> >> There are different kinds of errors.
> >>
> >> Some can be avoided by using an integrated development environment
> >> (e.g. misspellings, type mismatches, ...).
> >
> >Haven't heard of a python IDE - - - doesn't mean that there isn't such - -
> >just that I haven't heard of such. Is there a python IDE?
>
> There are several.
>
> Python comes with "IDLE".
>
Interesting - - - started looking into this.

> There are several others,
> e.g. "ECLIPSE" can be used for Python development.

Is 'Eclipse' a Windows oriented IDE?
(Having a hard time finding linux related  information on the
website.)

> Search for other alternatices.

Will do.

Thanks for the assistance.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-25 06:44 -0500:
>On Wed, Oct 25, 2023 at 6:24?AM Dieter Maurer  wrote:
> ...
>> There are different kinds of errors.
>>
>> Some can be avoided by using an integrated development environment
>> (e.g. misspellings, type mismatches, ...).
>
>Haven't heard of a python IDE - - - doesn't mean that there isn't such - -
>just that I haven't heard of such. Is there a python IDE?

There are several.

Python comes with "IDLE".

There are several others,
e.g. "ECLIPSE" can be used for Python development.
Search for other alternatices.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 6:20 AM Chris Angelico via Python-list
 wrote:
>
> On Wed, 25 Oct 2023 at 21:46, o1bigtenor  wrote:
> > > 2. Catch the failure as you save. We have a lot of tools that can help
> > > you to spot bugs.
> >
> > Tools like this for python please.
>
> Various ones. Type checkers like MyPy fall into this category if you
> set your system up to run them when you save. Some editors do basic
> syntax checks too.

I have been using geany as a plain text editor for some time. Searching for
suggestions for error checking in python I find listed Pylint,
Pyflakes and Pycodestyle.

Looks like I have another area to investigate. (grin!)
>
> > > 3. Catch the failure before you commit and push. Unit tests are great for 
> > > this.
> >
> > Where might I find such please.
>
> The same tools, but run as a pre-commit hook.
>
> Any tool that can help you find bugs has the potential to be of value.
> It's all a question of how much time it saves with earlier detection
> of bugs versus how much it costs you in pacifying the tool. Some are
> better than others.
>
Any suggestions?

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


Re: Question(s)

2023-10-25 Thread Chris Angelico via Python-list
On Wed, 25 Oct 2023 at 22:46, o1bigtenor via Python-list
 wrote:
>
> On Wed, Oct 25, 2023 at 6:24 AM Dieter Maurer  wrote:
> >
> > o1bigtenor wrote at 2023-10-24 07:22 -0500:
> > > ...
> > >Is there a way to verify that a program is going to do what it is
> > >supposed to do even
> > >before all the hardware has been assembled and installed and tested?
> >
> > Others have already noted that "verify" is a very strong aim.
>
> I have worked in environments where everything was 100% tested. Errors
> were either corrected or one's attendance was uninvited. Powerful impetus
> to do a good job.

Or powerful impetus to deny that the error was yours.

Remember, 100% test coverage does NOT mean the code is perfect. It
just means it's tested.

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


Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 6:24 AM Dieter Maurer  wrote:
>
> o1bigtenor wrote at 2023-10-24 07:22 -0500:
> > ...
> >Is there a way to verify that a program is going to do what it is
> >supposed to do even
> >before all the hardware has been assembled and installed and tested?
>
> Others have already noted that "verify" is a very strong aim.

I have worked in environments where everything was 100% tested. Errors
were either corrected or one's attendance was uninvited. Powerful impetus
to do a good job.
>
> There are different kinds of errors.
>
> Some can be avoided by using an integrated development environment
> (e.g. misspellings, type mismatches, ...).

Haven't heard of a python IDE - - - doesn't mean that there isn't such - -
just that I haven't heard of such. Is there a python IDE?
>
> Some can be found via tests.
> Look at Python's "unittest" package for learn how to write tests.
> "unittest.mock" can help you to mockup hardware you do not yet have.

Thanks - - -more to look into.

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


Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 6:25 AM Chris Angelico via Python-list
 wrote:
>
> On Wed, 25 Oct 2023 at 21:53, o1bigtenor  wrote:
> >
> > Hmm - - - - now how can I combine 'Hamming codes'
> > and a raid array?
> >
> > TIA
>
> Normally you wouldn't. But let's say you're worried that a file might
> get randomly damaged. (I don't think single-bit errors are really a
> significant issue with mass storage, as you'd be more likely to have
> an entire sector unreadable, but this can certainly happen in
> transmission.) What you do is take a set of data bits, add an error
> correction code, and send them on their way. The more data bits per
> block, the more efficient, but if there are too many errors you will
> lose data. So there's a tradeoff.
>
>
Thank you Mr Chris!
Cogent explanation that makes sense.
So - - - no change needed to my storage systems.
Great!

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


Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-24 07:22 -0500:
> ...
>Is there a way to verify that a program is going to do what it is
>supposed to do even
>before all the hardware has been assembled and installed and tested?

Others have already noted that "verify" is a very strong aim.

There are different kinds of errors.

Some can be avoided by using an integrated development environment
(e.g. misspellings, type mismatches, ...).

Some can be found via tests.
Look at Python's "unittest" package for learn how to write tests.
"unittest.mock" can help you to mockup hardware you do not yet have.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-25 Thread Chris Angelico via Python-list
On Wed, 25 Oct 2023 at 21:53, o1bigtenor  wrote:
>
> Hmm - - - - now how can I combine 'Hamming codes'
> and a raid array?
>
> TIA

Normally you wouldn't. But let's say you're worried that a file might
get randomly damaged. (I don't think single-bit errors are really a
significant issue with mass storage, as you'd be more likely to have
an entire sector unreadable, but this can certainly happen in
transmission.) What you do is take a set of data bits, add an error
correction code, and send them on their way. The more data bits per
block, the more efficient, but if there are too many errors you will
lose data. So there's a tradeoff.

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


Re: Question(s)

2023-10-25 Thread Chris Angelico via Python-list
On Wed, 25 Oct 2023 at 21:46, o1bigtenor  wrote:
> > 2. Catch the failure as you save. We have a lot of tools that can help
> > you to spot bugs.
>
> Tools like this for python please.

Various ones. Type checkers like MyPy fall into this category if you
set your system up to run them when you save. Some editors do basic
syntax checks too.

> > 3. Catch the failure before you commit and push. Unit tests are great for 
> > this.
>
> Where might I find such please.

The same tools, but run as a pre-commit hook.

Any tool that can help you find bugs has the potential to be of value.
It's all a question of how much time it saves with earlier detection
of bugs versus how much it costs you in pacifying the tool. Some are
better than others.

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


Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Tue, Oct 24, 2023 at 9:36 PM AVI GROSS via Python-list
 wrote:
>
> Agreed, Chris. There are many methods way better than the sort of RAID
> architecture I supplied as AN EXAMPLE easy to understand. But even so, if a
> hard disk or memory chip is fried or a nuclear bomb takes out all servers in
> or near a city, you would need  some truly crazy architectures with info not
> only distributed across the globe but perhaps also to various space
> satellites or servers kept ever further out and eventually in hyperspace or
> within a black hole (might be write-only, alas).
>
> The point many of us keep saying is there can not easily or even with great
> difficult, any perfect scheme that guarantees nothing will go wrong with the
> software, hardware, the people using it and so on. And in the real world, as
> compared to the reel world, many programs cannot remain static. Picture a
> program that includes many tax laws and implementations that has to be
> changed at least yearly as laws change. Some near-perfect code now has to
> either be patched with lots of errors possible, or redesigned from scratch
> and if it takes long enough, will come out after yet more changes and thus
> be wrong.
>
> A decent question you can ask is if the language this forum is supposed to
> be on, is better in some ways to provide the kind of Teflon-coated code he
> wants. Are there features better avoided? How do you make sure updates to
> modules you use and trust are managed as they may break your code. Stuff
> like that is not as abstract.

The above are very interesting questions - - - - anyone care to tackle
one, or some?
>
> In my view, one consideration can be that when people can examine your
> source code in the original language, that can open up ways others might
> find ways to break it, more so than a compiled program that you only can
> read in a more opaque way.
>
(Tongue in cheek) Except doesn't one make more  when software in
hidden in an unreadable state? (That forces the user to go back to the
original dev or group - - yes?)

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


Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Tue, Oct 24, 2023 at 8:43 PM Chris Angelico via Python-list
 wrote:
>
> On Wed, 25 Oct 2023 at 12:20, AVI GROSS via Python-list
>  wrote:
> > Consider an example of bit rot. I mean what if your CPU or hard disk has a 
> > location where you can write a byte and read it back multiple times and 
> > sometimes get the wrong result. To be really cautions, you might need your 
> > software to write something in multiple locations and when it reads it back 
> > in, check all of them and if most agree, ignore the one or two that don't 
> > while blocking that memory area off and moving your data elsewhere. Or 
> > consider a memory leak that happens rarely but if a program runs for years 
> > or decades, may end up causing an unanticipated error.
> >
>
> True, but there are FAR more efficient ways to do error correction :)
> Hamming codes give you single-bit correction and two-bit detection at
> a cost of log N bits, which is incredibly cheap - even if you were to
> go for a granularity of 64 bytes (one cache line in a modern Intel
> CPU), you would need just 11 bits of Hamming code for every 512 bits
> of data and you can guarantee to fix any single-bit error in any cache
> line. The "if most agree, ignore the one or two that don't" design
> implies that you're writing to an absolute minimum of three places,
> and in order to be able to ignore two that disagree, you'd probably
> need five copies of everything - that is to say, to store 512 bits of
> data, you would need 2560 bits of storage. But with a Hamming code,
> you need just 523 bits to store 512 reliably.
>
> Here's a great run-down on how efficiently this can be done, and how
> easily. https://www.youtube.com/watch?v=X8jsijhllIA
>
> Side note: If we assume that random bit flips occur at a rate of one
> every X storage bits, having redundant copies of data will increase
> the chances of a failure happening. For example, using a naive and
> horrendously wasteful "store 256 copies of everything" strategy, you
> would be 256 times more likely to have a random bitflip, which is
> insane :) You would also be able to guarantee detection of up to 128
> random bitflips. But as you can see, this puts a maximum on your
> storage ratio.
>

Hmm - - - - now how can I combine 'Hamming codes'
and a raid array?

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


Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
A post with useful ideas - - - - thanks (it generates some questions!
interleaved)

On Tue, Oct 24, 2023 at 8:35 PM Chris Angelico via Python-list
 wrote:
>
> On Wed, 25 Oct 2023 at 12:11, Thomas Passin via Python-list
>  wrote:
> > This doesn't mean that no program can ever be proven to halt, nor that
> > no program can never be proven correct by formal means.  Will your
> > program be one of those?  The answer may never come ...
>
snip
> So is all hope lost? No. We learn from our mistakes, we add more
> layers. And ultimately, we test until we're reasonably confident, and
> then go with it, knowing that failures WILL happen. Your goal as a
> programmer isn't to prevent failure altogether - if it were, you would
> never be able to achieve anything. Your goal is to catch those
> failures before they cause major issues.
>
> 1. Catch the failure as you're typing in code. Done, fixed, that's
> what the Backspace key is for.
> 2. Catch the failure as you save. We have a lot of tools that can help
> you to spot bugs.

Tools like this for python please.

> 3. Catch the failure before you commit and push. Unit tests are great for 
> this.

Where might I find such please.

> 4. Catch the failure collaboratively. Other developers can help. Or
> you can use automated tests that run on a bot farm, checking your code
> on a variety of different systems (see for example Python's
> buildbots).

This is very interesting - - - grin - - - almost looks like another rabbit hole
to climb into though.

> 5. Catch the failure in alpha. Release to a small number of willing
> users first. They get rewarded with cool new features before everyone
> else does, in return for having fewer guarantees.

For here its software for use here so I get to wear all the hats.

> 6. If all else fails, catch the failure before it kills someone.
> Design your system so that failures are contained. That's easier for
> some than others, but it's part of why I've been saying "system" here
> rather than "program".

This will not be an issue here - - - at least not yet. This is software for
collecting data to enhance management of things that aren't generally
managed in most like outfits. (Or they utilize the 800# gorillas in the
industries tools which are bloody pricey.)
>
> Eff up like it's your job.
> https://thedailywtf.com/articles/eff-up-like-it-s-your-job
>
Very interesting article - - - thanks!

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


Re: Question(s)

2023-10-24 Thread Thomas Passin via Python-list

On 10/24/2023 7:37 PM, Grant Edwards via Python-list wrote:

On 2023-10-24, Thomas Passin via Python-list  wrote:


Something less ambitious than a full proof of correctness of an
arbitrary program can sometimes be achieved.  The programming team
for the Apollo moon mission developed a system which, if you would
write your requirements in a certain way, could generate correct C
code for them.


Er, what?

C didnt' exist until after the Apollo program was done.

FORTRAN, perhaps?



Sorry, I mixed myself up.  The head of the team continued to develop the 
techniques and market them.  It's todays's version that can output C 
(going from memory a few years old here).  Sorry to have confused 
everyone and myself.


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


RE: Question(s)

2023-10-24 Thread AVI GROSS via Python-list
Agreed, Chris. There are many methods way better than the sort of RAID
architecture I supplied as AN EXAMPLE easy to understand. But even so, if a
hard disk or memory chip is fried or a nuclear bomb takes out all servers in
or near a city, you would need  some truly crazy architectures with info not
only distributed across the globe but perhaps also to various space
satellites or servers kept ever further out and eventually in hyperspace or
within a black hole (might be write-only, alas).

The point many of us keep saying is there can not easily or even with great
difficult, any perfect scheme that guarantees nothing will go wrong with the
software, hardware, the people using it and so on. And in the real world, as
compared to the reel world, many programs cannot remain static. Picture a
program that includes many tax laws and implementations that has to be
changed at least yearly as laws change. Some near-perfect code now has to
either be patched with lots of errors possible, or redesigned from scratch
and if it takes long enough, will come out after yet more changes and thus
be wrong.

A decent question you can ask is if the language this forum is supposed to
be on, is better in some ways to provide the kind of Teflon-coated code he
wants. Are there features better avoided? How do you make sure updates to
modules you use and trust are managed as they may break your code. Stuff
like that is not as abstract.

In my view, one consideration can be that when people can examine your
source code in the original language, that can open up ways others might
find ways to break it, more so than a compiled program that you only can
read in a more opaque way.


-Original Message-
From: Python-list  On
Behalf Of Chris Angelico via Python-list
Sent: Tuesday, October 24, 2023 9:41 PM
To: python-list@python.org
Subject: Re: Question(s)

On Wed, 25 Oct 2023 at 12:20, AVI GROSS via Python-list
 wrote:
> Consider an example of bit rot. I mean what if your CPU or hard disk has a
location where you can write a byte and read it back multiple times and
sometimes get the wrong result. To be really cautions, you might need your
software to write something in multiple locations and when it reads it back
in, check all of them and if most agree, ignore the one or two that don't
while blocking that memory area off and moving your data elsewhere. Or
consider a memory leak that happens rarely but if a program runs for years
or decades, may end up causing an unanticipated error.
>

True, but there are FAR more efficient ways to do error correction :)
Hamming codes give you single-bit correction and two-bit detection at
a cost of log N bits, which is incredibly cheap - even if you were to
go for a granularity of 64 bytes (one cache line in a modern Intel
CPU), you would need just 11 bits of Hamming code for every 512 bits
of data and you can guarantee to fix any single-bit error in any cache
line. The "if most agree, ignore the one or two that don't" design
implies that you're writing to an absolute minimum of three places,
and in order to be able to ignore two that disagree, you'd probably
need five copies of everything - that is to say, to store 512 bits of
data, you would need 2560 bits of storage. But with a Hamming code,
you need just 523 bits to store 512 reliably.

Here's a great run-down on how efficiently this can be done, and how
easily. https://www.youtube.com/watch?v=X8jsijhllIA

Side note: If we assume that random bit flips occur at a rate of one
every X storage bits, having redundant copies of data will increase
the chances of a failure happening. For example, using a naive and
horrendously wasteful "store 256 copies of everything" strategy, you
would be 256 times more likely to have a random bitflip, which is
insane :) You would also be able to guarantee detection of up to 128
random bitflips. But as you can see, this puts a maximum on your
storage ratio.

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

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


Re: Question(s)

2023-10-24 Thread Chris Angelico via Python-list
On Wed, 25 Oct 2023 at 12:20, AVI GROSS via Python-list
 wrote:
> Consider an example of bit rot. I mean what if your CPU or hard disk has a 
> location where you can write a byte and read it back multiple times and 
> sometimes get the wrong result. To be really cautions, you might need your 
> software to write something in multiple locations and when it reads it back 
> in, check all of them and if most agree, ignore the one or two that don't 
> while blocking that memory area off and moving your data elsewhere. Or 
> consider a memory leak that happens rarely but if a program runs for years or 
> decades, may end up causing an unanticipated error.
>

True, but there are FAR more efficient ways to do error correction :)
Hamming codes give you single-bit correction and two-bit detection at
a cost of log N bits, which is incredibly cheap - even if you were to
go for a granularity of 64 bytes (one cache line in a modern Intel
CPU), you would need just 11 bits of Hamming code for every 512 bits
of data and you can guarantee to fix any single-bit error in any cache
line. The "if most agree, ignore the one or two that don't" design
implies that you're writing to an absolute minimum of three places,
and in order to be able to ignore two that disagree, you'd probably
need five copies of everything - that is to say, to store 512 bits of
data, you would need 2560 bits of storage. But with a Hamming code,
you need just 523 bits to store 512 reliably.

Here's a great run-down on how efficiently this can be done, and how
easily. https://www.youtube.com/watch?v=X8jsijhllIA

Side note: If we assume that random bit flips occur at a rate of one
every X storage bits, having redundant copies of data will increase
the chances of a failure happening. For example, using a naive and
horrendously wasteful "store 256 copies of everything" strategy, you
would be 256 times more likely to have a random bitflip, which is
insane :) You would also be able to guarantee detection of up to 128
random bitflips. But as you can see, this puts a maximum on your
storage ratio.

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


Re: Question(s)

2023-10-24 Thread Chris Angelico via Python-list
On Wed, 25 Oct 2023 at 12:11, Thomas Passin via Python-list
 wrote:
> This doesn't mean that no program can ever be proven to halt, nor that
> no program can never be proven correct by formal means.  Will your
> program be one of those?  The answer may never come ...

Indeed, and I would go further and say that, in any non-trivial
system, it is impossible to completely 100% prove that it is perfectly
correct. Sometimes you might have perfect mathematics and software,
but only subject to certain assumptions about the environment. Or
about the users. More commonly, you build a system so that failure
becomes vanishingly unlikely.

Take space flight as an example. Computers have been vital to the
safety of human lives in space pretty much since humans have been
going to space at all. How do you make sure that the Apollo Guidance
Computer works correctly when you need it to? Multiple layers of
protection. Error correcting memory, redundant systems, and human
monitoring, plus the ability to rewrite the guidance software on the
fly if they needed to. Even when people are being sent to the moon,
you can't completely guarantee that the software is perfect, so you
add other layers to give greater protection.

(And more recently, both India's "Chandrayaan 2" and Japan's
"Hakuto-R" unmanned moon missions crash-landed due to software issues.
A half century of improvements hasn't changed the fundamental fact
that building a perfect system is basically impossible.)

So is all hope lost? No. We learn from our mistakes, we add more
layers. And ultimately, we test until we're reasonably confident, and
then go with it, knowing that failures WILL happen. Your goal as a
programmer isn't to prevent failure altogether - if it were, you would
never be able to achieve anything. Your goal is to catch those
failures before they cause major issues.

1. Catch the failure as you're typing in code. Done, fixed, that's
what the Backspace key is for.
2. Catch the failure as you save. We have a lot of tools that can help
you to spot bugs.
3. Catch the failure before you commit and push. Unit tests are great for this.
4. Catch the failure collaboratively. Other developers can help. Or
you can use automated tests that run on a bot farm, checking your code
on a variety of different systems (see for example Python's
buildbots).
5. Catch the failure in alpha. Release to a small number of willing
users first. They get rewarded with cool new features before everyone
else does, in return for having fewer guarantees.
6. If all else fails, catch the failure before it kills someone.
Design your system so that failures are contained. That's easier for
some than others, but it's part of why I've been saying "system" here
rather than "program".

Eff up like it's your job.
https://thedailywtf.com/articles/eff-up-like-it-s-your-job

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


RE: Question(s)

2023-10-24 Thread AVI GROSS via Python-list
Whoa!

The question cannot be about whether it is possible to prove any abstract 
program will be correct and especially not on real hardware that can fail in 
various ways or have unexpected race conditions or interacts with other places 
such as over the internet.

It has been quite well proven (think Kurt Gödel) that any system as complex as 
just arithmetic can have propositions that can neither be proven as true or as 
false and could be either. So there will be logical setups, written perhaps 
into the form of programs, that cannot be proven to work right, or even just 
halt someday when done.

The real question is way more detailed and complex. How does one create a 
complex program while taking care to minimize as well as you can the chances it 
is flawed under some conditions. There are walls of books written on such 
topics and they range from ways to write the software, perhaps in small modules 
that can be tested and then combined into larger subunits that can also be 
tested. There are compilers/interpreters/linters and sometimes ways of 
declaring your intentions to them, that can catch some kinds of possible 
errors, or force you to find another way to do things. You can hire teams of 
people to create test cases and try them or automate them. You can fill the 
code with all kinds of tests and conditionals even at run time that guarantee 
to handle any kinds of data/arguments handed to it and do something valid or 
fail with stated reasons. You can generate all kinds of logs to help establish 
the right things are happening or catch some errors. 

But all that gets you typically is fewer bugs and software that is very 
expensive to create and decades to produce and by that time, you have lost your 
market to others who settle for less.

Consider an example of bit rot. I mean what if your CPU or hard disk has a 
location where you can write a byte and read it back multiple times and 
sometimes get the wrong result. To be really cautions, you might need your 
software to write something in multiple locations and when it reads it back in, 
check all of them and if most agree, ignore the one or two that don't while 
blocking that memory area off and moving your data elsewhere. Or consider a 
memory leak that happens rarely but if a program runs for years or decades, may 
end up causing an unanticipated error.

You can only do so much. So once you have some idea what language you want to 
use and what development environment and so on, research what tools and methods 
are available and see what you can afford to do. But if you have also not 
chosen your target architecture and are being asked to GUARANTEE things from 
afar, that opens a whole new set of issues.

I was on a project once where we had a sort of networked system of machines 
exchanging things like email and we tested it. A while later, we decided to buy 
and add more machines of a new kind and had a heterogeneous network. 
Unfortunately, some tests had not been done with messages of a size that turned 
out to not be allowed on one set of machines as too big but were allowed on the 
other that had a higher limit. We caught the error in the field when a message 
of that size was sent and then got caught in junkmail later as the receiving or 
intermediate machine was not expecting to be the one dealing with it. We then 
lowered the maximum allowed size on all architectures to the capacity of the 
weakest one.

This reminds me a bit of questions about languages that are free and come 
pretty much without guarantees or support. Is it safe to use them? I mean could 
they be harboring back doors or spying on you? Will you get a guarantee they 
won't switch to a version 3.0 that is incompatible with some features your 
software used? The short answer is there are no guarantees albeit maybe you can 
purchase some assurances and services from some third party who might be able 
to help you with the open-source  software.

Unless your project accepts the realities, why start?


-Original Message-
From: Python-list  On 
Behalf Of o1bigtenor via Python-list
Sent: Tuesday, October 24, 2023 7:15 PM
To: Thomas Passin 
Cc: python-list@python.org
Subject: Re: Question(s)

On Tue, Oct 24, 2023 at 6:09 PM Thomas Passin via Python-list
 wrote:
>
snip
>
> By now you have read many responses that basically say that you cannot
> prove that a given program has no errors, even apart from the hardware
> question.  Even if it could be done, the kind of specification that you
> would need would in itself be difficult to create, read, and understand,
> and would be subject to bugs itself.
>
> Something less ambitious than a full proof of correctness of an
> arbitrary program can sometimes be achieved.  The programming team for
> the Apollo moon mission developed a system which, if you would write
> your requirements in a certain way, could generate correct C code for them.
>
> You won't be doing that.
>
&g

Re: Question(s)

2023-10-24 Thread Thomas Passin via Python-list

On 10/24/2023 7:15 PM, o1bigtenor wrote:

On Tue, Oct 24, 2023 at 6:09 PM Thomas Passin via Python-list
 wrote:



snip


By now you have read many responses that basically say that you cannot
prove that a given program has no errors, even apart from the hardware
question.  Even if it could be done, the kind of specification that you
would need would in itself be difficult to create, read, and understand,
and would be subject to bugs itself.

Something less ambitious than a full proof of correctness of an
arbitrary program can sometimes be achieved.  The programming team for
the Apollo moon mission developed a system which, if you would write
your requirements in a certain way, could generate correct C code for them.

You won't be doing that.

Here I want to point out something else.  You say you are just getting
into programming.  You are going to be making many mistakes and errors,
and there will be many things about programming you won't understand
until you get some good solid experience.  That's not anything to do
with you personally, that's just how it will play out.

So be prepared to learn from your mistakes and bugs.  They are how you
learn the nuts and bolts of the business of programming.



I am fully expecting to make mistakes (grin!).
I have a couple trades tickets - - - I've done more than a touch of technical
learning so mistakes are not scary.

What is interesting about this is the absolute certainty that it is impossible
to program so that that program is provably correct.
Somehow - - - well - - to me that sounds that programming is illogical.

If I set up a set of mathematical problems (linked) I can prove that the
logic structure of my answer is correct.


In general, that's not the case - CF Godel's Theorem.  There are true 
arithmetical statements that cannot be proven to be true within the 
axioms of arithmetic.  There's a counterpart in programming called the 
halting problem. Can an arbitrary computer program be proven to ever 
finish - to come to a halt (meaning basically to spit out a computed 
result)?  Not in general.  If it will never halt you can never check its 
computation.


This doesn't mean that no program can ever be proven to halt, nor that 
no program can never be proven correct by formal means.  Will your 
program be one of those?  The answer may never come ...



That's what I'm looking to do with the programming.

(Is that different than the question(s) that I've asked - - - dunno.)

Stimulating interaction for sure (grin!).



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


Re: Question(s)

2023-10-24 Thread Alan Gauld via Python-list
On 25/10/2023 00:08, o1bigtenor via Python-list wrote:

> So how does one test software then?

Testing is very different to proving!
As an industry we do a lot of testing at many different levels.
On bigger projects you'll find:
- Unit tests - testing small fragments of a bigger program
- Integration tests - testing that sub modules of code work
  together (and code with hardware, if applicable)
- System testing - checking that the code(and hardware) as a
  whole does what it should based on the specs (often done
  by an independent team)
- Performance testing - checking the system runs as fast as it
  should, using only the memory it should, for as long as it should.
- User testing - Can a real user drive it?
- security testing - Does it stop the bad guys from messing it
  up or using it as a gateway?

And there are more levels if you are really keen.
Testing often(usually!) takes up more time than programming.
And there are many, many books written about how to do it.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


Re: Question(s)

2023-10-24 Thread Alan Gauld via Python-list
On 24/10/2023 22:51, Grant Edwards via Python-list wrote:

>>> Is there a way to verify that a program is going to do what it is
>>> supposed to do even before all the hardware has been assembled and
>>> installed and tested?
> And the specified customer requirements are usually wrong too. Sure,
> the customer said it is supposed to do X, but what they actually
> needed was Y.

And this is the hardest bit, specifying exactly what you want at
a level that can be formally verified. I worked on some safety
critical systems a while back(1990s) and we had to formally verify
the core (non UI) code. We did this, but it still failed in some
scenarios because we verified it against faulty specs which,
in turn, were based on the customer's incorrectly stated requirements.
Garbage-In-Garbage-Out still applies.

Was the 3 months of formal analysis a waste of time? No, we still
caught lots of subtle stuff that might have been missed, but it
wasn't 100%. The bugs we did have were caught and identified
during system tests. So far as I know, nobody has died as a
result of any bugs in that system.

But, to the OP, the effort in
a) Learning the math and gaining experience for formal analysis and
b) actually performing such an analysis of real design/code
is simply not worth the effort for 99% of the programs you will write.
It is much simpler and faster to just test. And test again. And again.
Especially if you use automated testing tools which is the norm nowadays.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, o1bigtenor via Python-list  wrote:

> So how does one test software then?

That's what customers are for!



[Actually, that's true more often than it should be.]


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


Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, Thomas Passin via Python-list  wrote:

> Something less ambitious than a full proof of correctness of an
> arbitrary program can sometimes be achieved.  The programming team
> for the Apollo moon mission developed a system which, if you would
> write your requirements in a certain way, could generate correct C
> code for them.

Er, what?

C didnt' exist until after the Apollo program was done.

FORTRAN, perhaps?

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


Re: Question(s)

2023-10-24 Thread o1bigtenor via Python-list
On Tue, Oct 24, 2023 at 6:09 PM Thomas Passin via Python-list
 wrote:
>
snip
>
> By now you have read many responses that basically say that you cannot
> prove that a given program has no errors, even apart from the hardware
> question.  Even if it could be done, the kind of specification that you
> would need would in itself be difficult to create, read, and understand,
> and would be subject to bugs itself.
>
> Something less ambitious than a full proof of correctness of an
> arbitrary program can sometimes be achieved.  The programming team for
> the Apollo moon mission developed a system which, if you would write
> your requirements in a certain way, could generate correct C code for them.
>
> You won't be doing that.
>
> Here I want to point out something else.  You say you are just getting
> into programming.  You are going to be making many mistakes and errors,
> and there will be many things about programming you won't understand
> until you get some good solid experience.  That's not anything to do
> with you personally, that's just how it will play out.
>
> So be prepared to learn from your mistakes and bugs.  They are how you
> learn the nuts and bolts of the business of programming.
>

I am fully expecting to make mistakes (grin!).
I have a couple trades tickets - - - I've done more than a touch of technical
learning so mistakes are not scary.

What is interesting about this is the absolute certainty that it is impossible
to program so that that program is provably correct.
Somehow - - - well - - to me that sounds that programming is illogical.

If I set up a set of mathematical problems (linked) I can prove that the
logic structure of my answer is correct.

That's what I'm looking to do with the programming.

(Is that different than the question(s) that I've asked - - - dunno.)

Stimulating interaction for sure (grin!).
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-24 Thread o1bigtenor via Python-list
On Tue, Oct 24, 2023 at 5:28 PM Rob Cliffe  wrote:
>
> There is no general way to prove that a program is "correct".  Or even
> whether it will terminate or loop endlessly.
> These are of course theoretical statements of computer science.  But
> they can be rigorously proven.  (Sorry if I'm just saying this to show
> what a smart-ass I am. )
> In practice, of course, there is often a great deal that can be done to
> "verify" (a word whose meaning I intentionally leave vague) a program's
> correctness.
> In your case, it sounds as if you should
>
>  Write programs or functions to simulate each piece of hardware and
> generate random, but reasonably realistic, data.  (Python and most other
> programming languages provide means of generating random or
> pseudo-random data.)
>  In your main program:
>  Replace the bits of code that accept data from the hardware by
> bits of code that accept data from these simulation programs/functions.
>  Write the decisions it makes to a log file (or files).
>  Run the program as long as you can or until your patience is
> exhausted, and check from the log file(s) that it is behaving as you
> would expect.
>
> This is not guaranteed to catch all possible errors.  (Nothing is.) E.g.
>  The original code to accept data from the hardware (code that you
> remove in your test version of the program) might be wrong. Duh!
>  There might be specific sets of input data that happen not to arise
> in your testing, but that your program logic does not cope with.
> Nonetheless, this sort of testing (if done diligently) can give you a
> high degree of confidence in your program.
> And it is a good idea to do it.
> When you come to run your program "for real", and you have to
> troubleshoot it (as in real life you probably will), you will have
> eliminated simple bugs in your program, and can concentrate on the more
> likely sources of problems (e.g. misbehaving hardware).
>
Interesting - - - hopefully taken in the same vein as your second statement - -
I sorta sounds like programmers keep running around in the forest looking
for trees. (Grin!)

So how does one test software then?

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


Re: Question(s)

2023-10-24 Thread Thomas Passin via Python-list

On 10/24/2023 8:22 AM, o1bigtenor via Python-list wrote:

Greetings

(Sorry for a nebulous subject but dunno how to have a short title for
a complex question.)

I have been using computers for a long time but am only beginning my
foray into the
galaxy of programming. Have done little to this point besides
collection of information
on sensors and working on the logic of what I wish to accomplish. Have
been reading code that accompanies other's projects in the process of
self development.

Is there a way to verify that a program is going to do what it is
supposed to do even
before all the hardware has been assembled and installed and tested?

(Many years ago I remember an article (if not an issue) in Byte magazine about
mathematically proven constructs a.k.a. programs - - - this idea is
what I'm pursuing.
The concept is that in non-trivial programs there are plenty of places where a
poorly placed symbol or lack of a character will result in at best an inaccurate
result and at worst - - - no result. This is the kind of thing
(correct code) that I'm
hoping to accomplish - - - to rephrase the question - - - how do I
test for that?)

TIA


By now you have read many responses that basically say that you cannot 
prove that a given program has no errors, even apart from the hardware 
question.  Even if it could be done, the kind of specification that you 
would need would in itself be difficult to create, read, and understand, 
and would be subject to bugs itself.


Something less ambitious than a full proof of correctness of an 
arbitrary program can sometimes be achieved.  The programming team for 
the Apollo moon mission developed a system which, if you would write 
your requirements in a certain way, could generate correct C code for them.


You won't be doing that.

Here I want to point out something else.  You say you are just getting 
into programming.  You are going to be making many mistakes and errors, 
and there will be many things about programming you won't understand 
until you get some good solid experience.  That's not anything to do 
with you personally, that's just how it will play out.


So be prepared to learn from your mistakes and bugs.  They are how you 
learn the nuts and bolts of the business of programming.


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


Re: Question(s)

2023-10-24 Thread o1bigtenor via Python-list
On Tue, Oct 24, 2023 at 4:54 PM Grant Edwards via Python-list
 wrote:
>
> On 2023-10-24, Dan Purgert via Python-list  wrote:
> > On 2023-10-24, o1bigtenor wrote:
> >> Greetings
> >>
> >> (Sorry for a nebulous subject but dunno how to have a short title for
> >> a complex question.)
> >> [...]
> >> Is there a way to verify that a program is going to do what it is
> >> supposed to do even before all the hardware has been assembled and
> >> installed and tested?
> >
> > In short, no.
> >
> > Reality is a mess, and even if you've programmed/perfectly/ to the
> > datasheets (and passed our unit-tests that are also based on those
> > datasheets), a piece of hardware may not actually conform to what's
> > written.  Maybe the sheet is wrong, maybe the hardware is faulty, etc.
>
> And the specified customer requirements are usually wrong too. Sure,
> the customer said it is supposed to do X, but what they actually
> needed was Y.
>
> And the protocol spec isn't quite right either.  Sure, it says "when A
> is received reply with B", but what everybody really does is slighty
> different, and you need to do what everybody else does, or the widget
> you're talking to won't cooperate.
>
> And floating point doesn't really work the way you think it
> does. Sometimes it does, close-enough, for the test-cases you happened
> to choose...
>
Fascinating - - - except here I get to wear almost all of the hats.
I'm putting together the hardware, I get to do the programming and I
will be running the completed equipment.

I am asking so that I'm not chasing my tail for inordinate amounts of time
- - - grin!

Interesting ideas so far.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-24 Thread Barry via Python-list



> On 24 Oct 2023, at 18:25, o1bigtenor via Python-list  
> wrote:
> 
> Is there a way to verify that a program is going to do what it is
> supposed to do

In the general case not proven to be not possible.
Have a read about the halting problem 
https://en.wikipedia.org/wiki/Halting_problem

It is common to simulate hardware that does not exist yet and run software in 
the simulated environment.

Barry

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


Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, Dan Purgert via Python-list  wrote:
> On 2023-10-24, o1bigtenor wrote:
>> Greetings
>>
>> (Sorry for a nebulous subject but dunno how to have a short title for
>> a complex question.)
>> [...]
>> Is there a way to verify that a program is going to do what it is
>> supposed to do even before all the hardware has been assembled and
>> installed and tested?
>
> In short, no.
>
> Reality is a mess, and even if you've programmed/perfectly/ to the
> datasheets (and passed our unit-tests that are also based on those
> datasheets), a piece of hardware may not actually conform to what's
> written.  Maybe the sheet is wrong, maybe the hardware is faulty, etc.

And the specified customer requirements are usually wrong too. Sure,
the customer said it is supposed to do X, but what they actually
needed was Y.

And the protocol spec isn't quite right either.  Sure, it says "when A
is received reply with B", but what everybody really does is slighty
different, and you need to do what everybody else does, or the widget
you're talking to won't cooperate.

And floating point doesn't really work the way you think it
does. Sometimes it does, close-enough, for the test-cases you happened
to choose...





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


Re: Question(s)

2023-10-24 Thread Dan Purgert via Python-list
On 2023-10-24, o1bigtenor wrote:
> Greetings
>
> (Sorry for a nebulous subject but dunno how to have a short title for
> a complex question.)
> [...]
> Is there a way to verify that a program is going to do what it is
> supposed to do even
> before all the hardware has been assembled and installed and tested?

In short, no.

Reality is a mess, and even if you've programmed/perfectly/ to the
datasheets (and passed our unit-tests that are also based on those
datasheets), a piece of hardware may not actually conform to what's
written.  Maybe the sheet is wrong, maybe the hardware is faulty, etc.



-- 
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1  E067 6D65 70E5 4CE7 2860
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, o1bigtenor via Python-list  wrote:

> Is there a way to verify that a program is going to do what it is
> supposed to do even before all the hardware has been assembled and
> installed and tested?

It depends on what you mean by "verify ...".  If you want to prove a
program correct (in the mathematical sense), then the practical answer
is no. It's possible to prove _some_ programs correct, but they tend to
be uselessly trivial.

For real programs, the best you can do is choose a good set of test
cases and test them.  If you can simulate the various inputs and
collect the outputs, then you can do testing before you have real
target hardware.


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


Re: Question(s)

2023-10-24 Thread Dom Grigonis via Python-list
I don’t think there i a simple answer to this, although if you find something 
interesting, please share.

From my experience, industry is applying variety of testing methods. Starting 
from lowest level components and implementing unit tests, finishing with 
end-to-end testing platforms.

https://www.atlassian.com/continuous-delivery/software-testing/types-of-software-testing
 


Modular programming paradigm, IMO, is one of the solutions to this problem. 
Then, each component is a flexible program in itself that can be combined with 
others. This way, code is re-used by many people and code is well tested and 
issues are quick to surface.

As far as I know, unix/linux has a big emphasis on modularity in contrast with 
monolithic approach of windows, which could be one of the big reasons why (at 
least from my perspective) working in unix environment is so much more pleasant.

https://en.wikipedia.org/wiki/Unix_philosophy 


Regards,
DG

> On 24 Oct 2023, at 15:22, o1bigtenor via Python-list  
> wrote:
> 
> Greetings
> 
> (Sorry for a nebulous subject but dunno how to have a short title for
> a complex question.)
> 
> I have been using computers for a long time but am only beginning my
> foray into the
> galaxy of programming. Have done little to this point besides
> collection of information
> on sensors and working on the logic of what I wish to accomplish. Have
> been reading code that accompanies other's projects in the process of
> self development.
> 
> Is there a way to verify that a program is going to do what it is
> supposed to do even
> before all the hardware has been assembled and installed and tested?
> 
> (Many years ago I remember an article (if not an issue) in Byte magazine about
> mathematically proven constructs a.k.a. programs - - - this idea is
> what I'm pursuing.
> The concept is that in non-trivial programs there are plenty of places where a
> poorly placed symbol or lack of a character will result in at best an 
> inaccurate
> result and at worst - - - no result. This is the kind of thing
> (correct code) that I'm
> hoping to accomplish - - - to rephrase the question - - - how do I
> test for that?)
> 
> TIA
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


Question(s)

2023-10-24 Thread o1bigtenor via Python-list
Greetings

(Sorry for a nebulous subject but dunno how to have a short title for
a complex question.)

I have been using computers for a long time but am only beginning my
foray into the
galaxy of programming. Have done little to this point besides
collection of information
on sensors and working on the logic of what I wish to accomplish. Have
been reading code that accompanies other's projects in the process of
self development.

Is there a way to verify that a program is going to do what it is
supposed to do even
before all the hardware has been assembled and installed and tested?

(Many years ago I remember an article (if not an issue) in Byte magazine about
mathematically proven constructs a.k.a. programs - - - this idea is
what I'm pursuing.
The concept is that in non-trivial programs there are plenty of places where a
poorly placed symbol or lack of a character will result in at best an inaccurate
result and at worst - - - no result. This is the kind of thing
(correct code) that I'm
hoping to accomplish - - - to rephrase the question - - - how do I
test for that?)

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


Re: tinker Form question(s)

2020-09-07 Thread Peter Otten
Steve wrote:

> I am not sure how to post the code for my file here, is copy/paste the
> best way?

Yes. Try to paste only the relevant parts, or, if possible, post a small 
self-contained example that can be run by the reader without further 
editing.

> Is there another? I understand that attachments are stripped
> off.
> 
> """
> The following segment of code returns values of "spec".
> I would like to have it return the associated value of
> "DataLine" with each spec. It would also be nice to understand
> how this code works to hold/return the information.
> 
> In pseudocode, a line something like:
> 
> DataReturned = DataLine + " " + spec)
> New_Specs.append(DataReturned)
> 
> explains what I would like to have returned.

>  return ([spec.get()for spec in New_Specs])

[spec.get() for spec in New_Specs]

is called "list comprehension" and is syntactic sugar for a list-creating 
loop like

result = []
for spec in New_Specs:
result.append(spec.get())


The relevant parts of the loop where you set up the GUI and the New_Specs 
list:

>  New_Specs = []
>  for lineItem in range(len(ThisList)):
>  DataLine, Spec = GetLineByItem(ThisList[y])
...
>  NewSpec = tk.StringVar()
>  New_Specs.append(NewSpec)

First, using range(len(ThisList)) is almost always superfluous as you can 
iterate over the list directly. In your case:

>  New_Specs = []
   for item in ThisList:
>  DataLine, Spec = GetLineByItem(item)
...
>  NewSpec = tk.StringVar()
>  New_Specs.append(NewSpec)

Now, as you need DataLine later-on why not keep a copy? So let's turn 
New_Specs into a list of StringVar, DataLine tuples:

>  New_Specs = []
   for item in ThisList:
>  DataLine, Spec = GetLineByItem(item)
...
>  NewSpec = tk.StringVar()
   New_Specs.append((NewSpec, DataLine))

When the function terminates (there is a mainloop() missing) you can create 
and return the result:

# long form, with a loop
result = []
for spec, dataline in New_Specs:
result.append(dataline + " " + spec.get())
return result

# alternative using a listcomp:
return [dataline + " " + spec.get() for spec, dataline in New_specs]




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


tinker Form question(s)

2020-09-07 Thread Steve
I am not sure how to post the code for my file here, is copy/paste the best
way? Is there another? I understand that attachments are stripped off.

"""
The following segment of code returns values of "spec".
I would like to have it return the associated value of
"DataLine" with each spec. It would also be nice to understand 
how this code works to hold/return the information.

In pseudocode, a line something like:

DataReturned = DataLine + " " + spec)
New_Specs.append(DataReturned)

explains what I would like to have returned.


"""
 New_Specs = []
 OldSpec = ItemID 
 NewSpec = " "
 OldLine = ItemID
 x = 3
 y = 0
 
 for lineItem in range(len(ThisList)):
 DataLine, Spec = GetLineByItem(ThisList[y])
 
 SVRlabel = ttk.Label(window, width = BoxWidth1, text = DataLine)
 SVRlabel.grid(column = 1, row = x,  sticky=tk.W)
 
 SVRlabel = ttk.Label(window, width = BoxWidth2, text = Spec)
 SVRlabel.grid(column = 2, row = x)

 NewSpec = tk.StringVar()
 New_Specs.append(NewSpec)
  
 SVRCodeEntered = ttk.Entry(window, width = BoxWidth3, textvariable
= NewSpec)
 SVRlabel = ttk.Entry(window, width = BoxWidth3, textvariable =
NewSpec)

 SVRlabel.grid(column = 3, row = x, pady = 5, sticky=tk.W)
 
 SVRCodeEntered.grid(column = 3, row = x, pady = 5, padx = 15,
sticky=tk.W)
 SVRCodeEntered.insert(0, OldSpec)
 
 x += 1 
 y += 1

 return ([spec.get()for spec in New_Specs])

==
Steve
=
Footnote:
Some mornings it just isn't worth chewing through the leather straps.


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