nes_env.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:super_mario 作者: tsunaki00 项目源码 文件源码
def _create_pipes(self):
        # Creates named pipe for inter-process communication
        self.pipe_name = seeding.hash_seed(None) % 2 ** 32
        self.launch_vars['pipe_name'] = self.pipe_name
        if not self.disable_out_pipe:
            self.path_pipe_out = '%s-out.%d' % (self.path_pipe_prefix, self.pipe_name)
            os.mkfifo(self.path_pipe_out)

        # Launching a thread that will listen to incoming pipe
        # Thread exits if self.is_exiting = 1 or pipe_in is closed
        if not self.disable_in_pipe:
            thread_incoming = Thread(target=self._listen_to_incoming_pipe, kwargs={'pipe_name': self.pipe_name})
            thread_incoming.start()

        # Cannot open output pipe now, otherwise it will block until
        # a reader tries to open the file in read mode - Must launch fceux first
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号