asweigart / bext

A cross-platform Python 2/3 module for colorful, text-based terminal programs.
Other
18 stars 2 forks source link

goto is broken in 0.0.7 for unix/macos #3

Open davebur opened 2 years ago

davebur commented 2 years ago

in init.py, I was able to fix goto by going to line 650 and re-inserting:

elif currentPlatform == 'unix':

macOS and Linux:

import tty, termios, select, codecs  # Used by getKey()
getKey = GetKeyUnix().getkey
goto = _goto_control_code

That restored it and I was able to get the bouncing DVD logo's program from chapter 5 of your book to run then. Not sure what the right fix is, but 0.0.7 appears broken at the moment. It also fixed the example rotating_cube.py too. This is on linux with with python3.9 and bext-0.0.7.

karlWenninger commented 2 years ago

hey I've been going through Big Book of Small Python Projects (thanks!). When trying to run the bouncingdvd project on a Mac I got:

NameError: name 'goto' is not defined

I got this error after trying to run the version of the program that I copied from the book and your version of the program that I downloaded. a few google clicks brought me to this page. After reading @davebur 's comment I pasted

goto = _goto_control_code

on line 651 of the bext init.py file and everything seems to be working. Thank you both!