Author Topic: Help with pygame script on gcw-zero  (Read 632 times)

Offline brotus

  • *
  • Posts: 2
Help with pygame script on gcw-zero
« on: September 15, 2013, 01:03:07 AM »
I am new to developing for the gcw-zero (and new to python).  I've got a HelloWorld pygame script I would like to run on the gcw-zero, but I'm not sure how to go about it.  I am able to ftp it over to the device, but when I run it on the device, nothing happens.  Similarly, I have used the OpenPackageCreator tool to create a .opk, but I'm not sure I'm doing it correctly because when I run the .opk on the device, nothing happens.  Below are the fields I used in the OpenPackageCreator tool and I have attached the script, any help would be appreciated! Thank you!

 
Path:                      <Path to dir with .py script>
Name:                    HelloWorld
Comment:               HelloWorld!
Categories:             games;
Executable(GCW):   helloworld.py
Executable(A320):   <blank>
Icon:                       blah.png

Offline zear

  • Moderator
  • *
  • Posts: 2122
Re: Help with pygame script on gcw-zero
« Reply #1 on: September 15, 2013, 02:03:14 AM »
Few things to check:
1) Enable logging. Go to gmenu2x options and set "Output logs" to ON. Next time you run your opk, it will generate a stdout/stderr log in settings->Log Viewer
2) Make sure you include a proper header for your main .py file, so the OpenPackageCreator can detect the file as executable and set the proper chmods. It will also point the script to the proper location of the python interpreter during the launch of the file.
By a header i mean something like this:
Code: [Select]
#! /usr/bin/env python3) Make sure the main .py file is saved with UNIX/Linux endline format. Saving it with the Windows endlines will leave garbage at the header line and prevent the file from launching.

Offline brotus

  • *
  • Posts: 2
Re: Help with pygame script on gcw-zero
« Reply #2 on: September 15, 2013, 07:15:16 AM »
Changing the line ends fixed it, thanks!