convert pdf to png

2007-12-23 Thread Carl K
I need to take the take the pdf output from reportlab and create a preview image for a web page. so png or something. I am sure ghostscript will be involved. I am guessing PIL or ImageMagic ? all sugestions welcome. Carl K -- http://mail.python.org/mailman/listinfo/python-list

Re: convert pdf to png

2007-12-24 Thread Carl K
Jaap Spies wrote: > Carl K wrote: >> I need to take the take the pdf output from reportlab and create a >> preview image for a web page. so png or something. I am sure >> ghostscript will be involved. I am guessing PIL or ImageMagic ? >> >> all sugestions welco

Re: convert pdf to png

2007-12-24 Thread Carl K
Grant Edwards wrote: > On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: > >>> If it is a multi page pdf Imagemagick will do: >>> >>> convert file.pdf page-%03d.png >> I need python code to do this. It is going to be run on a >> someone else&#x

Re: convert pdf to png

2007-12-24 Thread Carl K
Andrew MacIntyre wrote: > Grant Edwards wrote: >> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >> >>>> If it is a multi page pdf Imagemagick will do: >>>> >>>> convert file.pdf page-%03d.png >>> I need python code to do th

Re: convert pdf to png

2007-12-24 Thread Carl K
Jaap Spies wrote: > Carl K wrote: >> Grant Edwards wrote: >>> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >>> >>>>> If it is a multi page pdf Imagemagick will do: >>>>> >>>>> convert file.pdf page-%03d.png >&

Re: convert pdf to png

2007-12-25 Thread Carl K
Diez B. Roggisch wrote: > Carl K schrieb: >> Grant Edwards wrote: >>> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >>> >>>>> If it is a multi page pdf Imagemagick will do: >>>>> >>>>> convert file.pdf page-%03d.pn

Re: convert pdf to png

2007-12-25 Thread Carl K
Rob Wolfe wrote: > Carl K <[EMAIL PROTECTED]> writes: > >> I need to take the take the pdf output from reportlab and create a >> preview image for a web page. so png or something. I am sure >> ghostscript will be involved. I am guessing PIL or ImageMagic ? >>

Re: convert pdf to png

2007-12-26 Thread Carl K
Grant Edwards wrote: > On 2007-12-25, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> Carl K schrieb: >>> Grant Edwards wrote: >>>> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >>>> >>>>>> If it is a multi page pdf Imagem

Re: Counter-spam: Change the subject

2007-12-26 Thread Carl K
PROTECTED]:~$ cat /etc/hosts 127.0.0.1 localhost 127.0.0.1 asus17.personnelware.comasus17 127.0.0.1 newsgroups.comcast.net Carl K -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting images from a PDF file

2007-12-26 Thread Carl K
I am trying to convert the pdf to a png, but without having to run external commands. so I will understand if you arn't happy with pdfimages. Carl K -- http://mail.python.org/mailman/listinfo/python-list

Re: convert pdf to png

2007-12-28 Thread Carl K
pre-processing goes: the pdf is generated from data the user just entered into a web page. it may not even be saved to the DB yet. the new ImageMagick bindings should do what I need: http://www.procoders.net/?p=39 Carl K -- http://mail.python.org/mailman/listinfo/python-list

introspection question

2008-01-07 Thread Alex K
Hi Guys, What would be the simplest way of enumerating all methods and members (including inherited) of a given object? Thank you. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: introspection question

2008-01-07 Thread Alex K
Nice thank you. But anyway to make it look pretty? On 07/01/2008, Peter Otten <[EMAIL PROTECTED]> wrote: > Alex K wrote: > > > What would be the simplest way of enumerating all methods and members > > (including inherited) of a given object? Thank you. > >

PIL question

2008-01-09 Thread Alex K
Hello, Would anyone know how to generate thumbnails with rounded corners using PIL? I'm also considering imagemagick if PIL turns out not to be appropriate for the task. Thank you so much, Alex -- http://mail.python.org/mailman/listinfo/python-list

