Phypton for Beaglebone

109 views
Skip to first unread message

hcasalnc...@gmail.com

unread,
Aug 22, 2018, 10:20:54 AM8/22/18
to BeagleBoard
Hello

Can the beaglebone support the phypton 3.7

Dennis Lee Bieber

unread,
Aug 22, 2018, 12:24:37 PM8/22/18
to beagl...@googlegroups.com
On Wed, 22 Aug 2018 07:20:54 -0700 (PDT),
hcasalnc...@gmail.com declaimed the
following:

>Hello
>
>Can the beaglebone support the phypton 3.7

You seem to keep asking this (and have yet to correctly spell PYTHON).
The June 2018 image comes with

debian@beaglebone:~$ uname -a
Linux beaglebone 4.14.49-ti-r54 #1 SMP PREEMPT Fri Jun 15 22:14:13 UTC 2018
armv7l GNU/Linux
debian@beaglebone:~$ python --version
Python 2.7.13
debian@beaglebone:~$ python3 --version
Python 3.5.3
debian@beaglebone:~$

Python 3.7 was only released June 27 2018 -- that is almost two weeks
AFTER the
http://debian.beagleboard.org/images/bone-debian-9.4-lxqt-armhf-2018-06-17-4gb.img.xz
image was built. Python 3.5.3 was released January 17 2017 -- I estimate
3.7 will show up on Debian sometime in late 2019.

According to https://packages.debian.org/search?keywords=python3.7 it
is currently in the testing release of "Buster", which will be the next
major Debian release. 3.6 is also in testing. Neither have been
"back-ported" to "Stretch" (which is the current OS release).

Debian is not known for "bleeding edge" applications. Their goal is to
only release well-tested/stable applications.

Ubuntu is known for bleeding edge, and looking at its package list
https://packages.ubuntu.com/search?keywords=python3.7 18.04LTS (bionic) has
a /beta/ release of Python 3.7, a formal release of 3.7 won't appear on it
for some time. The current 16.04LTS is running 3.5, and 18.04LTS has
non-beta Python 3.6.

So -- not even Ubuntu currently provides what you are asking.

