Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 19:35, 24 April 2008.

How to update Python script

From Forum Nokia Wiki

This article shows how we could update or write in to a python script file on the device from an online server.

Sometimes we may need to port our code from the server and run it on the device. The following code illustrates how we can update or port the code to the script file from the Webserver.

#import modules
import urllib
import appuifw
 
#Parameters for accessing the script file on device 
#as well as the path of code on the server
script = "mycode.py"
server = "WEB SERVER URL HERE/"
 
update = urllib.urlopen(server + script).read()
#Path  of the Python Script file to update 
d = file(u"C:\\Python\\" + script, "w")
d.write(update)
d.close()
#The script has been updated successfully
appuifw.note(u"The Script has been successfully updated","info")
Related Discussions
Thread Thread Starter Forum Replies Last Post
Old wishlist thread - feature requests now tracked in SourceForge eriksmartt Python 90 2006-03-09 13:46
How to compile PY to PYC? JOM Python 13 2008-06-13 17:07
using a configuration file roidayan Python 11 2008-03-06 19:21
problems with python kausarulmajed Python 1 2007-10-20 10:57
input function in interactive console d.nieto Python 3 2006-11-11 10:40
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZpythonQ
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX