Removing path from Python search module path

前端 未结 3 1021
无人及你
无人及你 2020-12-08 14:24

I understand that sys.path refers to

  1. OS paths that have your system libraries. I take it that these refer to /lib in *nix or Wi
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 14:52

    We can try below to insert, append or remove from sys.path

    >>> import sys
    >>>
    >>> sys.path.insert(1, '/home/log')
    >>> sys.path.append('/home/log')
    >>> sys.path
    ['', '/home/log']
    >>> sys.path.remove('/home/log')
    >>> sys.path
    >>> ['']
    >>>
    

提交回复
热议问题