Old 01-13-2018, 03:35 AM   #1
snooks
Human being with feelings
 
Join Date: Sep 2015
Posts: 1,471
Default Could a Mac user please test this Python code...

It's in the ReaChorder thread, which has been around for a while so you might not have seen the possible fixes for Tkinter GUI windows in Python ReaScript on Mac that Veto has put together on page 2...

https://forum.cockos.com/showthread.php?t=200185&page=2

It would be good to have a answer to this question.
snooks is offline   Reply With Quote
Old 01-13-2018, 04:01 AM   #2
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,002
Default

Thank you for your contribution snooks.

IMHO, it would be very convenient to have a separate thread for OSX users who want to use Reachorder.
Cause the current Reachorder thread is becoming really large and it becomes cumbersome to lookup.

In the new OSX thread, it would be nice for starters, for rookies, to have a very detailed explanation of:

- which exact version of Python-OSX to install, and where exactly to get that version.
Sidenote: I am on OSX 10.13 and i can't even get a regular python installer (from python website) to install, cause it gives me an error that there is nothing to install
So had to look for other ways to install python (like via homebrew).

- Where to get the right installer(s) for installing Tkinter OSX and exactly what to do to have it installed correctly.

I think these above 2 are really important: to be sure you have correct version of python-osx correctly installed and also Tkinter.
When you know these installs are 100% correct, dan we can go from there to handle the issue(s) that occur when executing Reachorder.
vanhaze is online now   Reply With Quote
Old 01-13-2018, 02:17 PM   #3
Veto
Human being with feelings
 
Join Date: Aug 2010
Posts: 767
Default

Quote:
Originally Posted by vanhaze View Post
- which exact version of Python-OSX to install, and where exactly to get that version.
Sidenote: I am on OSX 10.13 and i can't even get a regular python installer (from python website) to install, cause it gives me an error that there is nothing to install
So had to look for other ways to install python (like via homebrew).
I would go with the latest Python 3 version. Flaneurette specified version 3.3 as minimum for ReaChorder but chances are good it works with lower 3.x versions too (when it works ).
Quote:
Originally Posted by vanhaze View Post
When you know these installs are 100% correct, dan we can go from there to handle the issue(s) that occur when executing Reachorder.
Spot on, I can't agree more. Especially because ReaChorder masks error messages in it's current version (errors won't pop up).
So once again it's best to test this script first (IIRC you had that running at one point Vanhaze):
Quote:
Originally Posted by Veto View Post
Successfully running following "hello world" test script (Action list > Reascript: New > Paste everything into new file and save with .py extension)
PHP Code:
from sws_python import *
from tkinter import *

RPR_APITest() 
means that
  1. Reaper can see your Python installation
  2. Reaper can import the SWS Reascript modules and
  3. the correct version (Python 3.x) of the Tkinter GUI library is installed
---
Note: I deleted my previous post concerning Python and Tkinter installation on OSX because I just found this. So if you want to install a specific version please read thoroughly:
https://www.python.org/download/mac/tcltk/
Veto is offline   Reply With Quote
Old 01-13-2018, 02:32 PM   #4
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,002
Default

Hi Veto, i respect your everlasting help to this thread, you have good Karma !

I just ran that "Hello World" python script again (i have done some Reaper beta updates in between, and it has been awhile) and here is the outcome:

- I execute the script in Reaper Main Window.
A popup Window appears, stating "API test Hello, world"

- I opened MIDI editor, then opened Action list (choosing section Main) and ran the script:
A popup Window appears, stating "API test Hello, world"

- Using Python OSX 3.3 (is seen by Reaper)
Sidenote: I am not sure anymore how exactly i installed this Python version.
I do know that the v3.3 installer from the official python website gave me an error when i started install "can't install because there is nothing to install"
I think i then installed 3.3 by means of homebew.

- Reaper Reaper 5.71pre12
- OSX 10.13.2
- I installed this version of Tkinter:
https://www.python.org/download/mac/...vetcl-8-5-18-0
vanhaze is online now   Reply With Quote
Old 01-13-2018, 05:14 PM   #5
Veto
Human being with feelings
 
Join Date: Aug 2010
Posts: 767
Default

My enemies might not agree but thank you

So you have Python on Reaper running, can run the SWS modules, have the correct Tkinter version installed and also use the recommended Tk/Tcl version.
(For a better understanding: Tkinter is the Python Interface to Tk, a GUI-Toolkit for the scripting language Tcl. I mistakenly thought Tk/Tcl would work out of the box on OSX but according to that official note the underlying issue of all the hassle is that it seems not to)


===
Some things you could try if you like to go on:

When you run this test script in Reaper what do you get?
PHP Code:
import sys
import tkinter

RPR_ShowConsoleMsg
(sys.version+"\n\n")
RPR_ShowConsoleMsg(tkinter.TkVersion

Then you could try all those test cases in this post to see if that helps.
If you don't know how to comment (deactivate) or uncomment (activate) blocks of code in Python have a look here:
http://www.afterhoursprogramming.com...thon/Comments/

If you don't see any improvement I really don't know what else to do (other than maybe using an "encapsulated" python distribution like Anaconda).
Veto is offline   Reply With Quote
Old 01-14-2018, 02:02 AM   #6
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,002
Default

Hi Veto,

I made the test script and ran it.

Outcome:

A popup window with this:

3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 01:25:11)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]

8.5
vanhaze is online now   Reply With Quote
Old 01-15-2018, 06:21 PM   #7
Veto
Human being with feelings
 
Join Date: Aug 2010
Posts: 767
Default

Ok now the output of the test cases.
Ideally it shows a small window.
Quote:
Originally Posted by Veto View Post
Then you could try all those test cases in this post to see if that helps.
If you don't know how to comment (deactivate) or uncomment (activate) blocks of code in Python have a look here:
http://www.afterhoursprogramming.com...thon/Comments/

If you don't see any improvement I really don't know what else to do (other than maybe using an "encapsulated" python distribution like Anaconda).

PHP Code:
### 1
this line is activated

### 2
# this line is deactivated 

====
EDIT:
k done with this. Above test literally takes seconds, 30 if you are slow. This is not a matter of lack of knowledge but more of unwillingness.

Good luck y'all Mac users! *unsubscribing from both threads*

@snooks Thanks for bumping but I won't waste anymore time on this.

Last edited by Veto; Yesterday at 01:51 PM.
Veto is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:42 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.