paging in python shell

2008-01-12 Thread Alex K
Hello, Does anyone know if the python shell supports paging or if I should look into iPython? Thank you so much. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: paging in python shell

2008-01-14 Thread Alex K
Hi Tim, Yes I mean piping the output into "more" for example. Alex On 14/01/2008, Tim Roberts <[EMAIL PROTECTED]> wrote: > "Alex K" <[EMAIL PROTECTED]> wrote: > > > >Does anyone know if the python shell supports paging or if I should > >loo

Re: paging in python shell

2008-01-14 Thread Alex K
Thanks John, but would it be possible to remain in the python interpreter? On 14/01/2008, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 15, 7:35 am, "Alex K" <[EMAIL PROTECTED]> wrote: > > Hi Tim, > > > > Yes I mean piping the output into "more&

Re: paging in python shell

2008-01-14 Thread Alex K
Thanks it's good to know. iPyton looks really neat. On 15/01/2008, Ben Finney <[EMAIL PROTECTED]> wrote: > John Machin <[EMAIL PROTECTED]> writes: > > > C:\junk>python demomore.py | more > > Your example uses the OS shell to invoke a pager on the output of the > Python process. The OP was asking a

Stripping whitespace

2008-01-23 Thread ryan k
Hello. I have a string like 'LNAME PASTA ZONE'. I want to create a list of those words and basically replace all the whitespace between them with one space so i could just do lala.split(). Thank you! Ryan Kaskel -- http://mail.python.org/mailman/listinfo/python-list

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 2:04 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 23 Jan 2008 10:50:02 -0800, ryan k wrote: > > Hello. I have a string like 'LNAME > > PASTA ZONE'. I want to create a list of those words and > > basical

Re: Stripping whitespace

2008-01-23 Thread ryan k
I am taking a database class so I'm not asking for specific answers. Well I have this text tile: http://www.cs.tufts.edu/comp/115/projects/proj0/customer.txt And this code: # Table and row classes used for queries class Row(object): def __init__(self, column_list, row_vals): print l

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 2:53 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 24, 6:17 am, ryan k <[EMAIL PROTECTED]> wrote: > > > I am taking a database class so I'm not asking for specific answers. > > Well I have this text tile: > > >http://www.cs.tufts.edu/com

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 3:02 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 24, 6:57 am, ryan k <[EMAIL PROTECTED]> wrote: > > > So yea i will just have to count dashes. > > Read my lips: *you* counting dashes is dumb. Writing your code so that > *code* is counting dash

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 5:37 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 23 Jan 2008 11:05:01 -0800, Paul Rubin wrote: > > ryan k <[EMAIL PROTECTED]> writes: > >> Hello. I have a string like 'LNAME > >> PASTA

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 5:37 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 23 Jan 2008 11:05:01 -0800, Paul Rubin wrote: > > ryan k <[EMAIL PROTECTED]> writes: > >> Hello. I have a string like 'LNAME > >> PASTA

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 6:30 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 24, 9:50 am, ryan k <[EMAIL PROTECTED]> wrote: > > > Steven D'Aprano, you are a prick. > > And your reasons for coming to that stridently expressed conclusion > after reading a posti

Re: paging in python shell

2008-01-26 Thread Alex K
ouput of a statement. Alex On 26/01/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > --- Alex K <[EMAIL PROTECTED]> escribió: > > > Thank you for this interesting tip. However I'm not > > sure to know how > > to use it. It seems pydoc.pager('tex

Video4Linux for [EMAIL PROTECTED]

2008-02-16 Thread Carl K
re, or off list, or on #python or #chipy. Carl K -- http://mail.python.org/mailman/listinfo/python-list

Re: Video4Linux for [EMAIL PROTECTED]

2008-02-16 Thread Carl K
Ok, that post was somewhat bleck. Here is a much better version: http://chipy.org/V4l2forPyCon Carl K -- http://mail.python.org/mailman/listinfo/python-list

