Editing Russ Python Tips and Techniques
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 7: | Line 7: | ||
* when division by 0 is useful | * when division by 0 is useful | ||
* code is multiple files - scratch file | * code is multiple files - scratch file | ||
+ | * msg, print( msg ) | ||
* moving to 3.6 use fstrings | * moving to 3.6 use fstrings | ||
* example files with functions [[Python Example Code]] | * example files with functions [[Python Example Code]] | ||
Line 12: | Line 13: | ||
* dict based case statements | * dict based case statements | ||
* choose names for cut and paste | * choose names for cut and paste | ||
+ | * spyder using comments for navigation | ||
* mark your code with unusual string * zzz in your code | * mark your code with unusual string * zzz in your code | ||
− | + | * make your names searchable | |
=== Move these to a good place in the outline === | === Move these to a good place in the outline === | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==== Comments for Navigation ==== | ==== Comments for Navigation ==== | ||
Line 62: | Line 48: | ||
If you use print for debugging you may want to scan your code of "print" to remove unwanted statements. I do not delete them because sometimes I want them again for more debugging. I change "print" to "#rint" | If you use print for debugging you may want to scan your code of "print" to remove unwanted statements. I do not delete them because sometimes I want them again for more debugging. I change "print" to "#rint" | ||
to comment out the print but to stop it form showing up on searches. | to comment out the print but to stop it form showing up on searches. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
= Parameters for Applications = | = Parameters for Applications = | ||
Line 206: | Line 152: | ||
= Copy and Paste = | = Copy and Paste = | ||
− | |||
− | |||
There are lots of arguments against copy and paste, but used carefully I think that it is extremely useful. But used carefully. | There are lots of arguments against copy and paste, but used carefully I think that it is extremely useful. But used carefully. |