| | |
Problem with win32pipe ...
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
hi
I have a problem with the following code ...
>>> j = win32pipe.popen('c:\\disk\\plink jnitin@10.94.101.178 -pw mat123 df -g','r')
>>> for i in j:
print i
>>>
As you can see the file object 'j' does not have anything in it...
But if I type 'c:\disk\plink jnitin@10.94.101.178 -pw ibm123 df -g' in the DOS prompt, it works fine and gives me the required result...
So I gave a simple command via python like this...
>>> j = win32pipe.popen('dir','r')
>>> for i in j:
print i
Volume in drive C is DRIVE-C
Volume Serial Number is 5C8D-1DAC
Directory of C:\Disk
29/06/06 03:28 PM <DIR> .
29/06/06 03:28 PM <DIR> ..
29/06/06 02:11 PM <DIR> .idlerc
06/06/06 11:29 AM 225,280 1suntemplate.xls
29/06/06 03:28 PM 14,848 29-6-2006.xls
.
.
19 File(s) 1,474,430 bytes
3 Dir(s) 27,306,981,376 bytes free
>>>
It works fine... but not the previous command....
But the same code executes perfectly on a different machine... Both have XP...
Can anybody help me ??? Why the same code is working on one machine & not in another???
I have a problem with the following code ...
>>> j = win32pipe.popen('c:\\disk\\plink jnitin@10.94.101.178 -pw mat123 df -g','r')
>>> for i in j:
print i
>>>
As you can see the file object 'j' does not have anything in it...
But if I type 'c:\disk\plink jnitin@10.94.101.178 -pw ibm123 df -g' in the DOS prompt, it works fine and gives me the required result...
So I gave a simple command via python like this...
>>> j = win32pipe.popen('dir','r')
>>> for i in j:
print i
Volume in drive C is DRIVE-C
Volume Serial Number is 5C8D-1DAC
Directory of C:\Disk
29/06/06 03:28 PM <DIR> .
29/06/06 03:28 PM <DIR> ..
29/06/06 02:11 PM <DIR> .idlerc
06/06/06 11:29 AM 225,280 1suntemplate.xls
29/06/06 03:28 PM 14,848 29-6-2006.xls
.
.
19 File(s) 1,474,430 bytes
3 Dir(s) 27,306,981,376 bytes free
>>>
It works fine... but not the previous command....
But the same code executes perfectly on a different machine... Both have XP...
Can anybody help me ??? Why the same code is working on one machine & not in another???
Last edited by xav.vijay; Jun 29th, 2006 at 7:49 am.
•
•
Join Date: Jun 2006
Posts: 2
Reputation:
Solved Threads: 0
win32pipes are broken by definition, unfortunately. They won't work in all cases. I'd post a question to comp.lang.python (http://groups.google.com/group/comp.lang.python) where someone else should have experience working with/around plink specifically.
Maybe using the famous Microsoft kludge for handling spaces in filenames will do the trick. This wraps a pair of single quotes and double quote around the string. Try:
Also, if plink is plink.exe use extension.
Python Syntax (Toggle Plain Text)
j = win32pipe.popen('"c:\\disk\\plink jnitin@10.94.101.178 -pw mat123 df -g"','r')
Last edited by bumsfeld; Jun 30th, 2006 at 10:31 am.
![]() |
Similar Threads
- Problem with Windows Update and WinXP (Web Browsers)
- Installing Windows 98 On VMware. Floppy problem (Windows 95 / 98 / Me)
- Windows XP keeps restarting since a new video card (Windows NT / 2000 / XP)
- Redhat Linux 6.2 - ipop3d problem? (*nix Software)
- Problem with T720 (Cellphones, PDAs and Handheld Devices)
- Connection Problems (Networking Hardware Configuration)
- .htaccess mod_rewrite problem (Linux Servers and Apache)
Other Threads in the Python Forum
- Previous Thread: Python and Multimedia
- Next Thread: Turtle Graphics
Views: 2306 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Python
abrupt apache approximation argv beginner binary book calculator change cipher clear client code compile converter countpasswordentry cturtle dictionaries dictionary drive dynamic examples excel file float format ftp function gui homework import inches input java keyboard library line linux list lists loop maze mouse mysqldb newb number numbers output parsing path plugin port prime program programming projects py2exe pygame pymailer pyqt python random recursion recursive remote script scrolledtext search session signal singleton socket ssh string strings strip table terminal text textarea thread threading time tkinter tlapse trick tuple tutorial ubuntu unicode unit urllib urllib2 variable verify vigenere windows wordgame wxpython xlwt






