Apr-07-2019, 10:41 PM
Described in https://docs.python.org/3/library/subprocess.html.
But I run python3 on my program
Thee Popen works. It's the Popen.pid it doesn't like.
My imports are:
But I run python3 on my program
def Output_text (MyString, Xoffset, Yoffset, fg_color, bg_color, Font_size): global screen_width global screen_height global Python3 global Kill_pos, Killz print (Kill_pos, Killz) killval=Killz[Kill_pos] if Kill_pos == 0: p1=Popen ([Python3, 'Programs/Message.py', str(Xoffset), str(Yoffset), Font_size, fg_color, bg_color,MyString]) return() else: if killval > 0: os.kill(killval, signal.SIGUSR1) p1=Popen ([Python3, 'Programs/Message.py', str(Xoffset), str(Yoffset), Font_size, fg_color, bg_color,MyString]) Killz[Kill_pos]=Popen.pid print (Kill_pos, Killz, Popen.pid) returnand get
Quote:Traceback (most recent call last):
File "test_morse_practice.py", line 194, in <module>
Output_text (input_msg, XStart, YStart, Data_Font_fg_color, Data_Font_bg_color, Prompt_Font_Size)
File "test_morse_practice.py", line 108, in Output_text
Killz[Kill_pos]=Popen.pid
AttributeError: type object 'Popen' has no attribute 'pid'
Thee Popen works. It's the Popen.pid it doesn't like.
My imports are:
import random import signal import os from subprocess import Popen