blob: 153c2273e78386d55d18b09a9ba8473ede2802fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import os
strOuputHTMLFile = "OutputSVG.html"
if os.path.exists(strOuputHTMLFile):
os.remove(strOuputHTMLFile)
os.system("echo ^<html^> >> " + strOuputHTMLFile)
os.system("echo ^<body^> >> " + strOuputHTMLFile)
os.system("echo ^<svg height = \"100\" width = \"100\"^> >> " + strOuputHTMLFile)
while True:
objPoints = input("Input: ")
if not objPoints:
break
arrPoints = objPoints.split(",")
## print (len(arrPoints))
if len(arrPoints) == 2:
os.system("echo ^<circle cx = " + "\"" + arrPoints[0] + "\" cy = \"" + arrPoints[1] + "\" r = \"4\" stroke = \"white\" stroke-width = \"1\" fill = \"red\" /^> >> " + strOuputHTMLFile)
elif len(arrPoints) == 4:
os.system("echo ^<line x1 = " + "\"" + arrPoints[0] + "\" y1 = \"" + arrPoints[1] + "\" x2 = \"" + arrPoints[2] + "\" y2 = \"" + arrPoints[3] + "\" style = \"stroke: rgb(0, 0, 255); stroke-width: 2\" /^> >> " + strOuputHTMLFile)
os.system("echo ^</svg^> >> " + strOuputHTMLFile)
os.system("echo ^</body^> >> " + strOuputHTMLFile)
os.system("echo ^</html^> >> " + strOuputHTMLFile)
|