Script to setup files and folders for the pos system.


In [1]:
import os
import getpass

In [2]:
getusr = getpass.getuser()

In [3]:
os.listdir('/home/wcmckee/colortest/')


Out[3]:
['Sandwashed.png',
 'universal compassion.png',
 'universal-compassion.png',
 '584',
 'Rounge',
 'moose-fur.json',
 '584.png',
 'Moose-Fur.png',
 '494035.json',
 'Where-We-Begin.png',
 'universal compassion',
 '584.jpg']

In [4]:
homdurz = ('/home/' + getusr + '/sellcoffee')

In [5]:
homdurz


Out[5]:
'/home/wcmckee/sellcoffee'

In [9]:
prodz = (homdurz + '/products')

In [10]:
usrnam = (homdurz + '/usernames')

In [11]:
usrnam


Out[11]:
'/home/wcmckee/sellcoffee/usernames'

In [ ]:


In [6]:
os.mkdir(homdurz)


---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-6-86942e78ccfc> in <module>()
----> 1 os.mkdir(homdurz)

OSError: [Errno 17] File exists: '/home/wcmckee/sellcoffee'

In [8]:
os.mkdir(prodz)


---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-8-682e9b77045f> in <module>()
----> 1 os.mkdir(prodz)

OSError: [Errno 17] File exists: '/home/wcmckee/sellcoffee/products'

In [ ]:
os.mkdir(usrnam)