-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfdirectory.py
More file actions
36 lines (32 loc) · 845 Bytes
/
fdirectory.py
File metadata and controls
36 lines (32 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
os.getcwd()
print(os.getcwdb())
print(os.listdir())
# print(check)
# print(os.mkdir('testdir'))
print(os.listdir())
# os.mkdir('testdir')
# create file in directory
fname = open('testdir/text.txt', 'a')
fwrite = open('testdir/text.txt','w')
fwrite.write('Hello sushil how are you\nthis is firs directory inccer page')
# read the file
# fread = open('testdir/text.txt','r')
print(open('testdir/text.txt', 'r').read())
# print(os.remove('testdir/text.txt'))
# use shutil modul to delete non empty dierecoty
import shutil
shutil.rmtree('testdir')
# fname.write = 'hello sushil\nthis is a dmeo file which i just created ok.'
# print(fname.read())
# print(os.rename('testdir','newtest'))
# print(os.rmdir('newtest'))
print(os.listdir())
def funcname():
pass
# function functionName(){
# function body
# }
a = '1'
b = 1
print(a)