2013-02-08 3 views
0

Python의 Leap Motion 용 앱에서 작업 중이며 테스트를 마친 후 Launch App을 클릭하면 문제가 없습니다. 응용 프로그램 윈도우는 열리지 않지만 파이썬 코드는 모두 잘 동작합니다.시작 앱이 실행되는 동안 Tide SDK가 포함 된 Python 앱 패키지가 실행되지 않습니다.

그러나 앱을 패키징하고 실행하면 앱 창이 표시되고 파이썬이 전혀 작동하지 않습니다. 뭔가 빠졌습니까? 그래서,

<script type="text/python" src="PyLeapMouse.py" /> 
<script type="text/python" src="Geometry.py" /> 
<script type="text/python" src="Leap.py" /> 
<script type="text/python" src="LeapFunctions.py" /> 
<script type="text/python" src="Mouse.py" /> 

가 나는 또한 TiTitanium 변경 전역 네임 스페이스를 알고 다음과 같은 방식으로 파이썬 모듈을 포함

<html> 
    <head> 
     <script> 
      Titanium.include("PyLeapMouse.py"); 
      Titanium.include("Geometry.py"); 
      Titanium.include("Leap.py"); 
      Titanium.include("LeapFunctions.py"); 
      Titanium.include("Mouse.py"); 
     </script> 
     <script type="text/python"> 
      import Leap 
      import Mouse 
      import LeapFunctions 
      import time 
      import sys 

      def main(): 
       cursor = Mouse.cursor() 
       listener = LeapFunctions.Listener(cursor) 

       controller = Leap.Controller() 
       print "Adding Listener." 
       controller.add_listener(listener)#Attach the listener 

       print "Press Enter to quit..." 
       sys.stdin.readline() 
       controller.remove_listener(listener) 

      main() 
     </script> 
    </head> 
    <body style="background-color:#1c1c1c;margin:0"> 
    </body> 
</html> 

답변

1

시도 : 여기

내 index.html을의 코드입니다 그래도 문제가 해결되지 않으면 Ti.includeTitanium.include을 사용해보세요.

희망 사항.

+0

일 그 중 어느 쪽도 제거되었습니다 포함합니다, 난 두려워. 나는 파이썬 가져 오기 라인을 제거했을 때, 패키징 후에 실행 한 것과 같은 방식으로 작동했다는 것을 발견했다. 검은 화면을 보여 주지만 작동하지 않는다. 애플리케이션을 실행하면 Python을 패키징 한 것과 다르게 처리합니다. –