904 Posted Topics
| |
Re: [QUOTE=Lardmeister;455658]Yes I do, the K is too German for my taste.[/QUOTE]Lardmeister, a few words of advice: Hate only spreads hate! | |
Re: I think the Dutch suffer from the same mistake that France made, they ignore their growing younger muslim population. | |
Re: Note that argList[1] does not give list as result. Try: os.execv(mpathTotest, ["argument 2"]) or: os.execv(self.mpathTotest, [argList[1]]) | |
Re: If nothing is a hole A black nothing eats it all All, but for your soul | |
Is there a way to limit size of a list in Python, so it does not use all memory? | |
Re: Jeff, if you want to know how he did it, just click temporarily on "REPLY W/QUOTE" and look at the text shown. | |
Re: You should start your wxPython program with something like that: [code=python]app = wx.App(0) MyFrame(None, -1, 'frame title') app.MainLoop() [/code] or that: [code=python]class MyApp(wx.App): def OnInit(self): frame = MyFrame(None, -1, 'frame title') frame.Show(True) self.SetTopWindow(frame) return True app = MyApp(0) app.MainLoop() [/code] | |
Re: Digital picture of the right hand (palm) so you can see the line pattern. | |
Re: Easily done by not putting the recursive call into the return function, use temporary variable, something like this: [code=python]def factorialp(n): if n < 1: return 1 q = n*factorialp(n-1) print "%d! = %d" % (n, q) return q factorialp(5) """ result --> 1! = 1 2! = 2 3! = … | |
Re: You mean something like that: [code=python]try: fin = open("missing.txt", 'r') # optional error value what_error except IOError, what_error: print what_error """ result --> [Errno 2] No such file or directory: 'missing.txt' """ [/code] | |
Re: The English have survived wars with the Scotts, the Danish, the Germans, the Spanish, the French, also rebellious Irish, and Dutch settlers. They have been kicked out of America, the Middle East, India, and Africa. Yet they are resilient, proud, smart and capable people! Despite Cal Thoma and his negativism, … | |
Re: [QUOTE=jwenting]well, if I were a teacher having to grade that I'd fail it immediately anyway. Ugliest mix of C and C++ I've ever seen, global variables, very bad variable naming, etc. etc.[/QUOTE] Looks like our friend brahle uses cstdio rather than iostream because of the much smaller executable it produces. … | |
Re: I think I could come up with a much version of this using PhotoShop. | |
Re: If the pilot's fate is to die, do the passengers come along? What is your fate as a coal-miner, if the owner has bought politicians to bypass safety? | |
Re: [QUOTE=Brent.tc;424735]The video has been removed by the user... :([/QUOTE] It's called freedom of speech! I was once in Indiana and wondered why the people in the market place carried submachine guns and drove armored personnel carriers! | |
Re: If you want to do that sort of thing, you might as well download the console module from: [url]http://effbot.org/downloads/[/url] Console interface for Windows only (versions up to Python25 available): console-1.1a1-20011229.win32-py2.5.exe Look at documentation at: [url]http://effbot.org/zone/console-handbook.htm[/url] | |
Re: Wouldn't it be simpler to create a polygon with coordinates x0,y0 and x,y and x1,y1 back to x0,y0 and fill it with the color to match? | |
Re: Why only punish the corporals? How about the sergeants and lieutenants? | |
Re: You can create and save a module of your favorite class collection this way: [code=python]# put number of your favorite classes into one module # save it as MyClassCollection.py (preserve filename case) somewhere # on the PYTHONPATH so Python's import can find it class ClassA(object): def __init__(self, color='blue'): self.color = … | |
Re: The problem with time.sleep(sec) is that your whole program sleeps unless you thread the background action. So BearofNH's use of time.time() is more appropriate. | |
Re: Honest politicians would annoy me, if there were any. I am so used to the fact that they all lie. | |
Re: Can you tell us what you mean under synchronization. You may be using the wrong terminology. | |
Re: Unquestionably one of the squirrels left over from Hitler's Killer Squirrel experiment. After all this murderous fellow grew up somewhere near there. | |
Re: Sorry, I don't really know what you are talking about. I have never seen those purple thingies. | |
Re: Call me strange, but I like the stink of it! The noice is exciting too! Best of all, I like when they throw sparks. Beats ice hockey anytime. | |
Re: [QUOTE=linux;389357]I play guitar... I have a Gibson Les Paul and a Fender Stratocaster. Hear some of my stuff: [url]http://www.soundclick.com/alexglasser[/url] It's not much, but I like it.[/QUOTE] Alex, thanks for the link, neat site! | |
Re: My advice, use the vector container. One of the advantages of using C++. | |
| |
Re: I think that computer programming can be made exciting even with old languages like Qbasic. It's the dullfugg of a teacher that can bore the students out of their mind. | |
Re: [QUOTE=WaltP;389241]Dinosaurs are extinct. There can't be new ones. Only old, dead ones... :icon_razz:[/QUOTE]I have seen plenty of Hollywood movies were the dinos where very much alive! | |
Re: 256 colors is 8 bits per pixel. Hope that helps. | |
Re: Just one small hint: Your title "find way out !!!" is not conducive to get help. should have been something like "help with GSM/GPIO". This way anyone with knowledge of the subject will look further. | |
Re: Python is glue language for all sorts of other computer languages. Might be possible to use C# dlls. All you really need to do is to figure out how to relate Python argument types and C# argument types. Similar to the ctypes module. | |
Re: I was forced to learn it in school. Kind of one unsightly language, and lots of things to trip over, but you get used to that! We used Dev-Cpp (GNU CPP) and I still use that. | |
Re: [QUOTE=a1eio;307902]yea, ditch the printing and append it to a list and it'll be almost instant. :)[/QUOTE]Even with ditching print and returning list of primes, this algorithm is not like speed demon. It takes 6,000ms for primes up to 10,000 compared to 4ms with standard sieve algorithm. | |
Re: I keep reading that MySQL is hard to program with, no matter what computer language you use. Hope you find someone familiar with MySQL. | |
![]() | Re: [QUOTE=pyarticles;367806]Try [URL]http://pyarticles.blogspot.com[/URL][/QUOTE] Where is the meat? |
![]() | Re: [QUOTE=LaMouche;310092]I know printing primes isn't anything new, but (like always) I'd love to hear some feedback on how I can make my code more efficient and other constructive criticism. [php] def print_primes(r=10): primes = [ ] for i in range(2,r+1): prime = 1 for divisor in range(2,i): if i % … |
How do I best get a full display screen window using wxPython? | |
Re: This might help: [code=python]import wx class DemoFrame(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, 'Demo', size=(600, 400), pos=(300,300)) # make the widgets ... self.panel1=wx.Panel (self, -1) self.panel1.SetBackgroundColour ("white") # create splitter windows self.splitter = wx.SplitterWindow(self, style=wx.CLIP_CHILDREN | wx.SP_LIVE_UPDATE | wx.SP_3D) self.splitter2 = wx.SplitterWindow(self.splitter, -1, style=wx.CLIP_CHILDREN | wx.SP_LIVE_UPDATE | wx.SP_3D) self.mainpanel … | |
Re: I am scratching my head on this one! However, this modifiecation seems to work correctly ... [code=python]num = 32 b2 = 2 x = 1 def increasex3(num, b2, x): while num%(b2**x) < num: x = x+1 increasex3(num, b2, x) #print x # test return x result = increasex3(num, b2, x) … | |
Re: I think you are using wrong word here, list is like an array. You simply want each element of list displayed on separate line, right? [code=python]# for instance this is list cards = ['4 c', '12 h', '2 s', '6 s', '8 s'] # one list item per line display … | |
Re: If you don't have any arguments to pass you can import the C function directly from msvcrt.dll: [php]# optional console wait for keypress, any key # C:\Windows\System32\msvcrt.dll contains C functions # works only with console (many IDEs have their own output) from msvcrt import getch print "Hello!" getch() # this … | |
Re: I found a book on Ruby in my book store. Wonder what Ruby is named for? | |
Re: Obviously something wrong in your MainWin class. Maybe the missing indents in reg()? Do you get any traceback error? Change line app = wx.PySimpleApp(0) to app = wx.PySimpleApp(redirect = True) I don't have MySQLdb installed, so I can't help you much. | |
Re: Something like this will work fine: [code=python]from Tkinter import * root = Tk() root.title('root win') root.geometry("400x300+30+30") # create child window top = Toplevel() top.title('top win') top.geometry("200x100+100+130") top.lift(aboveThis=root) root.mainloop() [/code] | |
Re: We are talking PIL. 'n^2' ??? All I can think of is that you may want to average the color of one 4x4 area rather than one 2x2 area. | |
Re: x to the power 0.16 would be x**0.16 To make your Python code readable, you neeed to preserve the indentations, see: [url]http://www.daniweb.com/techtalkforums/announcement114-3.html[/url] |
The End.