OS4 DepotLogo by Browallia 
(anonymous IP: 107.20.115.174,1139) 
 HomeRecentStatsSearchSubmitUploadsMirrorsContactInfoDisclaimerConfigAdmin
 Menu

 Features
   Crashlogs
   Bug tracker
   Locale browser
 
 Categories

   o Audio (328)
   o Datatype (47)
   o Demo (180)
   o Development (529)
   o Document (21)
   o Driver (87)
   o Emulation (141)
   o Game (852)
   o Graphics (457)
   o Library (88)
   o Network (200)
   o Office (56)
   o Utility (804)
   o Video (60)

Total files: 3850

Full index file. Download
Recent index file. Download




 Links

  Amigans.net
  OpenAmiga
  Aminet
  IntuitionBase


Support the site


 Readme for:  Development » Library » amigavars.lha

AmigaVars

Description: Python module for read / write access to env vars
Download: amigavars.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 47kb
Version: 1.1
Date: 28 Jun 14
Author: Andy Broad
Submitter: Andy Broad
Email: andy/broad ology org uk
Homepage: http://www.broad.ology.org.uk
Requirements: Python
Category: development/library
License: Public domain
Distribute: yes
Min OS Version: 4.1
FileID: 8825
 
Comments: 0
Snapshots: 0
Downloads: 219  (Current version)
219  (Accumulated)
Votes: 0 (0/0)  (30 days/7 days)

Show comments Show snapshots Show content Show crashlogs Replace file 
amigavars module for python

INFORMATION

The standard python API for access to the environment variables is very posix
centric and only allows read only access to a copy of the evironment, loaded 
at script start and certainly doesn't provide write access to global amiga 
environment variables. Thus amiga script authors needing to set env vars must 
resort to pulling tricks like

os.system("SETENV foo bar save") 

and the perhaps even more convoluted

f = os.popen("getenv foo noline")

var = f.read()

f.close()

if var[0:6] != "GETENV":
	do stuff with var
to read it back again.

This module addresses this by providing three functions analogous to the
shell commands.

GetEnv(name)

	Returns the variable name or None if it doesn't exists

SetEnv(name,value,save)

	Set the variable name to value and saves to ENVARC: if save is True
UnSetEnv(name,delete)

	Unset the variable name and delete it from ENVARC: if delete is True

INSTALLATION

Copy amigavars.so to PYTHON:lib/site-packages

USAGE

It's a standard module so you can use it any way a standard module might be 
used.

e.g.

import amigavars

amigavars.GetEnv("foo")

or

from amigavars import *

SetEnv("foo","bar")


Copyright (c) 2004-2017 by Björn Hagström All Rights Reserved
Amiga OS and its logos are registered trademarks of Hyperion Entertainment