Copyright (c) Hyperion Entertainment and contributors.

Difference between revisions of "AmigaOS Manual: Python Modules and Packages"

From AmigaOS Documentation Wiki
Jump to navigation Jump to search
(Added function descriptions)
m
Line 16: Line 16:
 
This module contains AmigaOS-specific requester function for file and path queries, message boxes, ans similar aspects.
 
This module contains AmigaOS-specific requester function for file and path queries, message boxes, ans similar aspects.
   
=== Functions ===
+
=== FileRequest() ===
==== FileRequest ====
 
   
  +
drawer, file = FileRequest ( title, drawer, filename, pattern )
; Format
 
: 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.
 
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.
Line 30: Line 28:
 
</syntaxhighlight>
 
</syntaxhighlight>
   
==== MessageBox ====
+
=== MessageBox() ===
   
  +
result = MessageBox( title, body_text, buttons )
; Format
 
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 '|'.
 
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 '|'.

Revision as of 17:27, 3 January 2019

Modules

arexx

Functions

  • 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