from os import *
#import os
def foo():
a = listdir("trainingDigits")
b = open("trainingDigits/0_0.txt")
This code, if only enabled
from os import *
It will then be in
b = open(“trainingDigits/0_0.txt”)
This location reports
TypeError: Required argument ‘flags’ (pos 2) not found
If you enable only
import os
Name error: name ‘listdir’ is not defined will be reported at a = listdir (“training digits”)
The solution is
import os
def foo():
a = os.listdir("trainingDigits")
b = open("trainingDigits/0_0.txt")
Similar Posts:
- The bilibilibili cache video cache batch converted to MP4 format Python code
- How to Solve Libpng warning ICCP error
- AttributeError: module ‘cv2’ has no attribute ‘SIFT’ [How to Solve]
- Python Exception: TypeError: write() argument must be str, not list
- [Solved] Tensorflow TypeError: Fetch argument array has invalid type ‘numpy.ndarry’
- Python TypeError: __init__() missing 1 required positional argument: ‘on_delete’
- Python_:TypeError: write() argument must be str, not int
- Python OpenCV TypeError: integer argument expected, got float
- How to Solve Django xadmin installation Error [7 Types of Errors]
- [Solved] ImportError: cannot import name pywrap_tensorflow