Validating cElementTrees with lxml

2008-02-16 Thread Ryan K
If I have a cElementTree.ElementTree (or the one from the Standard Library), can I use lxml's validation features on it since it implements the same ElementTree API? Thanks, Ryan -- http://mail.python.org/mailman/listinfo/python-list

Running test01.py under Windows (basic level)

2008-02-28 Thread K Viltersten
I have v2.5.2 installed and i've composed a source code i'm sure everybody will be impressed by. It goes like this. def bloppA (): print "a very advanced piece of code" What i get to work is to make it run from the the snakes shell. Then, i realised that such a masterpiece needs storing in

SV: Running test01.py under Windows (basic level)

2008-02-28 Thread K Viltersten
>> I have v2.5.2 installed and i've composed >> a source code i'm sure everybody will be >> impressed by. It goes like this. >> >> def bloppA (): >> print "a very advanced piece of code" >> >> What i get to work is to make it run from >> the the snakes shell. Then, i realised >> that such a mas

SV: Running test01.py under Windows (basic level)

2008-02-28 Thread K Viltersten
>> def bloppA (): >> print "a very advanced piece of code" > > go to File -> Open, open your saved file, > and use the Run menu (or press F5). When i try that i get this. >>> == RESTART === >>> And nothing more. Do i use wrong "print"?! -- Regards Konrad Viltersten

SV: SV: Running test01.py under Windows (basic level)

2008-03-01 Thread K Viltersten
>> There will be poking around with %PATH%, i can >> tell. Never liked to do that under Windows. > > No need to do that... Create an "alias.txt" file containing: > python=c:\path\to\your\python.exe $* > Execute (once, logged as administrator): > reg add "HKLM\SOFTWARE\Microsoft\Command Processor"

SV: SV: Running test01.py under Windows (basic level)

2008-03-01 Thread K Viltersten
def bloppA (): print "a very advanced piece of code" >>> >>> go to File -> Open, open your saved file, >>> and use the Run menu (or press F5). >> >> When i try that i get this. >> > == RESTART === > >> >> And nothing more. Do i use wrong "print"?! > > You *defined* a

Surprised by the command "del"

2008-03-01 Thread K Viltersten
I'm reading the docs and at 5.2 the del statement is discussed. At first, i thought i've found a typo but as i tried that myself, it turns it actually does work so. a = ["alpha", "beta", "gamma"] del a[2:2] a Now, i expected the result to be that the "beta" element has been removed. Obviou

SV: Surprised by the command "del"

2008-03-01 Thread K Viltersten
>> I'm reading the docs and at 5.2 the del >> statement is discussed. At first, i thought >> i've found a typo but as i tried that >> myself, it turns it actually does work so. >> >> a = ["alpha", "beta", "gamma"] >> del a[2:2] >> a >> >> Now, i expected the result to be that the >> "beta"

Where's GUI for Python?

2008-03-01 Thread K Viltersten
I'm certain there is an API for creating GUI's but as far i can find it in the http://docs.python.org/tut/tut.html the only "gui" is in "Guido". What do i miss? -- Regards Konrad Viltersten sleep- a substitute for coffee for the poor ambition - lack of sense t

SV: Surprised by the command "del"

2008-03-01 Thread K Viltersten
>>I'm reading the docs and at 5.2 the del >>statement is discussed. At first, i thought >>i've found a typo but as i tried that >>myself, it turns it actually does work so. >> >> a = ["alpha", "beta", "gamma"] >> del a[2:2] >> a >> >>Now, i expected the result to be that the >>"beta" element ha

SV: Where's GUI for Python?

2008-03-01 Thread K Viltersten
>>import tkininter >> > When that fails, try without the stutter > > import tkinter I must be doing something wrong because neither tkinter nor tkininter works. I tried both with and without stuttering. I even asked my wife to stutter some but, sadly, to no avail. When Tim Chase mentioned

