Python Forum
getting a full path string from a pathlib.PurePath object
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
getting a full path string from a pathlib.PurePath object
#2
In [1]: import pathlib

In [2]: path = pathlib.Path('.')

In [3]: full_path = path.absolute()

In [4]: my_path = full_path.as_posix()

In [5]: print(my_path)
/home/victor

In [6]: type(my_path)
Out[6]: str
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
RE: getting a full path string from a pathlib.PurePath object - by wavic - Mar-20-2018, 07:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  -i option changes sys.path (removes leading empty string '') markanth 6 2,031 Aug-26-2022, 09:27 PM
Last Post: markanth
  Pathlib import not working chriswrcg 9 3,793 May-29-2022, 07:37 PM
Last Post: snippsat
  Convert string to path using Python 2.7 tester_V 10 6,546 Nov-20-2021, 02:20 PM
Last Post: snippsat
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,239 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  deleting an empty Dir, using pathlib.Path tester_V 9 5,924 Jul-01-2021, 01:53 PM
Last Post: Gribouillis
  Trying to pathlib instead of os.path tester_V 4 2,525 Jun-22-2021, 04:15 AM
Last Post: tester_V
  TypeError: int() argument must be a string, a bytes-like object or a number, not 'Non Anldra12 2 5,253 May-02-2021, 03:45 PM
Last Post: Anldra12
  pathlib destpath.exists() true even file does not exist NaN 9 4,744 Dec-01-2020, 12:43 PM
Last Post: NaN
  How to convert a string "<... object at POINTER>" to an object? mandaxyz 5 3,710 Aug-08-2020, 10:44 PM
Last Post: mandaxyz
  C-API for Python 3 - Get String from Object mga010 2 3,649 Jun-23-2020, 04:32 PM
Last Post: mga010

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020