Created
March 26, 2017 16:58
-
-
Save FabienArcellier/091929eb25b7eb475d8bcf5eafa85eb8 to your computer and use it in GitHub Desktop.
isolate tmpdir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# coding=utf-8 | |
import os | |
import tempfile | |
from subprocess import call | |
def main(): | |
os.environ["TMPDIR"] = "/home/far/tmp" | |
print(tempfile.gettempdir()) | |
call(["bash", "script.sh"]) | |
if __name__ == "__main__": | |
main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tmp=$(mktemp) | |
echo $tmp |
Author
FabienArcellier
commented
Mar 26, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment