<div dir="ltr">And also don't forget special char, or that it can bbe var char, or char in the DB lookup in boolean with the username.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 19, 2013 at 11:43 PM, David Hutto <span dir="ltr"><<a href="mailto:dwightdhutto@gmail.com" target="_blank">dwightdhutto@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im">Just use an explanatory user tip that states it should be case sensitive, just like with most sites, or apps.</div>
<div><div><img src="https://mail.google.com/mail/u/0/images/cleardot.gif"></div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Fri, Jul 19, 2013 at 10:21 AM, Joel Goldstick <span dir="ltr"><<a href="mailto:joel.goldstick@gmail.com" target="_blank">joel.goldstick@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 19, 2013 at 9:51 AM, Devyn Collier Johnson <span dir="ltr"><<a href="mailto:devyncjohnson@gmail.com" target="_blank">devyncjohnson@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Aloha Python Users!<br>
<br>
I have some coding tips and interesting functions that I want to share with all of you. I want to give other programmers ideas and inspiration. It is all Python3; most of it should work in Python2. I am a Unix/Linux person, so some of these will only work on Unix systems. Sorry Microsuck users :-D ;-)<br>



<br>
All of the below Python3 code came from Neobot v0.8dev. I host an artificial intelligence program on Launchpad (LP Username: devyncjohnson-d). I have not released my Python version yet. The current version of Neobot (v0.7a) is written in BASH and Python3.<br>



<br>
To emulate the Linux shell's date command, use this Python<br>
<br>
function def DATE(): print(time.strftime("%a %B %d %H:%M:%S %Z %Y"))<br>
<br>
Want an easy way to clear the terminal screen? Then try this:<br>
<br>
def clr(): os.system(['clear','cls'][<a href="http://os.name" target="_blank">os.<u></u>name</a> == 'nt'])<br>
<br>
Here are two Linux-only functions:<br>
<br>
def GETRAM(): print(linecache.getline('/<u></u>proc/meminfo', 1).replace('MemTotal:', '').strip()) #Get Total RAM in kilobytes#<br>
def KDE_VERSION(): print(subprocess.getoutput('<u></u>kded4 --version | awk -F: \'NR == 2 {print $2}\'').strip()) ##Get KDE version##<br>
<br>
Need a case-insensitive if-statement? Check this out:<br>
<br>
if 'YOUR_STRING'.lower() in SOMEVAR.lower():<br>
<br>
Have a Python XML browser and want to add awesome tags? This code would see if the code to be parsed contains chess tags. If so, then they are replaced with chess symbols. I know, many people hate trolls, but trolls are my best friends. Try this:<br>



<br>
if '<chess_'.lower() in PTRNPRS.lower(): DATA = re.sub('<chess_white_king/>', '♔', PTRNPRS, flags=re.I); DATA = re.sub('<chess_white_queen/>', '♕', DATA, flags=re.I); DATA = re.sub('<chess_white_castle/>'<u></u>, '♖', DATA, flags=re.I); DATA = re.sub('<chess_white_bishop/>'<u></u>, '♗', DATA, flags=re.I); DATA = re.sub('<chess_white_knight/>'<u></u>, '♘', DATA, flags=re.I); DATA = re.sub('<chess_white_pawn/>', '♙', DATA, flags=re.I); DATA = re.sub('<chess_black_king/>', '♚', DATA, flags=re.I); DATA = re.sub('<chess_black_queen/>', '♛', DATA, flags=re.I); DATA = re.sub('<chess_black_castle/>'<u></u>, '♜', DATA, flags=re.I); DATA = re.sub('<chess_black_bishop/>'<u></u>, '♝', DATA, flags=re.I); DATA = re.sub('<chess_black_knight/>'<u></u>, '♞', DATA, flags=re.I); PTRNPRS = re.sub('<chess_black_pawn/>', '♟', DATA, flags=re.I)<br>



<br>
For those of you making scripts to be run in a terminal, try this for a fancy terminal prompt:<br>
<br>
INPUTTEMP = input('User ≻≻≻')<br>
<br>
<br>
I may share more code later. Tell me what you think of my coding style and tips.<br>
<br>
<br>
Mahalo,<br>
<br>
Devyn Collier Johnson<br>
DevynCJohnson@Gmail.com<span><font color="#888888"><br>
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br></div><div class="gmail_extra">I'm guessing you may be posting with html.  So all your code runs together.<span><font color="#888888"><br clear="all"></font></span></div>
<span><font color="#888888"><div class="gmail_extra"><br>-- <br><div dir="ltr">
<div>Joel Goldstick<br></div><a href="http://joelgoldstick.com" target="_blank">http://joelgoldstick.com</a><br></div>
</div></font></span></div>
<br></div></div><span class="HOEnZb"><font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></font></span></blockquote></div><div class="im"><br><br clear="all"><br>-- <br>Best Regards,<br><span style="font-family:arial,helvetica,sans-serif">David Hutto</span><br><i><b>CEO:</b></i> <u><a href="http://www.hitwebdevelopment.com" target="_blank">http://www.hitwebdevelopment.com</a></u><br>


</div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br><span style="font-family:arial,helvetica,sans-serif">David Hutto</span><br><i><b>CEO:</b></i> <u><a href="http://www.hitwebdevelopment.com" target="_blank">http://www.hitwebdevelopment.com</a></u><br>

</div>