Thread: Python help
[code/]from sys import platform
os import system ,listdir
import subprocess
def platform():
if platform == "win32":
system("notepad")
elif platform == "linux2" or "linux":
subprocess.popen("gnome-terminal -e nano", shell=true)
def main():
platform()
a=listdir()
length=len(a)
print(length,a)
if __name__ == "__main__":main()][/code] ; in code how can capture when text editor closed ? there way capture editor close signal ? want run listdir() after editor close
subprocess.call() (check http://docs.python.org/library/subprocess.html) waits process finish.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] Python help
Ubuntu
Comments
Post a Comment