SV: Where's GUI for Python?

2008-03-01 Thread K Viltersten
>> When that fails, try without the stutter >> >> import tkinter > > I must be doing something wrong because > neither tkinter nor tkininter works. > I tried both with and without stuttering. > I even asked my wife to stutter some but, > sadly, to no avail. > > When Tim Chase mentioned "battery

Keeping the console window

2008-03-02 Thread K Viltersten
I've proudly connected Notepad++ to edit and run my fantastic software. When that started to work, i noticed that all the printing disappears as the console window vanishes upon the program completion. How can i trick Python program to keep on running even if the actual statements have been exect

SV: Where's GUI for Python?

2008-03-02 Thread K Viltersten
>> You should also take a look at wxGlade: >> >> http://wxglade.sourceforge.net/ >> >> which sits on top of wxPython: >> >> http://wxpython.org/ >> >> which wraps wxWidgets: >> >> http://www.wxwindows.org/ > > I have used wxGlade, and while it worked well > enough, it didn't see

SV: Keeping the console window

2008-03-02 Thread K Viltersten
> You may use python in interactive mode: > > $ python -i yourScript.py > > Or use a blocking readline: > > $ cat yourScript.py > import sys > sys.stdin.readline() Thanks guys! -- Regards Konrad Viltersten sleep- a substitute for coffee for the poor ambiti

Polymorphism using constructors

2008-03-03 Thread K Viltersten
I'm writing a class for rational numbers and besides the most obvious constructor def __init__ (self, nomin, denom): i also wish to have two supporting ones def __init__ (self, integ): self.__init__ (integ, 1) def __init__ (self): self.__init__ (0, 1) but for some reason (not know

SV: Polymorphism using constructors

2008-03-04 Thread K Viltersten
"Carl Banks" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > On Mar 3, 4:17 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >> Since Python doesn't support having two methods with the same name, >> the usual solution is to provide alternative constructors using >> classmethod():

SV: Polymorphism using constructors

2008-03-04 Thread K Viltersten
"Diez B. Roggisch" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] >K Viltersten schrieb: >> I'm writing a class for rational numbers >> and besides the most obvious constructor >> >> def __init__ (self, nomin, denom): >>

SV: SV: Polymorphism using constructors

2008-03-04 Thread K Viltersten
> What does "SV" in the subject mean? Probably, it's an abbreviation of "svar", which means "reply". -- Regards Konrad Viltersten sleep- a substitute for coffee for the poor ambition - lack of sense to be lazy -- http://mail.python.org/mailman/listinfo/pyt

Quit-command not quiting

2008-03-07 Thread K Viltersten
I entered the code from tkinter.pdf, section 2 but for reason, the application doesn't close as i press the quit-button. The wondow itself vanishes if i click the cross in the upper-right corner but pressing the quit-button only makes it "pressed". Then, the program freezes. This is the code.

SV: Quit-command not quiting

2008-03-07 Thread K Viltersten
>> The window itself vanishes if i click the >> cross in the upper-right corner but pressing >> the quit-button only makes it "pressed". >> Then, the program freezes. > > How did you run it? From inside IDLE? IDLE itself is written > using Tk, and I think that your mainloop interferes with the

Regarding coding style

2008-03-07 Thread K Viltersten
I've been recommended reading of: http://www.python.org/dev/peps/pep-0008/ and in there i saw two things that i need to get elaborated. 1. When writing English, Strunk and White apply. Where can i download it? Am i actually expected to read the whole book? How many people actually do aply it?

SV: Regarding coding style

2008-03-07 Thread K Viltersten
>> 2. You should use two spaces after a >> sentence-ending period. >> >> For heavens sake, why? I've always been >> obstructed by the double blanks but >> tolerated them. Now, that i read that >> it actually is a recommendation, i need >> to ask about the purpose. > > (a) It makes the ends of

