<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Hello all,<br><br>I have used *args and **kwargs to have a function accept optional parameters, but is there a lazy way to optionally pass parameters? For example, say my script can accept a number of parameters for a database connection, such as user, password, and database name. The function that makes the MySQL call has a default for user, say "root". So if the user didn't pass in a value for the user option, I don't want to pass it to the function doing the MySQL call. I don't want to have to do:<br><br>if options.user: <br>&nbsp;&nbsp;&nbsp; do_mysql_query(user)<br>else:<br>&nbsp;&nbsp;&nbsp; do_mysql_query()<br><br>and so on for each possible option. Is there a better way?<br><br>Thanks,<br>Sam<br><div>&nbsp;</div>_______________________<br>Samuel Huckins<br><br><div>Homepage -
 http://samuelhuckins.com<br>Tech blog - http://dancingpenguinsoflight.com/<br>Photos - http://www.flickr.com/photos/samuelhuckins/<br>AIM - samushack | Gtalk - samushack | Skype - shuckins<div><br></div></div></div></body></html>