lllllIllIlllI 178 Veteran Poster

Uh, sorry to burst your bubble. But a circumference is not the measure of atoms in the circle. Its the measure of distance, so therefore you have to measure the difference between 2 pixels, a diagonal it would be. But that isnt a proper circle. So then you would bisect the diagonal and make it into two diagonals between two pixels. But that still isnt a perfect circle so then you would do that again and again, never finding a perfect circle and thats why you can tell there is no end to pi. Because you can never get a measurable amount of 'atoms' that make up a circle without the circle not being a perfect circle.

kapish?

lllllIllIlllI 178 Veteran Poster

snippsat, you should post that as a tutorial :)

lllllIllIlllI 178 Veteran Poster

You can individually set a sizer/widget to show/hide. You do this by going:

sizer.Show(False)
#or otherwise
ExampleTextCtrl.Show(False)

Then you can set them to show again by doing the same command with True as the argument.

Hope that helps :)

lllllIllIlllI 178 Veteran Poster

I don't even know if i would trust Ms Paint to measure something to the nearest cm let alone to decimal places. :S

lllllIllIlllI 178 Veteran Poster

Today is my 16th birthday, so i had a question for everyone. How do you celebrate your birthday?
Do you get together with friends?
Go somewhere special?
Personally i spend it with family :)

But thats it from me, excuse me while i go and learn to drive :D

Grn Xtrm commented: Happy Birthday :) +0
Nick Evan commented: Happy b'day! +0
sknake commented: Happy birthday! :) +0
Ancient Dragon commented: Hope you have many many more birthdays :) +0
William Hemsworth commented: Happy Birthday (: +0
ahihihi... commented: BELATED(^.^) +0
lllllIllIlllI 178 Veteran Poster

New button? I dont see anything new :(

But im missing that favourite forum thing quite a lot... I used it to see if i needed to visit a forum or if i had read all the posts in it anyway.

I want it back! :)

lllllIllIlllI 178 Veteran Poster

Thats me! :P

lllllIllIlllI 178 Veteran Poster

A senior member is just one who has stayed here a long time.. i have been here for about a year and a half and im only starting to think of myself as a regular. Me a senior member? Not yet :P

ps. or members who are super awesomely good at what they do

lllllIllIlllI 178 Veteran Poster

Stop. More information, spent an extra 2 minutes posting your question and it will save a lot of time in the long run. So.
What GUI toolkit? Tk? wxPython? Qt?
What exactly are you wanting to find?

Once you have answered that, we will find it easier to answer you.

lllllIllIlllI 178 Veteran Poster

Yeah i still like python even though it has no brackets and curly braces. But there really is something nice about languages like C/C++ and Java with their very explicit syntax.

lllllIllIlllI 178 Veteran Poster

Yeah same, and i think that the problem should be the same throughout all programming languages. That way you can compare how other languages do it.

Also, it would be fun if you could nominate yourself to make the problem of the week, that way we could all get a turn at some point :)

lllllIllIlllI 178 Veteran Poster

mmmm, i would use decorators as well... i was just thinking if you didnt want to have to type that arbitraryFunction() that you probably wouldn't want to type @arbitraryDecorator That being said, decorators can be very useful and powerful especially when it comes to classes, so if you haven't used them before i would think its probably a good idea to have a go, even if it just is to lean about them. :)

lllllIllIlllI 178 Veteran Poster

Yes, you can, although its not that pretty, here is something that i think shows how something like that can be done.

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 we call the function that was supplied
        exec("self."+functionName+"()")

    def FunctionThatGetsCalledFirst(self):
	print "First"
	
    def Test(self):
        print "Hello"

        
e =Example()
#Try and call the function Test()
e.functionCaller("Test")
"""
First
Hello
""""

Hope that helps :)

lllllIllIlllI 178 Veteran Poster

I'm a bit confused.. what would be the point of such a thing?

lllllIllIlllI 178 Veteran Poster

In basic physics we learned about vectors, so

So.. what?

lllllIllIlllI 178 Veteran Poster

Cool, what state/area?

Let me just warn you: Don't get fat. I can tell you of many people who come over here and can't help but gain weight from all the cheap, easy fast food on every corner. Something like this number of 3.4, can rapidly have a lot of exponents thrown on it(even on just a weekend vacation).

