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
2c966a2a
authored
a year ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
ab6c3f65
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
d.py
diy2.py
w.py
d.py
0 → 100644
View file @
2c966a2a
# import csv
# file=open(r"C:\Users\EDY\Desktop\ngm.csv","w",newline="")
# write=csv.writer(file)
# ls=[["角色","血量","战斗力","元神"],["悟空","100","150","21"],["八戒","60","23","12"],["小A","80","65","12"]]
# #with open(r"C:\Users\EDY\Desktop\ngm.csv","w") as f:
# # pass
# #file=open(r"C:\Users\EDY\Desktop\ngm.csv",'w',encoding='utf-8')
# for row in ls:
# write.writerow(row)
# file.close()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
diy2.py
View file @
2c966a2a
message
=
"诺依,周末一起去看动漫展吧!"
with
open
(
r"C:\Users\EDY\Desktop\ngm.csv"
,
"w"
)
as
f
:
pass
# 请对message进行遍历,取出所有元素
for
i
in
message
:
print
(
i
)
This diff is collapsed.
Click to expand it.
w.py
0 → 100644
View file @
2c966a2a
import
csv
with
open
(
r'C:\Users\EDY\Desktop\ngm.csv'
)
as
f
:
r
=
csv
.
reader
(
f
)
print
(
list
(
r
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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