614 Posted Topics
Re: We can fix that with one character, a lowly comma :) If you put the comma after the print statement it should work [code] for x in range(1, len(depend)): #comma after the whole statement print "%05s" % ('I#'+str(x)), [/code] hope that helps EDIT: Also you need to have the percentage … | |
Re: Yeah i must admit i have noticed that number always seems to look a little low recently | |
Re: I'll say the same, its worked a treat on my computer, and apart from the usual IDLE annoyances with wxPython its all running smoothly. :) | |
Re: Post the exact error you are getting, that helps a lot :) | |
Re: Well you can use the [iCODE]type()[/iCODE] function to show what type the number is: [code] >>> type(12) <type 'int'> >>> type(12.4) <type 'float'> >>> type(input()) 12 <type 'int'> >>> type(input()) 12.5 <type 'float'> >>> [/code] So you can adapt that to check for any type. So when you input something … | |
Re: Okay, so look at your sentence just here: [quote] ask the user for the current population and displays the population after 1/2 years unitil it reaches 1 million at a rate of 8% per year. for example [/quote] That tells you exactly what you need to do, first: [B]Ask the … | |
Re: Newcastle - Australia with Telstra i get 1.5MB/s down and 256kB/s up | |
Re: Could you post the exact error? That can help a lot. As well there are a few things you need to address. [code] def name_list(): infile = open('names.txt', 'r') names = infile.readlines() infile.close() index = 0 while index < len(names): names[index] = names[index].rstrip('\n') index += 1 return names [/code] When … | |
Re: Ancient Dragon, new favourite golden oldie :P Really though, this whole thread just sounds a lot like "he said", "she said". I havent heart an argument like this since primary school :S | |
That was amazing, in 20 minutes you managed to ban Josh4. Im quite impressed at the speed you work at. And the forums are all clean again. So you really will only have noticed him if you were on here for a period of about 20 minutes :) So congrats … | |
Re: Steve's code is almost right :) The problem is in line 5 [code] line.replace('.','') [/code] The problem with that is that it doesn't store the new string in the variable automatically, so just add a [icode]line = [/icode] in front of that and it should be fine: [code] file1 = … | |
Re: And also change the like [code] app.Mainloop() [/code] to [code] app.MainLoop() [/code] | |
Re: [B]>Thank you for your friendly answer.[/B] Yeah that wasn't friendly at all, ignore him, it seems a previously banned member has gone around screwing up the forums by posting huge amounts of threads and being rude in answers | |
| |
Re: If you really want to get points for your questions and answers head over to somewhere more suited to it... [url]www.answerbag.com[/url] - Wow, you can get points!! | |
Re: Okay, first of all you need to learn a bit about scope: [url]http://www.network-theory.co.uk/docs/pytut/PythonScopesandNameSpaces.html[/url] That is basically where a variable lives, so you have the problem that when you call [icode]menu()[/icode] the variable option doesn't stay in memory after that function is completed. But don't fret :) that can be fixed … | |
Re: You can find out how something is make up by using the [icode]dir()[/icode] function. This lists all of the variables, methods and classes of whatever you put inside the brackets :) | |
Hi, Im using wxPython for my latest project and i was wondering, how do i make the window go to the best size, so it includes all of the objects on screen? I used to be able to remember... but i forgot :P | |
Hi guys, Im a making a program where i need to be able to specify a folder and have my program import every module from that folder into my program... I was wondering how i would go about it. I can't use something like eval. But yeah, help would be … | |
Re: If you are using python 3 then you just have to change your input and print statements to fit [code] order=int(input("Please enter the price of the order: ")) x=1.50 if order <10: print("the total price including the delivery charge is", order + x) else: print("The toal price including delivery charges … | |
Re: Sooo. What work have you done? Its nice to see a base from which we can help you. | |
Re: A lot of developers aren't bothering changing their modules to 3.x I dont upgrade personally because i know if i do i will not be able to use wxPython anymore :( So yeah, also seeing the last newspost was almost a year ago i have a feeling its not that … | |
Re: There is nothing quite as satisfying as gently closing the book after finishing the story :) | |
Re: It could help stop it flooding with bot posts or something though.. Otherwise they could make loads.. It could overwhelm the admins :P | |
Re: [url]http://xkcd.com/297/[/url] Sorry, i dont usually link things. But this feels appropriate :) | |
Re: Cost a lot of money? What for? The server that ran the movie bandwith or something? | |
Re: If you want to write something at the start of a file though you would need to do something like this [code] #opening the file in read ("r") mode f = open("file.txt",'r') #get all that is in the text file so far oldString = f.readlines() #and close it f.close() #delete … | |
Re: Yes you would increase that, but you would also need to completely redraw the whole circle. As well as that you would need to clear the last circle. | |
Re: Hahaha yeah same.. i have been looking everywhere for one.. no luck so far :P | |
Re: So is there any way to tell (apart from actually checking the threads) if your posts are being up/down rated? | |
I have noticed in the Python Forum there is nothing but -1's on all of the threads except one. So what i was wondering is can we limit the amount of down's a poster can do? For example a member such as myself could do up to 10 down points … | |
Its a great boardgame, i am sure some of you are familiar with. I found a great site to play it online if 7 of us want to go for a game :) [url]http://www.worldleadersthegame.com[/url] | |
Re: For moving something you have to do something like [code=python] self.rect = self.rect.move(self.whereyouwantittogo) [/code] As you can see that is just an example, its not using any of the proper variables that are seen in your program. But im sure you get the gist :) | |
Re: If i am that bored i go and garden. Or practice piano :) | |
Re: pygame, for simplicity as well as documentation and community | |
Re: [QUOTE]and why it's a good ideal to travel with your truckgun/survival-rifle.[/QUOTE] I sometimes forget how many guns there are in the US. Here in australia it is pretty rare to own a gun and *very* rare for someone to walk/drive around with it. I think in some ways the reason … | |
Re: You know, this was the first question i ever asked when i came to this forum. This is the answer i got :) [url]http://www.daniweb.com/forums/thread122666.html[/url] ![]() | |
Re: A static method is one that can be called without instantiating the class so [code] >>> class T(object): def test(): print "HI" >>> T.test() Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> T.test() TypeError: unbound method test() must be called with T instance as first argument (got … | |
Re: Have a fiddle around with [code=python] count = 0 while count <= len(s)+2: count +=1 print '*' [/code] That should print out that right amount of asterisks. See if you cant take that a bit further :) | |
Hi, I have been here for about a year and a half. I originally was only going to stay for just one question but fell in love with the community. So i would like to change my username to something more identifying. So could i change it to "Paul Thompson"? … | |
Re: Im not quite sure what you are doing. But you can do something like this [code] import random as name name.random() name.randrange(1,50) #etc [/code] Hope that helps :P if not, could you explain what you mean a bit more in depth? | |
Re: So then, what have you done? Post it here and we can help you with specific problems. Take a look at [url]http://www.daniweb.com/forums/announcement114-2.html[/url] if you dont know what i mean | |
Re: Huh, this while loop thing twice is two days. Assignments perhaps? Yes there is, you can always go between while and for loops, its just usually for loops are easier. for example [code] count = 3 while count <50: print(count) count += 3 [/code] See? Still simple,just not quite as … | |
Hi, I have been trying to get a java program that draws a line directly on the screen. I have made ones that draw on JApplets and JFrame's but i cant work out how i can draw directly on the screen without having something in the way. I looked at … | |
Re: Okay i have just finished reading the whole thread... And i noticed something you said: [QUOTE]Um, tried Microsoft works back in the bad old days (Windows 3.1) and never touched it since, it was so bad. [/QUOTE] Wow, it was bad back then?! Woop Dee Doo. Things get upgraded, you … | |
I am making a slider puzzle applet. And i have this problem when i display it as an applet my buttons do not seem to act the same was as they did before i made it into an applet by using a JApplet rather than a JFrame as my extension … | |
Re: [QUOTE=manathisbest;1015849] please help![/QUOTE] Sure, we can help. First, what have you done? And second, whats wrong, not just Help! [url]http://www.daniweb.com/forums/announcement114-2.html[/url] <-- read ![]() |
The End.