If you want something newer on Debian, you will likely have to build it
yourself, from sources. Otherwise you will have to wait for Debian Buster
to be released, followed by the creation of images for the Beaglebone
(which will likely be a few months more after Debian release date). You
might be able to use the instructions at
https://www.scivision.co/compile-install-python-beta-raspberry-pi/ in order
to build your own Python release on the BBB, since both currently run
variations of Debian Stretch (note: at the time of that page, 3.7 was only
in beta; you'd now get the release source files). Do expect the process
time to be longer on the BBB, and make sure you are running on a large SD
card for all the scratch files that will be generated.



--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/

hcasalncasal1963

unread,
Aug 22, 2018, 3:44:11 PM8/22/18
to Dennis Lee Bieber, beagl...@googlegroups.com
Thank you for your responses. 
I am sorry,  I made a mistake.  Yes,  I refer to Python software. 

I am a beginner,  and I would like to learn python to write basic programs in the Beaglebone board. 

I need to handle its analog /digital  inputs and outputs for a telemetry project .

I read about programing software and I believe Python is easy to begin to learn 

If I understood Well your explanation , for now I should use python 3. 5 and ubuntu for my projects. Is it correct? 

I apologize if I make mistake  but my native language is spanish



Regards 




Enviado desde mi Samsung Mobile de Claro
-------- Mensaje original --------
De: Dennis Lee Bieber <wlf...@ix.netcom.com>
Fecha: 8/22/2018 11:24 (GMT-05:00)
Asunto: [beagleboard] Re: Phypton for Beaglebone

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/ep0rnd52f2lkvh382ncur4n04en3c414a0%404ax.com.
For more options, visit https://groups.google.com/d/optout.

Dennis Lee Bieber

unread,
Aug 22, 2018, 3:47:35 PM8/22/18
to beagl...@googlegroups.com
On Wed, 22 Aug 2018 12:24:19 -0400, Dennis Lee Bieber
<wlf...@ix.netcom.com> declaimed the following:


>might be able to use the instructions at
>https://www.scivision.co/compile-install-python-beta-raspberry-pi/ in order
>to build your own Python release on the BBB, since both currently run

Just on a whim, I tried following those instructions. I started getting
"internal compiler error" "killed" part way through the "make" step. I
didn't bother digging deeper, but suspect I need to attach a USB hard-drive
and create a swap file/partition. GCC was probably running out of RAM (only
512kB vs recent R-Pi at 1024kB).

Dennis Lee Bieber

unread,
Aug 22, 2018, 4:02:37 PM8/22/18
to beagl...@googlegroups.com
On Wed, 22 Aug 2018 14:44:11 -0500, hcasalncasal1963
<hcasalnc...@gmail.com> declaimed the
following:

>If I understood Well your explanation , for now I should use python 3. 5 and ubuntu for my projects. Is it correct? 

Just use the Python that comes on the Beaglebone -- it has both 2.7 and
3.5 already in the normal (lxqt) install (don't even consider Ubuntu).

"python" will run using 2.7
"python3" will run using 3.5

debian@beaglebone:~$ uname -a
Linux beaglebone 4.14.49-ti-r54 #1 SMP PREEMPT Fri Jun 15 22:14:13 UTC 2018
armv7l GNU/Linux
debian@beaglebone:~$ python --version
Python 2.7.13
debian@beaglebone:~$ python3 --version
Python 3.5.3
debian@beaglebone:~$


hcasalncasal1963

unread,
Aug 23, 2018, 9:26:13 AM8/23/18
to Dennis Lee Bieber, beagl...@googlegroups.com
Thank you 



Enviado desde mi Samsung Mobile de Claro
-------- Mensaje original --------
De: Dennis Lee Bieber <wlf...@ix.netcom.com>
Fecha: 8/22/2018 15:02 (GMT-05:00)
Asunto: [beagleboard] Re: Phypton for Beaglebone

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

Hugo Casal

unread,
Aug 26, 2018, 1:34:24 AM8/26/18
to beagl...@googlegroups.com
Hello Dennis
I am trying to write my first  code in python, I am  sending an email in python. I wrote this code , but forever generate  an error, I don't know how to find it.
image.png
Here the screenshot with the code and error messages.
Do you have some suggestion that I can to use to eliminate this errors? I would like to learn python step by step  before to write a code for beagle bone black
thanks

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

Dennis Lee Bieber

unread,
Aug 26, 2018, 10:52:05 AM8/26/18
to beagl...@googlegroups.com
On Sun, 26 Aug 2018 00:34:00 -0500, Hugo Casal
<hcasalnc...@gmail.com> declaimed the
following:


>[image: image.png]
>Here the screenshot with the code and error messages.

PLEASE DON'T DO SCREEN SHOTS.

It's a TEXT CONSOLE -- you can cut and paste the text. A typical
console is only around 200 characters (bytes), not something that is 52000
bytes and is unreadable in my news client. I have to extract the image as a
separate file and open it in a graphics viewer to see it. And even then it
is too coarse a resolution for easy reading.

>Do you have some suggestion that I can to use to eliminate this errors? I

First: You managed to cut off the bottom of the error traceback so
there is no indication of the real error message. We need the entire
traceback for debugging purposes.

Second: You are entering your code in the interactive prompt, so
figuring out what line number in the trace back maps to a line in the
source is difficult. Put your code into a file, using your favorite editor,
and run it using
python the_source_file.py
(or python3 if you prefer to use that instead of the default python 2)

Using a file also means you don't have to retype everything when you
make a mistake.

THIRD -- YOU NEED TO CHANGE YOUR PASSWORD FOR THAT ACCOUNT. YOU JUST
SENT THE PASSWORD TO EVERYONE READING THIS GROUP!

Fourth: you are using gmail, which is a mess to use when not coming in
through their web-site; they change certificates every couple of weeks
which plays hob with old mail clients that don't know about the newest
certificate servers, and require one to do special actions if not using one
of their approved clients.

https://www.wpsitecare.com/gmail-smtp-settings/
(read the part starting with "Gmail Wants to make Your Life Difficult"

>would like to learn python step by step before to write a code for beagle

Using complex internet protocols as a "beginner" is /not/ learning
"step by step". {granted -- a week after discovering Python for the Amiga
[version 1.4, I think], I did write a minimal outgoing SMTPd controlled by
an AREXX submittal script invoked by AmigaELM... But I also have an old
degree in comp.sci. and spent some time reading the SMTP related RFC and
the source code for the SMTPd that was NOT working correctly [it wasn't
handshaking CC and BCC addresses, so only TO recipients were getting the
email]}.

As a beginner for the language, you should read the Python Language
Reference https://docs.python.org/3/reference/index.html , the Tutorial
https://docs.python.org/3/tutorial/index.html , and chapter 4 of the
Library manual https://docs.python.org/3/library/index.html . (Those should
be available packaged with most Python installs, but I can't state what
Debian does with them -- ActiveState packages them as Windows Help files).

For the BBB, you'll also want to look at the documentation for
Adafruit_BBIO
https://adafruit-beaglebone-io-python.readthedocs.io/en/latest/
https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/using-the-bbio-library
(you can download a PDF from the second)

Fifth: Toggling an LED on the BBB is going to be much easier than
configuring to send a properly formatted email message. See the email
format RFC https://tools.ietf.org/html/rfc5322 . At a minimum, you need a
few headers and a body; the body is separated from the headers by a blank
line. Your "moviemento" (or whatever it was) is being seen as an unknown
header field. Consider:

text = """\ #backslash so the newline is NOT included here
TO: <stuff in some address>
FROM: <stuff in another address>
SUBJECT: example email message format
DATE: <put in some date>

This is the body, it must have a blank line before it,
and can be any number of lines; please break the lines
at less than 80 characters (70 preferred).
"""

Rather than formatting that by hand, read the documentation for the
email module https://docs.python.org/3/library/email.html
{Note: I used the interactive mode as I was discovering what the module
does; it didn't exist back when I wrote that SMTPd; also, it is undergoing
some changes -- Python 3.6 adds message.EmailMessage with different
methods}


>>> from email import message
>>> from email import generator
>>> from email import utils
>>> em = message.Message()
>>> em["To"] = "Me Myself and I <wlf...@ix.netcom.com>"
>>> em["From"] = "Me and My Shadow <wlf...@ix.netcom.com>"
>>> em["Subject"] = "Example email message format"
>>> em["Date"] = utils.formatdate()
>>> em.set_default_type("text/plain")
>>> text = """This is the body, it must have a blank line before it,
... and can be any number of lines; please break the lines
... at less than 80 characters (70 preferred).
... """
>>> text
'This is the body, it must have a blank line before it,\nand can be any
number of lines; please break the lines\nat less than 80 characters (70
preferred).\n'
>>> em.set_payload(text)
>>>
>>> import sys
>>> emgen = generator.Generator(sys.stdout)
>>> emgen.flatten(em)
To: Me Myself and I <wlf...@ix.netcom.com>
From: Me and My Shadow <wlf...@ix.netcom.com>
Subject: Example email message format
Date: Sun, 26 Aug 2018 14:43:16 -0000

This is the body, it must have a blank line before it,
and can be any number of lines; please break the lines
at less than 80 characters (70 preferred).
Reply all
Reply to author
Forward
0 new messages