Sep-23-2018, 08:56 PM
Its the first time I'm using pathlib. Any reference to it seems to hang. Is it something to so with permissions ?
I'm working under my home directory, so there shouldn't be an issue.
I'm working under my home directory, so there shouldn't be an issue.
Output:bluefrog@pk:~/sample_code$ ls -ltr
total 48
drwxr-xr-x 2 bluefrog bluefrog 4096 May 22 2017 db_release
drwxr-xr-x 3 bluefrog bluefrog 4096 Nov 7 2017 bash
drwxr-xr-x 3 bluefrog bluefrog 4096 Apr 21 21:28 c++
drwxrwxr-x 28 bluefrog bluefrog 4096 Sep 23 12:10 python
drwxr-xr-x 3 bluefrog bluefrog 4096 Sep 23 15:34 python_tests
drwxr-xr-x 5 bluefrog bluefrog 4096 Sep 23 15:55 pthon_docs
bluefrog@pk:~/sample_code$ whoami
bluefrog
The code is quite simple:import pathlib print("Present working directory : {}".format(pathlib.Path.cwd())) rootdir = pathlib.Path("/home/bluefrog/sample_code/python") for path in rootdir.glob("./*.py"): print(path, path.stat().st_size, path.parent)Any ideas ?