I'm not sure about the differences between importing in python 2 vs 3. I'll
look into it more. I did try running python3 interactively in the libpruio
directory and tried an import directly.
debian@beaglebone:~/src/pruio_examples/libpruio$ ls
__init__.py __pycache__ ctypesloader.pyc pruio.pyc
__init__.pyc ctypesloader.py pruio.py
debian@beaglebone:~/src/pruio_examples/libpruio$ python3
Python 3.5.3 (default, Jul 9 2020, 13:00:10)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pruio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/debian/src/pruio_examples/libpruio/pruio.py", line 3, in
<module>
from ctypesloader import *
File "/home/debian/src/pruio_examples/libpruio/ctypesloader.py", line 375
except OSError,e:
^
SyntaxError: invalid syntax
I think that line should read "except OSError as e:" to be valid python 3.
I changed that and got another error.
debian@beaglebone:~/src/pruio_examples/libpruio$ vim ctypesloader.py
debian@beaglebone:~/src/pruio_examples/libpruio$ python3
Python 3.5.3 (default, Jul 9 2020, 13:00:10)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pruio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/debian/src/pruio_examples/libpruio/pruio.py", line 3, in
<module>
from ctypesloader import *
File "/home/debian/src/pruio_examples/libpruio/ctypesloader.py", line 48,
in <module>
class UserString:
File "/home/debian/src/pruio_examples/libpruio/ctypesloader.py", line
100, in UserString
def count(self, sub, start=0, end=sys.maxint):
AttributeError: module 'sys' has no attribute 'maxint'
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/67822a3e-476f-45ac-896f-7c455eb3cdb4n%40googlegroups.com.