Category: Python

  • Running external processes/programs with Python subprocess

    Note: It is good to know when the external process runs and for how long, which is included in the code snippet below. For the “when” part, it would have been nice to know the time zone as well. But due to the limitation mentioned here, it is not as easy as it sounds with […]

  • Parse sqlio log file with Python pyparsing

    A few weeks ago I posted some questions on 3 Python text processing modules: pyparsing, SimpleParse, and NLTK. Today I need to analyze a log file generated by sqlio. I decided to use pyparsing. I am pretty pleased with it. I am aware that there are at least 2 utility scripts for this: one is […]

  • Utility script for instance level objects comparison between 2 SQL Server instances

    Useful for SQL Server upgrade and migration, instance consistency check in the enterprise, et cetera. Known assumptions: 1. pyodbc and proper SQL Server database driver setup and tested; 2. Windows Active Directory trusted connection to both instances. Login/password can also be used with very simple modification of the code; 3. Proper permission is set on […]

  • Search objects in SQL Server databases with pyodbc

    Command line utility to search for objects based on names. Search results will be displayed in well formatted tabular format, left-justified. 1. pyodbc installed; 2. Use trusted authentication by default. Find the relevant code to adjust to login/password as needed; 3. -w for wild card search. Default is exact name match, case insensitive in almost […]

  • Questions on Text processing with Python

    No need to waste time on proving the importance of text processing, I suppose. Here is an automation use case I had in mind when I started my search: sucking out all domain\login inside a block of text. Yes, I can build my own regular expressions, and I have done that in the past. But, […]