Error
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.

global

simple ftp client example - python
Tuesday, 22 November 2011 07:47
// with few slight modifications (like s.recv -> s.read) you can run this script in pys60
// iam too lazy to add comments to this prog, since this is only snippets no comments

import socket
import time
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)#main socket
#***************************************
def sendcmd(cmd):
global s
s.send(cmd+"\r\n")
#***************************************
def getline():
global s
return s.recv(1024)
#***************************************
def execute(cmd):
sendcmd(cmd)
return getline()
#***************************************
#command executing sequence and delay is important in this module
def getpasv(cmd):
global s
ss=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
#temporary socket for pasv connection.
a=execute("PASV")
print a
print "connecting to %s:%d" % parse(a)
ss.connect(parse(a))
sendcmd(cmd)
fhandle=open("d:\\a.rar","wb")#replace d: with e: for memory card if pys60
while 1:
tmp = ss.recv(1024)
if not tmp:
break;
fhandle.write(tmp)
fhandle.close()
ss.close()
time.sleep(1) #this delay is required
return getline()
#***************************************
def parse(st):
x=st[st.rindex("(")+1:st.rindex(")")]
y=x.split(",")
ipaddr=y[0]+"."+y[1]+"."+y[2]+"."+y[3]
portnum=(int(y[4])*256)+int(y[5])
return ipaddr,portnum
#***************************************
print "program started"
try:
s.connect(('ftp.myserver.com',21))
print getline()
print execute("USER shankar")
print execute("PASS support123")
print execute("CLNT FileZilla")
print execute("OPTS UTF8 ON")
print execute("CWD /Tools")
print execute("PWD")
print execute("TYPE I")
print getpasv("RETR datarecovery.rar")
print execute("QUIT")
s.close()
except socket.error, e:
print "ERROR: %s" % e
print "done!"
#***************************************

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/sg2EIsKOqJo/13919

 
simple example thread in pys60
Thursday, 17 November 2011 01:12

import appuifw
import e32
import thread
def mine():
global running
print "new thread started"
while running:
print "thread running"
e32.ao_sleep(2)
print "thread stopped"
def startth():
global running
running=1
thread.start_new_thread(mine,())
def stopth():
global running
running=0
def cl():
appuifw.app.body.set(u"")
def about():
appuifw.note(u"programmed by shankar.")
def quith():
stopth()
print "bye"
lock.signal()
cl()
appuifw.app.title=u"thread_demo"
appuifw.app.exit_key_handler=quith
appuifw.app.menu=[(u"clear screen",cl),(u"Menu1",((u"About",about),(u"Quit",quith))),(u"thread",((u"start new",startth),(u"stop all",stopth)))]
lock=e32.Ao_lock()
lock.wait()

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/bQtzwAtKr6w/13885

 
Welcome Olaf to the Global Moderator team
Written by   
Wednesday, 23 September 2009 03:30

The Global Moderators would like to announce a new addition to the Global Moderator team.

Olaf Offick (aka ooffick) has graciously accepted our request to join the team stating, "I would be honored".

We, the Joomla community, are very grateful for the time and effort that Olaf has contributed to the project. He represents the true spirit of "giving back" to an Open Source community.

Please join us in congratulating and thanking him for taking on the role of Global Moderator.

Read more: http://community.joomla.org/blogs/community/1044-welcome-olaf-to-the-global-moderator-team.html

 


Taxonomy by Zaragoza Online