Using the e32 Module:
#Copyright (c) 2008 Pankaj Nathani
#Checking Python version and whether the aplication is running on an emulator
import e32
print e32.pys60_version
#Returns a string, like "1.4.2 final"
if(e32.in_emulator()==1):
print "Running on an emulator"
else:
print "Running on a real device"
#Copyright (c) 2008 Pankaj Nathani
#Copying a file
#General form: file_copy(target_name, source_name)
import e32
e32.file_copy("C:\\myimage.JPG", "C:\\Data\\Images\\myimage.jpg")
#This copies the file myimage.jpg, located in C, to the folder C:\Data\Images
#Copyright (c) 2008 Pankaj Nathani
#Discovering the available drives
#This is how to show what drives are available in the device (phone memory and/or memory card)
import e32
print e32.drive_list() #Returns a list with "C:" for phone storage and/or "E:" for memory card
#Copyright (c) 2008 Pankaj Nathani
#Handling inactivity time and setting device's time
#After a certain period of inactivity, the device's screen becomes dark
#You can check how long it has been since the last event and reset this period
import e32
print e32.inactivity() #Seconds since the user was last active
e32.reset_inactivity() #Resets the inactivity period to 0; useful for keeping screen light on
#You can also set the phone's time (note that you need WriteDeviceData capability) using:
#e32.set_home_time(new_time) where new_time is in Unix timestamp format (seconds since 01.01.1970, 00:00:00)
#For example,
e32.set_home_time(1134742324) #sets the time to 16.12.2005, 16:12:04
#Copyright (c) 2008 Pankaj Nathani
#Waiting
#If your application needs to pause before doing something
import e32
e32.ao_sleep(10) #Does nothing for 10 seconds
print "This message appeared after 10 seconds from starting the application"