> The best thing about Python is ___.
this.
--
http://mail.python.org/mailman/listinfo/python-list
difficult to go far wrong regarding style if you do a lot of
what's in this list. This list is not mine. I jotted these points
down, but this information is continually repeated by the actual wise
people (not me) in this newsgroup.
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
with a os.listdir lookup as in
filenamelist = [filename for filename in os.listdir('.') if
filename.find('.pdb.')]
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
odule* a to the constructor for
aclass, and that constructor modified the module variable "test". This is
a way to avoid using 'global', or in other words, the namespaces of things
are still clear (for me anyway).
Cya
Caleb
On Thu, 3 Feb 2005 00:13:05 +0530, Gurpreet Sac
y way I ever intend making native binary additions to my
own programs.
Regards
Caleb
On Wed, 2 Feb 2005 12:35:08 +0100, Olivier Ravard
<[EMAIL PROTECTED]> wrote:
Hi,
When I tryed to compile a python module using distutils under windows,
and there is an error message if we do not hav
iers (from within a class or function).
To the OP:
In general, this seems like a bad organization strategy for your code.
What is your actual use case?
Agreed. It is an interesting intellectual exercise, but there is surely a
better way of controlling access to 'test' in the OP's
he Python tutorial, which gets installed as part of the documentation.
That tutorial can get you much of the knowledge you will ever need with
Python.
thx
Caleb
On 2 Feb 2005 13:27:49 -0800, alex <[EMAIL PROTECTED]> wrote:
Hi,
I am a beginner with python and here is my first question:
How can
st majority of cases, but I'm naturally curious :)
thx
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
te.
thx
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
ss: '+test
my_a = a(test)
test = my_a.givetest()
print 'Outside after class: '+test
***
So here we explicitly pass "test" into the class, do stuff with it, and
rewrite test again with a method. Does this satisfy the technical problem?
regards
Caleb
On Thu, 3 Feb 200
into the
executable. This is somewhat of a problem for me but I expect this will
change within a release or two.
Lazarus is _very_ much like Delphi, and works on Windows, Linux, and
possibly several other platforms.
cya
Caleb
> and net for info about Borlands KYLIX 3 and have found litt
to
you or not - It certainly feels "right" to me, but then that is hardly
surprising. In any case, what I presented almost exactly fits how I
"think" about the problem, and that is what I want.
> bwaha.
?
regards
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
You really owe it to yourself to try the PyParsing package, if you have to
do this kind of thing with any frequency.
The syntactic difference between PyParsing and regular expressions is
greater than the syntactic difference between Python and C.
thx
Caleb
On Tue, 19 Jul 2005 13:35:02 +0200
Wow, I didn't know about enumerate.
Many thanks
Caleb
On Wed, 20 Jul 2005 15:19:50 +0200, Simon Brunning
<[EMAIL PROTECTED]> wrote:
> On 7/20/05, Mage <[EMAIL PROTECTED]> wrote:
>> Or is there better way?
>>
>> for (i, url) in [(i,links[i]) for i in
newsgroup to
fill in the blanks for me. It is guys like you who are willing to take
the time to give responses that make it what it is. In another
newsgroup, I could have been flamed for letting Simon know he helped more
than just the OP with his post :)
Thanks
Caleb
On Wed, 20 Jul 2005
idget
toolkit you want to use. Also, you would have to decide if you want to do
GUI-building via text-files or through a graphical method. The simplest
method (for the latter) I have seen so far is Glade, but perhaps other
posters will have better advice than me.
rgds
Caleb
On Tue, 26 Jul 20
options within a word. It's
not true completion (using valid completions for class hierarchies, a la
Delphi/VB), but I get a lot of mileage out of it with my python coding.
I fully expect Emacs has something similar, though I can't tell you how (I
hardly know emacs at all).
ract class method is being called in error).
regards
Caleb
On Mon, 01 Aug 2005 18:52:02 +0200, Peter Hansen <[EMAIL PROTECTED]> wrote:
> phil hunt wrote:
>> Suppose I'm writing an abstract superclass which will have some
>> concrete subclasses. I want to signal in m
but I know from personal experience that it would take a very special
IDE to compete with Vim for the manipulation of text (GUI design, of
course, is another story altogether).
regards
Caleb
On Mon, 01 Aug 2005 18:57:51 +0200, projecktzero <[EMAIL PROTECTED]>
wrote:
> VIM or Emacs. I
York
Short answer: yes
We use python and R at work, and in general you will find python syntax a
little cleaner for functionality they have in common. R is better for
some of the more hard-wired stats stuff, though.
On Mon, 19 Sep 2005 20:04:37 +0200, York <[EMAIL PROTECTED]> wrote:
> Hi,
The other thing (and this is always true) is that "better" needs
definition. On purely technical grounds, on average, MSOffice is better
than OO. However, holistically, OO is probably better (no lock-in, open
standards, multiplatform and so on). Those soft issues do matter.
On Mon, 19 Sep
Very interesting that sudoku solving appears on the python group - there
is a programming competition at mathschallenge.net (euler) where one of
the puzzles is developing a sudoku solving algorithm...
Actually the python entrants are giving the C guys a good run!
On Mon, 19 Sep 2005 09:12:54
rrent folder
namesToMatch = ['readme.txt','readme.doc'] # Buncha names to find
for item in fileNames: # check every filename
if item in namesToMatch: # is this item in the required list?
print 'Match found: '+item # if you found one, say so.
***
Hope this helps.
I would be interested to see an example of code that is more concise but
yet as *clear* as the one you already have. I can actually read and
understand what you've got there. That's cool :)
On 6 Feb 2005 11:28:37 -0800, <[EMAIL PROTECTED]> wrote:
I wrote this little piece of code to get a l
may be different in number and type. I don't have the
years of experience that Alex has, however, so I may end up regretting it
but right now, it seems to me to be the clearest approach in this
situation.
thx
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
that,
perhaps try to convince of our particular world-view, and so on.
By the end of the tutorial (more likely at halfway) you will probably know
whether this is worth pursuing or not. Oh, and do this before you invest
too much time in Perl :)
Keep well
Caleb
On 6 Feb 2005 05:19:09
n't know
python as well as I should (certainly not as well as others here!). I
guess it is just familiarity. A single comprehension is ok, nesting them
gets tricky, and 3 times is a strike for me. I will practise :)
keep well
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
hole
thing a little bit - and (mental note) I *must* remember this when I
explain stuff to people at work, having now experienced it first hand.
Thanks again
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
Sure, Nick, I agree with you completely.
I generally try to make sure that my classes are limited in what they
do/provide, so it is not often a problem that a class may need to be
instantiated in several very different ways.
But your point is well taken.
Thanks
Caleb
--
http://mail.python.org
Peter, that was very clear, thanks.
> So not only is
>
> for line in file(...):
># do stuff
>
> the most elegant, it is also the fastest. file.readlines() comes
close, but
> is only viable for "small" files.
--
http://mail.python.org/mailman/listinfo/python-list
slated into
python?
thanks
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
numerical code and python for
everything else.
You really will have to convince people here that execution speed is a
real issue for your programming task (in order to continue this
discussion). Otherwise the debate will go south real quick.
Keep well
Caleb
On Tue, 08 Feb 2005 12:17:05 -0600,
ng to type all those delimiters).
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
e to correlate the answer with the loop, but you
should be able to see after a while that this nesting is the same as
'>>> a = []
'>>> for b in range(4):
'>>> for i in range(3):
'>>> a.append(i*2*b)
keep well
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
of dynamic markup which pym
executes while parsing the file.
In other words, you can write python code within a comment block in your
C-header to generate unit-tests into other files, and get that code
executed with pym.
Keep well
Caleb
On Tue, 08 Feb 2005 19:58:33 GMT, Paddy McCarthy <[EM
Marc
I don't know how it is handled, but I expect also that there is an implied
close().
thanks
Caleb
When you read a file with that method, is there an implied close() call
on the file? I assume there is, but how is that handled?
--
http://mail.python.org/mailman/listinfo/python-list
k
c) not force everyone else to have to deal with variable declarations that
will be only an annoyance 95% percent of the time.
Is there a specific reason you want this added to the *language* itself?
Thanks
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
Stephen
You're gonna have to help me here.what is the effective difference?
Thanks
Caleb
'>>> a = []
'>>> for b in range(4):
'>>> for i in range(3):
'>>> a.append(i*2*b)
There is a subtle error in this explanation. T
forever (perhaps even only in other peoples code who decided
to use the "option"), it is not much to ask (I work in pascal a lot - I
know all about tons and tons of declarations).
thx
Caleb
You can also get all places where said variable exists by using grep, or
your editor's sea
ePascal, make a DLL and use ctypes to call it.
I do not know C and have no desire to learn now :)On the other
hand, I know pascal quite well.
keep well
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
them first.
Thanks again
Caleb
> (to translate a list comprehension to nested statements, remove
> the result expression, insert colons and newlines between the for/if
> statement parts, and put the append(result expression) part inside
> the innermost statement)
>
>
--
http
uld give it some more thought anyways.
Thanks again
Caleb
On Wed, 09 Feb 2005 12:38:37 -0500, Joe Francia
<[EMAIL PROTECTED]> wrote:
Caleb Hattingh wrote:
As you might imagine, I think about this constantly. However, there
are many other issues that make it complicated, such as having to w
is a really great feature for
this type of thing.
Of course, I have only used JEDI VCS, so I have nothing to compare it to:
ymmv.
keep well
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
Roy
How about the Yoda version:
do:
statement
do not do:
statement
The Yoda version actually goes
statement
:do
statement
:not do
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
Brent
Google "python ctypes". ctypes is cool :)
keep well
Caleb
On Wed, 9 Feb 2005 13:44:44 -0700, Brent W. Hughes
<[EMAIL PROTECTED]> wrote:
I have a third-party DLL and it's associated .h file. The DLL was
written
in C. I have neither the associated .c files nor t
http://www.python.org
On Tue, 15 Feb 2005 13:16:53 -0500, samar bazied <[EMAIL PROTECTED]>
wrote:
Hi..
plz
can u help me??
I am very new in python and I have some qustions about it.
can u give me design process of python and their related langauges?
and I will be very habby if u give me small ev
I have had good success with pygnuplot.
On Tue, 8 Mar 2005 20:45:22 +0200, ionel <[EMAIL PROTECTED]> wrote:
i need some pointers.
so far i've tryed matplotlib ...
--
http://mail.python.org/mailman/listinfo/python-list
of the
original first image would peer through the transparent bits of the
original second image.
I fully expect I am doing something wrong here, I just don't know what.
Thanks
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
I'm going to assume the following is self-explanatory - type the commands
in yourself.
'>>> a = 'hello my name is caleb'
'>>> b = a.split()
'>>> b
['hello', 'my', 'name', 'is', 'caleb']
&
I heartily support something like this, but alas I have not the time to
help out with it. I like the Enthought python distribution because it
installs several packages in one shot. A pity there isn't a similar thing
for python addons in Linux (or is there?).
Something apt-get-like would be
Wow, that was pretty clueless of me...right there on the *next* page of
the manual (I thought "im.paste(image, box)" and "im.paste(image, color)"
were the general forms for "paste", apparently didn't look further)
thx
Caleb
On 29 Nov 2004 22:17:36 -0800, To
Hi
I can't help you directly, but I am also finding im.putpixel to be
extremely slow - as the docs recommend, can you try using the
pixel-placing method of Draw? This is what I am going to try for my
application (resampling algorithms).
Thx
Caleb
On 30 Nov 2004 11:18:40 -0800, irond
Obviously, Peter and Jorge are hardcore, but below is what a beginner like
me hacked up:
My point, I guess, is that it is possible to quickly get a solution to a
specific problem like this without being a total expert. The code below
was typed out once, and with only one minor correction be
(good) news to me that C is not the only game in town for creating
binary python extensions.
Just a heads-up is all
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
Hi
You could just parse the model file. Off the top of my head
***
f = open('ModuleYouWantToExamine.py','r')
for i in f:
if i.find('def ') > -1:
print 'Found a function!: '+i.replace('def ','')
f.close()
***
You would have to build this up for a more complete examination. Of
course,
aiming for something like pointer emulation with simple
datatypes?
Thanks
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
],
CallFunc(Getattr(Name('Tkinter'), 'Text'), [Name('app'), Keyword('state',
Const('disabled'))], None, None)), Discard(CallFunc(Getattr(Name('t'),
'pack'), [], None, None)), Assign([AssName('info', 'OP_ASSIGN'
'a'
'>>> a # The value of a is changed.
8
'>>>
Is this kinda what you mean? I'm still new at this (and don't know REXX
from Adam).
Thanks
Caleb
There are many situations where this is useful. For instance, you
might be
getting a
Hi
You are probably typing this within IDLE. Try it after starting python in
a shell like DOS or Bash. Should work then (works for me, and I also get
the AttributeError in IDLE.
Thanks
Caleb
On Tue, 07 Dec 2004 21:15:51 GMT, It's me <[EMAIL PROTECTED]> wrote:
Why do I get an &quo
that I am only
taking 5 characters, but where does the newline (\n) come from? Is that a
remnant from when I terminated the previous 'g' input?
Thanks
Caleb
On Tue, 07 Dec 2004 23:36:56 -0500, Caleb Hattingh <[EMAIL PROTECTED]>
wrote:
Hi
You are probably typing this within
ppens.
thx
Caleb
On Tue, 7 Dec 2004 23:16:50 +0100, Lars Tengnagel <[EMAIL PROTECTED]> wrote:
Hej Caleb and others
I've been strugling with the same problem where i try to use popen3 to
run a
program. If I use a piped commandline
the program can read the file without problems but in t
to access them through a string
name? I don't know very much about the garbage collector, so I can't say
for sure.
thx
Caleb
On Wed, 08 Dec 2004 10:38:30 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote:
Nick Coghlan wrote:
Generally, altering the contents of the dicts returned
x had not yet been initialised, maybe. What I am seeing
is that "x" does not seem to update when being assigned to - I guess this
is what you are referring to by being unreliable.
But "unreliable" sounds kinda vague and intermittent, and I assume that is
not the case here
lso be nice if globals and locals behaved the same, differing
only in scope (which is what I expected originally anyway). But we can't
have everything, I guess :)
Caleb
On Wed, 08 Dec 2004 20:49:53 +0100, Peter Otten <[EMAIL PROTECTED]> wrote:
Caleb Hattingh wrote:
In what way is it
u
ave a clear idea of
how to play nice with locals().
thx
Caleb
Peter Otten wrote:
> Caleb Hattingh wrote:
>
> > I am convinced now that locals() doesn't work as (I) expected.
Steven
> > says there was some or other reason why locals() as used in this
context
> > is not
Hi Dan
I must confess that upon rereading my words, there is some irony there
(but not really sarcasm, is there?). However, I *really* tried to keep
my tone, well, professional. I realise I didn't do a good job and
apologise. I hope that's ok.
Keep well
Caleb
--
http://mail.
Diez
Ya got me there!
"""
I have a sript that downloads a webpage. According to the picture on
this webpage I need to pass a parameter to this , running script a few
lines later.
"""
Err, ya, I guess I would be suspicious too. Sorry about that!
Keep well
Cal
Here is something I would try but don't have the guts for:
If you could write an extension to idle (yes, idle, not Boa, not Eric,
etc) that pops up a small list of possible completions in a listbox when
you type a '.' (period) after any object name or module name (including
builtins), that wo
other reason is because of the magical little menu that pops up when I
type the period after "Self", and lets me pick a class member by typing
the first few letters...
Keep well
Caleb
On Thu, 09 Dec 2004 09:39:58 -0800, Jeff Shannon <[EMAIL PROTECTED]> wrote:
-- heck, even be
oo. I would be interested in hearing what to look out for in
the learning stage of developing C-extensions, for when I am overcome by
curiosity and feel the need to try it out.
Keep well
Caleb
I just want to know the basics of using C and Python together when the
need arises, that's a
In fact, as one of the Peter's (either Otten or Hansen) explained to me,
for line in open(file):
is actually both faster (being buffered) and generally better for very
large files because it doesn't read the whole file into memory, like
readlines does (if you have a memory limitation).
On Fri,
o your python executable is on
the PATH environment variable.
If you run other commands from python quite frequently, it is probably
a good idea to look into the "os.popen" set of commands, for more
flexibilty.
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
and wanted to share it.
Not saying that such a thing couldn't ever be said about some given
implementation of something complex in python (or any language, for
that matter), but I still had a good chuckle.
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
server procedure can return True or False.
One benefit is that if you change the input to the tests, you need only
update the server.Actually, you could let the procedures on the
server accept test input and student results, and return True or False.
This would be cool :)
Caleb
On Dec 14
s','r'))
I recently did a ton of scientific data analysis looking for trends in
10 years of data for a petrochemical plant, and I learned just how
convenient dicts and pickles can be to manage one's sanity :)
Caleb
On Dec 14, 4:31 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote:
Hi Erich
If you're going to be doing a lot of string substitution, you should
look at the Templating support in the library:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/304005
and (a little bit fancier):
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/335308
Regards
e and the applescript
interface that at least lets your business logic sit in one place. The
wrapper can use the right API depending on the platform it finds itself
on at runtime.
Regards
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
ed?
If you are this Henning Jansen:
http://www.henning-jansen.com/
you may get a lot much more accurate help from others in this group by
mentioning that you have some Ruby experience. That way, the guys in
here who also know Ruby (not me :) can quickly point out the
differences in behaviour for your specific question.
Regards
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
Hi Paul
> Thanks for the kind words!
No, thank _you_ for taking the time to write such a useful document.
regards
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
ux) or Scheduled Tasks (windows), if that was the
functionality you wanted in a server implementation of such a tool.
regards
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
robably because of something called GIL in Python.
> How can I get around
> that GIL and get speed-up?
> Thanks in advance.
> Daniel
Perhaps try
http://www.parallelpython.com/
or
http://www.its.caltech.edu/~astraw/seppo.html
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
Pat wrote:
> I have to do a big programm. Could someone give me some suggests about
> IDE (on Linux) and books to learn.
http://groups.google.com/groups/search?q=python+ide&qt_s=Search
Lots and lots to read :)
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
I'm writing something that has to invoke an external program, and every
time the external program prints something, update a UI. How would I go
about doing this?
signature.asc
Description: This is a digitally signed message part
--
http://mail.python.org/mailman/listinfo/python-list
and compare it with what I have on disk. At
this stage, just reporting the differences is fine.
I could do these steps myself with normal http access and
screen-scraping, but is there already such a system/script somewhere?
Alternatively, how do you all keep versions of python addons
up-to-date?
Unstable. Broadband
hasn't exactly hit the local market, although things might be looking
up in a few years or so.
keep well
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
creation.
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 15 Apr 2009 15:47:05 +0200, wrote:
But, lambda functions can't be pickled. I would like to pickle my
objects, and i would really like to use parallel python (which
requires pickling).
If you are fixated on using lambda, you could probably use Recipe 7.6:
Pickling Code Objects in the
Hi
I don't think this is what you want (a string representation of the
argument passed to a function as that argument is at runtime is way
beyond my abilities), but this can retrieve the literal text in the
function call as it appears in the .py file, assuming you have the .py
file available a
nning code
in the IDE.
Other than that, I now use SPE instead of Vim for python editing, which
is a big step for me. SPE is quite slick; some ways to go, but
certainly on the right track. The built-in code-completion is a godsend.
Hope this helps
Caleb
Sullivan WxPyQtKinter wrote:
> IDLE
t seeing, I would be glad
to hear it.
Regards
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
animal in zoo:
a = animal
anum = count
count = count + 1
IS a kludge, when you have this available to you:
for count, animal in enumerate(zoo):
a = animal
anum = count
I won't say how long it took me to start using list comprehensions :)
regards
Caleb
--
http://mail.py
Well, there it is:
* Added support for Free Pascal Compiler (http://www.freepascal.org/)
and Lazarus Project (http://www.lazarus.freepascal.org/)
Thanks to Michiel du Toit ([EMAIL PROTECTED])
That was easy. I just saw the new support for D2k6 recently.
thx Ravi
Caleb
--
http
I tried this:
from timeit import *
#Try readlines
print Timer('import
gzip;lines=gzip.GzipFile("gztest.txt.gz").readlines();[i+"1" for i in
lines]').timeit(200) # This is one line
# Try file object - uses buffering?
print Timer('import gzip;[i+"1" for i in
gzip.GzipFile("gztest.txt.gz")]').time
. Everyone loves small optimization exercises,
and there be bots here who get the optimal solution on the first try.
Though I would like to (seems an interesting application), I don't have
time available to go through all your code now.
Thanks
Caleb
--
http://mail.python.org/mailman/listinfo/p
wer
than ".read().splitlines(True)"? To me, the "one obvious way to do it"
is ".readlines()".
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
return 1
elif a.count == b.count:
return 0
else:
return -1
foldersizeobjects.sort(cmpfunc)
tot=0
for foldersize in foldersizeobjects:
tot=tot+foldersize.count
print foldersize
print 'Total: %.2f MB'%(tot/1024./1024.)
# End
regards
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
l me with great expectations either,
although it would be a good thing if they really supported it well.
rgds
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
reason
behind this, but I don't know it.
regards
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
Thanks John
I will use your code :) 30% improvement is not insignificant, and
that's what I was looking for.
I find the log function a little harder to read, but I guess that is a
limitation of me, not your code.
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
saw this project on
the daily freshmeat newsletter, and so will probably use that code
instead.
regards
Caleb
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 114 matches
Mail list logo