Hi Marc. The way I'm doing now is set up a bat file that I can drop .py files on to run it with virtualenv Python.exe. All the env variables are set there. This works well for stand-alone scripts and I imagine it would work very similarly if I asked IT to embed those in Windows environment too.
However once I start importing those scripts and call functions from other places like Maya/Deadline, I'm not sure what to do other than append the virtualenv path to sys.path. Sorry if I wasn't very clear, thinking about this makes my head spins. On Monday, January 15, 2018 at 3:05:30 PM UTC+7, Marcus Ottosson wrote: > > The question is a bit broad. What was your experience trying the > alternatives you mention; (1) having IT set the %PATH%, (2) launch scripts > with a bat file and (3) an entrypoint executable? > > On 15 January 2018 at 07:45, Panupat Chongstitwattana <[email protected] > <javascript:>> wrote: > >> Question for Windows system. My code is messy trying to get everything >> working with lots of hard-coded sys.path insert/append. I really want to >> get rid of. Our scripts and virtualenv do not live in the same location, >> what would be the best approach? >> >> Would you have the IT set %PATH% to virtualenv python.exe? >> >> Would you launch the scripts with bat file? That would mean having >> different bat file for every scripts. >> >> Have an entry point to launch every other tools so you only have to set >> this up once? >> >> The sys.path append/insert is also unavoidable when I want to call >> functions from Deadline events or jobscripts. >> >> Can anyone give me some suggestion please? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Python Programming for Autodesk Maya" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/72b9e969-7795-4864-ad2b-d02cef7643ff%40googlegroups.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/72b9e969-7795-4864-ad2b-d02cef7643ff%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/29eb5690-7803-4052-a84e-8b8b30d4620c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