Um, i'm going skiing in utah, going to see the golden gate bridge, the grand canyon, the national parks. So yeah, im excited. And not likely to get fat :P thats not me, im a gymnast so i dont usually eat fast food anyway :P

lllllIllIlllI 178 Veteran Poster

Well, i know my christmas present this year because i had to help plan it. Im coming to the US! :)

lllllIllIlllI 178 Veteran Poster

Isn't this what they pulled when they came out with gMail?

Yeah, it kinda feels like gmail's replacement in some ways.

lllllIllIlllI 178 Veteran Poster

Hi guys,
I have 5 google wave invitations left, and just wondered if anyone wanted to have a look at the preview.
If so, pop on a reply. :)

Cheers
Paul

lllllIllIlllI 178 Veteran Poster

just apply enough force along the same plane and you can negate it.

Have you thought about this? It would take thousands of years to slow any planet's rotation down.. See, planets are really really big, newton tells us that really really big things do not like to stop moving. And unless you have rockets the size of the moon and bigger then i can say that there is very little chance we could do anything, at all.

Instead, why don't you go outside and plant trees? Thats a lot better way to save our planet.

lllllIllIlllI 178 Veteran Poster

For storing them you can use a dictionary:

lines = text.split("\n")
lineDic = {}
for i,l in enumerate(lines):
    lineDic["Line %i"%s] = l
print lineDic

Hope that helps :)

EDIT: woo! 900 posts :P

scru commented: congrats +4
lllllIllIlllI 178 Veteran Poster

I tried wing IDE personally, i got the personal version. Though i do not use it any more, it actually wasn't nearly as good as it looked like it would be.
Now i just use Netbeans with a python plugin, it works a charm :)

lllllIllIlllI 178 Veteran Poster

Okay... we are missing a major point here. Mars is way too far away. When we discovered water on mars, it was the remains of ice lakes. Mars is cold, very cold. If we went to mars, the new problem would be global cooling. In a massive scale.

lllllIllIlllI 178 Veteran Poster

So you have to face the earth is doomed

No i don't. That sounds like someone who has given up. The government is run for the people and by the people. So, if people are serious about climate change (serious enough to want to move the planet) then something can be done. Start small, but it is getting places. Just recently the US announced that they were taking a figure of 17% cut in green house emissions by 2020 (or 2050, cant remember).

Here in Australia a Carbon Trading Scheme is being put through parliment.

People are doing things, and the more public pressure the faster things will get done.

lllllIllIlllI 178 Veteran Poster

hughv -> Waa waa waa.. They don't agree with me.

Get over it, really, if you want ideas, accept them, discuss them, never just completely discount them. Thats why its called a Discussion Forum.

My personal opinion is that the amount of raw materials as well as money required to either :
A) Move the whole planet
B) Teleport
Would be way beyond our reach.. And 25 years ago people thought we would by flying around in jetpacks with computer implanted in us.. unfortunately that hasnt happened yet :P

So i think we really have just this one chance, so rather than spend trillions of dollars trying to move our planet. Why dont we spend that money fixing what we have now?

lllllIllIlllI 178 Veteran Poster

Isnt it possible that you could just have two large buttons side to side? When you click them you can set the label (if you are using wxPython) via wx.Button.SetLabel("Label Here") Then you can bind it to an event so every time the user click a button it updates the label on the button.

I cant see the exact image you want, im at school.. so its blocked. But if you're not using wxPython and using Tkinter, then im sorry, i cant help with that :P

lllllIllIlllI 178 Veteran Poster

Why dont you just have it that it reads the first line of project1 and that can have a simple string telling you what version it is. Then if there is a newer one replace

Have this as the first line:

"12"

f = open('proj1.py')
lineOne = int(f.readlines()[0].strip('"'))
newVersion = 13
if newVersion > lineOne:
    #update

Hope that helps

lllllIllIlllI 178 Veteran Poster

Please post the code that you have written, or a specific problem that you have. We are *not* here to do your homework

lllllIllIlllI 178 Veteran Poster

You really need to use [code]

[/code] tags otherwise it looks messy.

