随笔分类 -  python

摘要:新建txt文本,输入名字,每个进行换行 from tkinter import * import time class RandomName(Frame): def __init__(self, parent=None, **kw): Frame.__init__(self, parent, kw) 阅读全文
posted @ 2024-04-23 09:13 朝阳1 阅读(203) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function from datetime import datetime import tornado from tornado.options impo 阅读全文
posted @ 2024-04-19 14:42 朝阳1 阅读(16) 评论(0) 推荐(0)
摘要:原理:pyautogui + opencv进行图片识别,然后进行操作.所以记得装 pip install opencv-python import pyautogui import pyperclip pyautogui.PAUSE = 1#每次延迟1秒 pyautogui.FAILSAFE=Tru 阅读全文
posted @ 2024-04-16 17:38 朝阳1 阅读(464) 评论(0) 推荐(1)
摘要:ChatGPT现在虽然都免费了,但是不岢雪(那俩字竟然是敏感字)上网还是很麻烦,网上有很多gpt网站可以用,但是自己用来开发的话,还是需要一个apikey的 项目地址 https://github.com/chatanywhere/GPT_API_free 可以直接去官网看如何申请 申请地址 htt 阅读全文
posted @ 2024-04-16 14:16 朝阳1 阅读(5702) 评论(0) 推荐(1)
摘要:地址 https://github.com/harry0703/MoneyPrinterTurbo 经过测试,很垃圾好像就是去pexels匹配视频、图片。。。~eng~还是用gpt把 Windows 百度网盘: https://pan.baidu.com/s/1bpGjgQVE5sADZRn3A6F 阅读全文
posted @ 2024-04-16 14:05 朝阳1 阅读(1160) 评论(0) 推荐(0)
摘要:import turtle from datetime import * # 抬起画笔,向前运动一段距离放下 def Skip(step): turtle.penup() turtle.forward(step) turtle.pendown() def drawCircle(content,con 阅读全文
posted @ 2024-04-16 09:46 朝阳1 阅读(127) 评论(0) 推荐(0)
摘要:背景图 import sys import math import pygame from datetime import datetime from pygame import display, image, font, transform # 创建罗盘时钟的窗口 def createWindow 阅读全文
posted @ 2024-04-16 09:36 朝阳1 阅读(571) 评论(0) 推荐(0)
摘要:import jieba text = "我喜欢自然语言处理技术!" seg_list = jieba.cut(text, cut_all=False) print("精确模式分词结果:", "/".join(seg_list)) #添加自定义词典 jieba.add_word("自然语言处理") 阅读全文
posted @ 2024-04-15 17:30 朝阳1 阅读(14) 评论(0) 推荐(0)
摘要:cuda安装之前,需要查看本机的gpu版本 查看自己电脑是否安装了显卡驱动 在桌面右击,打开NVIDIA 控制面板,点击系统信息,我们可以看到自己驱动程序版本,如果没有gpu驱动,建议先安装NVIDIA驱动 点击组件查看支持cuda的版本号,在这支持cuda 11.6.1 安装cuda https: 阅读全文
posted @ 2024-04-15 10:45 朝阳1 阅读(366) 评论(0) 推荐(0)
摘要:此项目只能随机生成图片,不能以图生图 先把源码克隆到本地,https://github.com/NVlabs/stylegan3 进入项目文件夹,激活虚拟环境 conda env create -f environment.yml conda activate stylegan3 访问https:/ 阅读全文
posted @ 2024-04-15 10:26 朝阳1 阅读(247) 评论(0) 推荐(0)
摘要:当前还没release版本,只能git安装 pip install git+https://github.com/huggingface/parler-tts.git 代码 from parler_tts import ParlerTTSForConditionalGeneration from t 阅读全文
posted @ 2024-04-13 15:14 朝阳1 阅读(126) 评论(0) 推荐(0)
摘要:1、查看所有虚拟环境 conda info --envs 或者 conda env list 2、创建名字为myenv,环境为python3.8的虚拟环境(python3.8为例) conda create --name myenv python=3.8 3、激活(进入)虚拟环境 conda act 阅读全文
posted @ 2024-04-09 11:21 朝阳1 阅读(1348) 评论(0) 推荐(0)
摘要:练手的项目,搜索的资源大部分都是枪版的。。。 import mechanicalsoup import re import json def extract_episode_number(label): match = re.search(r"(\d+)[^0-9]*集", label) if ma 阅读全文
posted @ 2024-04-01 16:41 朝阳1 阅读(189) 评论(0) 推荐(0)
摘要:import re import os import asyncio import requests from playwright.async_api import async_playwright def save_douyin_videos(keyword, file_name, video_ 阅读全文
posted @ 2024-03-29 10:39 朝阳1 阅读(700) 评论(0) 推荐(0)
摘要:# 卸载 pip uninstall -y playwright # 安装 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ playwright # 安装浏览器插件 playwright install 阅读全文
posted @ 2024-03-29 10:37 朝阳1 阅读(140) 评论(0) 推荐(0)
摘要:先上地址 https://github.com/ollama/ollama/tree/main 官网 https://ollama.com/ 下载 运行,然后会默认下载 ollama run llama2 选择不同的model ui交互 docker run -d -p 3000:8080 --ad 阅读全文
posted @ 2024-03-28 10:36 朝阳1 阅读(84) 评论(0) 推荐(0)
摘要:import redis host = '127.0.0.1' port = 6379 output_file = 'never_expire_keys.txt' # 连接到 Redis r = redis.Redis(host=host, port=port) # 查询每个键的 TTL,将永不过期 阅读全文
posted @ 2024-03-16 15:26 朝阳1 阅读(64) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- coding:utf-8 -*- """ # # 压力测试案例 # """ import threading import time import psutil import pytest import requests # 定义测试用例 @p 阅读全文
posted @ 2024-02-19 10:36 朝阳1 阅读(87) 评论(0) 推荐(0)
摘要:导出 pip freeze > requirements.txt 安装 pip install -r requirements.txt 阅读全文
posted @ 2024-01-30 10:57 朝阳1 阅读(34) 评论(0) 推荐(0)
摘要:使用venv(系统默认安装): 创建一个新的虚拟环境:运行命令 python -m venv myenv 其中myenv是你的虚拟环境的名称。 激活虚拟环境:会根据当前运行版本win/linux进行自动激活 activate 在激活的虚拟环境中安装所需的软件包:运行命令 pip install pa 阅读全文
posted @ 2024-01-30 10:26 朝阳1 阅读(59) 评论(0) 推荐(0)