Reference site

https://support.apple.com/en-us/HT201361



How to take a screenshot of your entire screen

  1. Press Shift-Command (⌘)-3.
  2. Find the screenshot as a .png file on your desktop.

How to take a screenshot of a selected portion of your screen

  1. Press Shift-Command-4. The pointer changes to a crosshair.
  2. Move the crosshair to where you want to start the screenshot, then drag to select an area.
    While dragging, you can hold Shift, Option, or Space bar to change the way the selection moves.
  3. When you've selected the area you want, release your mouse or trackpad button. To cancel, press the Esc (Escape) key before you release the button.
  4. Find the screenshot as a .png file on your desktop.

How to take a screenshot of a window

  1. Press Shift-Command-4. The pointer changes to a crosshair.
  2. Press the Space bar. The pointer changes to a camera.
  3. Move the camera over a window to highlight it.
  4. Click your mouse or trackpad. To cancel, press the Esc (Escape) key before you click.
  5. Find the screenshot as a .png file on your desktop.


This works with windows in the Finder and most apps.

How to take a screenshot of a menu

  1. Click the menu to reveal its contents.
  2. Press Shift-Command-4 The pointer changes to a crosshair.
  3. Drag to select the menu.
  4. Release your mouse or trackpad button. To cancel, press the Escape (esc) key before you release the button.
  5. Find the screenshot as a .png file on your desktop.

These steps capture the contents of a menu, but not its title:

  1. Click the menu to reveal its contents.
  2. Press Shift-Command-4. The pointer changes to a crosshair.
  3. Press the Space bar. The pointer changes to a camera.
  4. Move the camera over the menu to highlight it.
  5. Click your mouse or trackpad. To cancel, press the Esc (Escape) key before you click.
  6. Find the screenshot as a .png file on your desktop.

How to take a screenshot of the Touch Bar

If you have a Mac with a Touch Bar and macOS Sierra 10.12.2:

  1. Press Shift-Command-6.
  2. Find the screenshot as a .png file on your desktop.


[PyQt] Event Handling - Mouse clicked

Target

1. Create a button "Click" on window

2. When the button is pressed, display message dialog "Button Clicked"


Source code

import sys
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *

class MyWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("PyQT")
self.setGeometry(100, 100, 300, 400)

btn1 = QPushButton("Click", self)
btn1.move(20, 20)
btn1.clicked.connect(self.btn1_clicked)

def btn1_clicked(self):
QMessageBox.about(self, "Message", "Button clicked")

if __name__ == "__main__":
app = QApplication(sys.argv)
myWindow = MyWindow()
myWindow.show()
app.exec_()


Result



'Python' 카테고리의 다른 글

Anaconda Python  (0) 2017.02.02
[PyQt] Make a window with "Hello World"  (0) 2017.02.02
[PyQt] What is PyQt?  (0) 2017.02.02
Install PyCharm IDE  (0) 2017.02.02
[Python] print "Hello world"  (0) 2017.02.02

[PyQt] Make a window with "Hello World"


Target

1. Create a window

2. print "Hello World" on the window


Source code


import sys

from PyQt5.QtWidgets import *


app = QApplication(sys.argv)

label = QLabel("Hello World")

label.show() 

app.exec_() 



Result


QT library is located in C:\Users\JC\Anaconda3\Lib\site-packages\PyQt5 in my windows machine








'Python' 카테고리의 다른 글

Anaconda Python  (0) 2017.02.02
[PyQt] Event Handling  (0) 2017.02.02
[PyQt] What is PyQt?  (0) 2017.02.02
Install PyCharm IDE  (0) 2017.02.02
[Python] print "Hello world"  (0) 2017.02.02