If PythonShell <> Nil Then
dim theResult as String = PythonShell.ReadAll
if theResult <> "" then
TextArea1.Text = TextArea1.Text + theResult
end if
End If
The Python script waits for input:
print 'start'
do_loop = True
while do_loop:
theAction = raw_input()
if theAction == 'login':
print 'login'
else:
do_loop == False
break
#end if
#wend
I get the result “start” in Xojo, but no “login”. What am I doing wrong here?
The issue here is not about Python, it is about two independent programs running on OS X, your application and the Python console.
You could run the Python script in Terminal. And then communicate between Xojo and Python over sockets.
Or switch to AppleScript. Might work since Xojo supports AppleScript (“might” because I never used it myself).