Python Forum
can anyone help convert to python3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can anyone help convert to python3
#21
Chown /home/pi pi:pi.
Reply
#22
See post 12 again. Also, do take time to read the link I gave you on permissions.
Reply
#23
I think i have now changed it to pi.
pi@raspberrypi:~ $ sudo chown -R pi:pi /home/pi/tracker
pi@raspberrypi:~ $ ls -l /home/pi | grep tracker
drwxr-xr-x 4 pi   pi   4096 Jul 16 22:28 tracker
pi@raspberrypi:~ $
Reply
#24
Yep and the files should be OK as well, since -R does that recursively. Try running 2to3 again and see if you encounter any more problems.
Reply
#25
That now looks ok.
pi@raspberrypi:~ $ 2to3 -w /home/pi/tracker
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: No changes to /home/pi/tracker/audio.py
RefactoringTool: No changes to /home/pi/tracker/calibration.py
RefactoringTool: No changes to /home/pi/tracker/calibrationGraphics.py
RefactoringTool: No changes to /home/pi/tracker/compass.py
RefactoringTool: No changes to /home/pi/tracker/contacts.py
RefactoringTool: No changes to /home/pi/tracker/graphics.py
RefactoringTool: No changes to /home/pi/tracker/main.py
RefactoringTool: Refactored /home/pi/tracker/pyscope.py
--- /home/pi/tracker/pyscope.py (original)
+++ /home/pi/tracker/pyscope.py (refactored)
@@ -24,7 +24,7 @@
             try:
                 pygame.display.init()
             except pygame.error:
-                print 'Driver: {0} failed.'.format(driver)
+                print('Driver: {0} failed.'.format(driver))
                 continue
             found = True
             break
RefactoringTool: No changes to /home/pi/tracker/resources.py
RefactoringTool: Can't parse /home/pi/tracker/rotate.py: ParseError: bad input:                                                                                                  type=3, value='"""Rotates a point around another centerPoint. Angle is in degree                                                                                                 s. Rotation is counter-clockwise"""', context=('', (2, 0))
RefactoringTool: No changes to /home/pi/tracker/startup.py
RefactoringTool: Files that were modified:
RefactoringTool: /home/pi/tracker/audio.py
RefactoringTool: /home/pi/tracker/calibration.py
RefactoringTool: /home/pi/tracker/calibrationGraphics.py
RefactoringTool: /home/pi/tracker/compass.py
RefactoringTool: /home/pi/tracker/contacts.py
RefactoringTool: /home/pi/tracker/graphics.py
RefactoringTool: /home/pi/tracker/main.py
RefactoringTool: /home/pi/tracker/pyscope.py
RefactoringTool: /home/pi/tracker/resources.py
RefactoringTool: /home/pi/tracker/startup.py
RefactoringTool: There was 1 error:
RefactoringTool: Can't parse /home/pi/tracker/rotate.py: ParseError: bad input:                                                                                                  type=3, value='"""Rotates a point around another centerPoint. Angle is in degree                                                                                                 s. Rotation is counter-clockwise"""', context=('', (2, 0))
pi@raspberrypi:~ $

That now works using Thonny, after using 2to3. when before it would not.
Thanks for all the help.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  convert string into multiple columns in python3 VAN 2 2,779 Sep-26-2020, 11:14 PM
Last Post: scidam
  python3 convert hex to binary 32 bit Mkt 3 3,966 Aug-28-2020, 02:34 PM
Last Post: Mkt
  Gnuradio python3 is not compatible python3 xmlrpc library How Can I Fix İt ? muratoznnnn 3 4,929 Nov-07-2019, 05:47 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020