beginner's question

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
veronika

beginner's question

Post by veronika »

Hi,
This is probably a very primitive question, but I am just starting wih programming and pascal.
I had a very easy program, but when I try to compile, I get the message:
"The compile has failed as no compiler has been defined for the c:\....\myprogram.pas file extension."
What does that mean and how can I fix it so I can start writing more programs?
Can anyone help me? Thank you
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

This is probably a very primitive question, but I am just starting wih programming and pascal. I had a very easy program, but when I try to compile, I get the message:
"The compile has failed as no compiler has been defined for the c:\....\myprogram.pas file extension."
What does that mean and how can I fix it so I can start writing more programs?
Because of the complexity of the Zeus configuration model, this is in fact quite a common question :(

To help better understand how this is done, see the newly created Configuring Zeus to Run a Third Party Compiler tip.

Jussi
Guest

How to get enhancement for Python ?

Post by Guest »

Hello,

I would like to use the great looking ZEUS for Python only.

However, I am a little bit lost with the configuration.

What do I need to configure and how in order to get the great feature like auto-complete, intellisense, class browser and so on.

Simply start typing the code is ok, but I do not get any of those enhancement features.

Would soembody volunteer and help me getting this correct, please.

Thank you in advance

Christian
Germany
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Hi Christian,
I would like to use the great looking ZEUS for Python only.
However, I am a little bit lost with the configuration.
What do I need to configure and how in order to get the great feature like auto-complete, intellisense, class browser and so on.
This is what I would do to get a basic configuration for Python:
  1. Workspace Close menu to make sure no workspace is open
  2. Workspace Options menu to bring up the default workspace settings
  3. Change to the Compiler section and make sure the command line is empty for both debug and release configurations (ie see top left corner)
  4. Options Document Types menu to bring up the document types dialog
  5. Edit the document types and turn of the Display this file type in the file open types list option for any document type you are not interested in. This will reduce the number of file types that get shown in the file open dialog. Just enable this option for the files types you expect to be editing.
  6. Download this file: http://www.zeusedit.com/z300/xtags.zip
  7. Extract the new xtags.dll into the Zeus install directory. This will fix some of the intellisensing bugs with the current dll.
Next you need to check that Python is installed correctly. To check use the Tools DOS Command Line menu and type in Python.exe -? and you should get this result
Unknown option: -?
usage: Python.exe [option] ... [-c cmd | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
-d : debug output from parser (also PYTHONDEBUG=x)
-i : inspect interactively after running script, (also PYTHONINSPECT=x)
and force prompts, even if stdin does not appear to be a terminal
-O : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)
-OO : remove doc-strings in addition to the -O optimizations
-S : don't imply 'import site' on initialization
-t : issue warnings about inconsistent tab usage (-tt: issue errors)
-u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)
-U : Unicode literals: treats '...' literals like u'...'
-v : verbose (trace import statements) (also PYTHONVERBOSE=x)
-x : skip first line of source, allowing use of non-Unix forms of #!cmd
-h : print this help message and exit
-V : print the Python version number and exit
-W arg : warning control (arg is action:message:category:module:lineno)
-c cmd : program passed in as string (terminates option list)
file : program read from script file
- : program read from stdin (default; interactive mode if a tty)
arg ...: arguments passed to program in sys.argv[1:]
Other environment variables:
PYTHONSTARTUP: file executed on interactive startup (no default)
PYTHONPATH : ';'-separated list of directories prefixed to the
default module search path. The result is sys.path.
PYTHONHOME : alternate <prefix> directory (or <prefix>;<exec_prefix>).
The default module search path uses <prefix>\lib.
PYTHONCASEOK : ignore case in 'import' statements (Windows).
If you get this instead:
The name specified is not recognized as an internal or external command, operable program or batch file.
then you have not got python installed correctly. You must make sure the Python installation directory is in the system PATH.

Next consider save the following Python code to the c:\temp\sample.py file:

Code: Select all

#This program requires a excellent understanding of decimal numbers
def to_string(in_int):
    "Converts an integer to a string"
    out_str = ""
    prefix = ""
    if in_int < 0:
        prefix = "-"
        in_int = -in_int
    while in_int / 10 != 0:
        out_str = chr(ord('0')+in_int % 10) + out_str
        in_int = in_int / 10
    out_str = chr(ord('0')+in_int % 10) + out_str
    return prefix + out_str


def to_int(in_str):
    "Converts a string to an integer"
    out_num = 0
    if in_str[0] == "-":
        multiplier = -1
        in_str = in_str[1:]
    else:
        multiplier = 1
    for x in range(0,len(in_str)):
        out_num = out_num * 10 + ord(in_str[x]) - ord('0')
    return out_num * multiplier

print to_string(2)
print to_string(23445)
print to_string(-23445)
print to_int("14234")
print to_int("12345")
print to_int("-3512")
Open the file in Zeus and use the Tools DOS Command Line menu to run the script by entering Python.exe $fn as the argument string and You should get the following output produced:

Code: Select all

---------------------------------------------------------------------
     Zeus for Windows Programmers Editor - Version 3.93
     Copyright (c) Xidicone Pty Ltd 1993-2004.  All rights reserved.
----------------------------------------------------------------------

2
23445
-23445
14234
12345
-3512
You could get the same result using the Tools Options and defining the following tool:
  • Menu Text: Run '$fb' Python Script
  • Program Name: Python.exe
  • Program Arguments: $fn
  • Arguments: $fn
  • Working Directory: $fdd
  • Apply Changes
To test the tool open the c:\temp\sample.py file and run the tool from the entry show on the Tools menu.

Another option is to edit the Python Options Document Types and in the compiler section enter Python.exe $fn as the compiler string. This time open the c:\temp\sample.py file and use the Compiler Compile menu to run the script, but this method will only work if the script does not require any user input.

So as you can see depending on how you structure your project you have lots of options when it comes to configuring Zeus to run the Python script.

To get the intellisensing to work you need to create a workspace and add your source files to the workspace. Zeus will populate the class browser with the information found. For more information on how the intellisensing works see the code completion bug report.

To have Zeus help with the writting of the Python code also take a look at the Python SDK Help File QuickHelp topic.

Jussi
Guest

Post by Guest »

For the Zeus class browser to work with Python, the code must be in file with the .py or .python file extension.

These are the extensions that Exuberant Ctags hardcodes for the Python language.
Post Reply