Hi,
I just started to use DrPython and I have installed the
CodeCompletion plugin. I am using DrPython 161 (on windows) with
wxPython 2.6.1. Anyhow, when I try something like
x = []
x.
...it pops up "x.filename", "x.prepend" and "x.word". Shouldn't it
show "x.append", "x.pop", etc?
Just cur
Dennis,
Thanks. That certainly looks like it could work. I understand
about the interactive shell and my app going back and forth with the
reads/writes. When my program runs it won't be used in an interactive
python shell, but that is the only way I know of to really test it.
--
http://mail
I even tried inserting a "\r" or "\r\n" or "\n" to stdout, also tried
the same using msvcrt.putch() ...but no luck. I still have to hit
enter to get the prompt , where I can then type a command and hit
enter.
For example, I get this displayed:
[example]
Microsoft Windows XP [Version 5.1.2600]
(C)
I have setup multiple threads and a queue...which is working pretty
good. But I have one other issue...I have a new thread (since it is
different issue) here:
http://groups.google.com/group/comp.lang.python/browse_frm/thread/ec81d8982d1a0130
if you get chance, would you mind checking that out.
T
I have setup multiple threads and a queue...which is working pretty
good. But I have one other issue...I have a new thread (since it is
different issue) here:
http://groups.google.com/group/comp.lang.python/browse_frm/thread/ec81d8982d1a0130
if you get chance, would you mind checking that out.
T
I have a basic client/server socket situation setupwhere the server
accepts a connection and then waits for commands.
On the client side, I create a socket, connect to the server...then I
pass the socket to a class which just reads from the socket (in a
thread).
class Reader(Thread):
def
Paul Dale wrote:
> pexpect is POSIX compliant and works under Cygwin. I haven't tried it
> under pythonw.
Well if I want my code to run on other computers, then they'd have to
run it under Cygwin right?
--
http://mail.python.org/mailman/listinfo/python-list
I am currently using subprocess to execute a command. Then I read from
it's stdout...however, this is hanging on a read..waiting for more
bytes. So what I would like is to timeout...and select.selec() seems
to be what I need. Except I don't have a socket, i have stdout.
Any suggestions on how t
Steve Holden wrote:
> Look at how you might do it in other languages. Then you'll realise this
> isn't (just) a Python problem.
Yea your right. However, for example, in Java, one can use the Process
class, and then read from the stream until its the end (i.e. -1 is
returned). However, with Pytho
So it seems there is no good way to handle "interactive" processes on
windows using python. By interactive I mean processes/commands that
require user interaction, such as telnet or del (to delete a file or
directory sometimes you need to confirm with a yes or no), date, etc.
os.system gives the
ace to a process.
>
> http://pexpect.sourceforge.net/
>
> I've been using it on windows to automate a few things.
>
> Cheers,
>
> Paul
>
> jas wrote:
>
> >Kent,
> > Yes, your example does work. So did os.popen...however, the problem
&g
What about having a thread which reads from subprocess.Popen()'s
stdout...instead of read/write, read/write. just always read, and
write when needed?
any comments on that idea?
jas wrote:
> actually, i can't check for ">" only because if you a dir, a line can
> en
actually, i can't check for ">" only because if you a dir, a line can
end with a > but is not the end of the output
jas wrote:
> Thanks, that is certainly a start. As you mentioned, the "cd" could is
> an issue.
>
> Perhaps checking to see if the line
Thanks, that is certainly a start. As you mentioned, the "cd" could is
an issue.
Perhaps checking to see if the line ends with ">" is sufficient?
Dennis Lee Bieber wrote:
> On 24 Oct 2005 07:20:42 -0700, "jas" <[EMAIL PROTECTED]> declaimed the
> fol
Kent,
Yes, your example does work. So did os.popen...however, the problem
is specific to "cmd.exe".
Have you tried that yet?
Thanks!
Kent Johnson wrote:
> jas wrote:
> > Ok, I tried this...
> >
> > C:\>python
> > Python 2.4.1 (#65, Mar 30 2005, 09:1
Hi,
I would like to start a new process and be able to read/write from/to
it. I have tried things like...
import subprocess as sp
p = sp.Popen("cmd.exe", stdout=sp.PIPE)
p.stdin.write("hostname\n")
however, it doesn't seem to work. I think the cmd.exe is catching it.
I also tried
f = open("o
doesn't sound to encouraging :)
How about something with os.popen?
in = os.popen("cmd", "w")
in.write("hostname")
I tried this, and I get "IOError: [Errno 22] Invalid Argument"
I am not sure why this isnt working.
Steve Holden wrote:
> jas w
uot;cmd", stdout=sp.PIPE)
>>>
>>> result = p.communicate("ipconfig")
'result' is not recognized as an internal or external command,
operable program or batch file.
>>>
basically I was opening to send the "ipconfig" command to cmd.exe and
store
I see that, although I don't totall grasp the code. However, I am
looking to basically emulate a command prompt. i.e. everything u see
in the windows command prompt should be displayed back in python.
How can I do it without files?
Kent Johnson wrote:
> jas wrote:
> > Any o
Any other ideas? or examples of using subprocess to do what I was
asking?
Kent Johnson wrote:
> jas wrote:
> > I would like to redirect the output from os.system to a variable, but
> > am having trouble. I tried using os.popen(..).read() ...but that
> > doesn't g
I would like to redirect the output from os.system to a variable, but
am having trouble. I tried using os.popen(..).read() ...but that
doesn't give me exactly what i want.
..this is windows by the way.
For example:
tmp = os.popen("hostname").read()
...works as expected.
however,
tmp = os.pope
21 matches
Mail list logo