python if $_GET is empty do something & url path
Question: 
    import cgi
    form = cgi.FieldStorage()
    
    test = form['name'].value
    
    if test is None:
        print('empty')
    else:
        print ('Hello ' + test)
    

... and that doesn't seem to display anything when my url is something like
.../1.py

if i set it to .../1.py?name=asd it will display `Hello asd`

also how to get everything after the question mark and after the domain name:
for example if i try to access `http://localhost/thisis/test` i want to get
`/thisis/test`.

edit: i tried to use `try:` and i couldn't get it working.


Answer: To answer the first part of my question, i found what the problem is and
that's the correct code:

    
    
    import cgi
    form = cgi.FieldStorage()
    
    try:
        test = form['name'].value
    except KeyError:
        print('not found')
    else:
        print(test)
    

for my second question:

    
    
    import os
    print(os.environ["REQUEST_URI"])
    

