Obraciam sa na vas s prosbou o pomoc.
Mám napísany script , rozbehane apache, nastavene a ostestovane hello world scriptom a podobne a vsetky fungovali.
otrebujem spravit web kde si niekto vyberie ktore data sa vykreslia a zavola sa python script ktory zavola gnuplot a ten ich vykresli a ulozi ako obrazok.png ktory sa vykresli na stranke.
Problem je ze to neviem rozbehat ... Zatial mam"
script:
Kód: Vybrať všetko
#!/usr/bin/python
# Import modules for CGI handling
import cgi, cgitb
cgitb.enable()
# Create instance of FieldStorage
form = cgi.FieldStorage()
# Get data from fields
name = form.getvalue('name')
var = form.getvalue('var')
# plot graph
from os import system
system('gnuplot -e "filenaname='%s.txt'" plot.gp') %(name)
print "Content-type:text/html\r\n\r\n"
print "<html>"
print "<head>"
print "<title>plotting data</title>"
print "</head>"
print "<body>"
print "<h2>meno: %s \n var: %s</h2>" % (name, var)
print " <img src="%s.png" alt="%s">" %(name, name)
print "</body>"
print "</html>"
Kód: Vybrať všetko
reset
set terminal pngcairo enhanced size 5000,500 font 'DejaVuSerifCondensed,11' rounded;
set output 'steps.png'
set encoding iso_8859_2
set zeroaxis
set title 'dáta accelerometer - predne vrecko ' font 'DejaVuSerifCondensed-Bold,12'
set samples 7000
set style line 1 lt 1 lw 0.5 lc rgb "red"
set style line 2 lt 1 lw 0.5 lc rgb "blue"
set style line 3 lt 1 lw 1 lc rgb "green"
set datafile separator "|"
plot filename u 0:3 sm cs w l ls 1 t 'X-suradnice'
Kód: Vybrať všetko
<!DOCTYPE html>
<html>
<body>
<form action="/cgi-bin/test.py" method="post">
nazov suboru: <input type="text" name="name"> <br />
premenna: <input type="text" name="var" />
<input type="submit" value="Submit" />
</form>
</body>
</html>