> That's what I thought, but running the following command via a web
> request returns lines of length 0.
> 
> command = 'c:\path\plink -ssh [EMAIL PROTECTED] -pw password dir'
> lines = os.popen(command).readlines()

A couple things I'd check:

1) use raw strings when subjecting yourself to DOS path seperators:

   command = r'c:\path\plink...'

2) make sure that plink/putty/whatever has already attached to 
the server so there's no attempt by it to confirm the server 
fingerprint.

> The exact command works just fine when ran from either a regular
> python prompt or within the Django shell.

As Jay mentioned, it's only python code.  If it works in both the 
python prompt and the django shell, it should also work in the 
code, presuming you've gotten it verbatim.

As a simple test, just create a test line program:

   import os
   command = r'c:\path\to\plink ...'
   results = os.popen(command).readlines()
   print repr(results)

This eliminates Django from the picture entirely.  Once you get 
this working, it should be a drop-in to your Django code.

-tim



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to