Horje
python read file from same directory Code Example
python open file same folder
import os
with open(os.path.join(sys.path[0], "my_file.txt"), "r") as f:
    print(f.read())
python read file from same directory
f = open(os.path.join(sys.path[0], "test.html"), "r")
print(f.read())
f.close()




Python

Related
permutation with repetition python Code Example permutation with repetition python Code Example
python subprocess print stdout while process running Code Example python subprocess print stdout while process running Code Example
drop-trailing-zeros-from-decimal python Code Example drop-trailing-zeros-from-decimal python Code Example
loop through list of tuples python Code Example loop through list of tuples python Code Example
sort dictionary by values Code Example sort dictionary by values Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7