Is there a way how to put a watermark on images by using Python?
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
Douglas Alan wrote:
Okay, here's the definitive version (or so say I). Some good doobie
please make sure it makes its way into the standard library:
def fileLineIter(inputFile, newline='\n', leaveNewline=False, readSize=8192):
"""Like the normal file iter but you can set what string indicates n
Dan Bishop wrote:
Your statement is misleading, because it suggests that your processor
stores digits. It doesn't; it stores *bits*.
And where does the word 'bit' come from, hmm? It couldn't possibly be an
abbreviation of Binary digIT, could it?
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECT
Steven Bethard wrote:
Worth looking at is the thread:
http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/58f53fe8bcc49664/
Huh - I thought I put something in the original post saying "without resorting
to bytecode hacks", but I must have deleted it before sending the messag
Okay, here's the definitive version (or so say I). Some good doobie
please make sure it makes its way into the standard library:
def fileLineIter(inputFile, newline='\n', leaveNewline=False, readSize=8192):
"""Like the normal file iter but you can set what string indicates newline.
You can
It's good that you're using Python 2.3, which does have sets available,
as a previous poster mentioned. Users of Python 2.2 or earlier can get
most of the Set functionality using the following class (from Peter
Norvig's utils.py file):
# class Set:
# """This implements the Set class from PEP
Artificial Life wrote:
urllib2 does not seem to be able to handle META-REFRESH in an html
document. I just get back the html to the page that is supposed to forward
me to the intended page.
Right - urllib2 is for working with protocols (like HTTP) to transfer data,
whereas META-REFRESH is an appli
Thank you All ! I am going to update ...
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 26 Feb 2005 00:35:57 -0500, Mohammed Smadi wrote:
> hi;
>
> i have the following piece of code:
> =
> s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
> s.bind(("",port))
> s.sendto(data,(MY_GW,port))
> data = s.recvfrom(1024)
>
>
> data contains some instr
hi;
i have the following piece of code:
=
s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind(("",port))
s.sendto(data,(MY_GW,port))
data = s.recvfrom(1024)
data contains some instructions which i am sending to MY_GW. If the
reply arrives from the MY_GW quickl
urllib2 does not seem to be able to handle META-REFRESH in an html
document. I just get back the html to the page that is supposed to forward
me to the intended page. Any way around this?
--
http://mail.python.org/mailman/listinfo/python-list
2005, Feb 25 -> Scott David Daniels wrote :
> Attila Szabo wrote:
> >Hi,
> >def main():
> >lambda x: 'ABC%s' % str(x)
> >for k in range(2): exec('print %s' % k)
> OK, to no real effect, in main you define an unnamed function that
> you can never reference. Pretty silly, but I'll bi
Diez B. Roggisch wrote:
Or writing a Node-class is also so straightforward that few care about them
being part of the core:
Writing a *simple* node class is easy, but a full-featured one that supports
things like comparison and easy iteration is a bit more work. So various people
write partial im
Thanks a lot, mine is Python 2.3, and
from sets import Set as set
works great!
--- Steven Bethard <[EMAIL PROTECTED]> wrote:
> Anthony Liu wrote:
> > I want to use the set function like
> >
> > mylist = ['a', 'b', 'b', 'd', 'e', 'a']
> > myset = set (mylist)
> >
> > But I don't
Anthony Liu wrote:
I want to use the set function like
mylist = ['a', 'b', 'b', 'd', 'e', 'a']
myset = set (mylist)
But I don't know what to import, I tried sys, sets,
they don't work.
If you're using Python 2.4, they're builtin. If you're using Python
2.3, you'll probably want to do som
I want to use the set function like
mylist = ['a', 'b', 'b', 'd', 'e', 'a']
myset = set (mylist)
But I don't know what to import, I tried sys, sets,
they don't work.
What's the easy way to find out the module that
contains a particular function?
__
hi all,
i have read a tutorial about "gemath" and it has a dependency called MA
(Mask Array), the problem is i cannot find any link where to download
this thing, anyone knows where i could get Mask Array?
thanks.
--
Please read and believe: Turn $6 into $60,000 in 90 days,
GUARANTEED
I found this in a news group and decided to try
it. A little while back,
I was browsing through news groups, just like you
are now and came
across a message just like this, that said you
could make thousands of
dollars within week
Tom Willis wrote:
On Fri, 25 Feb 2005 15:02:04 -0700, Dave Brueck
How about writing them in Python?
Depending on who will be editing the config files, this can be a great approach.
[snip]
I actually thought of this, and I was kind of on the fence due to the
intended audience.
I don't think it's too
Mark wrote:
Long story short
here is a contemporary logo design by myself:
http://www.imagezilla.com/img.php?im=1182129642_logo.png
Any comments welcome...
*runs*
Heh. As a graphic design, I think it's very nice.
Unfortunately, it's probably a bit too "scary" as
a logo for Python the language
Harlin Seritt wrote:
Tkinter is easier to learn. It is better documented IMO. Tkinter is
just as functional as any other GUI toolkit for Python. Creating your
own widget sets is usually a breeze. Tkinter is not ugly if done
properly. Tkinter apps are ported easily. On and on :-)
In this forum, no s
Paul Rubin wrote:
"Kamilche" <[EMAIL PROTECTED]> writes:
I was inspired to enhance your code, and perform a critical bug-fix.
Your code would not have sent large files out to dialup users, because
it assumed all data was sent on the 'send' command. I added code to
check for the number of bytes sent
On Fri, 25 Feb 2005 15:02:04 -0700, Dave Brueck
<[EMAIL PROTECTED]> wrote:
> Jorgen Grahn wrote:
> > On Tue, 22 Feb 2005 20:38:28 -0500, Tom Willis <[EMAIL PROTECTED]> wrote:
> >
> >>How are the expert pythoneers dealing with config files?
> >
> > ...
> >
> >>Any ideas?
> >
> >
> > How about writin
Nick Coghlan wrote:
Anyway, if others agree that the ability to execute a suite at def
exeuction time to preinitialise a function's locals without resorting to
bytecode hacks is worth having, finding a decent syntax is the next
trick :)
I'm not certain how many use cases really require a full su
gf gf wrote:
Hi. I'm looking for a Python lib to convert HTML to
ASCII.
You might find these threads on comp.lang.python interesting:
http://tinyurl.com/5zmpn
http://tinyurl.com/6mxmb
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Nick Coghlan wrote:
Basically, yeah. Although I later realised I got the name of the feature
I want wrong - default arguments are evaluated when the def statement is
executed, not when the code is compiled. So it's a matter of being able
to execute some code in the functions local namespace at c
Lucas Raab wrote:
Is it possible to assign a string a numerical value?? For example, in
the string "test" can I assign a number to each letter as in "t" = 45,
"e" = 89, "s" = 54, and so on and so forth??
Use a dictionary with the strings as keys.
string2num = {}
string2num['t'] = 45
string2num['
Lucas Raab wrote:
> Is it possible to assign a string a numerical value?? For example, in
> the string "test" can I assign a number to each letter as in "t" =
45,
> "e" = 89, "s" = 54, and so on and so forth??
>
> TIA
>>> for c in 'abcd':
...print c, ord(c)
...
a 97
b 98
c 99
d 100
If that
Is it possible to assign a string a numerical value?? For example, in
the string "test" can I assign a number to each letter as in "t" = 45,
"e" = 89, "s" = 54, and so on and so forth??
TIA
--
http://mail.python.org/mailman/listinfo/python-list
Steven Bethard wrote:
So just to clarify, the issue you're trying to address is when you want
early binding like function default arguments get, but you don't want to
declare the names as function arguments?
Basically, yeah. Although I later realised I got the name of the feature I want
wrong -
Before I go and reinvent the wheel, does anyone already have python code
that can do netmask arithmetic - for example, determining if a list of
hostnames are on subnets described by a list of networks+netmasks like:
128.200.34.0/24
128.195.16.128/25
...and so on?
Thanks!
--
http://mail.python
Patrick Useldinger wrote:
>
> fdups' homepage is at http://www.homepages.lu/pu/fdups.html, where
> you'll also find a link to download the tar.
>
"""fdups has no installation program. Just change into a temporary
directory, and type "tar xfj fdups.tar.bz". You should also chown the
files accordin
hi...
i'm running rh8.0 with gnome.. i'm not sure of the version (it's whatever rh
shipped).
i've recently updated (or tried to update) python to the latest version.
when i try to run the 'Server Settings/Services' Icon within gnome, nothing
happens...
i tried to run the 'start services' command
I am trying to work with a program that is trying make an HTTP POST of text
data without any named form parameter. (I don't know - is that a normal
thing to do?) I need to write a CGI program that accepts and processes that
data. I'm not seeing how to get at data that's not a named form parameter.
Hi, I'm relatively new to python and have been reading some of the
topics on the Python logo and marketing issues etc. Long story short
here is a contemporary logo design by myself:
http://www.imagezilla.com/img.php?im=1182129642_logo.png
Any comments welcome...
*runs*
--
http://mail.python.org
Alexander Zatvornitskiy wrote:
> Hello All!
>
> I'am novice in python, and I find one very bad thing (from my point
> of view) in language. There is no keyword or syntax to declare
> variable, like 'var' in > Pascal, or special syntax in C. It can
> cause very ugly errors,like this:
>
> epsilon=0
>
Mike Meyer wrote:
It also fails on tags with a ">" in a string in the tag. That's
well-formed but ill-used HTML.
True enough...however, it doesn't fail too horribly:
>>> striptags("""the text""")
"'>the text"
>>>
and I think that case could be rectified rather easily, by stripping an
Jeremy Sanders wrote:
> On Fri, 25 Feb 2005 17:14:24 +0100, Diez B. Roggisch wrote:
>
> > Maybe [c]StringIO can be of help. I don't know if it's iterator is
lazy. But
> > at least it has one, so you can try and see if it improves
performance :)
>
> Excellent! I somehow missed that module. StringIO
By putting them into another file you can just use
.readline iterator on file object to solve your
problem. I would personally find it hard to work
on a program that had 400,000 lines of data hard
coded into a structure like this, but that's me.
-Larry
Jeremy Sanders wrote:
> On Fri, 25 Feb 200
Jorgen Grahn wrote:
On Tue, 22 Feb 2005 20:38:28 -0500, Tom Willis <[EMAIL PROTECTED]> wrote:
How are the expert pythoneers dealing with config files?
...
Any ideas?
How about writing them in Python?
Depending on who will be editing the config files, this can be a great
approach.
At the simplest
On Tue, 22 Feb 2005 20:38:28 -0500, Tom Willis <[EMAIL PROTECTED]> wrote:
> How are the expert pythoneers dealing with config files?
...
> Any ideas?
How about writing them in Python?
I have no URL handy, but it would surprise me if there wasn't a lot written
about different techniques for doing
> This will help in your code, but there is big pile of modules in stdlib
> that are not unicode-friendly. From my daily practice come shlex
> (tokenizer works only with encoded strings) and logging (you cann't
> specify encoding for FileHandler).
You can, of course, pass in a stream opened usi
On Fri, 25 Feb 2005 10:51:47 -0800 (PST), gf gf <[EMAIL PROTECTED]> wrote:
> Hans,
>
> Thanks for the tip. I took a look at Beatiful Soup,
> and it looked like it was a framework to parse HTML.
This is my understanding, too.
> I'm not really interetsed in going through it tag by
> tag - just t
Hi all,
I am looking for beta-testers for fdups.
fdups is a program to detect duplicate files on locally mounted
filesystems. Files are considered equal if their content is identical,
regardless of their filename. Also, fdups ignores symbolic links and is
able to detect and ignore hardlinks, whe
Michael Spencer <[EMAIL PROTECTED]> writes:
> gf gf wrote:
>> [wants to extract ASCII from badly-formed HTML and thinks BeautifulSoup is
>> too complex]
>
> You haven't specified what you mean by "extracting" ASCII, but I'll
> assume that you want to start by eliminating html tags and comments,
>
On Wed, 26 Jan 2005 18:25:09 -0500, "Dan Perl" <[EMAIL PROTECTED]> wrote:
>
>"rbt" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> Is there an easy way to exclude binary files (I'm working on Windows XP)
>> from the file list returned by os.walk()?
>>
>> Also, when reading files
Jubri Siji napisał(a):
Please i am new to python , whats the best IDE to start with
Vim, Emacs or jEdit.
--
Jarek Zgoda
http://jpa.berlios.de/ | http://www.zgodowie.org/
--
http://mail.python.org/mailman/listinfo/python-list
Hello gang,
My coworker and I are writing a Python class for the other developers
within our team. This class is supposed to encapsulate several things,
including daemonizing, setting up logging, and spawning a thread to
host an XML-RPC server.
I'm having a real problem with logging.Logger and th
David Eppstein <[EMAIL PROTECTED]> writes:
> In article <[EMAIL PROTECTED]>,
> "Xah Lee" <[EMAIL PROTECTED]> wrote:
>
>> parti(aList, equalFunc)
>>
>> given a list aList of n elements, we want to return a list that is a
>> range of numbers from 1 to n, partition by the predicate function of
>> e
Hi,
Using finditer in re module might help. I'm not sure it is lazy nor
performant. Here's an example :
=== BEGIN SNAP
import re
reLn = re.compile(r"""[^\n]*(\n|$)""")
sStr = \
"""
This is a test string.
It is supposed to be big.
Oh well.
"""
for oMatch in reLn.finditer(sStr):
print oMatch.
In article <[EMAIL PROTECTED]>,
Daniel Yoo <[EMAIL PROTECTED]> wrote:
>gf gf <[EMAIL PROTECTED]> wrote:
.
.
.
>: If not, how can I flush it manually? sys.stdout.flush() didn't
>: seem to work.
>
>H, that's odd. sys.stdou
gf gf wrote:
[wants to extract ASCII from badly-formed HTML and thinks BeautifulSoup is too complex]
You haven't specified what you mean by "extracting" ASCII, but I'll assume that
you want to start by eliminating html tags and comments, which is easy enough
with a couple of regular expressions:
Hallo!
I use Python mostly for CGI (Apache). And now I habe a problem: How
can I handle the situation if a user clicks on "abort" in the browser?
It seems that a CGI-script is NOT stopped at this point. Is there any
signal send to the CGI-process if the user clicks on "abort"?
Thank you.
Best r
Hallo!
I use Python mostly for CGI (using Apache). And now I habe a problem:
How can I handle the situation if a user clicks on ?abort? in the
browser?
It seems that a CGI-script is NOT stopped at this point. Is there any
signal send to the CGI-process if the user clicks on ?abort??
Thank you.
Be
Raghul wrote:
> hi,
>
> I want to learn Wxpython to work in windows.Is there any
tutorials
> available?Pls specify the link that will be easy to learn for
beginers
> like me
An approach that I find useful is to use an IDE to build the base
application structure, then examine the generated cod
"John Roth" <[EMAIL PROTECTED]> writes:
> I tend to write one test class per class, but that's
> just the way I got started. My feeling is that the
> methods in a test class should tell a story if you
> read the names in the order they were written,
> so I'd split the tests for a class into severa
aurora <[EMAIL PROTECTED]> writes:
> What I really want to bring up is your might want to look at refactoring
> your module in the first place. 348 test cases for one module sounds like a
> large number. That reflects you have a fairly complex module to be tested
> to start with. Often the bigges
Hans,
Thanks for the tip. I took a look at Beatiful Soup,
and it looked like it was a framework to parse HTML.
I'm not really interetsed in going through it tag by
tag - just to get it converted to ASCII. How can I do
this with B. Soup?
--Thanks
PS William - thanks for the reference to lynx,
You can look at the techniques and regular expressions in the
testgen.c.unit test module that is part of a generic test framework
called TestGen. TestGen uses a parser to automatically stub / copy
functions for testing purposes. The parser is capable of identifying
the function/method name as wel
Another way is to make a simple metaclass, setting an attribute (like
defining_class, or something) on each function object in the class
dictionary.
--
http://mail.python.org/mailman/listinfo/python-list
What happens when you try to connect? Be sure to check /etc/hosts.allow
and .deny on the server, if your server is compiled with TCP wrapper
support.
--
http://mail.python.org/mailman/listinfo/python-list
I have a problem that I run into a lot with the 'legend' command's
default behavior. I've found a work-around but I wonder if there's a
better way.
For a simple example, take the following:
x= [1,2,3,4,5,6,7,8]
a= [5,3,2,4,6,5,8,7]
b= [4,1,3,
> >Can anyone guide me on how to spawn
> >simultaneously( or
> > pseudo simultaneously) running microthreads using
> > stackless.
> >
> > Here is what i tried..
> >
> > def gencars(num,origin,dest,speed):
> > global adjls
> > global cars
> > global juncls
> > for i in range(num):
"Attila Szabo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I wrote this sample piece of code:
>
> def main():
>lambda x: 'ABC%s' % str(x)
>for k in range(2): exec('print %s' % k)
>
> main()
>
> With the lambda line, I get this:
> SyntaxError: unqualified
In article <[EMAIL PROTECTED]>,
Jack Orenstein <[EMAIL PROTECTED]> wrote:
> I am developing a Python program that submits a command to each node
> of a cluster and consumes the stdout and stderr from each. I want all
> the processes to run in parallel, so I start a thread for each
> node. There co
On 21 Feb 2005 15:01:05 -0800, "John Machin" <[EMAIL PROTECTED]>
wrote:
>
>Steve M wrote:
>> John Machin wrote:
>>
>> >
>> > Steve M wrote:
>> >> I'm actually doing this as part of an exercise from a book. What
>the
>> > program
>> >> is supposed to do is be a word guessing game. The program
>auto
Hi Duncan,
This should work reasonably reliably on Windows and Unix:
somestring = '/foo/bar/beer/sex/cigarettes/drugs/alcohol/'
os.path.normpath(somestring).split(os.path.sep)
['', 'foo', 'bar', 'beer', 'sex', 'cigarettes', 'drugs', 'alcohol']
However a better solution is probably to call os.path.
I tend to write one test class per class, but that's
just the way I got started. My feeling is that the
methods in a test class should tell a story if you
read the names in the order they were written,
so I'd split the tests for a class into several
classes if they had different stories to tell.
Jo
[EMAIL PROTECTED] wrote:
If the class had two attributes--x and y--would the code look like
something lik this:
class C(object):
def __init__(self):
self.__x = 0
self.__y = 0
def getx(self):
return self.__x
def setx(self, x):
I do something more or less like your option b. I don't think there is any
orthodox structure to follow. You should use a style that fit your taste.
What I really want to bring up is your might want to look at refactoring
your module in the first place. 348 test cases for one module sounds lik
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> When I look at how classes are set up in other languages (e.g. C++), I
> often observe the following patterns:
> 1) for each data member, the class will have an accessor member
> function (a Get function)
> 2) for each data member, the
On Fri, 25 Feb 2005 10:57:59 -0600, Larry Bates wrote:
> How did you get the string in memory in the first place?
They're actually from a generated python script, acting as a saved file
format, something like:
interpret("""
lots of lines
""")
another_command()
Obviously this isn't the most effi
Michael Hoffman wrote:
Steve Holden wrote:
Consider that the OP might want to pass the C parser output to a
Python web-content generator, which would make a deal of sense.
You're welcome to guess what the OP wants to do, but I'm not going to.
If he or she asks a coherent question it will probably
I'm cpmpletely lost on fonts.
I'm using Tkinter
I do medarial = '-*-Arial-Bold-*-*--24-*-*-*-ISO8859-1"
or Courier or Fixed in various sizes.
Works great on my RH 7.2
But a small embedded system Im working on, nothing seems to work,
almost everything falls back to a fixed 12
The X*4 fontpaths are t
Jeremy,
How did you get the string in memory in the first place?
If you read it from a file, perhaps you should change to
reading it from the file a line at the time and use
file.readline as your iterator.
fp=file(inputfile, 'r')
for line in fp:
...do your processing...
fp.close()
I don't t
On Fri, 25 Feb 2005 17:14:24 +0100, Diez B. Roggisch wrote:
> Maybe [c]StringIO can be of help. I don't know if it's iterator is lazy. But
> at least it has one, so you can try and see if it improves performance :)
Excellent! I somehow missed that module. StringIO speeds up the iteration
by a fac
On 25/02/2005 Dennis Lee Bieber wrote:
> On Thu, 24 Feb 2005 23:10:48 +0100, Jonas Meurer <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>
> > version used placeholders as well. anyway, i changed my code to resemble
>
> "resemble" is the key... It is NOT the correct s
Jeremy Sanders wrote:
> I have a large string containing lines of text separated by '\n'. I'm
> currently using text.splitlines(True) to break the text into lines, and
> I'm iterating over the resulting list.
>
> This is very slow (when using 40 lines!). Other than dumping the
> string to a f
> Because if so, does the term 'lazy evaluation' refer to the fact that
> instead of:
No, it is a common technical term. It means that a value is computed the
time it is requested for the first time.
Like this:
class Foo(object):
def __init__(self):
self.__bar = None
def getBar(se
In article <[EMAIL PROTECTED]>,
Victor Ng <[EMAIL PROTECTED]> wrote:
>No - that doesn't work, im_class gives me the current class - in the
>case of inheritance, I'd like to get the super class which provides
>'bar'.
Oh my. You said you were doing something evil, but didn't say *how*
evil. What
In article <[EMAIL PROTECTED]>,
Victor Ng <[EMAIL PROTECTED]> wrote:
>I'm doing some evil things in Python and I would find it useful to
>determine which class a method is bound to when I'm given a method
>pointer.
I don't know where (or if) it's documented, but im_class seems to give
you what yo
Victor Ng wrote:
I'm doing some evil things in Python and I would find it useful to
determine which class a method is bound to when I'm given a method
pointer.
For example:
class Foo(object):
def somemeth(self):
return 42
class Bar(Foo):
def othermethod(self):
return 42
Is t
I have a large string containing lines of text separated by '\n'. I'm
currently using text.splitlines(True) to break the text into lines, and
I'm iterating over the resulting list.
This is very slow (when using 40 lines!). Other than dumping the
string to a file, and reading it back using the
If the class had two attributes--x and y--would the code look like
something lik this:
class C(object):
def __init__(self):
self.__x = 0
self.__y = 0
def getx(self):
return self.__x
def setx(self, x):
if x < 0: x = 0
Peter Otten wrote:
import inspect
class Foo(object):
> ... def foo(self): pass
> ...
class Bar(Foo):
> ... def bar(self): pass
> ...
def get_imp_class(method):
> ... return [t for t in inspect.classify_class_attrs(method.im_class)
> if t[-1] is method.im_func][0][2]
Awesome! I didn't see the getmro function in inspect - that'll do the
trick for me. I should be able to just look up the methodname in each
of the class's __dict__ attributes.
vic
On Fri, 25 Feb 2005 16:29:25 +0100, Peter Otten <[EMAIL PROTECTED]> wrote:
> Victor Ng wrote:
>
> > I'm doing som
Victor Ng wrote:
> I'm doing some evil things in Python and I would find it useful to
> determine which class a method is bound to when I'm given a method
> pointer.
>
> For example:
>
> class Foo(object):
> def somemeth(self):
> return 42
>
> class Bar(Foo):
> def othermethod(s
Michael Maibaum wrote:
> On 25 Feb 2005, at 14:09, Harper, Gina wrote:
>
>> I would start with something like this:
>> somestring = '/foo/bar/beer/sex/cigarettes/drugs/alcohol/'
>> somelist = somestring.split('/')
>> print somelist
>
> However - this will not work on Windows. It'd work on all th
I'm trying to install wxPython 2.5.3.1 using Python 2.3.2 on a Fedora 2
machine.
I have python in a non-standard place, but I'm using --prefix with the
configure script to point to where I have everything. The make install
in $WXDIR seemed to go fine. I have the libxw* libraries in my lib/
directo
Does anyone know of a site(s) that shows examples of what you can do
with Nevow? I'm not necessarily referring to code, but what it can do
over the web. (Something I can show my boss if needed.)
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
>
> There was a request for nevow exam
No - that doesn't work, im_class gives me the current class - in the
case of inheritance, I'd like to get the super class which provides
'bar'.
I suppose I could walk the __bases__ to find the method using the
search routine outlined in:
http://www.python.org/2.2/descrintro.html
but I was hoping
Attila Szabo wrote:
Hi,
def main():
lambda x: 'ABC%s' % str(x)
for k in range(2): exec('print %s' % k)
OK, to no real effect, in main you define an unnamed function that
you can never reference. Pretty silly, but I'll bite.
Next you run run a loop with exec looking like you think i
[vic]
> I'm doing some evil things in Python and I would find it useful to
> determine which class a method is bound to when I'm given a method
> pointer.
Here you go:
>>> class Foo:
... def bar(self):
... pass
...
>>> Foo.bar.im_class
>>> Foo().bar.im_class
>>>
--
Richie Hindle
[EMAIL
I'm doing some evil things in Python and I would find it useful to
determine which class a method is bound to when I'm given a method
pointer.
For example:
class Foo(object):
def somemeth(self):
return 42
class Bar(Foo):
def othermethod(self):
return 42
Is there some wa
Text602 was a very popular word processor for IBM PC MS DOS
compatibles, used in Czechoslovakia. T602Parser provides a
simple class modelled after HTMLParser that can be used to
parse Text602 documents (MS DOS version, not Win602) and
to extract/convert data contained in them.
Version: 0.1 (in
Not exactly on point, but this is what I use in many of my
programs to show progress on long running console apps.
Larry Bates
class progressbarClass:
def __init__(self, finalcount, progresschar=None):
import sys
self.finalcount=finalcount
self.blockcount=0
#
On 25 Feb 2005, at 14:09, Harper, Gina wrote:
I would start with something like this:
somestring = '/foo/bar/beer/sex/cigarettes/drugs/alcohol/'
somelist = somestring.split('/')
print somelist
However - this will not work on Windows. It'd work on all the OS I
usually use though ;)
Michael
--
htt
Steve Holden wrote:
Consider that the OP might want to pass the C parser output to a Python
web-content generator, which would make a deal of sense.
You're welcome to guess what the OP wants to do, but I'm not going to.
If he or she asks a coherent question it will probably be answered.
--
Michael
I would start with something like this:
somestring = '/foo/bar/beer/sex/cigarettes/drugs/alcohol/'
somelist = somestring.split('/')
print somelist
This is close to what you seem to want. Good luck.
*gina*
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday,
In emacs matlab-mode, highlight a region then use indent-region:
C-M-\ runs the command indent-region
which is an interactive compiled Lisp function in `indent'.
(indent-region START END COLUMN)
Indent each nonblank line in the region.
With prefix no argument, indent each line using `indent-acco
1 - 100 of 140 matches
Mail list logo