Python Forum
TypeError("index() missing 1 required positional argument: 'pymydb'" - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/Forum-Python-Coding)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/Forum-Web-Scraping-Web-Development)
+--- Thread: TypeError("index() missing 1 required positional argument: 'pymydb'" (/Thread-TypeError-index-missing-1-required-positional-argument-pymydb)



TypeError("index() missing 1 required positional argument: 'pymydb'" - nikos - Feb-24-2019

# dbhost is optional, default is localhost
plugin = bottle_pymysql.Plugin( dbuser='nikos', dbpass='*******', dbname='counters', charset = 'utf8' )
app.install(plugin)
 

@app.route( '/' )
@auth_basic(is_authenticated_user)
def index( pymydb ):
 
    pdata = ''
    names = []
 
    pymydb.execute( '''SELECT name, phone, hits, money FROM clients ORDER BY hits DESC''' )
    data = pymydb.fetchall()
Error:
TypeError("index() missing 1 required positional argument: 'pymydb'",) Traceback: Traceback (most recent call last): File "/usr/lib64/python3.6/site-packages/bottle.py", line 862, in _handle return route.call(**args) File "/usr/lib64/python3.6/site-packages/bottle.py", line 1740, in wrapper rv = callback(*a, **ka) File "/usr/lib64/python3.6/site-packages/bottle.py", line 2690, in wrapper return func(*a, **ka) TypeError: index() missing 1 required positional argument: 'pymydb'
Can you help me fix this error?
index() has as an argument the bottle_pymysql keyword 'pymydb' but i'am not calling this function from within myscript it supposed to be run when script starts.

Why am i getting thsi error?


RE: TypeError("index() missing 1 required positional argument: 'pymydb'" - nikos - Feb-26-2019

Hello, any thoughts as to why i'm getting thsi error?


RE: TypeError("index() missing 1 required positional argument: 'pymydb'" - micseydel - Mar-03-2019

Can you please provide minimal, runnable code that reproduces this issue?