Skip to content

Instantly share code, notes, and snippets.

@sarancruzer
Created August 19, 2017 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sarancruzer/6ef9f067fed6ee73f7c9f0f97fe83c8d to your computer and use it in GitHub Desktop.
Save sarancruzer/6ef9f067fed6ee73f7c9f0f97fe83c8d to your computer and use it in GitHub Desktop.
i get the error when i initialize the array in python
File "/var/www/html/python/flask_movie/dbconn.py", line 35, in userRegister
# name = request.json['name']
# company_name = request.json['company_name']
# address = request.json['address']
myArray = []
myArray["john"] = "johns value"
myArray["jeff"] = "jeffs value"
print myArray["john"]
# return lists
TypeError: list indices must be integers, not str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment