View RSS Feed

by MeHMeT a.k.a MaRZoCHi

Pys60 - Tarih/Saat , Resim Konumu ve Tuş Eventleri

Yazıyı Değerlendir
by on 10-02-15 at 06:42 PM (404 Okunma)
Time Modülü ile Zaman Kullanımı

PHP- Kodu:
>>> import time 
 
# 1.Örnek 
# ---------------------------------------------
>>> t=time.strftime('%A %d %Y',time.localtime()) 
>>> 
d=time.strftime('%H:%M:%S',time.gmtime(time.time() - time.timezone)) 
>>> print 
str(t)+' - '+str(d
'Thursday 20 2007 - 11:49:29'
 
 
# 2.Örnek
# ---------------------------------------------
>>> time.strftime('%X %x')
>>> print 
a
'17:05:38 11/27/09'
 
 
# 3.Örnek
# ---------------------------------------------
>>> time.strftime('%A %d %Y %H:%M:%S',time.localtime())
>>> print 
b
'Friday 27 2009 17:01:52' 
Resmi Siteden Bu Modül ile İlgili Açıklamalar ve Bilgiler.Tıkla !



Canvas ile Resmi Belirlenen Pixellere Yerleştirmek

Kod:
play_icon = Image.open('e:\\Python\\Xplayer\\play.png')
canvas.blit(play_icon,target=(10,68))

Örnek : http://www.python-s60.com/program-is....html#post4648


Tuş Basıldı - Basılıyor ? ...

Yine Örnek : Örnek : http://www.python-s60.com/program-is....html#post4648
Anlamadığın Yer Olursa Çekinme Yaz.

PHP- Kodu:
from key_codes import *
 
def tr(t):return t.decode('utf-8')
 
execfile('E:\\Python\\Keyboard.class.src')
key=Keyboard()
 
 
# key.pressing : Eğer --- Tuşuna Basılıyor ise ...
# key.pressed  : Eğer --- Tuşuna Basıldı ise ...
 
 
# EKey1,EKey2 ....
 
while True:
    if 
key.pressing(EKey1):
      
abc()
    if 
key.pressed(EScancodeLeftArrow):
      
12
    
if key.pressed(EScancodeRightArrow):
      
12
    
if key.pressed(EScancodeDownArrow):
      
abc()
    if 
key.pressed(EScancodeUpArrow):
      
12 

PHP- Kodu:
# Api
#
# path = 'E:\\Python\\Keyboard.class.src'
# execfile((path))
# key = Keyboard()
#
# Api
 
class Keyboard(object):
    
__module__ __name__
    def __init__
(self):
        
self.state = {}
        
self.buffer = {}
    
def handle_event(selfevent):
        
code event['scancode']
        if (
event['type'] == EEventKeyDown):
            
self.buffer[code] = 1
            self
.state[code] = 1
        elif 
(event['type'] == EEventKeyUp):
            
self.state[code] = 0
    def pressing
(selfcode):
        return 
self.state.get(code0)
    
def pressed(selfcode):
        if 
self.buffer.get(code0):
            
self.buffer[code] = 0
            
return 1
        
return 
Ekteki Dosya Son Verdiğimin Script Halidir...

Submit "Pys60 -  Tarih/Saat , Resim Konumu ve Tuş Eventleri" to Google Submit "Pys60 -  Tarih/Saat , Resim Konumu ve Tuş Eventleri" to Facebook da Paylaş Submit "Pys60 -  Tarih/Saat , Resim Konumu ve Tuş Eventleri" to Digg Submit "Pys60 -  Tarih/Saat , Resim Konumu ve Tuş Eventleri" to del.icio.us

Son Güncelleme 10-11-26,03:46 PM de [ARG:5 UNDEFINED] Tarafından Yapıldı

Etiketler: Yok. Etiketleri Düzenle
Categories
Kod Örnekleri

Yorum

Trackbacks

Total Trackbacks 0
Trackback URL: