PYTHONQT Practice N1

Source: Internet
Author: User
Tags glob

#-*-coding:cp936-*-

Import Sys,image,random,os,glob,time

From PYQT4 import Qtgui

From PYQT4 import Qtcore

def a (path):

For I in Glob.glob (path):

List1=[]

T=image.open (i)

Time.sleep (1)

#t1 =imageenhance.contrast (t)

#t1. Enhance (1.2). Show (' 25% more Conrast ')

print ' Picture storage directory is:%s '% (i), ' Picture format:%s, picture size:%s, Picture mode:%s '% (T.format,t.size,t.mode)

T.resize ((128, 128))

T.transpose (Image.flip_left_right)

#t. Transpose (IMAGE.ROTATE_90)

#t. Transpose (image.rotate_180)

#t. Transpose (image.rotate_270). Show ()

T.rotate (Random.randint (0,270)). Show (Time.sleep (1.2))

#导入之后随机从其中找一张, and then from the A-coordinate 0,0 to the B-coordinate (100,100) (it would have been a complex effect, because the

#到鼠标键盘事件 (not learned), and now change from a-coordinate 0,0 to B-coordinate (100,100) at random,

#并图片旋转到中间之后向右边去, then the next one)

def Image1 (t= ' JPEG '):

size=2000,2000

For i in Sys.argv[1:]:

Out=os.path.splitext (i) [0]+ ' PILQT '

If I!=out:

Try

Im=image.open (i)

IM.PILQT (size)

Im.save (out,t)

Except IOError:

print ' Cannot create pilqt: ', I

Class Tooltip (Qtgui.qwidget):

def __init__ (self, parent = None):

Qtgui.qwidget.__init__ (self, parent)

Self.setgeometry (300, 300, 250, 150)

Self.setwindowtitle (' Tooltip ')

Self.settooltip (Time.ctime ())

QtGui.QToolTip.setFont (Qtgui.qfont (' Oldenglish ', 10))

App = Qtgui.qapplication (SYS.ARGV)

tooltip = tooltip ()

Tooltip.show ()

Sys.exit (App.exec_ ())

PYTHONQT Practice N1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.