50 个有用的 Python 脚本 - 免费 PDF 下载

资讯 2024-07-09 阅读:24 评论:0
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

在推特上关注我 -@harendraverma2

Watching me on Twitter - @harendraverma2

在 medium.com 上关注我 -@harendraverma21

Watch me on medium.com - @harendraverma21

  • 1.将 JSON 转换为 CSV

*安装

:: Installation

  • 2.密码生成器

    2. Password generator

  • 3.从多个文件中搜索字符串

    3. Search for strings from multiple files

  • 4.从给定网页获取所有链接

    4. Obtain all links from the given web page

*安装

:: Installation

  • 5.图片水印

*安装

:: Installation

  • 6.从 WEB 页面报废并下载所有图像

*安装

:: Installation

*执行脚本

*Executing scripts

  • 7.低电量通知

*安装

:: Installation

*执行脚本

*Executing scripts

  • 8.计算你的年龄

*执行脚本

*Executing scripts

  • 9\。有组织的不同类别的下载文件夹

    9\. Organised download folders for different types of downloads

  • 10.从 CSV 文件批量发送电子邮件

    E-mails from CSV documents in bulk

*安装

:: Installation

*执行脚本

*Executing scripts

  • 11\。获取A网站的IP地址和主机名

    One. Get an IP address and hostname for site A

  • 12\。终端进度条

    12\. Terminal progress bar

*安装

:: Installation

  • 13\。 Wifi密码弹出器

    13\. Wifi password ejector

  • 14\。给定网站的快照

    A snapshot of the site.

*安装

:: Installation

  • 15\。将文件拆分为块

    15\. Split files into blocks

  • 16\。加密和解密文本

    Okay. Encryption and decryption.

  • 17\。定期截屏

    17\. Regular screen cut.

*如何运行?

♪ How do you run?

  • 18\。十进制到二进制转换器

    18\. Decimal to binary converter

  • 19\。 CLI 所有应用程序

    CLI all applications

*安装

:: Installation

*如何使用它?

How do you use it?

  • 20\。货币转换器

    Ugh. Currency converter.

  • 21\。创建一个简单的秒表

    Two. Create a simple second watch.

  • 22\。用于压缩文件夹和文件的 Python 脚本

    . Python scripts for compressing folders and files

  • 23\。查找 IMDB 评级

    23\. Find IMDB rating

*如何运行脚本?

* How do you run the script?

  • 24\。网页抓取 Youtube 评论

    24\. Web page fetching YouTube comments

  • 25\。文字转语音

    25\. Text to voice.

*先决条件

* Preconditions

  • 26\。转换图像格式

    26\. Convert image format

  • 27\。随机维基百科文章

    27\. Random Wikipedia articles

*安装

:: Installation

  • 28\。检查网站连接

    28\. Checking website connections

  • 29\。 # 当前天气

    # Current weather #

*要求

*Requirement

  • 30\。 GUI 计算器应用程序

    30\. GUI calculator application

  • 31 元。数独解算器

    $31. Numeric solver

*如何使用它?

How do you use it?

*运行脚本。

* Run the script.

*点击这里了解更多详情

♪ Click here for more details ♪

  • 32\。文件加密解密

*用法

*Use

*点击这里了解更多详情

♪ Click here for more details ♪

  • 33\。地址位置

    33\. Address location

  • 34\。自动电子邮件

    34\. Automatic e-mail.

*要求:Python 版本 3、Smtplib 和 JSON

*Require: Python Versions 3, Smtplib and JSON

  • 35\。人工智能聊天机器人

*什么是人工智能机器人?

♪ What's an AI robot?

*如何使用它?

How do you use it?

*点击这里了解更多详情

♪ Click here for more details ♪

  • 36\。比特币价格 GUI 应用程序

*如何使用

* How to use it

  • 37\。 Codechef 自动提交

    37\. Codechef Auto-Submitting

  • 38\。校验和

    38\. Check sum

*示例:

*Examples:

  • 39\。加密货币转换器

*要求

*Requirement

*用法

*Use

  • 40\。加密货币价格

*要求

*Requirement

  • 41\。彩色图像到黑白图像转换器

*所需库

*Requirements required

*用法

*Use

*示例

* Example:

  • 42\。 CricBuzz 分数更新

*如何运行

♪ How to run ♪

  • 43\。 CSV 转 Excel

*要求

*Requirement

  • 44\。当前城市天气

    44\. Current urban weather.

  • 45\。目录组织者

    45\. Directory Organizer

  • 46\。 Excel 文件合并

    46\. Excel file merges

*需要库

♪ Need the library ♪

*用法

*Use

  • 47\。扩展 IP 地址信息

*运行程序

* Run the program

*输出

*Expire

  • 48\。 Excel to Python 列表转换器列表

*所需库

*Requirements required

*用法

*Use

  • 49\。 Python 中的文件资源管理器对话框

*1\。使用 tkinter

*Hold on. Use tkinter.

*2\。使用 PyQt

*2. Use PyQt

  • 50\。文件共享机器人

    50\. File sharing robot

  • 总结

    Summary

  • 下载PDF

    Download PDF

此脚本会将您的 JSON 数据转换为 CSV 文件。它将个文件作为输入,并提供个文件作为输出。

This script converts your JSON data to a CSV file. It uses a file as input and provides a file as an output.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

这个简单的 Python 项目使用和包来生成给定长度的随机字符串。

This simple Python project uses and packages to generate random strings for a given length.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

在您选择的文件夹中查找具有提供的字符串的文件。

Finds files with the provided string in the folder you select.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

此脚本从特定网站获取所有链接并将它们保存为文本文件。

This script retrieves all links from a particular website and saves them as text files.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

该项目将拍照并在其上添加您选择的水印。

The project will take pictures and add watermarks of your choice.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

该脚本将利用 selenium 和 beautifulsoup4 包从指定网页下载所有照片。

The script will download all photos from the designated web page using the selenium and beauutifulsoup4 packages.

  1. 我们需要使用 pip python 包管理器安装 selenium 和 beautifulsoup4。

    We need to install the pip python package manager selenium and beauutifulsoup4.

  2. 然后根据您的 chrome 浏览器版本和操作系统从这里下载 chrome 驱动程序 —https://chromedriver.chromium.org/

    Then download the chrome driver from here based on your chrome browser version and operating system — https://chromedriver.chromium.org/

3.您必须输入程序要求的chromedriver路径。

3. You must enter the chromedriver path required by the program.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

要运行以下脚本,您必须将终端打开到脚本的根目录并需要输入以下命令

To run the following scripts, you must open the terminal to the root directory of the script and enter the following command


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

它将询问您刚刚下载的 chrome 驱动程序路径以及您要从中下载图像的 URL。

It will ask about the path of the chrome driver you have just downloaded and the URL from which you want to download the image.

此 python 脚本显示有关设备电池百分比的通知。

This python script shows the notification of the percentage of the battery of the device.

要运行此脚本,我们需要通过运行以下命令下载psutil、py-notifier和win10tost。

To run this script, we need to download psutil, py-notifier and win10tost by running the following commands.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

打开终端进入脚本文件的根目录并运行以下命令

Open terminal to root directory of script file and run the following command


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

此脚本以三种不同的方式打印您的年龄:

This script print your age in three different ways: years , months , days


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

执行脚本非常简单!

It's very simple to execute a script!

只需在包含脚本的文件夹中打开一个终端,然后输入以下命令:

Just open a terminal in the folder containing the script and enter the following command:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

然后你必须输入姓名和年龄

Then you have to enter your name and age.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

这是一个 Python 脚本,可根据扩展名将下载目录中的文件分类到其他文件夹中。

This is a Python script that classifies the files in the downloaded directory into other folders by extension.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

该项目包括一个简单的批量电子邮件脚本,可将相同的消息传递给收件人列表。

The project includes a simple bulk e-mail script that can transmit the same message to the list of recipients.

该项目只需要 Python 标准库(更具体地说,是、和模块)。

The project requires only a Python standard library (more specifically, yes, and modules).


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

该脚本需要使用两个配置文件:

This script requires two configuration files:

  • emails.csv 应包含邮件应发送到的电子邮件地址。

    emails.csv should include the e-mail address to which the mail should be sent.

  • credentials.txt 应该包含您的 SMTP 服务器登录凭据,您的用户名和密码位于不同的行中,并且没有额外的空格或装饰。

    creditials.txt should contain your SMTP server login, your username and password are located in different lines and there are no extra spaces or decorations.

