The PIL handbook shows 30 or more formats. The tutorial has more to say
about details. Very good. Thanks.
John Fouhy wrote:
2009/1/23 Wayne Watson :
Continuing. The code that is eventually used to do the save is:
===
def SaveGIF(self):
if self.current_
2009/1/23 Wayne Watson :
> Continuing. The code that is eventually used to do the save is:
> ===
> def SaveGIF(self):
> if self.current_path:
> default_path = splitext(basename(self.current_path))[0] + ".gif"
> path = asksaveasfilename(defaultext
Continuing. The code that is eventually used to do the save is:
===
def SaveGIF(self):
if self.current_path:
default_path = splitext(basename(self.current_path))[0] +
".gif"
path = asksaveasfilename(defaultextension=".gif",
2009/1/23 Wayne Watson :
> What I'm getting at it is when I see something in a program as:
> path = asksaveasfilename(defaultextension=".jpg",
> title="Save as JPEG",
> initialfile=default_path,
>
Title: Signature.html
What I'm getting at it is when I see something in a program as:
path = asksaveasfilename(defaultextension=".jpg",
title="Save as JPEG",
initialfile=default_path,
2009/1/23 Wayne Watson :
> And if I pass it, 'pcx', 'fits', 'dog', 'cat', ...?
I don't understand your question. You can certainly do this:
tkFileDialog.asksaveasfilename(filetypes=[('PCX files', '*.pcx'),
('FITS files', '*.fits'), ('Dogs', '*.dog')])
If that's not what you want, you need to ex
Title: Signature.html
And if I pass it, 'pcx', 'fits', 'dog', 'cat', ...?
John Fouhy wrote:
2009/1/23 Wayne Watson :
How do I know what file types are available for asksaveasfilename? Suppose
one isn't available, for example, FITS. How do I get it?
You pass the file typ
2009/1/23 Wayne Watson :
> How do I know what file types are available for asksaveasfilename? Suppose
> one isn't available, for example, FITS. How do I get it?
You pass the file types as an argument to the function.
tkFileDialog.asksaveasfilename(filetypes=[('Text', '*.txt'), ('Stuff',
'*.stf'),
Title: Signature.html
How do I know what file types are available for asksaveasfilename?
Suppose one isn't available, for example, FITS. How do I get it?
--
Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
(121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)
On Thu, Jan 22, 2009 at 6:24 PM, Alan Gauld wrote:
> "Marcus Goldfish" wrote
>
>> I'm trying to design a base class for a hierarchy. The properties I want
>> to
>> specify for the base class depend on the values of other properties of the
>> base class.
>
> Don't worry so much about the properti
"Alan Gauld" wrote
is there a way to give arguments to a class definition?
I see that Kent interpreted your question differently to me.
If you do mean that you want to dynamically define class
attributes rather than instance attributes then __init__()
won't work. But I'd be interested to
"Marcus Goldfish" wrote
I'm trying to design a base class for a hierarchy. The properties I
want to
specify for the base class depend on the values of other properties
of the
base class.
Don't worry so much about the properties, the important thing to focus
on
in your base classes is the
On Thu, Jan 22, 2009 at 5:18 PM, Kent Johnson wrote:
> On Thu, Jan 22, 2009 at 4:51 PM, spir wrote:
>> Hello,
>>
>> is there a way to give arguments to a class definition? Eg
>>
>> class MonoList(list, typ, number):
>>item_type = typ
>>item_number = number
>
> Use the type() funct
On Thu, Jan 22, 2009 at 4:51 PM, spir wrote:
> Hello,
>
> is there a way to give arguments to a class definition? Eg
>
> class MonoList(list, typ, number):
>item_type = typ
>item_number = number
Use the type() function (which is the constructor for the type 'type')
to dynamically
"spir" wrote
is there a way to give arguments to a class definition? Eg
class MonoList(list, typ, number):
item_type = typ
item_number = number
Yes thats what the __init__ method is for.
class MonoList:
def __init__(self, lst, typ, num):
self.item_type = typ
self.number = num
Hello,
is there a way to give arguments to a class definition? Eg
class MonoList(list, typ, number):
item_type = typ
item_number = number
[I guess you understand what I try to do...]
denis
--
la vida e estranya
___
Tutor maillist
On Thu, Jan 22, 2009 at 3:04 PM, Marcus Goldfish wrote:
> I'm trying to design a base class for a hierarchy. The properties I want to
> specify for the base class depend on the values of other properties of the
> base class. For instance, in this toy example of a base FoodProcessor
> class:
> cl
On Thu, Jan 22, 2009 at 2:33 PM, Judith Flores wrote:
> Hello dear Python experts,
>
> How can I write a complete string (which sometimes will include many commas)
> to a cell in a CSV file? With the code below, what I obtain is a cell per
> letter of every string:
>
>
> file1=open('myfile.csv',
I'm trying to design a base class for a hierarchy. The properties I want to
specify for the base class depend on the values of other properties of the
base class. For instance, in this toy example of a base FoodProcessor
class:
class FoodProcessor:
"Model for a kitchen appliance food processo
Hello dear Python experts,
How can I write a complete string (which sometimes will include many commas) to
a cell in a CSV file? With the code below, what I obtain is a cell per letter
of every string:
file1=open('myfile.csv','w')
writer=csv.writer(file1)
mylist=[ " first , txt+words , more"
On Thu, Jan 22, 2009 at 6:08 PM, amit sethi wrote:
> hi , I need help as to how i can fetch a wikipedia article i tried changing
> my user agent but it did not work . Although as far as my knowledge of
> robots.txt goes , looking at en.wikipedia.org/robots.txt it does not seem it
> should block a
hi , I need help as to how i can fetch a wikipedia article i tried changing
my user agent but it did not work . Although as far as my knowledge of
robots.txt goes , looking at en.wikipedia.org/robots.txt it does not seem it
should block a useragent (*, which is what i would normally use) from
acces
On Thu, Jan 22, 2009 at 4:18 AM, Norman Khine wrote:
> Hello,
>
> I have this output when running the profile on one of my modules:
>
It's a bit easier to intepret with the headers:
ncalls tottime percall cumtime percall filename:lineno(function)
> 9815/96440.0090.0000.0090.0
On Wed, Jan 21, 2009 at 10:54 PM, wormwood_3 wrote:
> When creating a list of dictionaries through a loop, I ran into a strange
> issue. I'll let the code talk:
t = []
for thing in l:
> ... t.append(dict(thing=1))
> ...
t
> [{'thing': 1}, {'thing': 1}, {'thing': 1}, {'thing': 1
Hello,
I have this output when running the profile on one of my modules:
9815/96440.0090.0000.0090.000 {len}
60.0000.0000.0000.000 {locals}
50.0000.0000.0010.000 {map}
10.0000.0000.0000.000 {math.exp}
25 matches
Mail list logo