使用此代码:
class ProgramThread(QThread):
def run(self):
QThread.sleep(10)
def __del__(self):
self.wait()
class App(QWidget):
def __init__(self):
super().__init__()
thread = QPushButton('Start Thread',self)
thread.clicked.connect(self.startthread)
thread.move(20,100)
self.show()
def startthread(self):
# method 1
t = ProgramThread(self)
t.start()
# method 2
# self.t = ProgramThread()
# self.t.start()
我明白了:
ic = io.ImageCollection('../images/*.png')
print('Type:', type(ic))
ic.files
使用此代码:
Type: <class 'skimage.io.collection.ImageCollection'>
['../images\\chapel_floor.png',
'../images\\clock_motion.png',
'../images\\cycle_spin.png',
'../images\\fingers.png',
'../images\\mpl_hist.png',
'../images\\snakes.png',
'../images\\zebrafish-spinal-cord-color.png',
'../images\\zebrafish-spinal-cord.png']
我明白了:
ic = io.ImageCollection('../images/*.png:../images/*.jpg')
print('Type:', type(ic))
ic.files
当我尝试仅一种类型的特定文件搜索时,会得到所有文件的视图,但是当我尝试通过在两者之间添加':'来完成多项操作时,这应该是这样的我什么也没得到。
答案 0 :(得分:0)
将:更改为; ic = io.ImageCollection('../ images / .png; ../ images / .jpg')
对我有用。