Dingoonity.org

GCW Zero => Help => Topic started by: brotus on September 15, 2013, 01:03:07 am

Title: Help with pygame script on gcw-zero
Post by: brotus 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
Title: Re: Help with pygame script on gcw-zero
Post by: zear 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.
Title: Re: Help with pygame script on gcw-zero
Post by: brotus on September 15, 2013, 07:15:16 am
Changing the line ends fixed it, thanks!