Home > other >  Raspberry pie python development two ultimate question
Raspberry pie python development two ultimate question

Time:02-07

Raspberry pie py program under development will encounter two ultimate question:
1. Write good program how to boot operation
2. The program automatically after the operation how to manage such as switching process, kill process

1 now has been basically solved, by creating a XXX. The desktop file which can realize the automatic operation, specific methods online a lot not in detail, the other like what sh scripts to start, make the service start kiss measurement is invalid, may be I level, the food than recommended not to try the , the results generally like I


2. This problem has no solution, the program automatically run after by ps x command can see py process, but whether you use a kill or fg command are not management, which leads to a big problem, py all print output results in the program we can't see, even if the program has been running,

Don't know which prawn can give a solution or idea for question 2
Gratitude here

CodePudding user response:

The building Lord, solved? I have the same question, carries on the effective management for process such as sonar, the process of how to control stop?

CodePudding user response:

The from sympy import *
Alpha=symbols (' alpha ')
V=250
L=1000
Y=100
M=4
K=0.35
G=9.8
V=float (v)
L=float (l)
Y=float (y)
Def f (alpha) :
S=(g/m * (k * v * cos (alpha)) + tan (alpha)) * l + m * * * * 2 * 2 * g/k ln (1-0.0875 * l/(v * cos (alpha))) - y
Return s
D=0
While f (d) & lt; 0:
D=d + 0.01
If f (d) & gt; 0:
B=d
A=d 0.01
Break
Elif d> 1.6:
Break
X=b
While f (x) & gt; 0:
X=x + 0.01
If f (x) & lt; 0:
E=x
C=x - 0.01
Break
Elif x> 1.6:
Break
Print (a)
Print (b)
Print (c)
Print (e)
Print (f) (a)
Print (f) (b)
Print (f) (c)
Print (f (e))
While f * f (a) (b) & lt; 0:
If f * f (a) ((a + b)/2) & lt; 0:
B=(a + b)/2
Elif (f (a + b)/2) * f (b) & lt; 0:
A=(a + b)/2
Elif (f (a) - f (b)) * * 2 & lt; * * (=10-10) :
Print (" alpha (1)=", end=' ')
Print (57.29578 * (a + b)/2)
Break
While f (c) * f (e) & lt; 0:
If f (c) * f ((c + e)/2) & lt; 0:
E=(c + e)/2
Elif (f (c + e)/2) * f (e) & lt; 0:
C=(c + e)/2
Elif (f (c) - f (e)) * * 2 & lt;=10 * * (1) :
Print (" alpha (1)=", end=' ')
Print (57.29578 * (c + e)/2)
Break
I am novice, invented the dichotomy and root don't know why there is a problem, the second root out not to come, the original poster can help me have a look at
  • Related