Board index FlightGear Support Tools ATC-pie

Python on Mac OS eats my ATC-Pie for lunch

ATC-pie is a radar air traffic control simulation program for the FlightGear multi-player network.

Python on Mac OS eats my ATC-Pie for lunch

Postby Hevii Guy » Tue Feb 20, 2018 9:18 pm

I can't run ATC-Pie from a start-up script intended to be dropped onto my Dock as a convenient shortcut.

Micky's earlier suggestion of entering
Code: Select all
PYTHONIOENCODING=utf8 python3 ATC-pie.py
as the executable to run ATC-Pie worked great when I invoked it either directly or via a bash script - as long as I did it from the Terminal. However, when I tried to create an .app running the bash script to invoke the python executable (with either Platypus or Automator), the program hung. In case somebody is wondering, I'm throwing a bash script into the mix because I'm not sure how I could otherwise create the shortcut app. In any case, I'm almost certain that my problem has something to do with which python is being called (I've got 2.7 and 3.4 installed). Unfortunately, after a very long exercise of cleaning up my Paths, I still don't have it right :( First of all, here's my script (it's in the same directory as ATC-pie.py):
Code: Select all
#!/bin/sh
PYTHONIOENCODING=utf8 python3 ATC-pie.py

And here's my path:
Code: Select all
heviiguy@heviiApfel Resources$ echo $PATH                                     
/opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/opt/local/sbin:/opt/X11/bin:/usr/local/MacGPG2/bin:/Library/TeX/texbin:/usr/local/mysql/bin:/usr/local/php5/bin:/Applications/davinci.app/Contents/Resources/bin:/Applications/Argyll_V1.9.2/bin:/Applications/enblend-enfuse-4.0-mac:/Applications/McGimp-2.9-std.app/Contents/MacOS

This is what happens when I directly run the python script from my terminal...
Code: Select all
heviiguy@heviiApfel Resources$ cd /Users/heviiguy/Programs/FlightGear/ATC-Pie/Code/         
heviiguy@heviiApfel Code$ PYTHONIOENCODING=utf8 python3 ATC-pie.py
Loading aircraft & airline data... done.
Reading world navigation data... done.
Speech recognition modules not found; voice instructions disabled.
Speech synthesis module not found; pilot read-back disabled.
Setting up session 7681-0 in AD mode at location LSZR...
No elevation map found; using field elevation.
Radar position is: 47°29'15.49''N 9°33'9.63''E
No background image list found.
Closing main window.
heviiguy@heviiApfel Code$

As the above shows, it works as expected. It also works if I call the bash script...
Code: Select all
heviiguy@heviiApfel Code$ ./ATC-Pie.sh
Loading aircraft & airline data... done.
Reading world navigation data... done.
Speech recognition modules not found; voice instructions disabled.
Speech synthesis module not found; pilot read-back disabled.
Setting up session 9975-0 in AD mode at location LSZR...
No elevation map found; using field elevation.
Radar position is: 47°29'15.49''N 9°33'9.63''E
No background image list found.
Closing main window.
heviiguy@heviiApfel Code$

Yet, if I try to run the same code from Automator,it hangs :cry:
Here's the Automator entry:
Code: Select all
cd /Users/heviiguy/Programs/FlightGear/ATC-Pie/Code/
PYTHONIOENCODING=utf8 python3 ATC-pie.py

This is the output...
The action"Run Shell Script" encountered an error"
-: line 1: python3: command not found

And even when tell it where to find python3, it refuses to play nicely...
Code: Select all
cd /Users/heviiguy/Programs/FlightGear/ATC-Pie/Code/
/opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin/python3 PYTHONIOENCODING=utf8 python3 ATC-pie.py

This is the resultant dialogue:
/opt/local/Library/Frameworks/Python.framework/Versions/3.4/Resources/Python.app/Contents/MacOS/Python: can't open file 'PYTHONIOENCODING=utf8': [Errno 2] No such file or directory

Arrrgggghhhhh :twisted:
Any suggestions? They would be most welcome!
Hevii Guy
 
Posts: 42
Joined: Wed Mar 23, 2016 4:40 pm
Location: Global
Callsign: CH-HEVI
Version: 2017.3.1
OS: Mac OS 10.11.6

Return to ATC-pie

Who is online

Users browsing this forum: No registered users and 2 guests