#!/usr/bin/env python3

import sys
import subprocess
import sksat

def usage():
	print('usage> ./render.py fmt.pov startnum fnum')

def main(argc, argv):
	if argc != 4:
		usage()
		return
	
	povfmt	= argv[1]
	startnum= int(argv[2])
	fnum	= int(argv[3])
	out_interval = int(argv[4])
	
	for i in range(startnum, fnum):
		cmd = 'povray '
		cmd += povfmt
		cmd = cmd % i
#		cmd += ' | grep num:'
		subprocess.call(cmd, shell=True)
		print('num:\r' + str(i))
		if (i % out_interval) == 0:
			sksat.report("reder:%d" % i)

if __name__ == '__main__':
	argc = len(sys.argv)
	argv = sys.argv
	main(argc, argv)


@@ -28,16 +28,26 @@
 ort sys%0A
+import os%0A
 import s
@@ -56,16 +56,17 @@
 process%0A
+#
 import s
@@ -170,17 +170,17 @@
 argc != 
-4
+5
 :%0A%09%09usag
@@ -492,39 +492,121 @@
  0:%0A
+#
 %09%09%09
-sksat.report(%22
+cmd = '~/python/slack/sksat_bot/post.py simulation %5C%22' + '
 re
+n
 der:
-%25d%22 %25 i)
+' + str(i) + '%5C%22'%0A#%09%09%09os.system(cmd)%0A%09%09%09pass
 %0A%0Aif

update render.py