Posts: 4,646
Threads: 1,493
Joined: Sep 2016
Mar-22-2018, 03:47 AM
(This post was last modified: Mar-22-2018, 03:54 AM by Skaperen.)
(Mar-21-2018, 09:50 AM)DeaD_EyE Wrote: str(your_path.resolve())
The method resolve
returns a new Path object.
Path objects have a magic method for str and bytes (__str__, __bytes__).
str(pathobject) -> returns a str of the path
see my original post.
(Mar-21-2018, 09:50 AM)DeaD_EyE Wrote: str(your_path.resolve())
The method resolve
returns a new Path object.
Path objects have a magic method for str and bytes (__str__, __bytes__).
str(pathobject) -> returns a str of the path
also:
resolve
requires that the file exist. we need a PurePath version of that just for resolving
/../
. also a Path version for resovling both
/../
and
symlinks
that gracefully ends when a non-existing directory is encountered.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,646
Threads: 1,493
Joined: Sep 2016
Mar-23-2018, 12:31 AM
(This post was last modified: Mar-23-2018, 12:38 AM by Skaperen.)
i am using 3.5.2. that's what comes in Ubuntu 16.04.3 LTS. maybe 18.04 will fix this and include 3.6. but i want my code that uses pathlib to work on 16.04.X systems.
as for my original question, i found documentation that says str() is the right way to get just a string. it was in the "Operators" section, which i skipped over when i found a / thing that acted what i thought was wrong.
i don't think of str() as an operator but, apparently, BDFL does, so i should do that, at least in a Python context.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,646
Threads: 1,493
Joined: Sep 2016
Mar-24-2018, 03:55 AM
(This post was last modified: Mar-24-2018, 04:01 AM by Skaperen.)
i need to find documentation on how pyenv works in a technical sense, before i ever run it on my system. else i will have to isolate it in a VM or some other instance.
i have not yet decided if i will upgrade to Ubuntu 18.04 LTS, yet. i might just do it in a VM giving it the whole 2nd 1TB drive my laptop has. then it will be easier to run it on real hardware.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.