convention

How to name variable correctly to avoid warning like "Shadows name from outer scope" in Python

How to name variable correctly to avoid warning like "Shadows name from outer scope" in Python Question: I use PyCharm for my python program, and I wrote codes below: def get_files_name(): root_dir = “/Volumes/NO NAME/” for root, ds, fs in os.walk(root_dir): for f in fs: print(os.path.join(root_dir, f)) get_files_name() for root, ds, fs in os.walk(other_dir): pass …

Total answers: 4