日常使用的工具箱。这只是一个工具箱,让我的生活更轻松。也许也是你的..

codewars的Python项目详细描述


Codewars.nl

Make sure to install all the dependencies needed for each individual module.

依赖关系

必需:

- `sudo apt-get install gcc`
- `sudo apt-get install libbluetooth-dev`

安装最新版本(稳定版)

pip install codewars

替代版本

1. Go to "https://github.com/0x78f1935/codewars/releases" and do
2. Download the latest version, unzip it.
3. Open a virtualenv and navigate to the extracted folder.
4. Now install the wheel package:
    `python -m pip install codewars-x_x_x_whl`

安装开发版本(不稳定)

pip install git+https://github.com/0x78f1935/codewars@master

码头工人

还有一个Dockerfile和一个docker-compose.yaml文件,其中包括 python将在其中预安装codewars。您可以修改dockerfile 你喜欢的。Dockerfile总是通过default下载不稳定的版本。

示例

信息

有关详细文档,请参阅here

In the following section you will find a brief example on how to use this code. This library is ment to grow over time so more examples to come...

记录器

Example:
```
from codewars.logger import Logger
logger = Logger(appname="test", mode="DEBUG", write=False)
logger._testLoggerClass()
logger.info("Hello World!")
```

Note

The whole module makes use of the Logger class instead of the print method.

单元测试

Example:
```
from codewars.unittest import Test
print(Test().run())
```

蓝牙

Example:
```
from codewars.bluetooth import Bluetooth
bt = Bluetooth()  # Initialize the class, Scans once
scan_results1 = bt.scan()  # Scan area for the default 10 seconds, this is \
# also executed when this class initializes
scan_results2 = bt.run_until_discovered()  # Scan until a device is found
print("Scan results1: {}".format(scan_results1))
print("Scan results2: {}".format(scan_results2))
```

WiFi

Example:
```
from codewars.wifi import Wifi
wifi = Wifi("enp0s31f6")
sniff_results = wifi.sniff(totalResults=10)
print(sniff_results)
info_results = wifi.info(sniff_results)
print(info_results)
wifi.sniff_forever(duration=300)
```

冲浪者

Example:
```
from codewars.surf import Surfer
from asyncio import get_event_loop
surf = Surfer(loop=get_event_loop())
# GET METHODS
print(surf.get(url='http://httpbin.org/get')) # Read page
print(surf.get(url='http://httpbin.org/get', json=True)) # Read json
print(surf.get(url='http://httpbin.org/basic-auth/test/test1123', auth=('test', 'test1123'), json=True))
# POST METHODS
print(surf.post(
    url='http://httpbin.org/post',
    header={'api_key': 'special-key'},
    data={
        "id": 0x78f1935,
        "username": "codewars",
    },
    json=True
    ))
```

刮刀

Example
```
from codewars.scraper import Scraper
scraper = Scraper(debug=True)
scraper.hrefs(url = 'https://codewars.nl/space')
```

有关详细文档,请参阅here

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何使用“Wed,01 Jul 2015 17:32:41 EDT”解析字符串   java Storm apache升级(1.0.0到2.0.0)   java类驻留在不同的目录中,而不是包指定的目录。为什么?   将Java中的图像缩放到非常小的维度   java如何通过子文档从自定义方面访问ElasticSearch parentdoc字段   java如何在RationalSoftwareArchitect中使用findbugs?   Java中的事件提升处理   java值被添加到arrayList的所有索引中,而不是在“”时添加到最后一个索引中。正在使用arraylist的add()方法   JFrame中的java JPanel派生类   java如何用循环和异步方法模拟类   java Android阻止可绘制背景超出视图范围   为客户排序Java阵列   java Apache poi如何将工作表设置为枚举位置值属性?   java Rhino在使用自定义类参数调用javascript函数时出错   java格式化日期从年月日到年月日   spring如何修复java。lang.illegalargumentexception在此特定场景中是否尝试创建具有null实体的合并事件?   java如何创建更好的对象