Issues Setting Up Python Script (Rookie Mistake)

#1

Hello All,

Any issues why I'm getting the errors? I have installed Python 3. Not too sure!

Thanks in advance!

0 Likes

#2

Step 1: Check out the error message.
It says there's a Syntax Error on the print function. That means your script is running on Python 2, not Python 3.

Step 2: Look at the "Launch Path"
The "Launch Path" tells BTT which version of Python is used to execute your script (i.e. the interpreter). "/usr/bin/python" is the path to the version Python that comes preinstalled on all Macs... which is Python 2.

Step 3: Change the "Launch Path"
Try changing the "Launch Path" to "/usr/bin/python3".

1 Like

#3

Hey I tried that and it just crashes BTT, any ideas?

0 Likes

#4

Interesting. I just tried setting the Launch Path to "/usr/bin/python3" and BTT crashed when I ran the script.

1 Like

#5

Try this:

1 Like

#6

Hey that seems to have worked!! Is there a way to make "hello world" print when you press the icon on the TB? so if the button says "HW" once pressed shows "hello world" ?

0 Likes

#7

Yes.

Step 1:
Create a "Widget/Gesture".

Step 2:
Select the "Run Shell Script and Show Return Value" widget.

Step 3:
Input this... and then click "Save".

Step 4:
Under "Predefined Action", select "Execute Shell Script/Task".

Step 5:
Input this... and then click "Save".

1 Like

#8

Wow, fast reply. Thanks so much!!!! Have a great weekend!!!

Gabe

1 Like

#9

My pleasure. Don't hesitate to ask more questions if you have any. I'll see if I can help.

0 Likes

#10

Moved to #discussion thread, no presets found in this post :wink:

0 Likes