Copyright (c) Hyperion Entertainment and contributors.

AmigaOS Manual: Python Modules and Packages

From AmigaOS Documentation Wiki
Revision as of 12:21, 11 January 2019 by Janne Peräaho (talk | contribs) (Added amiga module and 4 function descriptions.)
Jump to navigation Jump to search

Modules

amiga

This module provides access to AmigaOS system functionality.

abort()

 abort ()

Abort the interpreter immediately. Calling the function fails in the hardest way possible on the hosting operating system. This function does not return!

access()

 access ( path, mode )

Use the real uid (User Identifier) or gid (Group Identifier) to test for access to a path. Note that most operations will use the effective uid/gid, therefore this routine can be used in a suid (Set Owner User ID) or sgid (Set Group ID) environment to test if the invoking user has the specified access to the path.

The mode argument can be F_OK to test existence, or the inclusive-OR of R_OK, W_OK, and X_OK.

chdir()

 chdir ( path )

Change the current working directory to the specified path.

chmod()

 chmod ( path, mode )

Change the access permissions of a file.

chown()

close()

dup()

dup2()

fdopen()

fstat()

ftruncate()

getcpu()

getcwd()

getcwdu()

getmachine()

getpid()

getports()

isatty()

kill()

link()

listdir()

lseek()

lstat()

mkdir()

open()

pipe()

popen()

putenv()

read()

remove()

rename()

rmdir()

stat()

stat_float_times()

strerror()

system()

tempnam()

tmpfile()

tmpnam()

umask()

unlink()

urandom()

utime()

waitforport()

write()

arexx

Msg()

Port()

dorexx()

Variables

  • __doc__
  • __file__
  • __name__

asl

This module contains AmigaOS-specific requester function for file and path queries, message boxes, ans similar aspects.

FileRequest()

 drawer, file = FileRequest ( title, drawer, filename, pattern )

Opens a file select requester with the given title, the drawer and filename gadgets predefined by drawer and title. If a pattern is given, a pattern gadget is also displayed and pre-set with the given pattern. The result is a tuple drawer, filename which relects the choice of the user.

Example

Opens up a file requester in T: with 'my.log' as a default name, and a filter set to '#?.log':

drawer, file = asl.FileRequest('Python File Request', 'T:', 'my.log', '#?.log' )

MessageBox()

 result = MessageBox( title, body_text, buttons )

Opens a message box with the given title and body text. The options on the dialog are taken from the 'buttons' argument. The 'buttons' string contains individual substrings separated by a '|'.

The result of this function is the button number selected by the user. Numbering starts from left with 1, 2 and so on, but the final button is 0.

Example

Puts up a requester asking for a 'Yes' or 'No' answer:

result = asl.MessageBox('Python Request', 'AmigaOS rules', 'Yes|No')

Selecting 'Yes' returns 1 and selecting 'No' returns 0.

Variables

  • __doc__
  • __file__
  • __name__

Packages