项目目录包含两个示例文件,您几乎肯定会希望并需要更改它们。

The catalogue contains two examples that you will almost certainly want and need to change.

准备好这些文件后,您所要做的就是

All you have to do is get these papers ready.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

该脚本将用于获取任何网站的 IP 地址和主机名。

The script will be used to get IP addresses and hostnames for any website.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

这里我只是以图像大小调整来显示进度条为例。当我们一次转换大量图像时,我们可以使用进度条显示调整了多少图像大小。

Here I'm just looking at the image size adjustment to show the progress bar. When we convert a large number of images at a time, we can use the progress bar to show how many images have been resized.

  • 显示进度条的库

进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

  • 调整图像大小的库

进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

从您的 Windows 操作系统获取保存的 wifi 密码

Fetch saved wifi passwords from your Windows operating systems


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

此脚本将捕获所提供网站的屏幕截图。

This script will capture the screenshots of the website provided.

在此处阅读有关的更多信息

Read more about it here.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

此脚本接受拆分索引和文件名,然后根据提供的索引对其进行拆分。

This script is divided into indexes and filenames, which are then split according to the index provided.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

一个对文本进行编码和解码的小型 Python 程序。

A small Python program that encodes and decodes text.

  • pycryptodome 3.9.8

  • 蟒蛇 3

    Python 3


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

用于定期捕获屏幕截图的 Python 脚本。

Python script to regularly capture screenshots.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

一个小python程序,将二进制和十进制,以及十进制转换为二进制。

A small python program that converts binary and decimal, as well as decimal, to binary.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

带有命令行界面的简单 Todo 应用程序。支持添加、删除和查看任务条目。

A simple Todo application with a command line interface. Supports adding, deleting and viewing task entries.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

跑步

Run >/strange

从代码编辑器或 Ide 运行它,或者在命令行中键入。 (而不是 [command] 添加你想要的所需命令)

Run it from the code editor or Ide, or type it in the command line. (Not add the command you want.)

命令

Command

添加任务。提示用户输入任务文本。

Adds the task. The user is prompted to enter the task text.

删除任务。提示用户输入任务 ID。

Deletes the task. The user is prompted to enter the task ID.

显示所有输入的任务。

Displays all entered tasks.

一个用实时信息转换货币的小python程序

A small python program that converts money with real-time information


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

此脚本用于检索电影文件夹中与 IMDb 上的电影匹配的电影评级和类型;数据是从 IMDB 的官方网站上抓取的,并保存在 CSV 文件中。

This script is used to retrieve movie ratings and types in the film folder that match those on IMDb; data are retrieved from the IMDB official website and stored in the CSV file.

然后可以使用 CSV 文件进行分析、按评级排序等。

The CSV files can then be used for analysis, ranking, etc.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

  • 安装要求。
  • 在 find_IMDb_rating.py 中,更新目录路径。
  • 键入以下命令:python find_IMDb_rating.py
  • 将在与 python 文件相同的目录中创建一个带有评级的 CSV 文件。

该脚本将获取 youtube 视频的 URL,并为用户和评论提供 CSV 文件。

The script will fetch URLs for yourtube videos and provide CSV files for users and comments.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

执行时,来自 abc.txt 的文本将转换为 mp3,保存,然后在您的设备上播放。

When implemented, text from abc.txt will be converted to mp3, saved and then played on your device.

  • abc.txt 与您的文字
  • gTTSu003du003d2.1.1模块(pip install gTTS下载)
  • os 模块(pip install os)

进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

此脚本将递归地将当前目录树中的所有 JPG 图像转换为 PNG,将 PNG 图像转换为 JPG(即,也将更改子目录中图像的格式。)

This script converts backwards all JPG images in the current directory tree to PNG and the PNG images to JPG (i.e., changes the formatting of images in subdirectories).


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

将任何来自维基百科的随机文章保存到文本文件的应用程序。

Saves any random articles from Wikipedia to a text file application.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

该脚本包含一个用于检查网站连接的基本实用程序。

The script contains a basic practical program for checking website connections.

网站 URL 应在输入文件 website.txt 中每行列出一个。

The URL of the website should list one in each row of the input file website.txt.

