def update(self, R2, name): if R2 == 6: conn = pymysql.connect(host='127.0.0.1', user='******', password='******', db='javap', charset='utf8') try: with conn.cursor() as cursor: sql = "update pypeople set answer=answer+1 where person = %s" cursor.execute(sql, name) conn.commit() finally: conn.close() q4.q4(name)
from q1 import q1 from q2 import q2 from q3 import q3 from q4 import q4 from q5 import q5 print "Question 1" q1() raw_input() print "Question 2" q2() print "Question 3" q3() print "Question 4" q4() print "Question 5" q5()
[0.65, 0.65, 2.5], [-0.65, 0.65, 2.5], ]) # # PRIMEIRA QUESTÃO q1(cube_points, parallel_points, pyramid_points, tronco_points) # SEGUNDA QUESTÃO cube_points, parallel_points, pyramid_points, tronco_points = q2( cube_points, parallel_points, pyramid_points, tronco_points) # TERCEIRA QUESTÃO c_points, p_points = q3(copy(cube_points), copy(pyramid_points), copy(parallel_points), copy(tronco_points), np.array([3, -3, 3]), True) # QUARTA QUESTÃO q4(c_points, p_points, True) # OPCIONAL eyes = [np.array([i, -3, 3]) for i in np.arange(-2, 8, .5)] for i, eye in enumerate(eyes): # TERCEIRA QUESTÃO c_points, p_points = q3(copy(cube_points), copy(pyramid_points), copy(parallel_points), copy(tronco_points), eye) # QUARTA QUESTÃO q4(c_points, p_points, show=False) make_gif()
def main(): q1() q2() q3() q4()