Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Python to easily realize visual large screen

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to use Python to easily visualize a large screen. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

When it comes to data visualization, we will think of visualization libraries such as Plotly, Matplotlib, Pyecharts, or some commercial software Tableau, FineBI, and so on. If you want to make the operation easier and show more powerful, then this tool big_screen is more suitable for you.

Characteristics of big_screen

Convenient tools, simple structure, you only need to transfer data to achieve large data display.

Installation environment pip install-I https://pypi.tuna.tsinghua.edu.cn/simple flask input data

Update the data you need to display in the folder data.py, as shown below:

Self.echart1_data = {'title':' Industry Distribution', 'data': [{"name": "superstores", "value": 47}, {"name": "Education and training", "value": 52}, {"name": "Real Estate", "value": 90} {"name": "Life Services", "value": 84}, {"name": "car sales", "value": 99}, {"name": "Tourism Hotel", "value": 37}, {"name": "hardware Building Materials", "value": 2} ]} self.echart2_data = {'title':' provincial distribution', 'data': [{"name": "Zhejiang", "value": 47}, {"name": "Shanghai", "value": 52}, {"name": "Jiangsu" "value": 90}, {"name": "Guangdong", "value": 84}, {"name": "Beijing", "value": 99}, {"name": "Shenzhen", "value": 37}, {"name": "Anhui", "value": 150} ]} self.echarts3_1_data = {'title':' age distribution', 'data': [{"name": "under 0", "value": 47}, {"name": "20-29", "value": 52} {"name": "30-39", "value": 90}, {"name": "40-49", "value": 84}, {"name": "over 50", "value": 99},]} self.echarts3_2_data = {'title':' occupation distribution' 'data': [{"name": "E-commerce", "value": 10}, {"name": "Education", "value": 20}, {"name": "IT/ Internet", "value": 20}, {"name": "Finance", "value": 30} {"name": "student", "value": 40}, {"name": "other", "value": 50},]} run cd big_screen-master locally Python app.py; result display

Online deployment

You can run the script directly as if it were local, so it can run successfully, and if we want it to run all the time, we can deploy it online. Use the command as follows:

Nohup python app.py

At this point, you can view the progress.

Ps-ef | grep python

You will see that we have just started the app.py code, this is running in the background, it will also run after closing the connection, so you can rest assured.

However, if something goes wrong, we don't know what went wrong, so we specify the log output file.

Nohup python-u app.py > robot.log 2 > & 1 &

There is one more question. What if I want to stop running online? You can use this command

Kill PID, thank you for your reading! On "how to use Python to easily achieve visual large screen" this article shares here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report