Skip to main content

use windows path to generate Path object.

Project description

处理windows路径

直接复制windows路径中,字符串中包含反斜杠,一般需要改成双反斜杠或者rstr。 用slash_path,可以直接用反斜杠的windows路径,产生Path对象,更方便一些。

参考项目

主要代码参考了这个最后一个:https://discourse.techart.online/t/python-handling-windows-path-with-characters/12045/18。

安装

$ pip install slash_path

使用

from slash_path import SlashPath
path_str = 'D:\next_cloud\newfile.txt'
sp = SlashPath(path_str)

更多范例参见utest文件夹。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slash_path-0.1.1.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file slash_path-0.1.1.tar.gz.

File metadata

  • Download URL: slash_path-0.1.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.10

File hashes

Hashes for slash_path-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d69c4fb0b35af9978b367191e08479fca9245786fcd35ac373758ebf081373f4
MD5 1b92662f763015a17d8827d43ef5518e
BLAKE2b-256 0cab45d038c379ac6ed3dd08e8c7235f4353e21e7907539fff7f55da687a14ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page