… 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
8 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
8 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
8 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
4 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
4 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
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
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
3 Years Ago
…, in <module> if __name__ == '__main__': main() File "Location… 'help' for help") if __name__ == '__main__': main() Discussion Thread by Liam_1 in Software Development
3 Years Ago
…; cname = "__"+func.__name__+"_Cache" rname = "…;__"+func.__name__+"_Rankings" exec("… Discussion Thread by james.lu.75491856 in Software Development
3 Years Ago
…(): window = MainWindow() window.show() if __name__ == "__main__": app = QApplication…() self.ui.setupUi(self) if __name__ == "__main__": app = QApplication… Discussion Thread by zspoja in Software Development
3 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
…= 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
… = web.application(urls, globals()) if __name__ == '__main__': app.run() Reply by james.lu.75491856
3 Years Ago
… self.assertEqual(check, pawn_check) if __name__ == "__main__": import … self.assertEqual(check, pawn_check) if __name__ == "__main__": unittest.… Discussion Thread by aravind07k in Software Development
3 Years Ago
…(['Boy'], self.flObj.filterList()) if __name__ == '__main__': unittest.main() my above….append(eachItem) return filteredList if __name__ == "__main__": try: filterby… Discussion Thread by krystosan in Software Development
3 Years Ago
…(['Boy'], self.flObj.filterList()) if __name__ == '__main__': unittest.main() my above….append(eachItem) return filteredList if __name__ == "__main__": try: filterby… Discussion Thread by krystosan in Software Development
….append(eachItem) return filteredList if __name__ == "__main__": try: filterby…'], filteredList) self.mox.VerifyAll() if __name__ == '__main__': unittest.main() but the… Reply by krystosan
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
2 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
2 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
2 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
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
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
6 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
6 Months Ago