Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson12-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
7ff5e1ec
authored
Aug 29, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
3b59c8ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
diy.py
diy1.py
diy.py
View file @
7ff5e1ec
with
open
(
r"C:\Users\Windows\Desktop\test.txt"
,
'a'
,
encoding
=
'utf_8'
)
as
file1
:
#file1=open(r"C:\Users\Windows\Desktop\test.txt",'a',encoding='utf_8')
file1
.
write
(
'张凌:16本
\n
'
)
#file1.write('张凌:16本\n')
#file1.close()
\ No newline at end of file
#with open(r"C:\Users\Windows\Desktop\test.txt",'a',encoding='utf_8')as file1:
# file1.write('张凌:16本\n')
#file1=open(r"C:\Users\Windows\Desktop\test.txt",'r',encoding='utf_8')
#aa=file1.read()
#print(aa)
with
open
(
r"C:\Users\Windows\Desktop\test.txt"
,
'r'
,
encoding
=
'utf_8'
)
as
file1
:
aa
=
file1
.
read
()
print
(
aa
)
\ No newline at end of file
diy1.py
0 → 100644
View file @
7ff5e1ec
with
open
(
r"C:\Users\Windows\Desktop\test.txt"
,
'r'
,
encoding
=
'utf_8'
)
as
file1
:
for
i
in
file1
:
print
(
i
)
if
'小兰:12本
\n
'
in
filel
:
print
(
'存在'
)
else
:
print
(
'不存在'
)
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