…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
…()` `['__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
… 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
… 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
…) return list(set(possibleItems)) if __name__ == '__main__': print('Text Adventure Demo… Discussion Thread by Sean___ in Programming
2 Months Ago
…) return list(set(possibleItems)) if __name__ == '__main__': print('Text Adventure Demo… Discussion Thread by Sean___ in Programming
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
2 Months Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Software Development
2 Months Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Software Development
Hi, it's been a long time since I last used wxpython, but I think it should be something like for i, seq in enumerate(data): for j, v in enumerate(seq): self.SetCellValue(i, j, v) You should find good examples in… Reply by Gribouillis
2 Months Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Software Development
Hi. Thx for your reply. I try this but not woking, I got error message "TypeError: String or Unicode type required". Also i alredy chek Mouse vs Python, but could not find any advance stuff, only basic, or I just dont know how to lok for … Reply by Nemius
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Software Development
Can you post the whole exception traceback that gets printed instead of only TypeError: String or Unicode type required" ? Reply by Gribouillis
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Software Development
Yeah, sure. Traceback (most recent call last): File "C:/Users/*****/PycharmProjects/MySQL Setup TE/main.py", line 131, in <module> frame = GlavniProzor() File "C:/Users/*****/PycharmProjects/MySQL … Reply by Nemius
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Software Development
The error means that you tried to insert in a grid cell a value `v` which type is not `str` or `unicode`, and the `Grid` type doesn't accept that. We can get more information about what this value was by using for i, seq in enumerate(data):… Reply by Gribouillis
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Software Development
I got this mesage. Traceback (most recent call last): File "C:/Users/*****/PycharmProjects/MySQL Setup TE/main.py", line 134, in <module> frame = GlavniProzor() File "C:/Users/*****/PycharmProjects/MySQL … Reply by Nemius
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Software Development
The 7L comes because you are using python 2 instead of python 3, which I disapprove, but it is your choice, and there are two integer types in python 2, namely `int` and `long`, so 7L is a long because the module you used to read the database returns long … Reply by Gribouillis
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Software Development
It work. Man, i just canot say how i grateful I am. Yeah i start whit python 2.7 and stil learning. Maybe that is what giving me the most problems, Python have to many versions, and everybody working whit different version. Anyway, thank you so much … Reply by Nemius
1 Month Ago
so I'm working on a class for a vector which I want to hash like a tuple, and to do so, a vector instance needs acess to it's properties. here's the constructor for the performative properties I'm using, and the vector class: def newProp():… Discussion Thread by DarkPikachu in Software Development
… = vector() print(hash(v)) if __name__ == '__main__': main() I'm sure… Reply by Gribouillis
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Programming
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Programming
For problem 1, I think you could remove the 'data' argument in def OnCellChange(self, evt, data): ... For problem 2, you need to compute the `row` value that you want to insert, for exemple def appendRow(self): row = … Reply by Gribouillis
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Programming
Thank you. As for first problem, its more complex than I thout it is. So I will need to start from scratch. For second problem, i try to add row = self.GetNumberRows() +1 but got error: _grid.GridTableMessage_swiginit(self,_grid.… Reply by Nemius
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Programming
The error message won't suffice, can you post the whole exception traceback printed by python ? Reply by Gribouillis
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Programming
Sure. Traceback (most recent call last): File "C:/Users/******/PycharmProjects/MySQL Setup TE/backpu.py", line 183, in onKeyDown self.appendRow() File "C:/Users/******/PycharmProjects/MySQL Setup TE/backpu.py&… Reply by Nemius
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Programming
Try `self.GetTable()` instead of `self` as first argument when you call `gridlib.GridTableMessage()`. Reply by Gribouillis
1 Month Ago
…) sizer.Fit(self) #Run if __name__ == "__main__": app = wx… Discussion Thread by Nemius in Programming
Thx. I try that, but now add 2 rows, not 1, but do not show any error. Reply by Nemius
1 Month Ago
Hello! Can you give me an example of Button widget in Kivy language? I can creat the button but don't know how to use it's callback. I mean how can i set a command for the Button in Kivy? Discussion Thread by Niloofar24 in Software Development
… above, there is no if __name__ == "__main__": window.run… Reply by M_12
1 Week Ago