Python troubles.

Feel free to talk about anything and everything in this board.
Post Reply
Mota-Lev
Green Beret
Posts: 3554
Joined: Sat Mar 17, 2007 4:19 pm
Location: AusFag

Python troubles.

Post by Mota-Lev » Sat Aug 28, 2010 12:20 pm

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.
Stupid tinypic removing my images

TaxiService
Night Stalker
Posts: 6887
Joined: Thu May 24, 2007 5:52 am
Location: 41.896198, 12.4165945
Contact:

Re: Python troubles.

Post by TaxiService » Sun Aug 29, 2010 4:44 am

·_· 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?
  • TaxiService! Shitposting since 2007!
MGM Sig

Dirk Gently
Commando
Posts: 2047
Joined: Sun Oct 21, 2007 2:34 pm
Location: 3C0E9056
Contact:

Re: Python troubles.

Post by Dirk Gently » Sun Aug 29, 2010 5:27 am

Update developer tools?

Mota-Lev
Green Beret
Posts: 3554
Joined: Sat Mar 17, 2007 4:19 pm
Location: AusFag

Re: Python troubles.

Post by Mota-Lev » Sun Aug 29, 2010 11:11 am

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?
Stupid tinypic removing my images

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests