摘要:
window.onerror=function(){ window.location.reload(true); }
阅读全文
posted @ 2022-07-14 09:34
CrossPython
阅读(28)
推荐(0)
摘要:
插播:python生成字典的方法 直接创建/键值对创建:dic={'a':1,'b':2,'c':3} dic=dict(a=1,b=2,c=3) 二元组列表创建:list=[('a',1),('b',2),('c',3)] dic=dict(list) 用dict和zip:dic=dict(zip
阅读全文
posted @ 2022-07-13 14:32
CrossPython
阅读(646)
推荐(0)
摘要:
fn main() { let values = vec![1, 2, 3]; for v in values.into_iter() { println!("{}", v) } // 下面的代码将报错,因为 values 的所有权在上面 `for` 循环中已经被转移走 // println!("{
阅读全文
posted @ 2022-07-11 21:58
CrossPython
阅读(43)
推荐(0)
摘要:
https://blog.csdn.net/wowotuo/article/details/116489754 所有 trait 的方法是顺序放在一起,并没有区分方法属于哪个 trait,这样也就导致无法进行 upcast,社区内有 RFC 2765 在追踪这个问题,感兴趣的读者可参考,这里就不讨论
阅读全文
posted @ 2022-07-11 16:45
CrossPython
阅读(493)
推荐(0)
摘要:
fn main() { let s = String::from("hello, 世界"); let slice1 = &s[0..1]; //提示: `h` 在 UTF-8 编码中只占用 1 个字节 assert_eq!(slice1, "h"); let slice2 = &s[7..=9];/
阅读全文
posted @ 2022-07-10 17:44
CrossPython
阅读(146)
推荐(0)
摘要:
struct Sheep {} struct Cow {} trait Animal { fn noise(&self) -> String; } impl Animal for Sheep { fn noise(&self) -> String { "baaaaah!".to_string() }
阅读全文
posted @ 2022-07-10 12:39
CrossPython
阅读(41)
推荐(0)
摘要:
struct Val<T> { val: T,} impl<T> Val<T> { fn value(&self) -> &T { &self.val }} fn main() { let x = Val{ val: 3.0 }; let y = Val{ val: "hello".to_strin
阅读全文
posted @ 2022-07-09 21:43
CrossPython
阅读(49)
推荐(0)
摘要:
fn main() { let a = [4,3,2,1]; // 通过索引和值的方式迭代数组 `a` for (i,v) in a.iter().enumerate() { println!("第{}个元素是{}",i+1,v); }} fn main() { let names = [Strin
阅读全文
posted @ 2022-07-09 18:49
CrossPython
阅读(70)
推荐(0)
摘要:
struct Unit;trait SomeTrait { // ...定义一些行为} // 我们并不关心结构体中有什么数据( 字段 ),但我们关心它的行为。// 因此这里我们使用没有任何字段的单元结构体,然后为它实现一些行为impl SomeTrait for Unit { }fn main()
阅读全文
posted @ 2022-07-09 15:59
CrossPython
阅读(69)
推荐(0)
摘要:
先从字符串到json a = json.loads(str) 处理完毕后再转json b = json.dumps(a).encode('utf8').decode('unicode-escape')
阅读全文
posted @ 2022-07-08 16:56
CrossPython
阅读(168)
推荐(0)
posted @ 2022-07-05 21:19
CrossPython
阅读(31)
推荐(0)
摘要:
opacity :设置背景透明度 rgba():设置颜色透明度 1.opacity 属性的效果是给背景颜色添加透明度,取值范围是0~1, 但也会让处于背景颜色中的字体一同透明, 单用效果很好 2.rgba(): R:红色值。正整数 (0~255) G:绿色值。正整数 (0~255) B:蓝色值。正整
阅读全文
posted @ 2022-07-04 11:14
CrossPython
阅读(585)
推荐(0)
摘要:
cratesrust-analysisTOML language supportrust -hint开启?
阅读全文
posted @ 2022-07-02 23:14
CrossPython
阅读(57)
推荐(0)
摘要:
[dependencies] reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "blocking"] } html2md = "0.2" use std::fs; fn main()
阅读全文
posted @ 2022-07-02 23:05
CrossPython
阅读(30)
推荐(0)
摘要:
https://kaisery.github.io/trpl-zh-cn/foreword.html rust 的核心思想是 由程序员,语法,编译器 共同 维护 程序内的变量生成,使用,复制,转移和销毁。 基本数据类型 i8,i16,i32,i64,i128 // 有符号整数 u8,u16,u32,
阅读全文
posted @ 2022-07-02 21:29
CrossPython
阅读(177)
推荐(1)
摘要:
改源码 requestium.py if isinstance(self.webdriver_options['prefs'], dict): download_dir = self.webdriver_options['prefs'].get('download.default_directory
阅读全文
posted @ 2022-07-02 16:18
CrossPython
阅读(45)
推荐(0)
摘要:
CREATE SEQUENCE my_serial AS integer START 1 OWNED BY address.new_id; ALTER TABLE address ALTER COLUMN new_id SET DEFAULT nextval('my_serial');
阅读全文
posted @ 2022-06-30 15:24
CrossPython
阅读(28)
推荐(0)
摘要:
error: failed to run custom build command for `openssl-sys v0.9.63` try directly, cargo install wasm-pack --git https://github.com/rustwasm/wasm-pack
阅读全文
posted @ 2022-06-29 22:11
CrossPython
阅读(44)
推荐(0)
摘要:
CREATE TABLE "public"."my_pg_table" ( "id" BIGSERIAL NOT NULL, "content" VARCHAR NULL DEFAULT NULL, "yesterday" DATE NOT NULL DEFAULT DATE(TIMEZONE('U
阅读全文
posted @ 2022-06-27 09:46
CrossPython
阅读(5189)
推荐(0)
摘要:
// 什么是问号操作符? // 参考: https://doc.rust-lang.org/book/second-edition/ch09-02-recoverable-errors-with-result.html // 参考: https://stackoverflow.com/questio
阅读全文
posted @ 2022-06-26 09:08
CrossPython
阅读(269)
推荐(0)
摘要:
option = { tooltip: { trigger: 'axis' }, title: [ { text: 'X轴最大变量', textAlign: 'center', left: '80%', top: '80%', textStyle: { fontSize: 100 } }, ], b
阅读全文
posted @ 2022-06-24 10:08
CrossPython
阅读(28)
推荐(0)
摘要:
<!-- THIS EXAMPLE WAS DOWNLOADED FROM https://echarts.apache.org/examples/zh/editor.html?c=line-race --> <!DOCTYPE html> <html lang="zh-CN" style="hei
阅读全文
posted @ 2022-06-23 23:10
CrossPython
阅读(71)
推荐(0)
摘要:
option = { color: ['#80FFA5', '#00DDFF', '#37A2FF', '#FF0087', '#FFBF00'], title: { text: '' }, tooltip: { trigger: 'axis', axisPointer: { type: 'cros
阅读全文
posted @ 2022-06-23 20:50
CrossPython
阅读(92)
推荐(0)
摘要:
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests bot = requests.session() bot.get('http://google.com') 保持 import requests, pickle session
阅读全文
posted @ 2022-06-18 20:13
CrossPython
阅读(321)
推荐(0)
摘要:
from pyecharts.charts import Bar, Pie, Page, Grid, Line, Geo from pyecharts.faker import Faker from pyecharts import options as opts from pyecharts.gl
阅读全文
posted @ 2022-06-02 20:21
CrossPython
阅读(147)
推荐(0)
摘要:
首先,安装中文支持包language-pack-zh-hans: sudo apt-get install language-pack-zh-hans 然后,修改/etc/environment(在文件的末尾追加): LANG="zh_CN.UTF-8"LANGUAGE="zh_CN:zh:en_U
阅读全文
posted @ 2022-05-28 21:45
CrossPython
阅读(2685)
推荐(0)
摘要:
sender: django -> dataframe -> to_dict -> JsonResponse -> receiver: django -> result=post.json() -> df = pd.DataFrame(result) -> convert df2dict
阅读全文
posted @ 2022-05-19 09:09
CrossPython
阅读(201)
推荐(0)
摘要:
https://pypi.tuna.tsinghua.edu.cn/simple/opencv-python/ 根据你python的版本,自己下载与python版本对应的opencv-python,网址如下 下载opencv-python 比如我的是python3.7,64位系统,就下载 openc
阅读全文
posted @ 2022-05-16 13:32
CrossPython
阅读(82)
推荐(0)
摘要:
pkg updatepkg upgrade whoamiifconfig termux-change-repopkg install proot-distroproot-distro install ubuntuproot-distro login ubuntu =>任何时候都通过这个登陆 pkg
阅读全文
posted @ 2022-05-05 09:00
CrossPython
阅读(424)
推荐(0)
摘要:
from django.shortcuts import HttpResponse import psutil from .models.first import func from multiprocessing import Process def index(request): n = 888
阅读全文
posted @ 2022-04-23 20:24
CrossPython
阅读(70)
推荐(0)
摘要:
celery Redis Queue 只需使用一个线程。 import threading t = threading.Thread(target=long_process, args=args, kwargs=kwargs) t.setDaemon(True) t.start() return H
阅读全文
posted @ 2022-04-23 14:52
CrossPython
阅读(633)
推荐(0)
posted @ 2022-04-23 12:17
CrossPython
阅读(22)
推荐(0)
摘要:
from subprocess import PIPE, STDOUT,Popen import traceback import subprocess # # -*- encoding=utf-8 -*- # from subprocess import Popen, PIPE, STDOUT #
阅读全文
posted @ 2022-04-22 23:19
CrossPython
阅读(28)
推荐(0)
摘要:
https://www.cnblogs.com/jmilkfan-fanguiju/p/7533729.htmlWindows PowerShell 版权所有 (C) Microsoft Corporation。保留所有权利。 尝试新的跨平台 PowerShell https://aka.ms/ps
阅读全文
posted @ 2022-04-22 22:07
CrossPython
阅读(40)
推荐(0)
摘要:
# https://msdn.microsoft.com/en-us/library/windows/desktop/aa383608(v=vs.85).aspx """ Windows Task Scheduler Module .. versionadded:: 2016.3.0 A modul
阅读全文
posted @ 2022-04-22 21:20
CrossPython
阅读(61)
推荐(0)
摘要:
After looking around the internet for many days. I've decided to ask my own question. I've done some digging around and found some ways to implement t
阅读全文
posted @ 2022-04-22 09:57
CrossPython
阅读(509)
推荐(0)
摘要:
0.安装selenium + Chrome Driver安装selenium:pip install selenium安装Chrome Driver: 下载:http://chromedriver.storage.googleapis.com/index.html版本要对应(chrome://ver
阅读全文
posted @ 2022-04-10 17:59
CrossPython
阅读(69)
推荐(0)
摘要:
import sys import requests from requestium import Session, Keys import json import pandas as pd import time import pickle import os import datetime im
阅读全文
posted @ 2022-04-10 17:37
CrossPython
阅读(84)
推荐(0)
摘要:
firstly, get cookie: browser.get_cookies()then transfer to requests session: cookies = login() for cookie in cookies: session.cookies.set(cookie['name
阅读全文
posted @ 2022-04-06 10:50
CrossPython
阅读(29)
推荐(0)
摘要:
Exception 会捕获除了SystemExit 、KeyboardInterrupt 和GeneratorExit 之外的所有异常。 如果你还想捕获这三个异常,将 Exception 改成 BaseException 即可。
阅读全文
posted @ 2022-04-04 19:25
CrossPython
阅读(497)
推荐(0)