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

What functions can be achieved by one line of python code

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains the "python line of code can achieve what functions", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "python line of code can achieve what functions" bar!

1. One line of code modifies any content of the web page

In the past, when I changed the content of the web page, I directly modified the source code until I knew the following command, opened the browser and typed it in Console

Document.body.contentEditable='true'

The whole page is like a rich text editor, you can modify any piece of content, even if you don't know HTML, you can easily install X, such as changing Alipay balance or changing the number of fans.

2. Start the Web service with one line of code

Under the same local area network, if you want to quickly access the file system under the target device, you can open the Web service on the target computer, and then another device can access it through a browser.

Python-m http.server 8080 # py3

Python-m SimpleHTTPServer 8080 # py2

3. One line of code runs away

Most of this probably knows, don't try it easily, try it on a virtual machine if you want to use it.

Rm-rf / * 4, one line of code website becomes black and white

Do you still remember that on April 4, the themes of many websites turned gray? Don't think how complicated it is, you can do it by changing one line of code.

Html {filter: grayscale (1);}

Set the html tag style to filter: grayscale (1), and the site immediately becomes black and white.

5. Generate the QR code import qrcode with one line of code

Qrcode.make ("www.foofish.net") .save (". / test.png")

You can use this line of code to generate a QR code directly, and you no longer need to use that X material to convert the QR code.

Thank you for your reading, the above is the content of "what functions can be achieved by one line of python code". After the study of this article, I believe you have a deeper understanding of what functions a line of python code can achieve, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Internet Technology

Wechat

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

12
Report