> It's trying to launch GhostScript, and failing.
Not sure this is the problem. Ghostscript is installed on my machine. Also, I
am able to convert .jpg to .png.___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http:/
Kent Johnson wrote:
Is this the way to define my own error and to use it:
class MyValueError(Exception):
define initialization and printing
You usually don't need to define anything extra, the Exception methods are fine.
I think there could be confusion over what you meant w
"Katt" wrote
The most recent one(with a few bug fixes etc) is as per my .sig...
Thanks Alan G. I got the new version now. I will go back to the
beginning and step through it again.
No, you don;t need to do that, its mainly typos and stuff thats fixed.
There is no radical changes.
I am cur
Message: 7
Date: Fri, 16 Oct 2009 13:54:37 +0100
From: "Alan Gauld"
To: tutor@python.org
Subject: Re: [Tutor] PyWin32 - Library of functions to interact with
windows
Message-ID:
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=response
"Katt" wrote
and Alan Gauld's
Nathan,
Depending upon how much control you have over the calling machine you
can eliminate the pesky password prompt from ssh altogether by creating
a private/public key pair for the client machine and copy the public key
to the host machine. This way when you ssh to the host you will be
authent
On Fri, Oct 16, 2009 at 1:45 PM, Nathan Farrar wrote:
> I'm trying to automate the collection of data to remote devices over
> ssh via pexpect. I had originally attempted (with limited success) to
> use paramiko, however due to cisco's ssh implimentation I cannot send
> mulitple commands over the
I'm trying to automate the collection of data to remote devices over
ssh via pexpect. I had originally attempted (with limited success) to
use paramiko, however due to cisco's ssh implimentation I cannot send
mulitple commands over the same connection, which is absolutely
essential. Therefore, I'
On Fri, Oct 16, 2009 at 1:43 PM, Serdar Tumgoren wrote:
> Hey everybody,
>
> Thanks for the recommendations -- I usually do use pdb to step through
> chunks of code, but always by setting a breakpoint. And then I have to
> "manually" print out the variables to see what's going on in the code.
Win
Hey everybody,
Thanks for the recommendations -- I usually do use pdb to step through
chunks of code, but always by setting a breakpoint. And then I have to
"manually" print out the variables to see what's going on in the code.
Is there a way to wrestle pdb into spitting out the code being
execut
"Serdar Tumgoren" wrote
I was wondering -- is there a way to "watch" a program execute by
piping a report of its actions to standard output or to a file?
There are tools for doing that - Look! - is one I know that works
for C++ and Java but I don;t know iof any freware ones or that
work fo
On Fri, Oct 16, 2009 at 9:53 AM, Serdar Tumgoren wrote:
> Hello everybody,
>
> I was wondering -- is there a way to "watch" a program execute by
> piping a report of its actions to standard output or to a file?
> Basically, I'd like to see the order that functions/methods are
> executing as they h
On Fri, Oct 16, 2009 at 9:44 AM, Robert Johansson
wrote:
> If I wanted prompt to be an integer, is my check with range still bad?
If the prompt is coming from raw_input() then you have already
guaranteed it is an integer when you convert it in a try/except block.
> Is this the way to define my o
Try the "pdb" module--the python debugger.
>From the virtual desk of Lowell Tackett
--- On Fri, 10/16/09, Serdar Tumgoren wrote:
From: Serdar Tumgoren
Subject: [Tutor] way to see code execution in real-time?
To: "Python Tutor"
Date: Friday, October 16, 2009, 9:53 AM
Hello everybody,
I wa
Hello everybody,
I was wondering -- is there a way to "watch" a program execute by
piping a report of its actions to standard output or to a file?
Basically, I'd like to see the order that functions/methods are
executing as they happen, along with how long each one takes.
Is this something cProfi
> What if a valid user input has to be an integer between 10 and 20? I mean,
> it could be that you are doing something that only makes sense for that
> input. Would it be pythonic to add a test like:
>
> If prompt in range(10,21):
Better to write
if 10 <= prompt <= 20:
> ...
> else:
> ... ra
"Dave Angel" wrote
for text, color in color_items: #3
textcolor(color) #4
print text#5
Ah! Good call, I never thought of unpacking the tuple in the loop.
Big improvement.
It would be possible (and maybe even desirable) to write a differe
"Katt" wrote
def colorPrint(strings):
for string in strings:
textcolor(string[1])
print string[0],
In the above function please let me know if I am correct in my
interpretation.
The first line of course would be the defining of the function and puting
something in the
"Katt" wrote
and Alan Gauld's: Tutor - > May 27, 2007).
Oops, thats the old Freenet version.
The most recent one(with a few bug fixes etc) is as per my .sig...
(The 3 yucky Geocities images at the top will be disappearing
soon as I finally move the files to the new server and turn off t
"Robert Johansson" wrote
What if a valid user input has to be an integer between 10 and 20?
Would it be pythonic to add a test like:
If prompt in range(10,21):
...
else:
... raise an error
Yes and it could be a ValueError in this case.
You could also test using conditions which, for a w
Well, my ideas weren't so good:
On Friday 16 October 2009, Eike Welk wrote:
> I have an other idea for a color function. It cam be embedded in
> the print statement because it returns an empty string:
>
>
> def color(color_num):
> '''Change text color and return empty string.'''
> textcolo
On Fri, Oct 16, 2009 at 7:21 AM, Dave Angel wrote:
> My attempt at readability (untested):
>
> def colorPrint(color_items): #1
> """Call this function to print one or more strings, each with
> a color number specified, to the console. The argument
> is a list of items, where
On Fri, Oct 16, 2009 at 7:53 AM, Eike Welk wrote:
> I have an other idea for a color function. It cam be embedded in the
> print statement because it returns an empty string:
>
>
> def color(color_num):
> '''Change text color and return empty string.'''
> textcolor(color_num)
> return ''
Robert Johansson wrote:
Hi,
I'm writing a text based menu and want to validate the user input. I'm
giving the options as integers, and I want to make sure the user enters a
proper value.
Here's what I've got so far: http://pastebin.com/m1fdd5863
I'm most interested in this segment:
while True
On Fri, Oct 16, 2009 at 7:25 AM, Robert Johansson
wrote:
> What if a valid user input has to be an integer between 10 and 20? I mean,
> it could be that you are doing something that only makes sense for that
> input. Would it be pythonic to add a test like:
>
> If prompt in range(10,21):
Better
> Hi,
> I'm writing a text based menu and want to validate the user input. I'm
> giving the options as integers, and I want to make sure the user enters a
> proper value.
> Here's what I've got so far: http://pastebin.com/m1fdd5863
> I'm most interested in this segment:
> while True:
>
On Friday 16 October 2009, Katt wrote:
> > print "There are",
> > textcolor(4)
> > print apples_left,
> > textcolor(7)
> > print "left in the basket."
>
> The above code is very easy to understand when looking at it, but
> from what I see of other programmers this would not be as pythonic.
I think
Katt wrote:
The textcolor() function returns None. so you need to keep it
out of your print statement:. This means you need to split your
print into multiple separate statements. (This will also be true
for the pywin32 version)
print "There are",
textcolor(4)
print apples_left,
textcolor(7)
pri
bob gailer wrote:
GoodPotatoes wrote:
:
for x in myuser.properties:# "myuser.properties" returns a tuple
of properties associated with the myuser AD object
print myuser.x
Traceback (most recent call last):
File "", line 2, in
print myuser.x
File "build\bdist.win32\egg\active_
Katt wrote:
Message: 3
Date: Thu, 15 Oct 2009 16:50:57 +0100
From: Rich Lovely
To: Wayne Werner
Cc: "tutor@python.org"
Subject: Re: [Tutor] Most pythonic input validation
Message-ID:
Content-Type: text/plain; charset=windows-1252
2009/10/15 Wayne Werner :
Hi,
I'm writing a text based menu
Message: 3
Date: Thu, 15 Oct 2009 08:11:11 +0100
From: "Alan Gauld"
To: tutor@python.org
Subject: Re: [Tutor] Changing the color of text in the windows shell
(WinXP/python 2.6.2)
Message-ID:
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=response
The textcolor() func
Message: 3
Date: Thu, 15 Oct 2009 16:50:57 +0100
From: Rich Lovely
To: Wayne Werner
Cc: "tutor@python.org"
Subject: Re: [Tutor] Most pythonic input validation
Message-ID:
Content-Type: text/plain; charset=windows-1252
2009/10/15 Wayne Werner :
Hi,
I'm writing a text based menu and want to
Message: 4
Date: Thu, 15 Oct 2009 09:35:30 +0100
From: Tim Golden
Cc: tutor@python.org
Subject: Re: [Tutor] PyWin32 - Library of functions to interact with
windows?
Message-ID: <4ad6ded2.5040...@timgolden.me.uk>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Katt wrote:
Hello all,
Date: Thu, 15 Oct 2009 08:11:11 +0100
From: "Alan Gauld"
To: tutor@python.org
Subject: Re: [Tutor] Changing the color of text in the windows shell
(WinXP/python 2.6.2)
Message-ID:
"Katt" wrote
lucky). So I will pursue all three types of changing color.
First I will try WConio, next to be
33 matches
Mail list logo