If you’ve managed to solve your own problem, do share what you did to solve it too, so that other readers can make use of your solution. If we have a solution for you, we’ll respond to you in the comments! If you couldn’t get Python to work, do share in the comments below the problem(s) you ran into. ("C:\\Users\\terresquall\\AppData\\Roaming\\Python\\Python39\\site-packages")Ĭursor.execute("SELECT * FROM `agents` ") That means that I’ll have to add the following to the top of my Python script for my imported package to register: python.py #!C:\Program Files\Python39\python.exe Location: c:\users\terresquall\appdata\roaming\python\python39\site-packages License: MySQL Connector/Python 8.0 license If you don’t know where this is, open Command Prompt or Terminal and type in the following: pip show įor example, to use the mysql-connector-python package from PIP, pip show gives the following output: > pip show mysql-connector-python The default install for composer will put it in an appdatacomposer directory. You’ll need to replace above with the place where your package(s) were installed. Make sure the composer binaries are in your path. 'Ready to Install' window will appear on the screen, then click on the 'Next' button. Uncheck the 'Learn more about Bitnami for XAMPP' option and click on the 'Next' button. If you’re looking to utilise additional packages from Python PIP, you’ll need to add some additional lines of code on your Python script(s). Choose a folder to install the XAMPP and click on the 'Next' button. This is so that the changes made to nf will apply. With the file in htdocs, turn on Apache in XAMPP and you should be able to run the file by accessing Make sure to restart Apache on XAMPP before doing any testing. Note that you will have to replace the first line with the path to Python. To test if your setup works, you can copy the following file into the htdocs folder of your XAMPP installation. There is no XAMPP download 64-bit option, but the XAMPP for 32 bit works perfectly on all the 64-bit editions of Windows. If you want Python files to only run on a specific site, you can also add the codes above into a block, such as in nf.Īrticle continues after the advertisement: 4. Step 1: Download the latest version of XAMPP from this link, or you can visit ‘ ’, to find the other versions available. This will cause index.py, default.py or home.py to be among the candidates to be loaded when a directory is accessed. Home.php home.cgi home.asp home.shtml home.html home.htm home.py Optionally, if you want XAMPP to automatically load index.py when a directory is accessed, find the following section in nf and add the highlighted portion below: nf ĭirectoryIndex index.php index.cgi index.asp index.shtml index.html index.htm index.py \ĭefault.php default.cgi default.asp default.shtml default.html default.htm default.py \ Once nf is open (you can open it with any text editor, such as Notepad or TextEdit), add the following lines at the end of the file: nf AddHandler cgi-script. Microsoft recommendsthe C:Program Filesfolder for the default installation destination. From there, you’ll need to head one level up, and head to apache/conf/nf.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |