I have python code that works in command prompt(Windows) using python file.py command, but when I copy this code and put it inside server, it does not work. (it gives me an error which does not occur when executed in command prompt)
Both Windows and server(ubuntu; it uses django as framework) use same version of Python - 3.5.2
Any advice or suggestion would be appreciated. Thank you in advance.
Here is the part of the code which gives me error (local variable 'district' referenced before assignment) only on server.
def GetDistrict_driver(addr): district = '' if addr == 'Seoul': district = 'S1' elif addr == 'Incheon': district = 'A1' elif addr == 'Daejeon': district = 'B1' elif addr == 'Gwangju': district = 'C1' elif addr == 'Daegu': district = 'D1' elif addr == 'Ulsan': district = 'E1' elif addr == 'Busan': district = 'F1' return district 
return districtline or there is more relevant code you don't showprint(locals())before return and see what's in the function scope.