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
e61d7229
authored
Oct 04, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
6d261686
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
15 deletions
diy.py
q.py
sales_list.txt
diy.py
View file @
e61d7229
li
=
[
'小'
,
'虎'
,
'语'
]
f
=
open
(
r'c:\Users\29018\Documents\lesson13-1\sales_list.txt'
,
'r'
,
encoding
=
'utf-8'
)
file
=
open
(
'C:
\\
Users
\\
29018
\\
Desktop
\\
test.txt'
,
'w'
,
encoding
=
'utf-8'
)
a
=
f
.
readlines
()
file
.
writelines
(
li
)
print
(
a
)
\ No newline at end of file
f
.
close
()
\ No newline at end of file
q.py
View file @
e61d7229
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
.
readlines
()
print
(
b
)
for
i
in
b
:
print
(
i
)
sales_list.txt
View file @
e61d7229
悟空 122 34 67
open(r'c:\Users\29018\Documents\lesson13-1\sales_list.txt','r',encoding=utf-8)
积极 23 90 89
\ No newline at end of file
\ 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