-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtest.py
More file actions
72 lines (57 loc) · 1.96 KB
/
test.py
File metadata and controls
72 lines (57 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# from Euclid.EuclidWindow import EuclidWindow
# from Euclid.EuclidWidgets import EuclidButton
# from PyQt5.QtWidgets import *
# from PyQt5.QtCore import *
# from PyQt5.QtGui import *
# from utils import *
# import sys
# import time
# class MyWindow(QMainWindow):
# def __init__(self):
# super().__init__(None)
# self.resize(1000,600)
# self.scene = QGraphicsScene()
# self.view = QGraphicsView(self)
# self.view.resize(self.size())
# self.view.setScene(self.scene)
# self.pixmap = QPixmap("./Res/agent_anchor.png").scaledToWidth(200)
# self.painter = QPainter(self.pixmap)
# self.item = QGraphicsPixmapItem(self.pixmap)
# self.scene.addItem(self.item)
# self.items = list()
# def keyPressEvent(self, ev: QKeyEvent) -> None:
# if ev.key() == Qt.Key_B:
# print("尝试绘制|追加新的pixmap")
# smallpixmap = QPixmap("./Res/penicon.png")
# s = time.time()
# for i in range(10000):
# item = QGraphicsPixmapItem(smallpixmap)
# self.items.append(item)
# self.scene.addItem(item)
# item.setPos(i * 10, 0)
# print(time.time() - s)
# print(len(self.scene.children()))
# print(len(self.items))
# elif ev.key() == Qt.Key_C:
# print("尝试绘制|在pixmap上绘制pixmap")
# smallpixmap = QPixmap("./Res/penicon.png")
# s = time.time()
# for i in range(10000):
# self.painter.drawPixmap(QRect(0, 0, 30, 30), smallpixmap)
# self.item.setPixmap(self.pixmap)
# print(time.time() - s)
# return super().keyPressEvent(ev)
# app = QApplication(sys.argv)
# window = MyWindow()
# window.show()
# exit(app.exec_())
import numpy as np
x = np.array([
[1,2,3],
[0,0,0],
[4,2,0]
])
y = np.copy(x[1:2,:])
y[0,0] = 10
print(y)
print(x)