包含每个测试站点的 URL 及其状态的两列报告包含在输出文件 website status.csv 中。

The two column reports containing each test site and its status are contained in the output file website status. csv.

该脚本仅检查来自网络服务器的 200 状态代码。

The script only checks 200 status codes from the network server.

每次运行该实用程序时,结果文件都会被覆盖。

The outcome document is covered every time the practical procedure is operational.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

该脚本将帮助您找到任何输入地点的当前天气。该脚本使用 openweathermap.org 来查找当前天气。

This script will help you to find the current weather at any input location. The script uses openweathermap.org to find the current weather.

要运行此脚本,您需要有 api 密钥,首先要获取 API 密钥在此处注册

To run this script, you need api key, first to get the API key to register here

获取api密钥后添加到代码中:

Add to code after acquiring api keys:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

这是一个使用 Python 解决 9x9 数独矩阵的脚本。

This is a script that uses Python to solve 9x9 unique arrays.

  1. 编辑 app.py 以添加您的数独矩阵。 (为空单元格填写。)

例如,

For example:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

这将在控制台上为您提供输出。输出将包含输入数独矩阵和求解的数独矩阵。

This will provide you with an output on the control table. The output will contain a digital monolithic matrix for input and resolution.

输入 u003d>

Enter u003d>


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

输出 u003d>

Output u003d>


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

点击这里了解更多详情

可以加密给定文件并解密加密文件的命令行 Python 脚本。

The command line Python script that can encrypt the given file and decrypt the encrypted file.

  • 加密文件

进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

  • 解密文件

进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

点击这里了解更多详情

该脚本会将您的地址转换为坐标。

This script converts your address to coordinates.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

自动化电子邮件 python 脚本 现在您可以使用 Python 中的 Smtplib 模块轻松地一次向多个人发送电子邮件

Auto-email python script now you can easily send emails to multiple individuals using the Smtplib module in Python


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

可以使用命令提示符轻松运行(Python 自动_email.py)-> 像您的 Gmail 帐户一样登录(相同的电子邮件和密码)-> 通过直观的用户友好菜单找到您的方式(您的密码和电子邮件仅存储在您的本地设备上,否则没有人可以访问您的信息!)

You can easily run (Python automatically_email.py)-> login like your Gmail account (same email and password)-> find your way through an intuitive user-friendly menu (your password and email are stored only on your local device, otherwise no one can access your information!)


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

聊天机器人(也称为talkbot、chatterbot、Bot、IM bot、交互式代理或人工对话实体)是一种计算机程序或人工智能,它通过听觉或文本方法进行对话。

Chat robots (also known as talkbot, chatterbot, Bot, IM bot, interactive agents or artificial dialogue entities) are computer programs or artificial intelligence that engage in dialogue by means of hearing or text.

首先在 UNIX 终端或 Windows CMD 上运行以下命令:

First run the following command on UNIX terminal or Windows CMD:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

点击这里了解更多详情

使用 Python 的 Tkinter 库和免费的 Luno API 告诉比特币的当前价格。按刷新以获取最新价格。

Use Python's Tkinter library and a free Luno API to tell Bitcoin's current price. Press refresher to get the latest price.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

或者

Or...


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

默认对是比特币到马来西亚林吉特,要更改它,请单击此处的以找出可用的代码并在第 9 行更改。

The default pair is Bitcoin to Lingit, Malaysia, and to change it, click here to find the available code and change it in line 9.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

