Tuesday, April 16, 2024
pip install packages where multiple python versions installed
Tuesday, October 24, 2023
Enable Python preview in Polyglot notebook
It is a big difference if anyone ever tried the Jupyter Notebook. Once we experience, we need that experience everywhere including .Net. That experience was there in terms of a Jupyter kernel for .Net¹. That requires Jupyter installed in the machine already. Finally, more native experience came for .Net in the form of a VS Code extension. That was called .Net Interactive Notebooks² which uses .Net Interactive (formerly Try.Net) behind the scene. That started supporting many languages such as PowerShell, JavaScript, SQL etc... which is kinda out of the .Net world. Finally, in Nov 2022, .Net Interactive was renamed to Polyglot notebooks³ to reflect its purpose.
Is Python supported by Polyglot Notebooks?
The Polyglot notebooks didn't have the support for Python. We had to switch to Jypyter to work with Python and come back. Now Polyglot Notebooks has Python support as a preview.
How to enable Python in Polyglot Notebook?
References
¹ - https://devblogs.microsoft.com/dotnet/net-core-with-juypter-notebooks-is-here-preview-1/
² - https://hanselman.com/blog/announcing-net-interactive-try-net-includes-net-notebooks-and-more
³ - https://devblogs.microsoft.com/dotnet/dotnet-interactive-notebooks-is-now-polyglot-notebooks/
⁵ - https://github.com/dotnet/interactive/blob/main/docs/jupyter-in-polyglot-notebooks.md
Tuesday, June 22, 2021
Close all overdue Azure DevOps work items with Python
As software engineers, we need to track our work items even if we are working as freelancers or for an enterprise. Those work items constitute the health of the project also helping the management to understand the high-level view. Every company has its own ALM software to track the work. One of the famous ALM is Azure DevOps (ADO hereafter) from Microsoft.
Problem
In an ideal situation, we should plan our tasks for every day. Good if we can plan in advance and close the work items as soon as it's done. But sometimes we may not be able to make the ADO work items sync with reality. It may be due to long release days. Unexpected support issues, shortage of team members, etc. At the end of the billing cycle finance department will be chasing us to close work items. At that time closing each and every item manually is time-consuming. There are many ways to tackle it such as import to Excel close all and sync. We may use any no-code low-code platforms such as Power Automate to automate the task. Developers who use those platforms normally called 'citizen developers'. I strongly recommend trying any of these methods to automate this type of work. There is no need to code.
The no-code, low-code platforms generally offer building blocks to do simple day-to-day operations then provide extensibility via plug-ins or by invoking web requests / Web APIs. The plug-ins require coding efforts. Invoking web requests needs deep knowledge of Web APIs and how the service is structured.
Potential solution
As developers, we are proud of our programming ability and may not want to become citizen developers. For those, there are SDKs available to automate Azure DevOps work items. Also when the no-code, low-code platform doesn't have required customizations, we have to use the SDKs or make direct Web API calls to Azure Dev Ops.
We can use the Python SDK given by Azure DevOps as one of the mediums to interact with Azure Dev Ops to close all the OverDue work items.
Code is available on GitHub.
How to use is already documented in the readme.md files. Please follow that.
Code walkthrough
The Git Repo has enough comments. I am also planning a YouTube video explaining the same.
Tuesday, December 29, 2015
Published my first Google App Engine Python Application
This would have been a post if everything went easily. But it was not easy. Got one trouble. Ok let me start the story.
Introduction
Google App Engine (here after GAE) was there for long time at least from 2011 its no more preview. Unfortunately I didn't get a chance to play with it. Now since my family went to India during the winter season, I have enough time to play around.I never thought it would be easy as publishing web site from Visual Studio to Azure in single click. But app engine is simple as one click publish.
First I ensured that it still has free quota. Because being in the Microsoft shop in my day job who embraces Azure a lot, there is no way I will be hosting an application into Google cloud. So its for my personal use and for personal use I never wanted to pay money. Oh except my domain and hosting space.
https://cloud.google.com/appengine/docs/quotas
First Python application targeting Google App Engine
Then I started with the below basics on Python based GAE development and how to publish a simple Python web app into GAE.https://cloud.google.com/appengine/docs/python/
https://cloud.google.com/appengine/docs/python/tools/devserver
https://cloud.google.com/appengine/docs/python/gettingstartedpython27/introduction
Then setup the environment. I already had Python 2.7. So installed only the GAE SDK.
https://cloud.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python
Its very simple. Once we install the SDK. It will provide us an option to run our web site locally. Once we are satisfied we can push to app engine ie cloud
The helloworld sample in google help is very preliminary. So googled for little higher startup sample and I got the below link.
http://www.labnol.org/internet/host-website-on-google-app-engine/18801/
In the above link I was able to see some more better sample which deal with html files as well. I took that did some modification in html and tried to run from local app engine server. It worked fine.
Deployment
Then I tried to deploy to real GAE by clicking on the Deploy button in the GAE launcher. It opened the browser and I entered my google credentials. But unfortunately it didn't publish to my app engine. The window stayed as is with the below messageIf your browser is on a different machine then exit and re-run this
application with the command-line parameter
--noauth_local_webserver
Then googled with error and language Python. Then I got another workaround to a known issue.
If the local development server is running we will not be able to deploy to GAE. I just stopped the local server and deployed. It worked.
The public url is as follows
http://joystestproject.appspot.com/




