Faqts : Business : Programming : Shopping For You : Python

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

15 of 30 people (50%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

how would i run a command to an applicatation like telnet?

Feb 8th, 2010 05:07
shanu khan, mohamed helmy, Shopping Snooper, Dipak Khandelwal, jsieoa gide, Joe Bloggs, john Cena, raj sandia, Scott Mandarich, Joonas Paalasmaa, chase cobb, http://www.nighthawks.co.in


Text:

            Use popen2 module 
            http://www.python.org/doc/current/lib/module-popen2.html

            Example:

            import popen2

            in, out = popen2.popen2("sort")


            out.write("1\n")
            out.write("2\n")
            out.write("4\n")
            out.write("3\n")

http://www.nighthawks.co.in
http://www.contactindianhotels.com
http://www.buygranites.com
http://www.buystonesonline.com
http://www.mahimawholesalejewelry.com
http://www.jaipurbandhej.com
http://www.celestialindia.net
http://www.websitesofhotels.com
http://www.goodtimepass.com
http://www.heritagehotelsinrajasthan.com
http://www.silverwholesalejewellery.com
http://www.indianmedicaltourism.com
http://www.kotastone.com
http://www.prlog.org/10503545-sale-37684-black-granite-vanity-top-37-22-17500.html


            print in.readline(),
            print in.readline(),
            print in.readline(),
            print in.readline(),

            prints 1 2 3 4

http://www.nighthawks.co.in
http://www.contactindianhotels.com
http://www.buygranites.com
http://www.buystonesonline.com
http://www.mahimawholesalejewelry.com
http://www.jaipurbandhej.com
http://www.celestialindia.net
http://www.websitesofhotels.com
http://www.goodtimepass.com
http://www.heritagehotelsinrajasthan.com
http://www.silverwholesalejewellery.com
http://www.indianmedicaltourism.com
http://www.kotastone.com
http://www.prlog.org/10503545-sale-37684-black-granite-vanity-top-37-22-17500.html