0

スクリーンショット機能を作成しようとしていますが、試行するたびに次のエラーが表示されます。

Traceback (most recent call last):
  File "C:\Panda3D-1.8.1\direct\showbase\EventManager.py", line 61, in eventLoop
Task
    self.doEvents()
  File "C:\Panda3D-1.8.1\direct\showbase\EventManager.py", line 55, in doEvents
    processFunc(self.eventQueue.dequeueEvent())
  File "C:\Panda3D-1.8.1\direct\showbase\EventManager.py", line 122, in processE
vent
    messenger.send(eventName, paramList)
  File "C:\Panda3D-1.8.1\direct\showbase\Messenger.py", line 397, in send
    self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
  File "C:\Panda3D-1.8.1\direct\showbase\Messenger.py", line 482, in __dispatch
    method (*(extraArgs + sentArgs))
  File "C:\Panda3D-1.8.1\direct\showbase\ShowBase.py", line 2317, in __oobeButto
n
    messenger.send(button + suffix)
  File "C:\Panda3D-1.8.1\direct\showbase\Messenger.py", line 397, in send
    self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
  File "C:\Panda3D-1.8.1\direct\showbase\Messenger.py", line 482, in __dispatch
    method (*(extraArgs + sentArgs))
TypeError: Screenie() takes exactly 1 argument (0 given)
:task(error): Exception occurred in PythonTask eventManager
Traceback (most recent call last):
  File "Play.py", line 791, in <module>
    run()
  File "C:\Panda3D-1.8.1\direct\showbase\ShowBase.py", line 2921, in run
    self.taskMgr.run()
  File "C:\Panda3D-1.8.1\direct\task\Task.py", line 502, in run
    self.step()
  File "C:\Panda3D-1.8.1\direct\task\Task.py", line 460, in step
    self.mgr.poll()
  File "C:\Panda3D-1.8.1\direct\showbase\EventManager.py", line 61, in eventLoop
Task
    self.doEvents()
  File "C:\Panda3D-1.8.1\direct\showbase\EventManager.py", line 55, in doEvents
    processFunc(self.eventQueue.dequeueEvent())
  File "C:\Panda3D-1.8.1\direct\showbase\EventManager.py", line 122, in processE
vent
    messenger.send(eventName, paramList)
  File "C:\Panda3D-1.8.1\direct\showbase\Messenger.py", line 397, in send
    self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
  File "C:\Panda3D-1.8.1\direct\showbase\Messenger.py", line 482, in __dispatch
    method (*(extraArgs + sentArgs))
  File "C:\Panda3D-1.8.1\direct\showbase\ShowBase.py", line 2317, in __oobeButto
n
    messenger.send(button + suffix)
  File "C:\Panda3D-1.8.1\direct\showbase\Messenger.py", line 397, in send
    self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
  File "C:\Panda3D-1.8.1\direct\showbase\Messenger.py", line 482, in __dispatch
    method (*(extraArgs + sentArgs))
TypeError: Screenie() takes exactly 1 argument (0 given)

スクリーンショットを行う部分はこちら

def Screenie(self):
file_name = Filename('whatever.png')

self.win.saveScreenshot(file_name)

  base.accept('f9', Screenie)

誰かがそれの何が悪いのか教えてもらえますか? 直したいけどどうしたらいいのかわからない…

4

1 に答える 1