• Creator
  • #2152911

    python programming language


    by jairus kagondu ·

    i have been trying some programming using python 2.5.5 on windows but my problem is that i cant save ,retrieve and execute my codes… come up with a window,what am i missing?

All Answers

  • Author
    • #2927432


      by jairus kagondu ·

      In reply to python programming language


    • #2927397

      Does this help you?. :)

      by Anonymous ·

      In reply to python programming language

      How to Save..

      > I tried but its not working. Here’s a code for sum of two numbers. Now
      > how do i save it?
      >>>> #! /usr/bin/env python
      > …
      >>>> def sum(x,y):
      > … return x+y
      > …
      >>>> x=int(raw_input(‘Enter a number: ‘))
      > Enter a number: 35
      >>>> y=int(raw_input(‘Enter a number: ‘))
      > Enter a number: 7
      >>>> print ‘sum is’, sum(x,y)
      > sum is 42

      You *don’t* write your program inside Python; the interactive prompt is
      just for testing a few lines of code. Instead, use another program (a text
      editor) to create a file containing your source code, save it using a name
      like, and run it from a shell prompt using: python

      Retrieve ext. variables in python program.

      Trying to convert TCL code to python.

      Have a property file from where I read some VAR’s. Looks like this:
      EARPROJECT = sgs-procDist
      APPNAME = SGSProcedure

      In my TCL code I confirm the existence of the VAR = f.ex EARPROJECT by
      using code:

      if { ([info exists APPNAME] && [info exists STAGEDIR] && [info exists
      EARPROJECT] && [info exists EARDESTINATION]) } {
      Does anyone know and equalent way to confirm a Variable from the same
      property file using PYTHON code ???
      You can read it with the module ConfigParser

      how to run a code in python.

      The Python interpreter is usually installed as /usr/local/bin/python . Putting /usr/local/bin in your Unix shell’s search path makes it possible to start it by typing the command:


      You may be able to check where the python is installed by typing “which python”.
      (Note. In the same way you can start CDAT typing “cdat” at a command line).

      You can put all your commands in a file with the extension ‘’ and run it by


      Note that there is a difference between “python file” and “python

      Please post back if you have any more problems or questions.

Viewing 1 reply thread