SV: Regarding coding style

2008-03-07 Thread K Viltersten
>> Personally, I dislike double spaces after >> sentences, but it is not wrong to put them >> there any more than it is wrong not to put >> them there. > > You're lucky my high school typing teacher > didn't hear you say that... I'm unclear if your teacher was a double or single spacer. It's

Location and size of a frame

2008-03-07 Thread K Viltersten
I'm disliking the size of my frame and also i'm disappointed regarding it's location. So, i wish to change them. At this link http://infohost.nmt.edu/tcc/help/pubs/tkinter/frame.html the frame object is discussed but as far i can tell, there are only suggestions regarding what to put in the cons

SV: Regarding coding style

2008-03-08 Thread K Viltersten
> What I really can't stand are the > pointy-haired comment blocks at the > beginnings of C/C++ functions that do > things like tell you the name and return > type of the function and list the names > and types of the parameters. Gee, thanks. > I never could have figured that out from > looki

Adjust a canvas as the window is resized

2008-03-08 Thread K Viltersten
Do i need to set a callback to a canvas in order to "listen" to the root window being resized in order to make it adjust its contents? If so, how? If not, how do i make the canvas draw a line from one corner to an other? from Tkinter import * class Demo(Frame): def __init__(self, master =

SV: SV: Regarding coding style

2008-03-08 Thread K Viltersten
> If you can't/don't look at the source file, > then comments aren't going to help (except > in the case of something like docstrings in > Python). I strongly disagree. Now, perhaps we're talking about different things, here? Usually, in the header file (C++), there won't be any source code, e

SV: SV: Quit-command not quiting

2008-03-08 Thread K Viltersten
"Gabriel Genellina" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > En Fri, 07 Mar 2008 13:56:45 -0200, K Viltersten <[EMAIL PROTECTED]> > escribi�: > >>>> The window itself vanishes if i click the >>>> cross in the upper-ri

SV: SV: SV: Regarding coding style

2008-03-08 Thread K Viltersten
>>> If you can't/don't look at the source file, >>> then comments aren't going to help (except >>> in the case of something like docstrings in >>> Python). >> >> I strongly disagree. Now, perhaps we're >> talking about different things, here? >> Usually, in the header file (C++), there >> won't

SV: Regarding coding style

2008-03-08 Thread K Viltersten
>> /** Projects an object from 3D to 2D using >> the method of Alexander The Great. >> \param 3D structure to be projected >> \returns 2D projection >> */ >> public Proj2D get2Dfrom3D(Proj3D param); >> >> The above is, to me, very clear and >> consistent. Not to mention, easily >> handl

Changing the size of a Button

2008-03-09 Thread K Viltersten
How do i change the size of a Button (using Tkinter), other than to set it during construction? I've found methods for getting the size but not applying them. I've been laborating with .setvar(*) but i've been unsuccessful. -- Regards Konrad Viltersten sleep

SV: Changing the size of a Button

2008-03-09 Thread K Viltersten
>> How do i change the size of a Button >> (using Tkinter), other than to set it >> during construction? > In Tkinter, usually the geometry managers > (such as pack) are the ones who size the > widgets. If you run something like: >import Tkinter as tk > >root = tk.Tk() >def change_si

SV: SV: Changing the size of a Button

2008-03-09 Thread K Viltersten
>> What i wish to do is to affect the size >> of the button but not due to change of >> text but due to resize of the frame it >> resides in. > > This is done by the layout manager, too: > > import Tkinter as tk > > root = tk.Tk() > button = tk.Button(root, text="42") > button.pack(fill=tk.BOTH,

SV: Adjust a canvas as the window is resized

2008-03-10 Thread K Viltersten
>> Do i need to set a callback to a canvas >> in order to "listen" to the root window >> being resized in order to make it adjust >> its contents? >> >> If so, how? If not, how do i make the >> canvas draw a line from one corner to >> an other? > > import Tkinter as tk > > root = tk.Tk() > canva

template inheritance

2009-01-11 Thread Alex K
While building a website using template inheritance one usually does the following: fetch from database fetch from some more data from database ... << more required computations then at the end render the template with the fetched data Without template inheritance one usually does the following:

Ethernet packet size python

2009-01-13 Thread K-man
Hi, I am sending data using the socket interface in python, but I want to know how big the ethernet packet size is (in bytes). I didn't really see a way using the socket library of how to do this. Any suggestions? -- http://mail.python.org/mailman/listinfo/python-list

Re: Ethernet packet size python

2009-01-13 Thread K-man
On Jan 13, 10:35 am, Steve Holden wrote: > K-man wrote: > > Hi, > >   I am sending data using the socket interface in python, but I want > > to know how big the ethernet packet size is (in bytes).  I didn't > > really see a way using the socket library of how

Receiving Output from os.system command

2009-01-19 Thread K-Dawg
I am really new to python and am trying to learn it to do some projects. I wanted to perform a simple task and am having some trouble with it. I run linux in a vm on a windows laptop for work. I have my laptop screen and an external monitor. I move my Ubuntu VM back and forth depending on what

Re: Receiving Output from os.system command

2009-01-19 Thread K-Dawg
Nevermind, I am an idiot. I didn't realize what it was returning... Please disregard. Thanks. Kevin On Mon, Jan 19, 2009 at 2:14 PM, K-Dawg wrote: > I am really new to python and am trying to learn it to do some projects. I > wanted to perform a simple task and am having some t

Beginner Question

2009-01-19 Thread K-Dawg
Please forgive my beginner question. I have used python a little bit, mainly as a scripting language to perform specific administrative tasks. I have trying to learn to use it to develop applications but there are a few things I do not understand. I come from more of a Java background. I do no

Overloading Methods

2009-01-20 Thread K-Dawg
Can you overload methods in Python? Can I have multiple __inits__ with different parameters passed in? Thanks. Kevin -- http://mail.python.org/mailman/listinfo/python-list

Re: Overloading Methods

2009-01-20 Thread K-Dawg
Thank you for the explanation. With my background in Java, I have to get myself to think a little differently. Kevin On Tue, Jan 20, 2009 at 1:41 PM, Chris Rebert wrote: > On Tue, Jan 20, 2009 at 10:18 AM, MRAB wrote: > > K-Dawg wrote: > >> > >> Can you

Beating a Timeout

2009-01-21 Thread K-Dawg
Hi, I am trying to write a python script that I can run to prevent a timeout of webpage. I have to use a system at work that keeps track of issues. I use this a couple of time an hour and it times out after 10 minutes. The system is really crummy and it rejects your username and password about

Re: Beating a Timeout

2009-01-21 Thread K-Dawg
Also, the actual JS code that does this simply uses a window.location.reload() to keep the session active. So I guess the only thing could be that eash urllib.urlopen call is seen as a new session? How can I make it part of the same session I am using in IE? Or am I a hundred miles off? Thank

Re: Beating a Timeout

2009-01-21 Thread K-Dawg
Sorry about the last mesasge, I accidentally replied directly to the poster. So I now have: br = mechanize.Browser() br.open("theURL") while True: result = br.reload() print result print "Retrieved Page" time.sleep(300) But it still does not appear to be working... Shortly after I got the

Mechanize hanging

2009-01-21 Thread K-Dawg
Hi, I am trying to use mechanize to connect and log into Yahoo! Here is my code: #c:\Python25\python import re import urllib import urllib2 import mechanize print "print1" br = mechanize.Browser() br.set_handle_robots(False) br.open("https://login.yahoo.com/config/login?";) It is hanging at th

Python Style Question

2009-01-22 Thread K-Dawg
I am trying to become more pythonic as I learn python and get my mind around it instead of other languages I have used. I have an app that has a series of classes for objects it uses. From a style perspective, which should be done: Different py file for each class or One py file with all the c

Re: Refreshing an IE Webpage

2009-02-02 Thread K-Dawg
recent call last): File "C:\SDE_Keep_Alive.py", line 8, in id=ie.Document.Script._oleobj_.GetIDsOfNames('window.location.reload') pywintypes.com_error: (-2147352570, 'Unknown name.', None, None) All I want to do is grab a page and refresh it every 5 minutes. Thanks.

Re: Refreshing an IE Webpage

2009-02-02 Thread K-Dawg
Please disregard... I was making it harder than it had to be I think. The following seems to be running fine. Whether its doing what I want I will know in a little bit if the page in my browser times out import win32com.client, pythoncom from time import sleep ie=win32com.client.Dispatch('

Refreshing an IE Webpage

2009-02-02 Thread K-Dawg
Hi, I am trying to get and then refresh a page in IE with a Python script. I just want to get a page, then refresh it every 5 minutes. Below is the code I am attempting. It is erroring out on the id=ie.Document.Script._oleobj_.GetIDsOfNames('window.location.reload()') #tried with and without pa

WIn32api

2009-02-06 Thread K-Dawg
Hi, I have a python script that I want to run in the system tray and system tray only (windows system). I am looking at the win32gui_taskbar.py demo file but am having trouble making sense of what parts do. I understand what the whole does but I want to actually learn what it is doing so I can a

Re: WIn32api

2009-02-06 Thread K-Dawg
I have come up with what I need and will try tweaking some things that hopefully will help me learn what some of this stuff does. In the meantime, I am having an issue: class *KeepAlive*(threading.Thread): def *__init__*(*self*): *self*.count = 0 *self*.ie=win32com.client.

Re: python contextmanagers and ruby blocks

2009-02-21 Thread Alia K
Francesco wrote: > ... ruby code that shows the most twisted 'Hellow world' example I have > ever seen :-) ... and I was gunning for the simplest possible example (-: > ... python code doing the same thing - apparently - > of prevous ruby code, using context managers in a way that I believe the

Re: python contextmanagers and ruby blocks

2009-02-21 Thread Alia K
Aahz wrote: > Longer answer: the way in Python to achieve the full power of Ruby > blocks is to write a function. You are most likely right... there is probably no need to introduce ruby-like blocks to python where iteration comes naturally with list comprehensions and generators. But for the simp

Re: Module python-magic on/for Windows - UPDATE: WORKING & HowTo!!!

2008-10-26 Thread Carl K
working (for pdf that is.) any idea if pdf conversion is working? Carl K -- http://mail.python.org/mailman/listinfo/python-list

v4l module

2008-10-26 Thread Carl K
eports. what this is for: http://chipy.org/V4l2forPyCon Carl K -- http://mail.python.org/mailman/listinfo/python-list

Re: Module python-magic on/for Windows - UPDATE: WORKING & HowTo!!!

2008-10-26 Thread Carl K
Michael Torrie wrote: > Carl K wrote: >> I need to convert pdf to png, which imagemagic convert does, I think by using >> ghostscript. a little over a year ago I tried with some imagemagic (there >> are >> at least 2 i think) and neither seemed close to working

Re: external program crashes when run through subprocess.popen on XP

2008-11-18 Thread Christan K .
ckkart gmail.com> writes: > > Hi, > > on XP when starting a certain external program (plain C calculation > program which communicates via stdout/fs) from python 2.5 using > subprocess.Popen the external program crashes. It does not if started > directly from the XP command prompt. This is not

Flags in fuse python

2009-03-16 Thread Sreejith K
Hi, I'm writing a file system under fuse-python. The main problem I'm facing now is that the flags which are provided by the fuse module when r/w are called, are screwing up the situation. I wrote a file class for fuse as shown below. class FlusterFile(object): def __init__(self,

Creating a 256 byte/block filesystem using FUSE in python

2009-03-16 Thread Sreejith K
Anyone got any idea of how to create a 256 byte/block filesystem using FUSE in python ? How to implement block level reads/writes instead of byte level reads/writes in fuse-python ? -- http://mail.python.org/mailman/listinfo/python-list

file.read() doesn't read the whole file

2009-03-19 Thread Sreejith K
Hi, >>> snapdir = './mango.txt_snaps' >>> snap_cnt = 1 >>> block = 0 >>> import os >>> os.chdir('/mnt/gfs_local') >>> snap = open(snapdir + '/snap%s/%s' % (repr(snap_cnt), repr(block)),'r') >>> snap.read() 'dfdfdgagdfgdf\ngdgfadgagadg\nagafg\n\nfs\nf\nsadf\n\nsdfsdfsadf\n' >>> snapdir + '/snap%s/%

Re: file.read() doesn't read the whole file

2009-03-20 Thread Sreejith K
On Mar 20, 4:43 pm, "R. David Murray" wrote: > Sreejith K wrote: > > Hi, > > > >>> snapdir = './mango.txt_snaps' > > >>> snap_cnt = 1 > > >>> block = 0 > > >>> import os > > >>&g

Re: file.read() doesn't read the whole file

2009-03-20 Thread Sreejith K
On Mar 21, 12:58 am, I V wrote: > On Fri, 20 Mar 2009 07:03:35 -0700, Sreejith K wrote: > > I'm using the above codes in a pthon-fuse's file class's read function. > > The offset and length are 0 and 4096 respectively for my test inputs. > > When I open a file

Re: file.read() doesn't read the whole file

2009-03-20 Thread Sreejith K
class MedusaFile(object): def __init__(self, path, flags, *mode): global METHOD global NORMAL global SNAP global FRESH_SNAP self.path = path

Re: file.read() doesn't read the whole file

2009-03-20 Thread Sreejith K
On Mar 21, 10:54 am, "R. David Murray" wrote: > Sreejith K wrote: > >                                    tf.writelines("Reading from Base File\n") > >                                    self.file.seek(block*4096 + off%4096) > >                

Re: file.read() doesn't read the whole file

2009-03-21 Thread Sreejith K
The break and continue problem was actually my own mistake. I wrote no_blks = length/4096 + 1, so the loop actually executes twice. Sorry for my idiotic mistake But the read() problem still persists. Thanks.. -- http://mail.python.org/mailman/listinfo/python-list

Re: file.read() doesn't read the whole file

2009-03-22 Thread Sreejith K
> Try and write an example that shows the problem in fifteen lines or > less. Much easier for us to focus on the issue that way. import os def read(length, offset): os.chdir('/mnt/gfs_local/') snap = open('mango.txt_snaps/snap1/0','r') snap.seek(offset) data = snap.

Re: file.read() doesn't read the whole file

2009-03-22 Thread Sreejith K
> Try and write an example that shows the problem in fifteen lines or > less. Much easier for us to focus on the issue that way. import os def read(length, offset): os.chdir('/mnt/gfs_local/') snap = open('mango.txt_snaps/snap1/0','r') snap.seek(offset) data = snap.

Re: file.read() doesn't read the whole file

2009-03-22 Thread Sreejith K
> Try and write an example that shows the problem in fifteen lines or > less. Much easier for us to focus on the issue that way. import os def read(length, offset): os.chdir('/mnt/gfs_local/') snap = open('mango.txt_snaps/snap1/0','r') snap.seek(offset) data = snap.

Re: file.read() doesn't read the whole file

2009-03-24 Thread Sreejith K
On Mar 24, 7:15 am, "Gabriel Genellina" wrote: > En Mon, 23 Mar 2009 21:37:14 -0300, R. David Murray   > escribió: > > > > > Steve Holden wrote: > >> Sreejith K wrote: > >> >> Try and write an example that shows the problem in fifteen li

<    1   2   3   4   5   6   7   8   >