… self.db[to] if __name__=="__main__": discoveryServer=DiscoveryServer…BUF))) except: break if __name__=="__main__": alias=raw_input… Discussion Thread by StrikerX11 in Software Development
9 Years Ago
…20) glPopMatrix() glutSwapBuffers() return if __name__ == '__main__': main() [/code]…in <module> if __name__ == '__main__': main() File &…258, in __call__ self.__name__, self.__name__, NullFunctionError: Attempt to call… Discussion Thread by L_E_G_I_O_N in Software Development
9 Years Ago
… 'Method: %s' % obj.__name__ strme = '%s' % obj.__name__ str1=strme else: print… 'Function: %s' % obj.__name__ strme = '%s' % obj.__name__ str1=strme [/CODE] Discussion Thread by heshan in Software Development
9 Years Ago
… 'Method: %s' % obj.__name__ strme = '%s' % obj.__name__ str1=strme else: print… 'Function: %s' % obj.__name__ strme = '%s' % obj.__name__ str1=strme [/CODE] Discussion Thread by heshan in Software Development
… that instead of [ICODE]obj.__name__[/ICODE] you should grab [ICODE… Reply by BearofNH
9 Years Ago
…existingtype = self.__specs[counter][1].__name__ valuetype = type(values[counter]) …valuetype = valuetype.__name__ if valuetype == existingtype: #print "… Discussion Thread by thanatosys in Software Development
8 Years Ago
…): self.run_testcase() if __name__=="__main__": logger…],[recorder.capture]) if __name__=="__main__": …w_Decorators import wrapper if __name__=="__main__": logger… Discussion Thread by falek.marcin in Software Development
5 Years Ago
…()` `['__builtins__', '__doc__', '__name__', '__package__']` (Currently imported packages…dir()` `['__builtins__', '__doc__', '__name__', '__package__', 'time']` New…()` `['__builtins__', '__doc__', '__name__', '__package__']` (Currently imported packages… Discussion Thread by HTMLperson5 in Software Development
5 Years Ago
…()` `['__builtins__', '__doc__', '__name__', '__package__']` (Currently imported packages…dir()` `['__builtins__', '__doc__', '__name__', '__package__', 'time']` New…()` `['__builtins__', '__doc__', '__name__', '__package__']` (Currently imported packages… Discussion Thread by HTMLperson5 in Software Development
… could `del sys.modules[module.__name__]`, but it would not *really… Reply by Gribouillis
5 Years Ago
… def showName(): print("__name__ is: " + str(__name__)) If I import…;nametest", in other words __name__ gets the module name it… it in a module, then __name__ shows "__main__". Is… Discussion Thread by drichird in Software Development
4 Years Ago
… def showName(): print("__name__ is: " + str(__name__)) If I import…;nametest", in other words __name__ gets the module name it… it in a module, then __name__ shows "__main__". Is… Discussion Thread by drichird in Software Development
Here is one import nametest nametest.__name__ = "foobar" nametest.showName() Reply by Gribouillis
4 Years Ago
… def showName(): print("__name__ is: " + str(__name__)) If I import…;nametest", in other words __name__ gets the module name it… it in a module, then __name__ shows "__main__". Is… Discussion Thread by drichird in Software Development
… say the main purpose of __name__ is to verify what module…). By the way, does nametest.__name__ = .... reset the original variable or… Reply by drichird
4 Years Ago
… def showName(): print("__name__ is: " + str(__name__)) If I import…;nametest", in other words __name__ gets the module name it… it in a module, then __name__ shows "__main__". Is… Discussion Thread by drichird in Software Development
… foo(): x = thefunc() ** 2 if __name__ == "__main__": foo() "…; Otherwise, yes, `nametest.__name__ = ...` resets the original variable. `__name__` is an ordinary… Reply by Gribouillis
4 Years Ago
… main(): #renewable code main() if __name__ == "__main__": main() I… don't understand what `__name__` and `__main__` is but I… Discussion Thread by nouth in Software Development
… program. > what is the `__name__` by default? If the Python…` and a shebang line -- whichever), `__name__` will be `"__main__"… shell by writing `import my_module`, `__name__` will be `"my_module"… Reply by sepp2k
4 Years Ago
…= web.application(urls, globals()) if __name__ == '__main__': app.run() Traceback…SLASHfaviconDOTicoserver', 'SLASHserverDOTpy', 'SLASHserverDOTpyserver', '__builtins__', '__doc__', '__name__', '__package__', 'app', 'dirs', 'f', '… Discussion Thread by james.lu.75491856 in Software Development
3 Years Ago
… self: return '%s()' % (self.__class__.__name__,) return '%s(%r)' % (self.__class__….__name__, self.items()) def copy(self): … Discussion Thread by mark103 in Software Development
3 Years Ago
… %s at [ %d, %d ]' % (func.__name__, f.f_lineno, 0) return func… Discussion Thread by Tcll in Software Development
…,index = C[f.f_lineno][func.__name__] ( func.__name__, f.f_lineno, columns[index…(columns): C[f.f_lineno][func.__name__][1] = 0 else: C[…f.f_lineno][func.__name__][1] += 1 finally: del … Reply by Tcll
3 Years Ago
… %s at [ %d, %d ]' % (func.__name__, f.f_lineno, 0) return func… Discussion Thread by Tcll in Software Development
… f = frame.f_back name = func.__name__ if name == '__init__': name = func… else: C[f.f_lineno][func.__name__][1] += 1 finally: del … Reply by Tcll
3 Years Ago
… %s at [ %d, %d ]' % (func.__name__, f.f_lineno, 0) return func… Discussion Thread by Tcll in Software Development
… f = frame.f_back name = func.__name__ if name == '__init__': name = args… else: C[f.f_lineno][func.__name__][1] += 1 finally: del … Reply by Tcll
3 Years Ago
… the main() function. if __name__ == '__main__': main() Okay…the main() function. if __name__ == '__main__': main() Is…calls the main() function. if __name__ == '__main__': main() printName… Discussion Thread by Slavi in Software Development
2 Years Ago
… the main() function. if __name__ == '__main__': main() Okay…the main() function. if __name__ == '__main__': main() Is…calls the main() function. if __name__ == '__main__': main() printName… Discussion Thread by Slavi in Software Development
… is executed, a special variable `__name__` is defined. In the first… the intended meaning of if __name__ == '__main__': do_stuff() is if we_are_executed_as_a_script_and_not_as_a_module… Reply by Gribouillis
2 Years Ago
… the main() function. if __name__ == '__main__': main() Okay…the main() function. if __name__ == '__main__': main() Is…calls the main() function. if __name__ == '__main__': main() printName… Discussion Thread by Slavi in Software Development
Use of `if __name__ == '__main__':` # use it for testing … imported as a module if __name__ == '__main__': function1() Reply by vegaseat
2 Years Ago
… ,redirect, url_for, request app = Flask (__name__) @app.route('/suc/<name…(url_for('suc',name = user)) if __name__ == '__main__' : app.run(debug = True… Discussion Thread by <HHH> in Web Development
11 Months Ago
… ,redirect, url_for, request app = Flask (__name__) @app.route('/suc/<name…(url_for('suc',name = user)) if __name__ == '__main__' : app.run(debug = True… Discussion Thread by <HHH> in Web Development
…,url_for,request,render_template app = Flask (__name__) @app.route('/') def my_form(): return…(url_for('suc', name=user)) if __name__ == '__main__' : app.run(debug=True… Reply by snippsat
11 Months Ago
…) q.task_done() q = Queue if __name__ == "__main__": main() Discussion Thread by karmstrong in Software Development
First off I let this question season since I'm not a python guru. But as I code in many languages the error looks to be that something expects an integer and that's it. Read https://stackoverflow.com/questions/28036309/typeerror-list-object-cannot-be… Reply by rproffitt
1 Month Ago
This is one small snippet of after event usage. You could express if you find this kind of simple code to be usefull as snippet. Notice also vegaseat's sticky message threads in begining of Python forum in addition to code snippets. Code Snippet by pyTony in Software Development
…=BOTH) change() win.mainloop() if __name__ == '__main__': main() Reply by jklotzner
1 Week Ago
Hi guys; I'm new in python and thread ,i start learning by create a simple code but i find some defficult this code below have some function and thread also Queue function to share data between thread this is a part of my code: def PutChar(Ch):… Discussion Thread by sekmani in Software Development
… timeout expired!'.format(timeout)) if __name__ == '__main__': main() I'll try… Reply by Gribouillis
1 Week Ago
Hi guys; I'm new in python and thread ,i start learning by create a simple code but i find some defficult this code below have some function and thread also Queue function to share data between thread this is a part of my code: def PutChar(Ch):… Discussion Thread by sekmani in Software Development
… print('You entered', char) if __name__ == '__main__': main() You can see… Reply by Gribouillis
1 Week Ago
…) return list(set(possibleItems)) if __name__ == '__main__': print('Text Adventure Demo… Discussion Thread by Sean___ in Community Center
2 Days Ago
…) return list(set(possibleItems)) if __name__ == '__main__': print('Text Adventure Demo… Discussion Thread by Sean___ in Community Center
It looks quite simple. You need to add an attribute to dungeon items, such as `GoldValue: 25,`. From the character's point of view, you can invent a new variable similar to location or inventory, such as `purse = 18` which means that you have 18 gold … Reply by Gribouillis
1 Day Ago