Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson7_2
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5593ec88
authored
Sep 23, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
e6025c3c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
6 deletions
3.py
diy2.py
myh.csv
xxx.csv
3.py
0 → 100644
View file @
5593ec88
import
csv
with
open
(
r"C:\Users\EDY\Desktop\myh.csv"
)
as
f
:
r
=
csv
.
reader
(
f
)
print
(
list
(
r
))
\ No newline at end of file
diy2.py
View file @
5593ec88
message
=
"诺依,周末一起去看动漫展吧!"
# a=[["角色","血量","战斗力","元神"],["悟空","100","150","21"],["八戒","60","23","12"],["小A","80","65","12"]]
# file=open(r"C:\Users\EDY\Desktop\myh.csv","w",encoding="utf-8")
# 请对message进行遍历,取出所有元素
# for item in a:
for
i
in
message
:
# file.write(",".join(item)+"\n")
print
(
i
)
# file.close()
# import csv
# file=open(r"C:\Users\EDY\Desktop\myh.csv","w",newline="",encoding="utf-8")
# write=csv.writer(file)
# a=[["角色","血量","战斗力","元神"],["悟空","100","150","21"],["z八戒","60","23","12"],["A","80","65","12"]]
# for row in a:
# write.writerow(row)
# file.close()
# with open (r"C:\Users\EDY\Desktop\myh.csv")as f:
# a=[]
# for line in f:
# row=line.strip("\n").split(",")
# a.append(row)
# print(a)
# import csv
# with open(r"C:\Users\EDY\Desktop\myh.csv") as f:
# r=csv.reader(f)
# print(list(r))
\ No newline at end of file
myh.csv
0 → 100644
View file @
5593ec88
角色,血量,战斗力,元神
悟空,100,150,21
八戒,60,23,12
小A,80,65,12
xxx.csv
0 → 100644
View file @
5593ec88
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment