Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:PySymbian Hello World

From Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Code ExampleArticle
Created: hamishwillee (07 Jan 2011)
Last edited: hamishwillee (08 May 2013)

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Article
Created: hamishwillee (07 Jan 2011)
Last edited: hamishwillee (08 May 2013)
Trails.png Getting Started with Python
 > Download & Install > Archived:PySymbian Hello World > Archived:PySymbian Application Packaging & Distribution

Python logo.png
Comes with Code: File:PythonHelloWorld.zip

This article shows how to create and test a basic Python "Hello World" application The very simple Python script below asks the user for their name, then displays a dialog with the text: "Hello Name, welcome to Python World."

# import the app user interface framework module
import appuifw
 
# create a single-field dialog (text input field): appuifw.query(label, type)
data = appuifw.query(u"Type your name", "text")
 
# create an information note: appuifw.note(label, type)
appuifw.note(u"Hello "+str(data)+", welcome to Python World", "info")

Copy this text into your preferred text editor and then save the file as Helloworld.py (the ".py" extension is used for uncompiled python scripts).

If you're using the interactive shell for testing, you need to copy the file to \Data\Python\ on any drive:

  • For the device you can copy the file directly into the correct folder using PC Suite, or send it as a message with Bluetooth and then move it to the correct folder, using a File manager application.
  • If you're using the emulator you can copy it direct into the appropriate folder - [SDK]/epoc32/winscw/c/data/python.

To test your script first launch the "Python2.0.0" icon for the interactive shell, then do "Options | Run Script" and select it from the list.

Figure 1 Python Interactive shell


That's it. You've now created and launched a basic script. The next topic in this trail shows how you can package your script as an application.


Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Article
Created: hamishwillee (07 Jan 2011)
Last edited: hamishwillee (08 May 2013)
Trails.png Getting Started with Python
 > Download & Install > Archived:PySymbian Hello World > Archived:PySymbian Application Packaging & Distribution

Licence icon cc-by-sa 3.0-88x31.png© 2010 Symbian Foundation Limited. This document is licensed under the Creative Commons Attribution-Share Alike 2.0 license. See http://creativecommons.org/licenses/by-sa/2.0/legalcode for the full terms of the license.
Note that this content was originally hosted on the Symbian Foundation developer wiki.

This page was last modified on 8 May 2013, at 06:02.
48 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×