614 Posted Topics
Re: Mark thread is solved has moved. You can now find it as a link at the top. Use ctrl+F and search for solved and you should find it. It is next to the bit that says "Python Discussion Thread View First Unread" Just an FYI for anyone who needs to … | |
Re: Actually, if you want to learn about sockets then i suggest this tutorial just here [url]http://www.amk.ca/python/howto/sockets/[/url] it gives more than just the syntax and actually helps you learn how to use them. Though, this one: [url]http://www.devshed.com/c/a/Python/Sockets-in-Python/[/url] is the one that i learnt with, it was pretty good. Hope that helps … | |
Re: I disagree. For a few reasons, first of all, no one really cares about your "Solved Threads" count, so there is no need to only award one poster with the solved thread. Another problem there is, what if 15 different people all helped just a little bit with your problem, … | |
Re: It is because of the way that chrome handles the javascript. Notice when you hover the mouse over the Go to last post button the link that is displayed down the bottom is a javascript link. Therefore chrome will not see it as you clicking a link so much. Because … | |
Re: hmm... it doesn't have any kind of "This thread is more than three months old" warning that i can see. Thats odd | |
Re: Okay, so an import error eh.... well, if it is working once windows has fully loaded then that makes me think that something is not being started quickly. [code] import wmi [/code] I am going completely off guesswork here as i have never used wmi. But if what you said … | |
Re: [QUOTE=jwenting;1218170]Not only do online petitions never work (and rightly so, there's no way in hell to know if the people "signing" are real and not some bot being used to generate millions of "signatures", but I fully agree with banning kids from playing gory games. Just as I fully agree … | |
Re: Here is what i would do. I would have something that is the Main function, that calls room1 to start off with... Then IF room1 wants to call room2 it returns a special value that means i know the Main function has to call room2. [code] def room1(): #is you … | |
Re: I know what they are talking about. We used to be able to go to a forum and middle mouse click on the 'last post' button which would open a link in a new tab. Now though it is javascript which means that it will not open in a new … | |
Re: That is because there is no class or function called tennisPro.. Also, you need to use code tags [noparse] [code] #code here [/code] [/noparse] cheers | |
Re: There is no goto keyword in java that will take you to a certain line. According to wikipedia the goto keyword is reserved in java but not actually used. So, goto is not a choice.. changing the code should be though. i'll leave that to someone a little more equipped … | |
If you go the community forum category you can see forum threads that you are not meant to see. I have a screen shot attached. | |
Re: The problem with having globals is that it means that you are usually declaring something inside a function when it is going to be used outside a function so it is probably better to just declare the variable outside any sort of function at all. It also makes it easier … | |
Re: just an FYI as to what split is for (i am assuming you are new to python) is that is automatically splits up a string into its separate words. Such as [code] 'Hello i am Paul'.split() #Would give the result of a list: ['Hello','i','am','Paul'] [/code] The argument you can give … | |
Re: If you have to make your own sort algorithm i would look at the wikipedia pages for sorts such as the bubble sort. It is a very simple sort and the pseudo-code can be very easily translated into python. [url]http://en.wikipedia.org/wiki/Bubble_sort[/url] From wikipedia pseudo code [code] procedure bubbleSort( A : list … | |
Re: Here is a quick program to get all the current ones. But it really doesn't matter if you overwrite them for the most part anyway. The chance of you doing that is also very small [code] import wx for f in dir(wx): if f.startswith("ID_"): print f, eval('wx.'+f) [/code] This will … | |
Re: If you knew that the array is only two deep (2D array) then you could do it: [code] for listIndex, subList in enumerate(myList): try: ind = subList.index('sheep') break except ValueError: print "Not in list number",listIndex print "It is in list number",listIndex print "and index number",ind,"of that list" [/code] What that … | |
Re: Sheesh man who really cares. I hope you're not going to be getting that many infractions that the grammar actually annoys you.. :P ![]() | |
Re: One thing to always look into when using wxPython is the api. The one for the richtextCtrl is found here: [url]http://www.wxpython.org/docs/api/wx.richtext.RichTextCtrl-class.html[/url] There you will find methods to set and get values, and by using these intelligently you should be able to achieve what you want. | |
Re: <CannedResponseforhomework> So, what have you done? Remember here at daniweb we aren't here just to do your homework: [url]http://www.daniweb.com/forums/announcement114-2.html[/url] When you have shown effort, we will show some too. </CannedResponseforhomework> | |
Well just then i hit 1000 posts, one of my prouder moments at daniweb :) [url]http://www.daniweb.com/forums/thread264325.html[/url] It's good to reach that number, and get a star on my profile. Does this mean i can count myself as a regular now? :P Anyway, 1000 posts in i'm still loving it, so … | |
A couple of days ago i just got back from my first overseas trip. Where did i choose to go for this trip of mine? No other place than the fabled USA. As the first Paul to go there since Paul Hogan with Crocodile Dundee it was important to observe … | |
Re: I have no experience with wx.Config so i can't help you there, but there is a way you could do this without that and just using a file. [code] #... inside your frame/panel class def LoadCtrl(self): #Assuming listctrl is called listOne #and the file is fileOne f = open(fileOne) for … | |
Re: I'm a bit confused.. what would be the point of such a thing? | |
Re: And what have you done? Remember we are not just here to hand out free homework. [URL="http://www.daniweb.com/forums/announcement114-2.html"]Show Effort[/URL] | |
Re: It isn't the third line that is having the issues. It is line 37. If you look there, there is an if yet no indentation after it. Though i assume all you need to do is backspace that if a couple of times to get it on the correct level. … | |
Re: Yeah... i might own that :P EDIT: Woops, didn't see that this was just a bumped thread | |
Re: If i remember correctly wxPython is not looking to port to python 3.x any time soon. So if you are interested in using that then i would reccomend that you don't change. Personally i have not moved, i have tried it out but i never really found a reason to … | |
Re: Well i would start by re-downloading the file. Something may have gone wrong that caused the download to stop halfway through. So try that, if you haven't already :) | |
Re: Yes, you can, although its not that pretty, here is something that i think shows how something like that can be done. [code] class Example(object): #This is what we use to call every function def functionCaller(self, functionName): #This is the function that needs to #be called every time self.FunctionThatGetsCalledFirst() #Now … | |
Re: It really depends. Are you using wxPython Tkinter or some other kind of GUI becuase they all differ. I can give you an example in wxPython [code=python] import wx class MainFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self,None) self.menubar = wx.MenuBar() self.file = wx.Menu() self.file.Append(wx.ID_ANY,'&Test') self.menubar.Append(self.file,'File') self.SetMenuBar(self.menubar) self.Show() app = wx.App(False) frame = MainFrame() … | |
Re: I have a feeling that you could use a listctrl in a better way. If you use the style wx.LC_REPORT i think it is, you can have a look just like you want in just one widget. Ill just give you an example. [code] #!/usr/bin/python import wx class MyFrame(wx.Frame): def … | |
Well, i am doing this because i think i should introduce finally. So i am Paul Thompson 16 years old I live in Newcastle Australia Probably the coolest thing that has happened in my life is that i lived on a boat for 3 years sailing up and down the … | |
Re: Mine was asking about what the heck threading was... ooh have i learnt :P | |
Re: This shows that your data inside the `incoming_data` list is of type long. You can just 'add' (+) strings and longs together. You can do one of two things. You can do something like this using the comma >>>print "Hello this uses a comma to add an int to the … | |
Re: Yeah, i got that. Its easily fixed by taking out the manifest. I didn't have this problem with windows XP but i am getting it with 7. So i would use gui2exe like suggested above and just make sure that XP manifest file is unticket down the bottom Hope that … | |
Re: Grib, i have a feeling this is for some kind of python assignment. Essentially that pseudo-code works. I really never found pseudo-code that useful in python though. The actual code is just so similar to it that it almost makes no sense to make it. :) | |
Re: You should put your code in [noparse] [code] #your code here [/code] [/noparse] the code tags. This makes it a lot easier to see what your code is doing. It will keep indentation and highlight key words. :) | |
Re: I *think* i understand what you mean, but so i don't give you the whole answer i'll try and point you in the right direction. I think for something like this you should have a look at using sets [url]http://docs.python.org/library/sets.html[/url] These are great for easily taking out any of the … | |
Re: Yeah, i was in favour of that "Up to" rep system back when Dave first suggested it, i'm surprised there hasn't been more talk on the subject. It sounds like a great idea. | |
Re: You could just use the [icode]Show(False)[/icode] function on all of the children of the panel. | |
Re: Do you get any error message? There should be a log file if you get an error while running the executable. | |
Re: Yeah i agree with vegaseat, we need to see the code for MyFrame, thats where the problem most likely is. Also just to make sure, are you actually getting any errors? Or is it just not updating? | |
Re: Perhaps have a dictionary? [code] >>> def FFunc(): print "This is the F function" >>> def BFunc(): print"This is the B function" >>> def DFunc(): print "This is the D function" >>> randomstuff = ['F','B','D','F','B'] >>> funcdict = {'F':FFunc,'B':BFunc,"D":DFunc} >>> for f in randomstuff: funcdict[f]() This is the F function … | |
Re: No. [url]http://www.daniweb.com/forums/announcement114-2.html[/url] Tell us your problem you are having ("its not working" doesn't count) and we can help you with your problems. We aren't going to go and find the bugs as well as try and fix them. | |
Re: This page explains it very clearly [url]http://www.network-theory.co.uk/docs/pytut/Packages.html[/url] One thing i noticed quickly though, you are not meant to have [code]my_package/ __init.py__ sub_pack/ __init.py__ test.py [/code] in your actual code for __init__.py Its just meant to be the way you organise the filesystem. From the first __init__.py you should be able … | |
Re: That seems like a lot of work for dani for a very small number of users to benefit.. And also, once the images are in the cache it should load faster | |
Re: If you are using python 3 then the above code will not work. What you will need to do then is slightly different as [icode]input()[/icode] in python 3 returns a string. [code] choice = input("Press 1 to hit or 0 to stay") if int(choice) == 1: print "Lets hit it!" … |
The End.