Results 1 to 2 of 2

Thread: Getting Python to print "hello world"

  1. #1
    Orinda NNTP User

    Default Getting Python to print "hello world"

    I have python on opensuse 10.2. This was extracted via a gunzip tar file to a newly created directory just below root - i.e. /python. I used YAST for the C compiler but needed to get some experience using TAR and manually going through these steps.

    In any event it looks like the make files installed everything OK. The question is how do I "start" it and where can you do a command such as print "hello world" or 8*8=64? Also is there a graphical interface to this utility as well?

    This is the directory hierarchy:

    linux102:/python # ls
    Python-2.6.1 Python-2.6.1.tar
    linux102:/python # cd Python-2.6.1
    linux102:/python/Python-2.6.1 # ls
    build Grammar Makefile PC RISCOS
    config.log Include Makefile.pre PCbuild setup.py
    config.status install-sh Makefile.pre.in pyconfig.h Tools
    configure Lib Misc pyconfig.h.in
    configure.in libpython2.6.a Modules python
    Demo LICENSE Objects Python
    Doc Mac Parser README
    linux102:/python/Python-2.6.1 #

  2. #2
    Join Date
    Jul 2008
    Location
    Voorhout, Netherlands
    Posts
    262

    Default Re: Getting Python to print "hello world"

    Orinda wrote:
    > I have python on opensuse 10.2. This was extracted via a gunzip tar file
    > to a newly created directory just below root - i.e. /python. I used YAST


    Totally unnecessary

    Python has been included with SuSE and openSUSE since the dawn of mankind
    (well, so to speak..)

    Just do 'zypper in python' or install with YaST and your DVD.

    When Python is installed, it's called with 'python' on the command line in a
    terminal window.
    $python
    Python 2.5.1 (r251:54863, Dec 1 2008, 17:47:46)
    [GCC 4.2.1 (SUSE Linux)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>


    The 'hello World' exercise couldn't be simpeler:

    >>> "Hello World"

    'Hello World'
    >>> print "Hello World"

    Hello World
    >>>


    Ctrl-D exits the Python interpreter.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •