@saqer/

AdvancedIndolentObjects

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Make an inventory for Excel from Python

# import the excel package
import xlwt
from xlwt import Workbook

# Create a new workbook
wb = Workbook()

# Make a sheet in the workbook
sheet1 = wb.add_sheet('Sheet 1')

# Inventory header
sheet1.write(0,0,'ITEM')

# set up the counter to allow the inventory to be input
i = 1

# run a loop forever to allow inventory input
while 1:
    g = input() # take anything from the keyboard
    sheet1.write(i,0,g)
    wb.save('inventorysheet.xls')
    i += 1