ICode9

精准搜索请尝试: 精确搜索
  • Win-KeX/wsl2/kali启动报错 - A fatal error has occurred and VcXsrv will now exit.2022-06-15 18:34:09

    A fatal error has occurred and VcXsrv will now exit. Cannot open log file "/tmp/win-kexsl_******.log" Please open /tmp/win-kexsl_keiplyer.log for more information. Vendor: The VcXsrv Project Release: 1.20.14.0 Contact: marha@users.sourceforge.ne

  • Ubuntu安装完成后修改源2022-06-15 13:31:25

    安装VMware-tools工具 找到磁盘进行解压VMware-tools sudo tar -xf vmware-tools.gz -C /tmp/ 安装完成后vmware-tools后无法进行文件拖拽 1、安装open-vm-tools 进入系统后,使用以下命令安装open-vm-tools: sudo apt-get install open-vm-tools 执行完成后,重启系统,发现系统界面

  • python之 shelve模块2022-06-15 00:38:23

    python之 shelve模块 shelve模块比pickle模块简单,只有一个open函数,返回类似字典的对象,可读可写;key必须为字符串,而值可以是python所支持的数据类型 f=shelve.open(r'sheve.txt') # f['stu1_info']={'name':'wei','age':18,'hobby':['piao','s

  • 回溯法2022-06-14 13:02:28

    https://leetcode.cn/problems/IDBivT/solution/sheng-cheng-pi-pei-de-gua-hao-by-leetcod-ro96/ class Solution { void backtrack(vector<string>& ans, string& cur, int open, int close, int n) { if (cur.size() == n * 2) { a

  • 文件操作2022-06-12 10:01:14

    假如现在这个世界上,如果可以操作文件的所有软件都消失了,比如word,wps等等,此时你的朋友通过聊天软件给你发过来一个文件,文件名是:娱乐圈明星联系方式.txt,在座的所有同学,那么你接受到这个文件之后,你的内心是否有一丝冲动,想要看看里面写的是什么。但是前提说了所有可以操作文件的软件全

  • python之拷贝文件2022-06-09 00:00:56

    python之拷贝文件 使用python实现类似cp的功能 方式一: 文件with读写模式 #!/bin/python3 # -*- coding: utf-8 -*- src_file=input('源文件路径:').strip() dst_file=input('目标文件路径:').strip() with open (r'%s' %src_file,mode='rb') as read_f,\ open (r

  • Python 读取txt文件时,'gbk' codec can't decode byte 0xaf in position 6532: illegal multibyt2022-06-08 22:37:01

    解决办法:(1)在打开文本的时候,设置其编码的格式. 如:f=open('1.txt','r',encoding='gbk')(2)如果上一步还是不能解决,那么就是打开的1.txt文本中的一些内容超出了GBK编码的范围.可以选择使用编码更广的'gb1830', 如:f=open('1.txt','r',encoding='gbk')(3)还是不能解决?那

  • 5.24. 学习记录2022-06-08 18:02:57

    1. C语言open 函数 C语言open()函数:打开文件函数_C语言中文网 (biancheng.net) C语言open()函数:打开一个文件 - C语言网 (dotcpp.com)   2. define 定义空字符串  这种方法是用于将空字符串定义为一个新命名,用于给 ifdef 做标志的; 同样有用的是头文件开头为了防止反复编译而设

  • XMLHttpRequest2022-06-08 11:32:43

    概念 XMLHttpRequest:是浏览器内置的一个构造函数 作用:基于 new 出来的 XMLHttpRequest 实例对象,可以发起 Ajax 的请求 使用 使用 XMLHttpRequest 发起 GET 请求 主要的 4 个实现步骤: ① 创建 xhr 对象 ② 调用 xhr.open() 函数 ③ 调用 xhr.send() 函数 ④ 监听 load 事件 let xhr

  • layer.open 提交成功自动关闭窗口,并重新加载页面2022-06-07 00:35:22

    两个open success: function (data1) { if(data1.resultCode==0){ layer.msg('办结成功!', { icon: 1, time: 2000 //2秒关闭(

  • Python3:使用open()打开文件时报错'gbk' codec can't decode byte2022-06-04 20:00:07

    错误提示很明显,就是编码方式不对。 原因: 在Windows下Python使用open()函数打开文件时会默认使用gbk解码。即使文件本身存储为UTF-8格式。 解决方案:指定参数encoding为utf-8 即: 将 with open('file_name', 'r') as f: 改为: with open('file_name','r',encoding='utf-8') as f:

  • python 文件操作模式2022-06-02 18:01:15

    对文件操作的基本步骤 f=open('a.txt','r',encoding='utf-8') data=f.read() print(data) f.close() 文件的打开和关闭使用open()、close()函数,文件刚打开时光标在最前面。 open()函数的第一个参数为要打开的文件名,默认路径为这个脚本所在路径;第二个参数为打开模式,第三个参数为

  • 实验62022-06-01 17:04:06

    task1 f1=open('data3_id.txt','r',encoding='utf-8') list1,list3=[],[] for i in f1.readlines(): list1.append(i.strip().split(',')) def is_valid(x): if len(x)==18: for i in x: if '0�

  • 实验62022-05-28 17:03:35

    f1=open('data3_id.txt','r') list1,list3=[],[] for i in f1.readlines(): list1.append(i.strip().split(',')) def is_valid(x): if len(x)==18: for i in x: if'1'<=i<='9'or i==&#

  • Linux中级——“驱动” 控制硬件必须学会的底层知识2022-05-25 22:31:48

    驱动认知 1. 什么是驱动 驱动就是对底层硬件设备的操作进行封装,并向上层提供函数接口。 设备分类: linux系统将设备分为3类:字符设备、块设备、网络设备。 字符设备:指只能一个字节一个字节读写的设备,不能随机读取设备内存中的某一数据,读取数据需要按照先后顺序。字符设备是面向流

  • 实验62022-05-25 16:03:01

    3 1 def is_valid(a): 2 l=0 3 f=0 4 for i in a: 5 l+=1 6 if '0'<=i<='9' or i=='X': 7 pass 8 else: 9 f+=1 10 break 11 if l!=18 or f!=0:

  • 实验六2022-05-25 13:02:15

    def is_valid(x): if len(x[1])==18 and (x[1][:-1].isdigit() and x[1][-1] in '0123456789X'): return True return Falsewith open('data3_id.txt','r',encoding='utf-8') as f: id_name=[(i[:2],i[3:].strip(�

  • 实验62022-05-25 12:33:01

    def is_valid(x): ls=[str(i) for i in range(0,10)] ls.append('X') if len(x)<18: return False for a in range(len(x)): if x[a] not in ls: return False break if a==len(x)-1: retu

  • 实验62022-05-25 12:32:48

      2 f1=open('data3_id.txt','r') 3 list1,list3=[],[] 4 for i in f1.readlines(): 5 list1.append(i.strip().split(',')) 6 def is_valid(x): 7 if len(x)==18: 8 for i in x: 9 if'1'<=i

  • 实验62022-05-25 07:31:08

    task3 # Created on 刘杰的iPad. f1=open('data3_id.txt','r') list1,list3=[],[] for i in f1.readlines(): list1.append(i.strip().split(',')) def is_valid(x): if len(x)==18: for i in x: if'1'<

  • 实验六2022-05-25 02:32:53

              with open("data5.txt","r",encoding="utf-8") as f: d=f.readlines() import random n=int(input("输入随机抽点人数:")) f1=set() l=len(f1) while l<n: f=random.randint(0,len(d)) f1.add(d[f]) l=len(f1

  • 实验62022-05-24 23:04:01

    import random n = eval(input('输入抽取数目:')) with open('C:\\Users\\肖鑫\\Desktop\\实验6数据文件\\实验6数据文件\\data5.txt','r',encoding='utf-8') as f: x = [] for line in f: x.append(line.strip('\n�

  • 实验六2022-05-24 22:34:39

    def is_valid(m): if len(m)==18 and m.isdigit(): return 'True' elif len(m)==18 and m[-1]=='X': return 'True' else: return 'False' with open('D:/实验六数据文件data3_id.txt',

  • 实验六 付子安 2021838200352022-05-24 22:01:51

    1 title = ['城市', '人口(万)'] info = [ ['南京', '850'], ['纽约', '2300'], ['东京', '3800'], ['巴黎', '1000'] ] with open('city1.csv'

  • 实验六2022-05-24 18:35:40

    #task3.py def is_valid(x): if len(x) != 18: return False else: for i in x: try: i = int(i) except: if ord(i) != ord('X'): return False re

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有