A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| var client = {}; | |
| client.run = function (options) { | |
| options = options || {}; | |
| var socket = io.connect(options.remote || "http://localhost:8080"); | |
| socket.on('connect', function() { | |
| var term = new Terminal({ |
| import os | |
| import sys | |
| import json | |
| import socket | |
| import threading | |
| activate_this = os.environ.get("SUBLIMEREPL_ACTIVATE_THIS", None) | |
| # turn off pager | |
| os.environ['TERM'] = 'emacs' |
| # -*- coding: utf-8 -*- | |
| __author__ = 'Arkady.Babaev' | |
| import requests | |
| import xml.etree.ElementTree as ET | |
| class ALMUrl: | |
| def __init__(self, ip, port, domain, project): | |
| self.__base = u'http://' + ip + u':' + port + u'/qcbin' | |
| self.__auth = self.__base + u'/authentication-point/authenticate' |
| <!-- take into use: | |
| Save this file | |
| Open Notepad++ | |
| Select menu: Language > Define your language... | |
| You get a popup. Select "Import", navigate to xml-file | |
| Click "Save as" and name your file eg. "RobotFramework" | |
| Now you can open a Robot test suite file and select from Languages -menu the correct language (in the bottom) | |
| --> | |
| <NotepadPlus> | |
| <UserLang name="RobotFramework" ext="txt"> |
Unfortunately, Fabric has not yet officilly been ported to Python 3. However, it is possible to get it to work. Here is how I did it.
First, create a virtual environment to run fabric in. (If you haven't set up virtual environments for Python, go ahead and do that now, then come back.) I have the [fink environment] (http://finkproject.org) installed on my Mac, and
#Flask-admin Many-to-Many Search
Many-to-Many searches are not easily supported by Flask-admin. Read Here for more info
##Solution
Tested on Flask-Admin 1.1.0
| """Asynchronous requests in Flask with gevent""" | |
| from time import time | |
| from flask import Flask, Response | |
| from gevent.pywsgi import WSGIServer | |
| from gevent import monkey | |
| import requests |
| license: gpl-3.0 |