Advertisement
Guest User

Untitled

a guest
Jun 18th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1.  
  2. #set all the defaults first
  3. DBName = "mythconverg"
  4. DBUserName = "mythtv"
  5. DBPassword = "mythtv"
  6.  
  7. #list of arguments that can be passed:
  8. acceptedArgs = ['--DBName','--DBUserName']
  9.  
  10. #pretend these are our arguments for now
  11. myargs = ['--DBName="newName"','--DBUserName="newUser"','--DBPassword="newPassword"']
  12.  
  13. for arg in myargs:
  14.     if arg.split['='][0] in acceptedArgs:
  15.         #assign new value here
  16.     else
  17.         #this is an unacceptable argument, raise an exception
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement