#encoding=utf-8
import cv2
import json
import numpy as np
import torch
from skimage import measure
from skimage import morphology
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.optim as optim
import matplotlib.pyplot as plt
from PIL import Image
import warnings
from collections import namedtuple
from torch.utils.model_zoo import load_url as load_state_dict_from_url
import re
def Readinfor():
with open('lucky.txt') as a:
head= a.readlines(1)
print("head = ", head)
str2 = str(head)
#print("abc = ", str2.split(','))
strimgh = str2.split(',')[1]
#print("strimgh = ", strimgh)
strhimg = re.sub("\D", "", strimgh)
strimgw = str2.split(',')[0]
#print("strimgw = ", strimgw)
strwimg = re.sub("\D", ""
python 读取txt中数字的方法
最新推荐文章于 2024-08-04 22:09:35 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)