Usage Analysis of a single Python implementation program instance

Source: Internet
Author: User

Usage Analysis of a single Python implementation program instance

This example describes how to use a single Python implementation program. Share it with you for your reference. The details are as follows:

Here, we first use win32ui. FindWindow to find the window name. If it does not exist, an exception will be thrown.

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

Import wx

Import win32ui

Import win32con

Try:

# First, check whether the program is running

Win = win32ui. FindWindow (None, 'window name ')

Try:

If win:

Win. ShowWindow (win32con. SW_SHOWNORMAL)

Except t:

Pass

Except t:

# No related window found

App = wx. App ()

Main_frm = wx. Frame (None)

Main_frm.Show ()

App. MainLoop ()

If the 'window name' part is not defined, a new window is created.

I hope this article will help you with Python programming.

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.