Current location: Hot Scripts Forums » Programming Languages » Other Languages » using python in combination with php


using python in combination with php

Reply
  #1 (permalink)  
Old 09-18-06, 05:40 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
using python in combination with php

hi,

i've recently developped a php class that searches on your server for files containing a specific keyword. This search engine also includes reading mp3 files for artist, album genre and year. As this is very intensive i was thinking of writing the dir-scan part in python.

Is this possible? i know to execute external programs with php (exec, shell_exec), but they usually require additional params. here's an example:
PHP Code:

$username "UnrealEd";

$password "thisisstatedinthisdatabase"
shell_exec("myprog $username $password"); 
is there any way to do something like this with python. something like this:
PHP Code:

$searchString $_POST['sString'];

shell_exec("advancedSearch.py $searchString"); 
thans in adnvace,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
  #2 (permalink)  
Old 09-29-06, 04:34 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
sorry for double posting.

I found it. i have to use the getopt module in combination with the sys module:
Code:
import sys
import getopt

opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="])
more info can be found in the python docs about the getopt module

Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
FYI: Shout goes out over PHP security bugs nugensoftware PHP 0 11-01-05 11:43 PM
PHP Downside--Solutions? Amulet PHP 10 07-15-05 08:26 AM
PHP multi-dimensional array sorting issue aqw PHP 2 06-24-05 11:09 PM
PHP / Graphic Developers someotherguy582 Job Offers & Assistance 1 06-05-05 07:40 PM


All times are GMT -5. The time now is 03:40 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.