Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Untitled1.ipynb",
"version": "0.3.2",
"provenance": [],
"toc_visible": true
},
"kernelspec": {
"name": "python2",
"display_name": "Python 2"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"[View in Colaboratory](https://colab.research.google.com/github/asanso/wycheproof/blob/master/Untitled1.ipynb)"
]
},
{
"metadata": {
"id": "LtmMnLUG0U6L",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "iH1oEngB02Zv",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"!pip install --upgrade -q gspread"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "XKxzbrsy1Ulk",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"!pip install --upgrade -q gspread"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "6UbkNzJn1Um3",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 374
},
"outputId": "a1266caf-276e-4869-c5c6-4d5d33c5cf56"
},
"cell_type": "code",
"source": [
"from google.colab import auth\n",
"auth.authenticate_user()\n",
"\n",
"import gspread\n",
"from oauth2client.client import GoogleCredentials\n",
"\n",
"gc = gspread.authorize(GoogleCredentials.get_application_default())\n",
"\n",
"sh = gc.create('A new spreadsheet')\n",
"\n",
"# Open our new sheet and add some data.\n",
"worksheet = gc.open('A new spreadsheet').sheet1\n",
"\n",
"cell_list = worksheet.range('A1:C2')\n",
"\n",
"import random\n",
"for cell in cell_list:\n",
" cell.value = random.randint(1, 10)\n",
"\n",
"worksheet.update_cells(cell_list)\n",
"# Go to https://sheets.google.com to see your new spreadsheet."
],
"execution_count": 0,
"outputs": [
{
"output_type": "error",
"ename": "ImportError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m\u001b[0m",
"\u001b[0;31mImportError\u001b[0mTraceback (most recent call last)",
"\u001b[0;32m<ipython-input-6-a2da4ed0467d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mauth\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mauthenticate_user\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mgspread\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0moauth2client\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclient\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mGoogleCredentials\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mImportError\u001b[0m: No module named gspread",
"",
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0;32m\nNOTE: If your import is failing due to a missing package, you can\nmanually install dependencies using either !pip or !apt.\n\nTo view examples of installing some common dependencies, click the\n\"Open Examples\" button below.\n\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n"
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.