Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello World

Status
Not open for further replies.

ddrillich

Technical User
Jun 11, 2003
546
US
Good Day,

I'm new to Python and trying the following program but it doesn't print anything. Any idea why?

Thanks,
Dan


"""

@author Dan Drillich
@created 30-May-06


"""

from java.lang import System
import sys
sys.add_package('java.lang')


def main():
CR = chr(13)

#Need to set the value of Request, RequestPost and Error Folder
System.out.println("Hello World")



main()
 
This is all you need to do to print Hello World::


print "Hello World!"




[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
post what you ran and how you ran it.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
I don't know anything about Intraspect. The code that you have is perfectly valid python code. If it is not working, then the problem is the way that Intraspect is implementing python.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
When you want to use stdout instead of print use the following:

Code:
from sys import stdout

def main():
    stdout.write("Hello World")

main()

Hope this helps

mcvdmvs
"It never hurts to help" -- Eek the Cat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top