app = QApplication(sys.argv)
abc = pd.read_csv("filepath")
web = QWebEngineView()
web.load(QUrl.fromLocalFile(abc.to_html())
web.show()
sys.exit(app.exec_())
Asked
Active
Viewed 205 times
0

eyllanesc
- 235,170
- 19
- 170
- 241

surya ambati
- 94
- 8
-
Try `web.setHtml(abc.to_html())` instead of `web.load(QUrl.fromLocalFile(abc.to_html())` – Heike Jul 01 '20 at 10:09
-
you can find the same thing in above code. – surya ambati Jul 01 '20 at 10:21
-
Why not loading the CSV directly into the `WebEngineView` ? – Maurice Meyer Jul 01 '20 at 11:45
-
@suryaambati what same thing? – Heike Jul 01 '20 at 14:06
1 Answers
0
If you are going to load html then you must use the setHtml()
method:
web.setHtml(abc.to_html())

eyllanesc
- 235,170
- 19
- 170
- 241
-
Thanks you its working but do you have any idea how to add css file as well? – surya ambati Jul 01 '20 at 18:25
-
@suryaambati See https://stackoverflow.com/questions/50807744/apply-css-class-to-pandas-dataframe-using-to-html/50939211 – eyllanesc Jul 01 '20 at 18:31