r/pythonhelp • • Feb 01 '24

Code stopped working

1 Upvotes

Why has my code all of a sudden stopped working? It normally did and now it doesnt im gonna send my code but its the “loan” part that isnt working I will send the point which im struggling.

loanconfirm=input('wouldyouliketotakeoutaloan?youmustpayitback')ifloan.lower()=='yes':loan=int(input('howmuchmoneydoyouwanttotakeout?')) balance=balance+loanprint(f'{loan}+{balance}={int(loan+balance)}')


r/pythonhelp • • Feb 01 '24

Need advice in python programm

1 Upvotes

Hello,

this is my python script

command = "ps ax | grep 'openvpn --daemon' | awk '{print $1}'"
process = subprocess.Popen(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = process.communicate()
if out:
print ("standard output of subprocess:")
if err:
print ("standard error of subprocess:")
print ("returncode of subprocess:")

But I get this error

standard error of subprocess:
returncode of subprocess:

why do i get an error ? normally it should display me the pid of the programm openvpn