从Excel工作表获取数据 [英] Getting data from an Excel sheet

查看:126
本文介绍了从Excel工作表获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将数据从Excel工作表加载到我的Django应用程序中?我使用数据库PosgreSQL作为数据库。

How do I load data from an Excel sheet into my Django application? I'm using database PosgreSQL as the database.

我想以编程方式执行此操作。客户想要每周将两个不同的列表加载到网站上,他们不想在管理部分执行此操作,他们只想从Excel工作表中加载列表。请帮助,因为我在这里很新。

I want to do this programmatically. A client wants to load two different lists onto the website weekly and they don't want to do it in the admin section, they just want the lists loaded from an Excel sheet. Please help because I'm kind of new here.

推荐答案

看看 xlrd 包,它允许您在Py​​thon中读取Excel文件。读取数据后,您可以随意使用数据,包括将其保存到数据库中。

Have a look at the xlrd package, which allows you to read Excel files in Python. Once you've read the data you can do whatever you want with it, including saving it to the database.

有关基本的使用示例,请查看 http://scienceoss.com/read-excel-files-from-python/

For a basic usage example, look at http://scienceoss.com/read-excel-files-from-python/

这篇关于从Excel工作表获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