本文章引用自: https://www.educative.io/edpresso/installing-pip3-in-ubuntu ,版权归原作者所有。 pip3 is the official package installer for Python 3. It can be used to install packages from the Python Package Index. Installation Step 1 - Update systemIt is always a good idea to update before trying to install a new package. Run the command below: sudo apt update Step 2 - Install
可以使用 t (target) 选项来指定安装的位置。 举例: pip install -r requirements.txt -t /path/to/directory 安装到当前路径: pip install -r requirements.txt -t . 参考 https://pip.pypa.io/en/stable/reference/pip_install/#cmdoption-t
如何显示? import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face
可以使用 cp 复制,或 sync 同步,或者 mv 移动 https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html 单个文件的下载和上传下载文件 aws s3 cp <S3Uri> <LocalPath> 上传文件 aws s3 cp <LocalPath> <S3Uri> S3Uri 格式:s3://bucket-name/ob
创建一个管理员账号 打开 IAM 控制台 ,选择创建一个管理员账号 Add User Access type 选上 Programmatic access Permissions 选 Attach existing policies directly。然后 Policy 选 AdministratorAccess 下一步,直到显示 Access Key ID 和 Secret Access Key 页
Generate random characters Math.random().toString(36).replace(/[^a-z]+/g, '').slice(0, 5); Math.random(),生成随机数,例如:0.09751664076957856 .toString(36),转换成36进制后
引用自stackoverflow: from tkinter import Tk r = Tk() r.withdraw() r.clipboard_clear() r.clipboard_append('i can has clipboardz?') r.update() # now it stays on the clipboard after the window is closed r.destroy() 注意:需要启用 tkinter
列出指定目录下的全部文件,或可以通过扩展名指定文件类型,也可以通过指定排除规则,忽略部分文件。 def list_files( dir: str, ext: list = None, recursive: bool = True, excludes: list = None ): """ Args: - dir, directory path.
目前(Python 3.8)为止,Python 并没有原生支持访问系统剪贴板。 搜寻出有几种方法,梳理如下: 使用系统 shell 命令简单有效。但是并不适合复
Qt/Pyside2 读取系统剪贴板内容 import sys from PySide2.QtWidgets import QApplication app = QApplication(sys.argv) clipboard = app.clipboard() print(clipboard.mimeData().formats()) print(clipboard.mimeData().data(clipboard.mimeData().formats()[0])) app.closeAllWindows() app=None mimeData() 就和 drag 时对 mimeData() 的操作一样了。 引用自 doc.qt.io: QClipboard supports the same data types that QDrag does, and uses similar mechanisms. For advanced clipboard usage read Drag and Drop .