In our examination of the Python language so far we’ve looked at the basics, some of the advanced stuff and a few architectural elements. This week we’ll look at Python in practice.Back in the first part of this series on Python we ran up the interpreter and talked about running IDLE, the Python user interface (really a glorified command-line environment). Python also can be run directly from the system command line. You also can configure all sorts of operating parameters, such as where modules are loaded from, what Python file should be run automatically on start-up and what debugging options should be used.How you set these parameters will depend on which operating system you are running. On the Macintosh there’s a separate utility for editing the configuration file; under Windows and Unix you specify the parameters or file containing them on the command line.Now remember: Python is a script language – the Python interpreter reads a plain text source file and translates it to byte code or intermediate language. This byte code is saved in a file of type .pyc in the same subdirectory as the source file (its file type will be .py). Python is smart enough to keep the interpreted byte-code version and use it instead of the source version for subsequent programs, as long as the date and time stamp on the original .py file aren’t later than the .pyc file. The .pyc files are platform-independent so a common directory can be shared over a network.Another form of byte-code file Python creates are files of the type .pyo, which are optimized by removing certain control statements. This type also can cause problems and prevent successful execution. Although .pyc and .pyo files run no faster than starting with the original source file, you lose the load time it takes for the interpreter to read the source file and translate it to byte code (which can be significant).As it happens, you can use the .pyc and .pyo files for distribution because it is not easy to reverse-engineer these formats.In the first part we mentioned that Python can be used as a Common Gateway Interface interpreter. Under Microsoft’s Internet Information Server you can install Python through the Internet Services Manager. Open the properties of the individual server you want to change, or, if you want to apply the service to all Web servers, use the WWW Service Master properties. On the Home Directory tab under the Application Settings click the Configuration button.This shows the defined file handlers. Click the Add button and enter the following:Executable: "pathpython.exe" -u "%s" "%s"Extension: .py Change the path to match the path to the Python executable and then, optionally, add similar entries for the extension .pyc and, if you plan to use it, .pyo. The quotes are important. Also note that the switch “-u” is required to use unbuffered binary input and output (this means each character is sent and received immediately as a full eight-bit character – buffering must not be used in a CGI environment).But wait! There’s more!Spyce is a server-side language that provides Python-based dynamic HTML generation a la JSP or ASP. Spyce is Python embedded in HTML. It also can be used as a command-line utility for static text pre-processing or as a Web server proxy.Spyce consists of a small core module with additional modules, including access to HTTP requests, generation of HTTP responses and error handling. A preliminary release of workflow automation also is available that provides state machine-based application design. Other Python-based projects include:SimPy: A freeware process-based discrete-event simulation language based on standard Python that provides all the components of a simulation model.Mailman A free Web-integrated mailing list manager that offers built-in archiving, automatic bounce processing, content filtering, digest delivery and spam filtering.Zope (DocFinder: 6337): An open source application server that provides content management, portals and custom applications written in Python, and includes a built-in Web server and search engine.Python is a remarkable language that definitely should be considered for projects ranging from routine network management tasks and applications support to driving serious enterprise solutions.If you’re using Python, let us know! Brag away at gearhead@gibbs.com. Related content news analysis IBM cloud service aims to deliver secure, multicloud connectivity IBM Hybrid Cloud Mesh is a multicloud networking service that includes IT discovery, security, monitoring and traffic-engineering capabilities. By Michael Cooney Dec 07, 2023 3 mins Network Security Cloud Computing Networking news Gartner: Just 12% of IT infrastructure pros outpace CIO expectations Budget constraints, security concerns, and lack of talent can hamstring infrastructure and operations (I&O) professionals. By Denise Dubie Dec 07, 2023 4 mins Network Security Data Center Industry feature Data centers unprepared for new European energy efficiency regulations Regulatory pressure is driving IT teams to invest in more efficient servers and storage and improve their data-center reporting capabilities. By Maria Korolov Dec 07, 2023 7 mins Enterprise Storage Enterprise Storage Enterprise Storage news analysis AMD launches Instinct AI accelerator to compete with Nvidia AMD enters the AI acceleration game with broad industry support. First shipping product is the Dell PowerEdge XE9680 with AMD Instinct MI300X. By Andy Patrizio Dec 07, 2023 6 mins CPUs and Processors Generative AI Data Center Podcasts Videos Resources Events NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe