What is it that you want to do via STAF?  It's difficult to answer how you 
can use STAF if we don't know what it is that you are trying to accomplish 
via test automation.

For example, you could use STAF's PROCESS service to run your Python 
script on a different machine (or on many different machines) if you 
wanted.  For example, perhaps from machine1 you wanted to be able to run 
this Python script on machine2.  You could use STAF's FS (File System) 
service to copy your sample script file from machine1 to machine2 and then 
use STAF's PROCESS service to run this script.  Here are STAF command line 
line examples of how to do this:

STAF machine1 FS COPY FILE "/tmp/test.py" TOFILE /tmp/test.py" TOMACHINE 
machine2
STAF machine2 PROCESS START SHELL COMMAND "/tmp/test.py" RETURNSTDOUT 
STDERROTSTDOUT WAIT

STAF also provides APIs for submitting STAF service requests via Java, 
C/C++, Python, Perl, and Tcl or you can use STAX.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:   santosh hs <santosh.tron...@gmail.com>
To:     staf-users@lists.sourceforge.net
Date:   07/18/2011 10:42 AM
Subject:        [staf-users] Can some one tell me as how can i use STAF in 
python.



Can some one tell me as how can i use STAF in python.
suppose i have script which connects to DB and fetches the data , in this 
case how can i use STAF.

below is sample script

import MySQLdb
db=MySQLdb.Connect("localhost","root","san123","phone")
cursor=db.cursor()
cursor.execute("SELECT * FROM phonebook WHERE Name ='san')
get_contact=cursor.fetchall()
print get_contact
db.close()


please let me know how ca i use STAF here, any other simple example for 
STAF usage other than the above script is also appreciated. 

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to