Re: [Tutor] subprocess and su

2007-08-21 Thread Alan Gauld
"Alan Gauld" <[EMAIL PROTECTED]> wrote > Oddly I just tried some experiments and I can't get subprocess > to work with the stdout=PIPE option, it used to... > > Anyone have any idea what my obvious mistake is? > > Traceback (most recent call last): > File "", line 1, in ? > File "C:\Python24\li

Re: [Tutor] subprocess and su

2007-08-21 Thread Alan Gauld
"Tino Dai" <[EMAIL PROTECTED]> wrote > PIPE=subprocess.pipe Not sure why you need this? > sbp=subprocess.Popen > (["su","-",stdin=PIPE,stdout=PIPE,close_fds=True,shell=True) and I'm not sure what that [ is doing in there? I assume you meant to have a closing ] after the "-"? Have you looked a

Re: [Tutor] subprocess and su

2007-08-21 Thread Eric Brunson
Tino Dai wrote: > Hi there, > > I'm have a tough time figuring out how to get su and subprocess > working. I have > > PIPE=subprocess.pipe > > sbp=subprocess.Popen(["su","-",stdin=PIPE,stdout=PIPE,close_fds=True,shell=True) > > > > how I thought that it was supposed to work was it would all

[Tutor] subprocess and su

2007-08-21 Thread Tino Dai
Hi there, I'm have a tough time figuring out how to get su and subprocess working. I have PIPE=subprocess.pipe sbp=subprocess.Popen (["su","-",stdin=PIPE,stdout=PIPE,close_fds=True,shell=True) how I thought that it was supposed to work was it would allow me to use sbp.communicate() to send

Re: [Tutor] Data Gathering

2007-08-21 Thread Fiyawerx
I've used Twill for similar applications also, and I found this with a quick google.. http://twill.idyll.org/python-api.html For what I've used it, it works wonders. On 8/19/07, Johnny Jelinek IV <[EMAIL PROTECTED]> wrote: > > Hi, > > I was wondering if something like this is possible; Can I cre

Re: [Tutor] operating system key-bindings that call Python scripts

2007-08-21 Thread Fiyawerx
Noob here, but just wondering, would it be hard for you to have the program instead of insert the text for you, copy it to your clipboard? It would add a step, but then you could do something like [, ctrl-v] to paste into whatever window you're in. Some keyboards like logitech's g15 allow special

Re: [Tutor] Convert bmp to mpeg

2007-08-21 Thread Alan Gauld
"Eric Brunson" <[EMAIL PROTECTED]> wrote >> I would like to make a method where I give a number of bmp-file as >> argument and than create a mpeg format from these - is that >> possible >> with python and which packages should I use? > > On my platform the ffmpeg suite is one of the de facto sta

Re: [Tutor] getting the size of an open TarFile object

2007-08-21 Thread Adam A. Zajac
> > I've been working with the tarfile module and just noticed an > > apparent flaw in my own logic. I wanted to add files to the tar > > until it neared a certain file size. After every addition I would > > use os.path.getsize(). What I noticed today is that I could add a > > file to the tar wi

Re: [Tutor] Convert bmp to mpeg

2007-08-21 Thread Eric Brunson
Per Jr. Greisen wrote: > Hi, > > I would like to make a method where I give a number of bmp-file as > argument and than create a mpeg format from these - is that possible > with python and which packages should I use? On my platform the ffmpeg suite is one of the de facto standards for creating

Re: [Tutor] Accesing "column" of a 2D list

2007-08-21 Thread Kent Johnson
Ian Witham wrote: > This looks like a job for List Comprehensions! > > >>> list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] > >>> new_list = [item[1] for item in list] > >>> new_list > [2, 5, 8] > >>> Alternately, if you want *all* columns, you can use zip() to transpose the lists: In [1]: lst = [[

Re: [Tutor] Convert bmp to mpeg

2007-08-21 Thread Alan Gauld
"Per Jr. Greisen" <[EMAIL PROTECTED]> wrote > I would like to make a method where I give a number of bmp-file as > argument > and than create a mpeg format from these - is that possible with > python and > which packages should I use? MPEG is normally used for video (MP3 excepted) but if JPEG i

[Tutor] Convert bmp to mpeg

2007-08-21 Thread Per Jr. Greisen
Hi, I would like to make a method where I give a number of bmp-file as argument and than create a mpeg format from these - is that possible with python and which packages should I use? Thanks in advance -- Best regards Per Jr. Greisen ___ Tutor maillis

Re: [Tutor] operating system key-bindings that call Python scripts

2007-08-21 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote > (Windows or Linux) to recognize that every time I type, say, > -'C' '1', > a Python script I wrote will execute and out will pop the current > date time Ctrl-C is a particularly difficult combination since in many OS it is the system interrupt but if you went for a s