Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13-1
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
93695532
authored
Oct 04, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
a7ae0341
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
q.py
sales_list.txt
q.py
View file @
93695532
ww
=
open
(
r'c:\Users\29018\Documents\lesson13-1\sales_list.txt'
,
'w'
,
encoding
=
'utf-8'
)
ww
.
write
(
'悟空 122 34 67
\n
积极 23 90 89'
)
ww
.
close
()
ww
=
open
(
r'c:\Users\29018\Documents\lesson13-1\sales_list.txt'
,
'r'
,
encoding
=
'utf-8'
)
b
=
ww
.
read
()
print
(
b
)
\ No newline at end of file
b
=
ww
.
readlines
()
print
(
b
)
for
i
in
b
:
print
(
i
)
sales_list.txt
View file @
93695532
ww=open(r'c:\Users\29018\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8')
b=ww.read()
print(b)
\ No newline at end of file
悟空 122 34 67
积极 23 90 89
\ No newline at end of file
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