UEFfile.py 文件源码

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

项目:electron-cassette-io 作者: stardot 项目源码 文件源码
def cat(self):
        """
        Prints a catalogue of the files stored in the UEF file.
        """

        # Catalogue command

        if self.contents == []:

            print 'No files'

        else:

            print 'Contents:'

            file_number = 0

            for file in self.contents:

                # Converts non printable characters in the filename
                # to ? symbols
                new_name = self.printable(file['name'])

                print string.expandtabs(string.ljust(str(file_number), 3)+': '+
                            string.ljust(new_name, 16)+
                            string.upper(
                                string.ljust(hex(file['load'])[2:], 10) +'\t'+
                                string.ljust(hex(file['exec'])[2:], 10) +'\t'+
                                string.ljust(hex(len(file['data']))[2:], 6)
                            ) +'\t'+
                            'chunks %i to %i' % (file['position'], file['last position']) )

                file_number = file_number + 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号