Also, provide a link to where you referenced things from, when referencing directly it is also a good idea to surround the text in quotation marks to indicate this is directly from a reference.

Otherwise its good :)

lllllIllIlllI 178 Veteran Poster

Here is another page you also might enjoy
http://docs.python.org/library/email-examples.html

lllllIllIlllI 178 Veteran Poster

Never heard of onecare... See when i was that age i wasnt quite as computer literate as i liked to think i was.. Still not bad for a 12 year old. But yeah, i can't say i remember things like that :P

lllllIllIlllI 178 Veteran Poster

Im going sailing on my boat, i used to live on it for a number of years sailing up and down Queensland and NSW. So we are going back out on that these holidays... and i have a massive programming job to be done, so not all holiday for me :P

lllllIllIlllI 178 Veteran Poster

No

seconded

lllllIllIlllI 178 Veteran Poster

We can fix that with one character, a lowly comma :)
If you put the comma after the print statement it should work

for x in range(1, len(depend)):
   #comma after the whole statement
    print "%05s" % ('I#'+str(x)),

hope that helps

EDIT: Also you need to have the percentage sign after the quotation marks to make the string formatting work properly, i put that in the code already though

lllllIllIlllI 178 Veteran Poster

I think this is what you need:

import os
os.startfile('filename.py')

Hope that helps :)

lllllIllIlllI 178 Veteran Poster

How did it really start?
Well the Big Bang Theory was premiered in September 24th 2007 :P

Obviously thats the more important one :)

lllllIllIlllI 178 Veteran Poster

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. :)

lllllIllIlllI 178 Veteran Poster

I see myself in there!!! ;)

I know! Im there too, i feel quite privileged :)

lllllIllIlllI 178 Veteran Poster

Post the exact error you are getting, that helps a lot :)

lllllIllIlllI 178 Veteran Poster

Yeah i must admit i have noticed that number always seems to look a little low recently

lllllIllIlllI 178 Veteran Poster

Huh? Care to enlighten the rest of us pagans?

A while ago i was like " I think there is some virus software brought out by Microsoft this time" and people were like nah, but i was right! :P

lllllIllIlllI 178 Veteran Poster

Cause in line 4 of the program you reset the input to 0!? :P Delete line 4

lllllIllIlllI 178 Veteran Poster

Okay, so look at your sentence just here:

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

That tells you exactly what you need to do, first: Ask the user for the current population
This is done with just an input statement

#designed for python 3.x but will work with 2.x
population = int(input("Enter the population"))

So now to the while loop, a while loop needs a condition on which it stops.. We have that here:Until it reaches 1 million

while population < 1000000:
    #do stuff

So not to give everything away, try having a go at that and see what you get, try and make it work! :)

lllllIllIlllI 178 Veteran Poster

Steve's code is almost right :)
The problem is in line 5

line.replace('.','')

The problem with that is that it doesn't store the new string in the variable automatically, so just add a line = in front of that and it should be fine:

file1 = open('words.txt', 'r')
file2 = open('output.txt', 'w')
file1_cont = file1.readlines()
for line in file1_cont:
    line = line.replace('.', ' ')
    file2.write(line)

Hope that helps :)

lllllIllIlllI 178 Veteran Poster

Ha ha! I knew it. So i wasnt wrong all those posts ago :)

lllllIllIlllI 178 Veteran Poster

All that the .pyw extension does that the .py doesn't is make that black window "python.exe" not show up, which is useful for wxPython apps, sometimes :P

lllllIllIlllI 178 Veteran Poster

Hooray for aussies! :) Yeah the whole josh thing happened at about 6 o'clock (am) for me

lllllIllIlllI 178 Veteran Poster

You should probably document your code to explain what each bit is doing, like why you need the third item in the list, why it need to be converted so many times, and what getch() and msvrt are.

But other then that, good snippet

e-papa commented: True +3
lllllIllIlllI 178 Veteran Poster

I though Ezzaral was online.. I didn't know abut niek_e though :P

lllllIllIlllI 178 Veteran Poster

Okkay. Then what i would do is rather than just saying

open("names.txt")

I would do the full address of where i put the file so

open(r"C:\Program Files\Wing IDE 101 3.2\src\debug\tserver\names.txt")

And that should find it then :)