Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13_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
dcb390a6
authored
Mar 06, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
aee22136
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
diy.py
sales_list.txt
diy.py
View file @
dcb390a6
with
open
(
r'c:\Users\Administrator\Desktop\sales_list.txt'
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
a
=
file
.
readlines
()
for
i
in
a
:
data
=
i
.
split
()
print
(
data
)
\ No newline at end of file
a
=
[
'你好啊
\n
'
,
'悟空
\n
'
,
'我在贝尔编程学python
\n
'
]
with
open
(
r'c:\Users\Administrator\Desktop\hello.txt'
,
'a'
,
encoding
=
'utf-8'
)
as
file
:
file
.
writelines
(
a
)
sales_list.txt
View file @
dcb390a6
...
...
@@ -13,5 +13,8 @@
王娇 12 11 12 12 15 35 23 11
ith open(r'c:\Users\Administrator\Desktop\sales_list.txt','r',encoding='utf-8')as file:
a=file.readlines()
with open(r'c:\Users\Administrator\Desktop\sales_list.txt','r',encoding='utf-8')as file
a=file.readlines()
for i in a:
print(i)
\ No newline at end of file
data=i.split()
print(data)
\ 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