Skip to content

Instantly share code, notes, and snippets.

@oliviano
Last active May 19, 2020 14:42
Show Gist options
  • Save oliviano/bb19ee774fedb0f2dde62b786cb666d7 to your computer and use it in GitHub Desktop.
Save oliviano/bb19ee774fedb0f2dde62b786cb666d7 to your computer and use it in GitHub Desktop.
#format command
print('my super duper variable is {} and it is currently setting at: {}' .format(x,y))
# with ordered fetching
{1} {2} for ordered element fetching aka print('my super slinky {2} and {1}'.format(bobs,bits))
#Re
opName = 'my fucketed up;sdf 1234 string$'
opName2 = re.sub('\W+','_', opName)
-> my_fucketed_up_sdf_1234_string_
opName3 = re.sub('[:-;$]','_',productName) # swap any char between '[]' to '_' inside produName (string)
my fucketed up_sdf 1234 string_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment