614 Posted Topics
| |
Re: If you want to can use the pyHook module Download-http://sourceforge.net/project/showfiles.php?group_id=65529 Here is a program that will listen for any keystrokes really easily: [code=python] import pythoncom, pyHook def OnKeyboardEvent(event): print 'MessageName:',event.MessageName print 'Message:',event.Message print 'Time:',event.Time print 'Window:',event.Window print 'WindowName:',event.WindowName print 'Ascii:', event.Ascii, chr(event.Ascii) print 'Key:', event.Key print 'KeyID:', event.KeyID print 'ScanCode:', … | |
Re: What do you want re-arranged. That piece of code looks perfect. | |
Hi I have fiddled around with other GUI's such as pygame and wxPython but i wanted to use something a little more powerful when it came to 3D objects and i saw what PyOpenGl can do. But i spent ages looking for any help but i couldn't find any place … | |
Re: The reason it will say failed at the end of the code is becuase sum and count only exist inside your method. To stop that you can add [icode]global sum[/icode] and [icode]global count[/icode] to the start of the code. | |
Re: Jargon is programming terms such as variables, definitions, modules. At least thats how i understand it to be. | |
Hi My problem today is i have opened up the wxPython Demo and copied one of the pieces of code across to IDLE so i can have a fiddle with it. My problem is that at the start it goes [icode]from Main import opj[/icode]. Thats what stuffs it up. The … | |
Re: It would be cool if you could have a text file full of all of the words so the user could add their own. Your text file could look like this: Python:yothnp spam:apms This was the user could add their own and you could just import it to a dictionary … | |
Re: sys.argv is the arguments you give to the program when you run it from the command line. For example: [code] C:\Python> python image.py This_is_arg_0 This_is_arg_1 [/code] Hope that helps. What i think you have to do is give the program a location of some images to convert. That seems the … | |
Hi everyone What i am doing now is creating a program that the user can change the way buttons look half way through. My problem is i couldnt work out how to update the wx.Button's style while the program is running. I was wondering if anyone could help me for … | |
Re: you can use such flags as [code=python] wx.TOP wx.BOTTOM wx.LEFT wx.RIGHT #Here is an example self.sizer.Add(self.Tree,proportion=1,flag = wx.TOP|wx.BOTTOM) #Now that would only expand top and botton # I cant remember if you need wx.EXPAND in there too.... [/code] to tell the sizers which ways it is allowed to expand. | |
Re: I think you might we able to use sizers to do this. There is a flag you can use when making a sizer called wx.ALIGN_CENTER and this will keep it in the center no matter what. | |
Hi What i am trying to do is make a wx.FileDialog() show Import as the label on the button. I know you can change it to such things as open and save but i cant find a way to let me change it to a label saying import. Any help … | |
Re: I tried it and liked it. I thought it was nice to just have a web browser that was so simple for once. As much as it is good i just cant see why google needed to enter the web browser wars! | |
Re: Oh that is so mean! The poor people. The chimps looked pretty into it though! :) | |
Re: why do they need to be different files, couldn't you just make them definitions in the one file and then just call them when they are needed? | |
Re: How about this Where are the nearest Toilets - Ahi Nai Ta Pai | |
Re: Py2exe is probably the easiest one to use and there are code snippets helping you to use it as well. Vegaseat did this one - [URL="http://www.daniweb.com/code/snippet499.html"]http://www.daniweb.com/code/snippet499.html[/URL] | |
Hi guys I have been making a program over the last few days that grabs an image and re-paints it in paint in 256 colour. The main thing this program is for is so you can watch it getting painted in paint. It works perfectly on my computer but i … | |
Hey everyone I am interested in learning Pygame as a GUI that is suited to making games and i was wondering if it was worth it? My question is, is it good for anything else than games or animations? | |
Hi guys Im pretty new to java after programming with python for about a year i thought i'd give it a go. I did have a quick question though. How would i check for membership in a string. For example [code=java] String str1="Hello world"; String str2 = "world"; [/code] Is … | |
Re: I think this might have a lot to do with the competition being held in Australia for High School Students in python at the moment, it sound suspiciously like a problem that is stumping almost all of the people on the final week. | |
Re: you counld use string.replace For example: [code=python] words = 'hello i enjoy eating rasberry muffins' words = words.replace('rasberry muffins','toasted bread') print words # this will output 'hello i enjoy eating toasted bread' [/code] Hope this solves your problem. :) | |
Hi I have made a program that uses a GUI for most of its functions but as soon as i change it to an exe using py2exe all the buttons turn all square and everythin looks like it came from windows 98 rather than XP. Is there any way to … | |
Hi What i want to do for this is to have my program run in the background simulate pressing a button such as ENTER every 10 seconds or so. I have trauled the net and found solutions for VB and C++ but none for python. Is this possible in python … | |
Hi I have been trying to do one of the projects in the projects for beginners section that asks you to get your computer to log off after a certain amount of time has passed without any mouse or keyboard movement. I am not yet up to that bit, in … | |
Re: What kind of editing? Do you mean automated resizing or drawing new things onto the picture and then saving it? wxPython has a lot of cool image/paint tools so you could check that out but in the end it really depends on exactly what kind of editing you want to … | |
Re: Government is a great, great thing. As much as it it annoying i think without it helping and 'being the centre of out existance' we all would be in a much worse place today. Governments are sort of like a buisness that has a monopoly on a whole place and … | |
Re: Vegaseat gives a few options in this post: [url]http://www.daniweb.com/forums/thread34434.html[/url] They include alternatives to Winsound. | |
Hi I have a weather forecasting program that uses a few threads. These threads stop and start at different times throughout the program so there is no set amount of threads at one time. My problem is when i try and close the main thread the program keeps going because … | |
Re: This is how i do it: [code=python] a=b=c=None [/code] Hope that helps! :) | |
Re: you could change the 'while play' to something else that was an integer that equalled 10 and then every time the person has their turn you subtract one away from it until it is zero and the program ends. [code=python] import random words = ['sprinkles', 'computer', 'mouse', 'shooter', 'edge', 'guard', … | |
Re: that is one of the most Random games i have ever played! I got 70% | |
Re: yeah. I really think Bill has been really charitable and well i understand why he would retire. I mean he would be super rich. Its not like he needs to save for his super annuation is it! | |
Hi Guys What i am trying to do here is have a tuple of numbers, lets say X. Then i have a list of a few other tuples. I want the program to find the tuple that is closest in value. [code=python] x = (214,521) lis = [(200,500),(250,550),(300,600)] [/code] I … | |
Re: Could you hook the modem to the wired router and then run a CAT-5 cable or something to the wireless router? also [URL="http://www.wirelessforums.org/alt-internet-wireless/question-possible-have-2-wireless-routers-connected-one-modem-3992.html"]This[/URL] site looks like it has some ideas to. | |
Re: Okay this is my solution [LIST] [*]Go to Control Panel [*]Click System [*]Click the Advanced Tab [*]Click environment variables down the bottom [*]In the bottom scrollbox click on Path [*]Click edit [*]To the end of the list add this: ;C:\python25;C:\python25\scripts [*]If your python is not python 2.5 or is installed … | |
Re: I dunno but thats what the site says that they are doing at the moment. They got about 13 million downloads and that must have to count for something at least! | |
Re: Are you running it in something like IDLE because if so getch wont work. Try using the python command window. yeah i just checked the code in the command window and it works a-okay! :) | |
Re: For easy 3d design programs you can't go past the free Google Sketchup [url]http://sketchup.google.com/[/url] I also really like ashampoo CD and DVD burner, there is a free version wich is still quite good. | |
Hi I have made a program with wxPython and i have this bit of code: [code=python] def getpic(self,event,urlp='http://mirror.bom.gov.au/radar/IDR043.gif?20080427173538'): fc = url.urlretrieve(urlp,filename='Weather.jpg') image_file = 'Weather.jpg' self.bmp = wx.Bitmap(image_file) self.img = wx.StaticBitmap(self.background, wx.ID_ANY, self.bmp, pos = (20, 60)) self.background.SetInitialSize() [/code] This is a bit of my code, not the full thing but … | |
Re: If you were just playing sound the module 'winsound' would do the trick if you were on a windows machine. | |
Re: thats a comment, anything after a hash is a comment in python | |
Re: i live in australia and i never hear ANY of the other names for it. | |
Re: Um just a quick note: Im under the impression you do have parentheses after a class definition becuase this can be used to set class parents and attibutes as well as making it a new-style class. [code=python] # a few examples import wx class MainFrame(wx.Frame): pass #this means this class … | |
Hi i have been fiddling around with the wxPython GUI toolkit for a bit and i wanted one of my programs to start with the window expanded. I googled it but couldn't find an answer there so any help here would be greatly appreciated. | |
Re: you could use a set. That would split the word into a set with all individual letters in it or you could go [code=python] strings = 'airplane' letters = [] for letter in strings: letters.append(letter) print letters #['a','i','r','p','l','a','n','e'] [/code] There might be a better way to do it but thats … | |
Hi Using a template from the tutorial Fuse offered i made this program: [code=python] import wx import os WINDOW_WIDTH = 700 WINDOW_HEIGHT = 600 class MainFrame(wx.Frame,object): def __init__(self): wx.Frame.__init__(self,None, title = "Paul's Text Editor", pos = (200,75), size = (WINDOW_WIDTH,WINDOW_HEIGHT)) self.menubar = wx.MenuBar() self.menufile = wx.Menu() self.menuinfo = wx.Menu() self.SetMenuBar(self.menubar) … | |
Re: have you added the path in which Class1 is situated to sys.path? Try this: [code=python] import sys sys.path.append(place where myclass1 is located) import MyClass1 class MyClass2(): anobject = MyClass1() [/code] Make sure the file in which MyClass1 is located is called MyClass1.py or pyw or something like that |
The End.