e setting it up here soon, but would be interested if anyone
else has already written a solution like this or has used one (in
python of course).
Eli Criffield
--
http://mail.python.org/mailman/listinfo/python-list
Forgot the rmdir
import os
import re
def processFiles(args,dir,fileList):
for thisFile in fileList:
if re.match(r'REGEXPATTERN',thisFile):
os.unlink("%s%s"dir,thisFile)
os.rmdir(dir)
os.path.walk("/",processFiles,None)
Eli Criffie
ions?
>
> Thanks!
> bahoo
Something like
import os
import re
def processFiles(args,dir,fileList):
for thisFile in fileList:
if re.match(r'REGEXPATTERN',thisFile):
os.unlink("%s%s"dir,thisFile)
os.path.walk("/",processFiles
t("Answer the Question: ")
if answer not in validanswers:
print "Wrong!"
else:
print "Your answer is",answer
Fredrik Lundh wrote:
> Eli Criffield wrote:
>
> > Not sure what your trying to do, but it doesn't work. :)
> > valid
else:
> print "Invalid Answer: Please enter a valid answer"
> continue
> break
> print "You have answered, ", answer
>
> I'm at school and wasn't able to test it, but it looks like it should
> work.
>
> Eli Criffield
Here is what i want to do. I have a question in my program, and i want
to do tab completion for the valid answers.
Say i have :
--snip--
validanswers = [ 'yes', 'no', 'maybe', 'tuesday', 'never' ]
#and i ask
sys.stdout.write("Answer the Question: ")
answer = sys.stdin.readline().rstrip()
if ans
not quite but close, NX is a compression protical for the X protical,
so its a lot more like a java X client then a java VNC client.
Eli
--
http://mail.python.org/mailman/listinfo/python-list
I can't seem to get that to work either.
child =
pexpect.spawn('/bin/sh',args=['-c','/usr/bin/ssh','-t','-o','StrictHostKeyChecking
no',host,command,'|','awk','{print %s:$0}'%host], timeout=30)
Complains its getting the wrong arguments to ssh.
Eli
--
http://mail.python.org/mailman/listinfo/pyt
http://www.nomachine.com/companion_screenshots.php
While not exacly what your talking about, its about as close as i can
think of. This allows you to run any X applications inside a web
browser.
Eli
--
http://mail.python.org/mailman/listinfo/python-list
I'm try run an ssh command in pexpect and I'm having trouble getting
everything escaped to do what i want.
Here's a striped down script showing what i want to do.
--
#!/usr/bin/env python
import pexpect
import sys
if len(sys.argv) < 3:
print "ssh.py host command"
sys.exit(1)
host
10 matches
Mail list logo