I wouldn’t recommend putting in on GameLogic as GameLogic is cleared every time a new scene loads. As an alternative you can put it on GameLogic.globalDict, e.g:
GameLogic.globalDict['inventory'] = {}
GameLogic.globalDict['inventory']['keys'] = 100[/code
Or, if you're feeling adventurous you can make a module. Just make a text file (blender text file that is) called Inventory.py then you can do things like this:
Inventory.py
import cPickle
items = {}
armour = {}
weapons = {}
def save(file):
global items, armour, weapons
data = {}
data['items'] = items
data['armour'] = armour
data['weapons'] = weapons
file = open(file, "w")
f.truncate(0)
pickle = cPickle.Pickler(file)
picle.dump(data)
file.close()
def load(file):
global items, armour, weapons
file = open(file, "r")
pickle = cPickle.Unpickler(file)
data = pickle.load()
items = data['items']
armour = data['armour']
weapons = data['weapons']
f.close()
def use_item(item, amount):
global items, armour, weapons
if item in items:
if items[item] >= amount:
items[item] -= amount
return(True)
else:
return(False)
else:
return(False)
You can access that module by doing (in a different script/module):
import Inventory
Add items to the inventory
Inventory.items[‘key’] = 100
Inventory.items[‘gold’] = 50
Use items
if Inventory.use_item(‘key’, 1):
print ‘key used!’
else:
print ‘not enough keys :(’
Weapons and armour:
Inventory.weapons[‘sword’] = 2
Inventory.armour[‘shield’] = 23562 # <-You can never have to many shields
Save and load
Inventory.save(‘inventory.txt’) # inventory.txt is the filename
Inventory.items[‘gold’] += 1000 # add some gold…
print Inventory.items[‘gold’] # heaps of gold!
Inventory.load(‘inventory.txt’)
print Inventory.items[‘gold’] # not so much gold 
Do display the items, weapons and armour more tricky. You need to add objects, heres the gist of that:
Inventory Drawing
import Inventory
cont = GameLogic.getCurrentController()
add_object = cont.actuators[‘add_object’] # an add object actuator
def init():
Inventory.objects = [] # make a list for storing all the objects used in drawing the inv.
def draw_items():
x = 0 # co-ordinates for the objects
y = 0
z = 0
for item in Inventory.items:
add_object.object = ‘btn_bg’ # ‘btn_bg’ is a plane that will be a button
add_object.instantAddObject() # add the object
ob = add_object.objectLastCreated # create a variable for that object
ob[‘item’] = item # assign an ‘item’ property to the button for future reference
ob.position = [x,y,z] # move the button
add_object.object = 'Text' # a real time text object
add_object.instantAddObject()
ob = add_object.objectLastCreated
ob['Text'] = item
ob.position = [x - 0.4, y - 0.4, z + 0.1] # we add some spacing on the text so its close to centered
y += 1 # increment the y ordinate so it offsets the next object
if not has_attr(Inventory, ‘objects’):
init()
draw_items()
The above codes not complete but after reading up on python you should be able to polish it off (making the buttons work by using mouse over sensors and left click sensors).
Phew, big post.