Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

I am getting a key error how to get rid of this

$
0
0

I am new to python programming and I was reading the headfirst python book. I wrote the correct code but it is not working why?

import cgiform_data = cgi.FieldStorage()

The following line gives an error:

  athlete_name = form_data['Which_Athelete']

and the Error is:

Traceback (most recent call last):  File "C:/Users/Hamza Shah/Desktop/Headfirst Python/chapter7/webapp/cgi-bin/generate_timing_data.py", line 7, in <module>    athlete_name = form_data['Which_Athelete']  File "C:\Users\Hamza Shah\AppData\Local\Programs\Python\Python37-32\lib\cgi.py", line 534, in __getitem__    raise KeyError(key)KeyError: 'Which_Athelete'

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>