Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 01-25-2006, 05:03 PM   #1 (permalink)
NIN
 
True Techie

Join Date: Apr 2004

Posts: 202

NIN

Default python

I'm teaching myself python. I've been using a Linux command line and when I make a file and run it python never gives me a return value. When I use the interpreter and just type it in I get the return.

The test program is:

def test(x,y):
return 1 #return is indented#it doesn't show when posted.
test(1,2)

When done in the command line I get 1 and the return value but when I make a file test.py I get nothing. When I make the file in vi and and run it from the command line: python test.py. when I substitute print for return it works.
__________________
A+, Network+, and powerpoint certified

Studying Linux+
NIN is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On