w10schools
Login Register
  • Home
  • Tutorials
    • HTML, CSS
      • HTML, HTML5
      • CSS, CSS3
    • XML
    • JavaScript, AJAX
    • PHP
    • Ruby on Rails
      • Ruby
      • Rails
    • ASP.NET
      • ASP
      • C# .NET
    • Java
      • JSP
    • Databases
      • MySQL
      • MSSQL Server
      • Oracle
    • Web Server
      • Windows
      • Linux
      • Apache
      • IIS
    • Design
      • Dreamweaver
      • Flash
      • Photoshop
      • Fireworks
      • CorelDRAW
      • Illustrator
  • References
    • HTML
      • Bootstrap
    • CSS
      • CSS Selectors
      • Sass
    • JavaScript
    • Mobile Apps
      • Cordova
    • Ruby on Rails
      • Ruby
      • Rails
    • PHP
      • Function
      • Language
      • CodeIgniter
      • Phalcon
      • PHPUnit
      • Symfony
      • Drupal
      • Yii
      • Laravel
    • Perl
      • Perl
    • Python
      • Python
      • Django
      • NumPy
      • Pandas
      • scikit-image
      • scikit-learn
      • Statsmodels
      • Matplotlib
    • Lua
      • Lua
    • C, C++
      • C
      • C++
    • Server
      • Docker
      • Apache HTTP Server
      • Nginx
    • Database
      • PostgreSQL
    • Big Data
      • TensorFlow
    • Game Development
      • Phaser
      • LÖVE
  • Articles
    • News
    • General
      • Website Promotion
      • Online Advertising
      • Make Money Online
    • Editorials
    • Interviews
    • Web Roundups
  • Resources
    • Design
      • Fonts
      • Graphics
      • Vectors
      • Templates
      • UI (User Interface)
      • Brushes
      • Patterns, Backgrounds
      • Textures
    • Web Development
      • HTML, CSS
      • XML
      • JavaScript, AJAX
      • Ruby on Rails
      • PHP
      • Java
      • .NET
      • Python
      • Perl
      • Flash
    • Mobile Application Development
      • Mobile Development Tools
      • Swift
    • Online Services
      • Online Storage
      • Web Hosting
  • Tools
    • Generators
Edit
In Place Editing Advanced Editing
  • References
  • Python
  • Python
  • File & Directory Access

pathlib.Path.home()

classmethod Path.home()

Return a new path object representing the user’s home directory (as returned by os.path.expanduser() with ~ construct):

>>> Path.home()
PosixPath('/home/antoine')

New in version 3.5.

Links:
  • https://docs.python.org/3.5/library/pathlib.html#pathlib.Path.home
doc_python
doc_python
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.

Popular Articles
pathlib.Path class pathlib.Path(*pathsegments) A subclass of PurePath, this class represents concrete paths of the system’s path flavour (instantiating it crea
pathlib.Path.resolve() Path.resolve() Make the path absolute, resolving any symlinks. A new path object is returned: >>> p = Path() >>> p PosixPath('.'
pathlib.Path.iterdir() Path.iterdir() When the path points to a directory, yield path objects of the directory contents: >>> p = Path('docs') >>> for c
pathlib.Path.owner() Path.owner() Return the name of the user owning the file. KeyError is raised if the file’s uid isn’t found in the system database.
pathlib.Path.replace() Path.replace(target) Rename this file or directory to the given target. If target points to an existing file or directory, it will be unconditiona


Return to View
  • Facebook
  • Tweet
  • Digg it
  • Stumbleupon
  • Delicious
  • Plus Share

Designed by : w10schools

service@w10schools.com

Our Partners: aeeble – Providing content publishing and search solutions