diff --git a/examples/python/dominfo.py b/examples/python/dominfo.py index e41709c519..2f250e7383 100755 --- a/examples/python/dominfo.py +++ b/examples/python/dominfo.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python # dominfo - print some information about a domain import libvirt diff --git a/examples/python/domrestore.py b/examples/python/domrestore.py index b0321388d9..ccc82f633c 100755 --- a/examples/python/domrestore.py +++ b/examples/python/domrestore.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python # domstart - make sure a given domU is running, if not start it import libvirt diff --git a/examples/python/domsave.py b/examples/python/domsave.py index 35e2c8a543..12ffac191d 100755 --- a/examples/python/domsave.py +++ b/examples/python/domsave.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python # domstart - make sure a given domU is running, if not start it import libvirt diff --git a/examples/python/domstart.py b/examples/python/domstart.py index 52fb79e840..b1e89b8e43 100755 --- a/examples/python/domstart.py +++ b/examples/python/domstart.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python # domstart - make sure a given domU is running, if not start it import libvirt diff --git a/examples/python/esxlist.py b/examples/python/esxlist.py index a0602e8925..c55424fe1b 100755 --- a/examples/python/esxlist.py +++ b/examples/python/esxlist.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python # esxlist - list active domains of an ESX host and print some info. # also demonstrates how to use the libvirt.openAuth() method diff --git a/python/generator.py b/python/generator.py index 68009b947e..15751bd16c 100755 --- a/python/generator.py +++ b/python/generator.py @@ -1010,7 +1010,7 @@ def buildWrappers(): classes = open("libvirt.py", "w") extra = open(os.path.join(srcPref,"libvirt-override.py"), "r") - classes.write("#!/usr/bin/python -i\n") + classes.write("#!/usr/bin/env python\n") classes.write("#\n") classes.write("# WARNING WARNING WARNING WARNING\n") classes.write("#\n") diff --git a/python/libvirt-override.py b/python/libvirt-override.py index d544a0e64d..909ebe349a 100644 --- a/python/libvirt-override.py +++ b/python/libvirt-override.py @@ -2,6 +2,11 @@ # Manually written part of python bindings for libvirt # +# Specify -i commandline option after python was started +if __name__ == "__main__": + import os + os.environ["PYTHONINSPECT"] = "1" + # On cygwin, the DLL is called cygvirtmod.dll try: import libvirtmod diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index 01636aa6f1..459337975b 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # # esx_vi_generator.py: generates most of the SOAP type mapping code