Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Definitive Python wrapper for Windows System Path

License

NotificationsYou must be signed in to change notification settings

RealGreenDragon/winsyspath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPi.org VersionPyPi.org LicensePyPi.org Py Versions

winsyspath

Definitive Python wrapper for Windows System Path

Compatibility

  • Python 2.7.x
  • Python 3.x and newer

Example

import winsyspath# Directory to add in the System Pathpath = 'C:\\'# Init System Path wrapper and read its actual valuesyspath_wrapper = winsyspath.WinSysPath()# Try to add a path into System pathtry:    if syspath_wrapper.add(path):        print("The path "{}" is correctly added to the System Path".format(path))    else:        print("The path "{}" is already in System Path, so cannot be added".format(path))except (EnvironmentError, WindowsError, OSError, ValueError) as ex:    print("Error -> {}".format(str(ex)))# Reload System path value (needed only if it is modified outside python)syspath_wrapper.reload()# Print System Path value as a listprint(syspath_wrapper.get())# Print System Path value as a stringprint(syspath_wrapper.get_str())# Try to remove a path from System pathtry:    if syspath_wrapper.remove(path):        print("The path "{}" is correctly removed from System Path".format(path))    else:        print("The path "{}" is not in System Path, so cannot be removed".format(path))except (EnvironmentError, WindowsError, OSError, ValueError) as ex:    print("Error -> {}".format(str(ex)))

Sources

About

Definitive Python wrapper for Windows System Path

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp