Jump to content


subinalex

Member Since 18 Mar 2014
Offline Last Active Mar 31 2014 11:24 PM
-----

Topics I've Started

Chapter:manage Your Data

30 March 2014 - 11:10 PM

Hi ,

I changed the add_timing_data.py as mentioned in page 348 as below.

import cgi
import os
import time
import sys
import yate
import sqlite3

print(yate.start_response('text/plain'))
"""
addr=os.environ['REMOTE_ADDR']
host=os.environ['REMOTE_HOST']
method=os.environ['REQUEST_METHOD']
cur_time=time.asctime(time.localtime())
print(host+","+addr+","+cur_time+":"+method+":",end='',file=sys.stderr)
"""
form_data=cgi.FieldStorage()
"""
for each_form_item in form.keys():
print(each_form_item + '->' + form[each_form_item].value,end='',file=sys.stderr)
print(file=sys.stderr)

"""
the_id=form_data['Athlete'].value
the_time=form_data['Time'].value

connection = sqlite3.connect('coachdata.sqlite')
cursor = connection.cursor()
cursor.execute("INSERT INTO timing_data(athlete_id,value) VALUES(?,?)",(the_id,the_time))

connection.commit()
connection.close()


print('OK.')




But this is throwing a key error on 'Athlete',I suspect if this is due to unamended test_form.py which sends value to add_timing_data.py.

In test_form.py,the only key is 'TimeValue',shouldnt it be amended to read in form_data['Athlete'] and form_data['Time'] values?

Please advise.

Unable To Run Python Command Line

29 March 2014 - 06:53 AM

Hi,

I am unable to run initDBtables.py on python command line.I am exhausted searching for a solution in web,everywhere they speak about running on cmd.

But i want to run it on python commandline,is it possible.


am getting the below error when we run so

File "<stdin>",line 1 in <module>
Nameerror:name 'initDBtables' is not defined

Adb File Move

27 March 2014 - 01:23 PM

Hi Guys,

I am getting the below error while copying the script to /sdcard/s14a/scripts by

using the command

C:\Program Files (x86)\Android\android-sdk\platform-tools>adb push mydroidtest.p
y \sdcard\sl4a\scripts


failed to copy 'mydroidtest.py' to '\sdcard\sl4a\scripts': Read-only file system





Can you guys please help out

Adb File Move

27 March 2014 - 01:21 PM

Hi Guys,

I am getting the below error while copying the script to /sdcard/s14a/scripts by

using the command

C:\Program Files (x86)\Android\android-sdk\platform-tools>adb push mydroidtest.p
y \sdcard\sl4a\scripts
failed to copy 'mydroidtest.py' to '\sdcard\sl4a\scripts': Read-only file system



Error - failed to copy 'mydroidtest.py' to '\sdcard\sl4a\scripts': Read-only file system


Can you guys please help out

Building Distribution File

18 March 2014 - 03:06 AM

Hi guys,

After building and installing setup.py ,i am unable to see the nester.pyc in the 'Nester' folder.
Can anyone explain why is it so?

i am using Python 3.3,is it because of the version .


Thanks,
Subin