使用 selenium 在 [https://www.codechef.com] 上提交代码的简单脚本。

Submits a simple script of the code using selenium on [https://www.codechem.com].


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

此脚本可以从 md5、sha1、sha224、sha256、sha384 和 sha512 生成校验和。此外,对于另一层秘密,它可以使用 HMAC 和提供的秘密创建签名校验和。最后,为了向脚本提供实际值,它还可以验证校验和是否与生成它的文件匹配。

This script can generate checksums from md5, sha1, sha224, sha256, sha384 and sha512. In addition, for another layer of secrets, it can create signature checksums using HMAC and the secret provided. Finally, in order to provide actual values to the script, it can also verify that the check and match the document that generated it.

生成一个 sha1 校验和

Generates a sha1 checksum and


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

生成签名

Generates signature


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

验证校验和

Validate Checksums


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

验证签名

Authentication signature


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

使用 PyQt 在 Python 中实现的加密货币转换器的简单 GUI。 UI 是使用 Qt Creator 设计的。

A simple GUI using an encrypted currency converter that PyQt performs in Python. UI is designed using Qt Creator.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

要开始将您的加密货币转换为美元、欧元或其他加密货币,请输入:

To start converting your encrypted currency to United States dollars, euros or other encrypted currency, enter:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

该程序获取加密货币的实时价格。

The program obtains real-time prices for encrypted currency.

安装所需的库:

Repository required for installation:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

之后运行:

Run after:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

一个简单的 Python 脚本,它将彩色图像文件名作为参数并将其转换为灰度图像并保存输出图像文件。它显示了 Pillow 库的基本用法。

A simple Python script that uses the colour image filename as a parameter and converts it to a greyscale image and saves the output image file. It shows the basic usage of the Pillow library.

1.枕头(PIL)

1. Pillows (PIL)

  1. 转到脚本的文件夹并打开命令提示符。 2.运行命令:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

这个 Python 脚本基于网络抓取,使用 Beautiful soup 库获取最近的板球比赛的得分来抓取数据。

This Python script is web-based and uses the Beauutiful Soup library to capture data from the most recent cricket game.

在终端中输入此命令。

Enter this command in the terminal.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

它将显示所有最近比赛的比分更新。

It will show an update of all recent competitions.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

该程序将任何逗号分隔值文件(例如:.csv 或 .data)中的数据写入 Excel 文件。

This program writes data from any comma-separated value file (e. g. csv or.data) to an Excel file.

安装所需的库:

Repository required for installation:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

之后运行:

Run after:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

示例输入文件

example entered in document


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

使用 GET 请求检索有关您所在城市当前天气详细信息的详细信息,只需插入任何城市的名称,它将提供当前温度、当前风速和当前天气类型等详细信息。

Use the GET to request details about the current weather in your city and simply insert the name of any city, which will provide details about the current temperature, current wind speed, and current weather type.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

根据文件的类型(常用扩展名)组织给定目录中的文件。无法识别的扩展名保留在父目录本身中,而其他扩展名则移动到各自的新目录,如“图片”等。

The files in the directory are organized according to the type of file (common extension). Unidentified extensions are kept in the parent directory itself, while other extensions are moved to their respective new directories, such as " Pictures ".

python main.py [-h] path_ to_ the_ 目录

Python main.py[-h]path_to_the_directories


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

一个简单的脚本,用于从给定路径作为输入的具有类似表结构的 Excel 文件,并创建一个统一的 Excel 工作簿。

A simple script to use as input an Excel file with a similar table structure from a given path and to create a unified Excel workbook.

1.openpyxl

提供了一个示例脚本“将 excel 文件合并到 1.py”以显示 Excel Merger 的用法。当脚本运行时,它会询问统一工作簿的名称和包含需要合并的 excel 文件的文件夹的路径。

Provides an example script, " Combine Excel files into 1.py ", to show the use of Excel Merger. When the script runs, it asks about the name of the unified workbook and the path to the folder containing the Excel files that need to be merged.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

从终端查看有关您的公共 IP 地址的扩展信息。

View extension information about your public IP address from the terminal.

python脚本运行,参数如下

Python script running with the following parameters


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

输出应采用以下形式:

The output shall be in the following form:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

一个简单的工具,可以读取 excel 文件和任何相应的工作表,并将其转换为列表数据结构的 python 列表。

A simple tool to read the excel file and any corresponding sheet and convert it into a python list of the data structure of the list.

1.xlrd

提供了一个示例脚本来显示 ExcelToList 的用法。它读取 excel 及其工作表,并打印列表列表。

An example script is provided to show the use of ExcelToList. It reads the excel and its sheet and prints the list of lists.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

点击这里了解更多详情

Click here for more details

打开文件资源管理器对话框 UI 以使用 Python 选择文件。

Opens the file manager dialogue UI to select files using Python.

使用 tkinter 的示例:

Example to use tkinter:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

安装PyQt5

Install PyQt5

使用 PyQt5 的示例:

Example using PyQt5:


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

使用 Python 开发的 File-Sharing telegram Bot 它就像一个集中的文件存储库,授权用户可以共享文件并且文件可供所有用户使用。可以使用 /help 命令查看功能和命令。这个机器人可以直接托管在 Heroku 上。

File-Sharing telegram Bot, developed using Python, is a centralized repository of files that allows users to share files and that can be used by all users. Use /help commands to view functions and commands. This robot can be hosted directly on Heroku.


进入全屏模式 退出全屏模式

Enter fullscreen mode. Exit fullscreen mode.

点击这里了解更多详情

Click here for more details

在本文中,我讨论了 50 个 Python 脚本或 50 个迷你项目,您可以创建它们来提高您的 Python 技能。我希望这些能帮助你学习新的东西。在这篇文章上拍手,以便尽快从这一系列帖子中了解更多帖子。

In this paper, I have discussed 50 Python scripts or 50 mini-projects that you can create to improve your Python skills. I hope these will help you learn new things. Clap your hands on this article so that you can learn more from this set of posts as soon as possible.

感谢您阅读本文,别忘了关注我MediumorTwitter阅读更多此类文章。如果您觉得这个故事对其他人有帮助,也可以与您的朋友分享。

thanks you for reading this paper, and don't forget to focus on me Medium or Twitter /strang > >. You can also share this story with your friends if you think it will help others.

感谢您的阅读!

Thank you for reading!

给我买杯咖啡

Get me a cup of coffee.

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 0.00003374个比特币等于多少人民币/美金

    0.00003374个比特币等于多少人民币/美金
    0.00003374比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00003374比特币等于2.2826 1222美元/16.5261124728人民币。比特币(BTC)美元(USDT)人民币(CNY)0.00003374克洛克-0/22216.5261124728比特币对人民币的最新汇率为:489807.72 CNY(1比特币=489807.72人民币)(1美元=7.24人民币)(0.00003374USDT=0.0002442776 CNY)。汇率更新于2024...
  • 0.00006694个比特币等于多少人民币/美金

    0.00006694个比特币等于多少人民币/美金
    0.00006694比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00006694比特币等于4.53424784美元/32.5436 16人民币。比特币(BTC)美元(USDT)人民币(CNY)0.000066944.53424784【比特币密码】32.82795436 16比特币对人民币的最新汇率为:490408.64 CNY(1比特币=490408.64人民币)(1美元=7.24人民币)(0.00006694USDT=0.0004846456 CNY)汇率更新时...
  • 0.00015693个比特币等于多少人民币/美金

    0.00015693个比特币等于多少人民币/美金
    0.000 15693比特币等于多少人民币?根据比特币对人民币的最新汇率,0.000 15693比特币等于10.6 1678529美元/76.86554996人民币。比特币(BTC)【比特币价格翻倍】美元(USDT)人民币(CNY)0.000/克洛克-0/5693【数字货币矿机】10.6 167852976.8655254996比特币对人民币的最新汇率为:489,807.72 CNY(1比特币= 489,807.72人民币)(1美元=7.24人民币)(0.00015693 U...
  • 币圈院士:5.20比特币(BTC)以太坊(ETH)行情分析

    币圈院士:5.20比特币(BTC)以太坊(ETH)行情分析
    利空出尽?华尔街多头坚信美股将摆脱泥潭 经济衰退风险被夸大A lot of people on Wall Street believe that beauty will escape the quagmire; the risk of recession is exaggerated. 从目前美国经济的情况加上美股先有的走势来判断,确信通胀已经或即将见顶,这为价格压力回落铺平了道路,这最终将使美联储得以放缓...
  • 2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?

    2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?
    GDP作为全球公认的实力基准,就像是一个大国实力的代言人,它是布雷顿森林体系下全球团结的声音。它不仅仅是数字的累积,更是大国综合实力的人格化,默默诉说着每个国家的辉煌与荣耀。虽然GDP不是衡量一个国家综合实力的唯一标准,但无疑是最关键的指标之一。作为一面镜子,它反映了国家的经济实力和发展水平,是国家综合实力的重要体现,不容忽视。2000年,中国GDP迈过/克洛克-0/万亿美元的重要门槛,达到/克洛克-0/。2/克洛克-0/万亿美元(折合人民币7。7万亿元)。然而,在全球经济的...
标签列表