Page 1 of 1

Python troubles.

Posted: Sat Aug 28, 2010 12:20 pm
by Mota-Lev
While using python I run into a few troubles and require some assistance.

First off I was using 2.7 just learning things of some tutorials. I was making a basic test app to see a python app.. But alas I do not know how to get a python app to build so does 'build applet' do that for you? If so mine have been crashing I have 3 versions on my computer but all seem to make the program just crash right after it opens and yeah the app does need something done for it to close.
The code is..

Code: Select all

name=raw_input("Name: ")
       print "Hey " + name"
raw_input=("Press<enter>")
as stupid and simple that code is I cannot seem to get it to work in an app. So help is appreciated.

My second problem is now python 2.7 wont work and I have to use 3.1. Not sure if I'm paranoid or not but I seem to be having getting code lines that work in 2.7 to work in 3.1. I had 2.7 prior to 3.1 but after installing 3.1 I attempted to open 2.7 and got this error..

Image

Any help there is wanted also.

My third problem is getting this dictionary code to work.

Code: Select all

name={'name1': 1, 'name2': 2, 'name3':3'}

for item in name:
    print item
I get this error when trying that..

Image

Now finally. loops....

I have tried this 2 ways both fail in 3.1..

First

Code: Select all

while 1:
     name = raw_input("Name: ")
     if name == 'quit': break
Image

Second

Code: Select all

name = raw_input("Name: ")
then I get an error.

Image

Note the raw_input was working with version 2.7 but due to the fact I cannot get that to load because of the firewall error I cannot attempt this code in it. So if anyone can help me with this it would be great. I'm running 10.6.4 if that helps.

Re: Python troubles.

Posted: Sun Aug 29, 2010 4:44 am
by TaxiService
·_· those statements are not legal!

Code: Select all

name=raw_input("Name: ")
       print "Hey " + name"
raw_input=("Press<enter>")
why did you indent print ? o_o and what is the meaning of that " after the print statement?

i'd do something like this:
Image

output:
Image


but wait, i just noticed i am using python 2.5 <_< what about it? have you tried using that one?
what version of python came with your computer?

Re: Python troubles.

Posted: Sun Aug 29, 2010 5:27 am
by Dirk Gently
Update developer tools?

Re: Python troubles.

Posted: Sun Aug 29, 2010 11:11 am
by Mota-Lev
TaxiService wrote:why did you indent print ? o_o and what is the meaning of that " after the print statement?
ARGH didn't even see that thanks.
Dirk Gently wrote:Update developer tools?
I have 3.2.3, does that need updating?