[Tutor] python access of usb for winxp
Hello, I want to retreive data to and fro USB device attached/connected to my WinXP PC. Is there any module or library available in python? I came across "pyusb" and downloaded some packages but I am not getting how to use or install those packages. Can anybody help me out in above stuffs? All help will be highly appreciated. Thanks and Best Regards, --Govind Goyal ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] serial -->file tranfer
Hello, I have a modem connect to my Windows XP PC through a serial cable. I Want to transfer the file(e.g '.TXT' format) from XP PC to serial modem and also from Serial modem to winXP PC. Can anybody help me out how to do it in Python and provide some sample code or useful links so that I can proceed further in my project?? All help will be highly appreciated. Thanks & Regards, Govind ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] + converted to 25 in http string
Hi, I am using http to automate my Access point(AP) configuration where I sent following strings to AP server through script. params = urllib.urlencode ({'WRegion':"USA",'ssid':"wifi",'ap':"ap",'ssid_enable':"ssid_enable",* 'wire_mode':"b+only",* 'w_channel':6,'lan_ac':"everyone",'int_ac':"everyone"}) Above string I captured using a tool ethereal and then implementing this in my script. But the problem is that when I run this script all configurations in AP are OK except the parameter marked as bold in above string. I used the same tool ethereal to see what string is actually passing to Access point while I run my script and I got following: params = urllib.urlencode ({'WRegion':"USA",'ssid':"wifi",'ap':"ap",'ssid_enable':"ssid_enable",* 'wire_mode':"b25only",* 'w_channel':6,'lan_ac':"everyone",'int_ac':"everyone"}) In conclusion,the character "+" is getting converted into"25" whenever I run script.Thats why all other configuartions are OK except above mentioned case. Can anybody help to resolve this issue? Best Regards, Govind Goyal ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Error in my code
Hi, I am executing following lines of code: def WEP40_KEY(n): params = urllib.urlencode({}) headers = {"Connection": "Keep-Alive","Authorization": ""} conn = httplib.HTTPConnection(HOST) conn.request("GET", "/w_sec.htm HTTP/1.1", params, headers) response = conn.getresponse() print response.status, response.reason params = urllib.urlencode({'wsecurity':"WEP",'wep_auth':"Shared+Key",'wepenc':"128+bit",'wep_key_no':"key1",'ascii_key1':"12345678901234567890123456",'ascii_key2':"",'ascii_key3':"",'ascii_key4':"",'passphrase':"",'wpa_psk':"12345678",'key_lifetime':"65535",'wpa_enc':"TKIP",'save':"Save",'message': "",'todo':""}) headers = {"Connection": "Keep-Alive","Authorization": ""} conn = httplib.HTTPConnection(HOST) conn.request("POST", "w_sec.htm", params, headers) response = conn.getresponse() print response.status, response.reason conn.close() WEP40_KEY(sys.argv) I am getting following error: C:\Documents and Settings\Govindadya\Desktop\Marvell>Marvell_WEP40.py 192.168.1. 16 File "C:\Documents and Settings\Govindadya\Desktop\Marvell\Marvell_WEP40.py", line 41 * response = conn.getresponse() ^ IndentationError: unindent does not match any outer indentation level* ** Can anybody help me out on this? Best Regards, Govind ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] urllib2_realm??
Hi, Use of Basic HTTP Authentication: import urllib2 auth_handler.add_password(*'realm'*, 'host', 'username', 'password') What is realm and its use in above line of code? If I want to access a web page and I don't know what the realm is,then what should I write in place of realm? Can anybody help? Best Regards, Govind Goyal ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Matching string
Hello, I want to use a pattern matcing (regular expression) inside "if loop" such that if it will find "*MBytes*" and *"Mbits/sec"* both *at a time *regardless of there position in a particular string ,then only it executes code inside "if block". for example if my string is *"[904] 1.0- 2.0 sec 1.19 MBytes 10.0Mbits/sec 2.345 ms0/ 850 (0%)"* then if condition evalutes to TRUE and code inside it will be executed. If my string is *"Server listening on UDP port 5001"* then if condition evaluates to False and code inside it will be not executed. Can anybody help? Regards, Govind ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] python books
Hi, I want to purchase a python book but confused of which authur?I need suggestion. How is "Teach yoursef python in 24 hours by Ivan van laningham"? Regards, Govind ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Input from and output to a file
hi, 1) I want to read data not from but from a file which is in specified directory. 2) I want to redirect my output(which is by default STDOUT) to a file. Can anybody suggest these queries? Thanks Regards, Govind ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Coding for AP configuration
Hello, I am a beginner in python.I am working as S/W tester relating to WI-FI testing where we've to manually configure Access points(AP). I want to write a Automated Scripts to configure my AP through HTTP. Can any body suggest basic coding for this? Thanks. Best Regards, Govind Goyal ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor