Skip to content

Instantly share code, notes, and snippets.

@mooose
mooose / get_float.py
Created October 14, 2020 07:27
Convert a strnig to float
def do_float(x):
"""convert a string into a float - float is in the front of the string
"""
if isinstance(x, int):
return float(x)
elif isinstance(x, float):
return x
else:
x = str(x)
try:
@mooose
mooose / hangoutAlert
Last active December 5, 2018 10:37
Sending a simple message from python to Hangout Chat Group
WEBHOOK_URL = <URL of Hangout Chat Group to push a message to>
from google.appengine.api import urlfetch
import urllib
def hangoutAlert(message):
"""hangoutAlert
send a message to hangoutAlert via Hangout Chat Alerts Group
"""
bot_message = urllib.urlencode({'text' : message })
@mooose
mooose / gae_csv.py
Created November 14, 2018 17:29 — forked from mattes/gae_csv.py
class InitCSVHandler(webapp2.RequestHandler):
def get(self):
fetched = self.request.get('fetched')
if not fetched:
self.response.write("no fetched date")
return
taskqueue.add(url='/create_csv', queue_name='csv', params={'fetched': fetched})
self.response.write("creating " + str(fetched))