PYTHONQT Practice N2

Source: Internet
Author: User

#-*-coding:cp936-*-

"""

Requirements

1 Use the following modules first

Pil (Image)

2: Prepare several pictures (. Jpg,.gif), etc.

3: Set Picture information (difficulty) this with pil (image)

4: Divided into 2 kinds of situations;

1: The fundamental program is set up to automatically randomly change every few seconds.

2: Automatic random change according to the user's own settings

Graphics issues

1: Display the picture content, information, size, name, call in time

2: The time of each picture is displayed (set first)3 to 4 seconds, then the random degree of rotation,

And then switch to another picture.

3: Maybe the same picture will appear 2 or more times, because the random problem

4: When the first picture jumps out of the human eye range, the next random picture appears, allowing people to watch

5: Add a small function, when the user does not want to see, enter the time to exit

6: To random the picture in this file, instead of just a random image

A few points of the picture

Rotate, move, size

"""

"""

Other Notes:

1: Picture with . jpg as the main, sequence number starting from 0

2: Picture size I'm not sure, so I can only show these questions through the program.

3:

"""

Import random,image,time,string,os,sys,glob# The first step to complete, importing the required modules

# The first section, the main folder creation time, folder size and other properties displayed

# allow users to view folder-related properties

# to prepare for the second step, there is no setting whether or not a Chinese directory appears

# Step three, add a function to see when the folder was created

From PYQT4 import Qtgui

From PYQT4 import Qtcore

def class_import_image (path): # Why the function name is this, because Image is an object of a class, because it is imported so it is written like this

Try

Ls=os.listdir (PATH)

#except:

#print (' Access Deny ')

Except Exception, E:

Print (' Access deny ')

Print E,ur ' file path is incorrect ', ur ' your file path? Sorry to find the wrong place ', ur ' This place can be you find, really ... '

Else

For L in LS:

Temp=os.path.join (path,l)

Print ur ' create file time : ', Time.ctime ((Os.path.getatime (temp))),

Print ur ' Create folder time is : ', Time.ctime (Os.path.getctime (Os.path.dirname (temp))),

Print Len (temp), ur ' number ', Sum (os.path.getsize (Os.path.join (path,l)) for name in temp), ur ' bytes ',

if (Os.path.isdir (temp)):

Print (temp)

Class_import_image (temp)

Else

Print (temp)

If __name__== ' __main__ ':

While 1:

Print ur ' serial number is : '

print ' 1:class_import_image ("1") '

print ' 2:path ("2") '

Xz=raw_input (ur ' Please enter serial number:')

If xz== ' 1 ':

Class_import_image (' e:\\image\\ ')

Continue

If xz== ' 2 ':

Pass

Break

PYTHONQT Practice N2

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.