2.2.7.py 335 B

1234567891011
  1. import os
  2. print('1')
  3. print(os.path.abspath(__file__))
  4. current_dir = os.path.abspath(os.path.dirname(__file__))
  5. file_path = os.path.join(current_dir, 'test.txt')
  6. print('and the file_path is:', file_path)
  7. print('dirname we get is:', os.path.abspath(os.path.dirname(__file__)))
  8. print('this what we get with "os.getcwd()"', os.getcwd())