using python get current timestamp
>>>import time
>>>time.time()
//currenting timestamp to int
>>>int(time.time())
//converting to string
>>>str(time.time())
using python get current timestamp
>>>import time
>>>time.time()
//currenting timestamp to int
>>>int(time.time())
//converting to string
>>>str(time.time())
using python get friend timeline in twitter. following tools should be used:
python-simplejson
first install python-simplejson, if in ubuntu, just using command as follows
$apt-get install python-simplejson
then, downloading python-twitter , unpackage it. then using command
$ python setup.py build $ python setup.py install
then, open python.
>>> import twitter
>>> api = twitter.Api(“username”, “passworld”)
>>> posts = api.GetFriendsTimeline(‘username’)
>>> print [post.text in post as posts ];
for the file, the script should be liked:
import twitter
class mytwitter():
def __init__(self):
self._config = None
def main():
api = twitter.Api('username', 'passworld')
posts = api.GetFriendsTimeline('username')
for post in posts:
print post.text.encode('utf-8')
if __name__ == "__main__":
main()
I found a http server that developed by python. but it is not multiple thread. it provide simple service for http request and dir request. and a other python http server tutorial is here.
web.py and lighttpd is full work currently.
quixote and lighttpd is fully work currendly.
try web.py with lighttpd.
try to enable python quixote with scgi on lighttpd.
get python-quixote
get python-scgi
I have install follow service on my vps hosting:
samba – file and print server
lighttpd – a fast webserver
python – script language
ruby – script programming language