Answers for "fs get file in other directory"

-3

python read all text files in directory

import os
from re import search

arr = os.listdir()
strtxt = ".txt"
for txtfile in arr:
    if txtfile.__contains__(strtxt):
        fileObject = open(txtfile, "r")
        data = fileObject.read()
        print(data)
Posted by: Guest on December-22-2020
0

how to copy file in root directory

sudo cp -R /path/to/files/you/want/copied/ /copy/to/this/path/
Posted by: Guest on December-05-2019

Python Answers by Framework

Browse Popular Code Answers by Language