Skip to content

WebNinjaDeveloper.com

Programming Tutorials




Menu
  • Home
  • Youtube Channel
  • Official Blog
  • Nearby Places Finder
  • Direction Route Finder
  • Distance & Time Calculator
Menu

How to Execute Python Scripts in XAMPP Server in Windows 10 Full Tutorial

Posted on February 11, 2023

 

 

To execute a Python script on a Windows 10 machine using XAMPP, you will need to follow these steps:

 

 

Download and install XAMPP on your machine. This will install Apache and MySQL on your system, which are necessary for running a Python script using XAMPP.

 

 

Open the XAMPP control panel and start the Apache and MySQL modules.

 

 

 

 

Create a new folder in the “htdocs” directory within the XAMPP folder (typically located at “C:\xampp\htdocs“). This will be the root directory for your Python script.

 

 

 

 

 

 

 

 

 

 

 

Place your Python script in the newly created folder.

 

 

In a web browser, navigate to “http://localhost/[foldername]/[scriptname].py“. Replace [foldername] with the name of the folder you created in step 3 and [scriptname] with the name of your Python script.

 

 

Step 2.5: Add Python extension to default page locations (Optional)

 

 

Inside the httpd.conf file search for <IfModule dir_module> to add index.py among others to the list of default page locations.

 

 

 

 

 

 

 

 

 

 

 

Your script will be executed, and the output will be displayed in the browser.

 

 

Step 3: Restart Apache / XAMPP

 

 

If Apache was running while editing, now is the time to restart it.

 

Recent Posts

  • Android Java Project to Crop,Scale & Rotate Images Selected From Gallery and Save it inside SD Card
  • Android Kotlin Project to Load Image From URL into ImageView Widget
  • Android Java Project to Make HTTP Call to JSONPlaceholder API and Display Data in RecyclerView Using GSON & Volley Library
  • Android Java Project to Download Youtube Video Thumbnail From URL & Save it inside SD Card
  • Android Java Project to Embed Google Maps & Add Markers Using Maps SDK
  • Angular
  • Bunjs
  • C#
  • Deno
  • django
  • Electronjs
  • java
  • javascript
  • Koajs
  • kotlin
  • Laravel
  • meteorjs
  • Nestjs
  • Nextjs
  • Nodejs
  • PHP
  • Python
  • React
  • ReactNative
  • Svelte
  • Tutorials
  • Vuejs




©2023 WebNinjaDeveloper.com | Design: Newspaperly WordPress Theme