{"id":208253,"date":"2024-06-21T11:19:59","date_gmt":"2024-06-21T15:19:59","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=208253"},"modified":"2024-08-13T15:54:49","modified_gmt":"2024-08-13T19:54:49","slug":"use-a-python-script-to-read-and-write-on-excel-file-in-python","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/","title":{"rendered":"Use a Python Script to Read and Write on Excel File in Python"},"content":{"rendered":"\n<p>This post demonstrates how to utilize the\u00a0<strong>xlwings<\/strong>\u00a0Python package to execute a Python script to read and write Excel\u00a0<strong>in Python<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-running-a-python-script-to-read-and-write-excel-file-in-python\">Running a Python script to read and write Excel file in Python<\/h2>\n\n\n\n<p>Unlike the previous post, I will demonstrate how to read and write an Excel file in Python without relying on a button in Excel.<\/p>\n\n\n\n<p>By bypassing the use of an Excel button, we can verify the functionality in Python to ensure it operates correctly. Once confirmed, we can then integrate this process by clicking a button within Excel.<\/p>\n\n\n\n<p>This approach is preferred because testing Python functionalities directly from Excel right from the beginning can be quite cumbersome.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Python code<\/h3>\n\n\n\n<p>The Python code below handles three inputs: whether the file is new or existing, the file name (whether it&#8217;s new or existing), and whether the Excel instance should be visible or not.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import os\nimport xlwings as xw\nimport sys\n \n# Check if a file exists and exit with a warning message if it does.    \ndef exit_file_exists(base_name, directory):\n \n    filename = os.path.join(directory, base_name)\n    if os.path.exists(filename):\n        print(f\"\"\"File '{filename}' already exists. \n              Exiting the program.\"\"\")\n        sys.exit(0)  # Use 0 for a normal termination\n    return filename\n \n#===================================================\n# Input\n#===================================================\n# new or existing file\nb_excel_new_file = True #False\n \n# new or existing filename\nfile_name_w_ext = \"TestBook9.xlsm\" \n \n# Excel instance visible or not\nb_excel_visible = True #False\n#===================================================\n \n# Excel instance\napp = xw.App(visible=b_excel_visible)\n \n \n# create file \nif b_excel_new_file == True:\n    \n    # Get the directory of the running Python file\n    current_directory = os.path.dirname(os.path.abspath(__file__))\n    # Check if the file exists\n    filename = exit_file_exists(file_name_w_ext, current_directory)\n    \n    # New workbook\n    wb = xw.Book()\n    wb.save(filename)\n    print(f\"File '{filename}' is newly created.\")\n    \nelse:\n \n    filename = os.path.join(os.path.dirname(os.path.abspath(__file__)), \n                            file_name_w_ext)\n    wb = xw.Book(filename)\n \n \n# select first sheet\nsht1 = wb.sheets[0]\n \n# 1) one cell\nsht1.range('A1').value = 'Hello World'\n \n# 2) a range of cells\nsht1.range('A3:D4').value = 11\n \n# 3) formula\nsht1.range('F3').formula = '=SUM(A3:D3)'\n \n#4) clear cells\nsht1.range('A3:B4').clear()\n \n# exit instance only when xw.App(visible=False)\nif b_excel_visible == False:\n    wb.save()  # save \n    app.kill() # shut down excel process<\/pre>\n\n\n\n<p>A result is simple as follows.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"678\" height=\"153\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2024\/06\/excel-shlee.png\" alt=\"\" class=\"wp-image-208256 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/06\/excel-shlee.png 678w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/06\/excel-shlee-300x68.png 300w\" data-sizes=\"(max-width: 678px) 100vw, 678px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 678px; aspect-ratio: 678\/153;\" \/><\/figure>\n\n\n\n<p>After creating a new file named TestBook9.xlsm, attempting to create another new file with the same name, TestBook9.xlsm, will result in an error message. The program will then exit to ensure the existing TestBook9.xlsm file is not overwritten.<\/p>\n\n\n\n<p>The folder and file names were too long, so they have been abbreviated to &#8220;aaa,&#8221; &#8220;bbb,&#8221; and &#8220;ccc&#8221; for convenience.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\nrunfile('aaa.py', wdir='bbb')\nFile 'ccc\\TestBook9.xlsm' is newly created.\n \nrunfile('aaa.py', wdir='bbb')\nFile 'ccc\\TestBook9.xlsm' already exists. \n     Exiting the program.<\/pre>\n\n\n\n<p><em>Originally posted on <a href=\"https:\/\/shleeai.blogspot.com\/2024\/06\/use-python-script-to-read-and-write.html\">SH Fintech Modeling<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post demonstrates how to utilize the xlwings Python package to execute a Python script to read and write Excel in Python.<\/p>\n","protected":false},"author":662,"featured_media":191319,"comment_status":"open","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,338,341],"tags":[806,5878,595,17282],"contributors-categories":[13728],"class_list":{"0":"post-208253","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-ibkr-quant-news","9":"category-quant-development","10":"tag-data-science","11":"tag-excel","12":"tag-python","13":"tag-xlwings-package","14":"contributors-categories-sh-fintech-modeling"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Use a Python Script to Read and Write on Excel File in Python<\/title>\n<meta name=\"description\" content=\"This post demonstrates how to utilize the xlwings Python package to execute a Python script to read and write Excel in Python.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/208253\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Use a Python Script to Read and Write on Excel File in Python\" \/>\n<meta property=\"og:description\" content=\"This post demonstrates how to utilize the xlwings Python package to execute a Python script to read and write Excel in Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-21T15:19:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-13T19:54:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/python-blue-background-digits.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sang-Heon Lee\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sang-Heon Lee\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/use-a-python-script-to-read-and-write-on-excel-file-in-python\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/use-a-python-script-to-read-and-write-on-excel-file-in-python\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Sang-Heon Lee\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0a959ff9de7f0465a07baa1fe1ae0200\"\n\t            },\n\t            \"headline\": \"Use a Python Script to Read and Write on Excel File in Python\",\n\t            \"datePublished\": \"2024-06-21T15:19:59+00:00\",\n\t            \"dateModified\": \"2024-08-13T19:54:49+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/use-a-python-script-to-read-and-write-on-excel-file-in-python\\\/\"\n\t            },\n\t            \"wordCount\": 232,\n\t            \"commentCount\": 0,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/use-a-python-script-to-read-and-write-on-excel-file-in-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/06\\\/python-blue-background-digits.jpg\",\n\t            \"keywords\": [\n\t                \"Data Science\",\n\t                \"Excel\",\n\t                \"Python\",\n\t                \"xlwings package\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Quant\",\n\t                \"Quant Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"CommentAction\",\n\t                    \"name\": \"Comment\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/use-a-python-script-to-read-and-write-on-excel-file-in-python\\\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/use-a-python-script-to-read-and-write-on-excel-file-in-python\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/use-a-python-script-to-read-and-write-on-excel-file-in-python\\\/\",\n\t            \"name\": \"Use a Python Script to Read and Write on Excel File in Python | IBKR Campus US\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/use-a-python-script-to-read-and-write-on-excel-file-in-python\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/use-a-python-script-to-read-and-write-on-excel-file-in-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/06\\\/python-blue-background-digits.jpg\",\n\t            \"datePublished\": \"2024-06-21T15:19:59+00:00\",\n\t            \"dateModified\": \"2024-08-13T19:54:49+00:00\",\n\t            \"description\": \"This post demonstrates how to utilize the xlwings Python package to execute a Python script to read and write Excel in Python.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/use-a-python-script-to-read-and-write-on-excel-file-in-python\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/use-a-python-script-to-read-and-write-on-excel-file-in-python\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/06\\\/python-blue-background-digits.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/06\\\/python-blue-background-digits.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Python\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0a959ff9de7f0465a07baa1fe1ae0200\",\n\t            \"name\": \"Sang-Heon Lee\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/sang-heonlee\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Use a Python Script to Read and Write on Excel File in Python","description":"This post demonstrates how to utilize the xlwings Python package to execute a Python script to read and write Excel in Python.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/208253\/","og_locale":"en_US","og_type":"article","og_title":"Use a Python Script to Read and Write on Excel File in Python","og_description":"This post demonstrates how to utilize the xlwings Python package to execute a Python script to read and write Excel in Python.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/","og_site_name":"IBKR Campus US","article_published_time":"2024-06-21T15:19:59+00:00","article_modified_time":"2024-08-13T19:54:49+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/python-blue-background-digits.jpg","type":"image\/jpeg"}],"author":"Sang-Heon Lee","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sang-Heon Lee","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/"},"author":{"name":"Sang-Heon Lee","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0a959ff9de7f0465a07baa1fe1ae0200"},"headline":"Use a Python Script to Read and Write on Excel File in Python","datePublished":"2024-06-21T15:19:59+00:00","dateModified":"2024-08-13T19:54:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/"},"wordCount":232,"commentCount":0,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/python-blue-background-digits.jpg","keywords":["Data Science","Excel","Python","xlwings package"],"articleSection":["Data Science","Quant","Quant Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/","name":"Use a Python Script to Read and Write on Excel File in Python | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/python-blue-background-digits.jpg","datePublished":"2024-06-21T15:19:59+00:00","dateModified":"2024-08-13T19:54:49+00:00","description":"This post demonstrates how to utilize the xlwings Python package to execute a Python script to read and write Excel in Python.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/use-a-python-script-to-read-and-write-on-excel-file-in-python\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/python-blue-background-digits.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/python-blue-background-digits.jpg","width":1000,"height":563,"caption":"Python"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0a959ff9de7f0465a07baa1fe1ae0200","name":"Sang-Heon Lee","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/sang-heonlee\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/06\/python-blue-background-digits.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/208253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/662"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=208253"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/208253\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/191319"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=208253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=208253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=208253"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=208253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}