有没有办法在 pygame 上显示 Excel 工作表?
不太确定如何用这个话语,但是我在Excel中有一个信息数据库,一旦他们单击一个按钮,我就想将其显示到Pygame UI。任何人都知道是否可能,我该怎么做?
数据如下: excel data
我只设法实现了这一点:
MasterList = pd.read_csv(r'MasterList.csv')
def display_all():
ending = False
while not ending:
display(MasterList)
ending = True
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
pygame.display.update()
但是它仅在端子中显示Excel纸,但不显示UI。
任何帮助将不胜感激!
Not quite sure how to phrase this, but I have a database of information in Excel that I want to display to the pygame UI once they click a button. Anyone know if it is even possible, and how do I go about doing it?
The data is something as follows: Excel Data
I've only managed to get this far:
MasterList = pd.read_csv(r'MasterList.csv')
def display_all():
ending = False
while not ending:
display(MasterList)
ending = True
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
pygame.display.update()
But it only displays the excel sheet in the terminal but not the UI.
Any help is greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只需要显示它,您可以尝试将工作表转换为图像,然后将其加载到pygame中。
代码来自:https://blog. aspose.com/2021/05/28/convert-excel-to-image-in-python/
之后,使用 pygame.image.load() ,然后
.blit()
它。If you only need to display it, you can try converting the worksheet to an image and then loading it into pygame.
Code from: https://blog.aspose.com/2021/05/28/convert-excel-to-image-in-python/
After that, use
pygame.image.load()
and then.blit()
it.