Since you are on this topic, do you (or anyone else) have any type of
code-completion mode for python in emacs?
Thanks
-george
For what its worth, Vim has a generic type of code-completion that uses
the file being edited to check for completion options within a word. It's
not true
Terry
Yes, I must agree with you that it is something I should know. I do try
to keep with things but there are always some things that slip through the
cracks, like enumerate, in this case. That is why I am extremely grateful
the for the activity, generosity and pure knowledge on this
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 range(len(links))]:
for i, url in enumerate(links):
Chris
1. get arbitrary numerical data (typically large data sets in columnar
format or even via COM from other packages. I generally have to deal with
one or more sets of X,Y data)
2. manipulate the data (scaling, least squares fitting, means, peaks,
add/subtract one XY set from another etc)
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
Hi Doug
Not only was Kylix a letdown, there is talk also of it being
discontinued. To be fair though, it is easy to see the difficulty for
Borland to deploy a Linux IDE of the same quality as Delphi when so much
in different Linux distributions is variable, the widget set being a prime
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
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
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
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 work
in a team where the average guy knows
Carl
What is the ultimate version control tool for Python if you are working
in a
Windows environment?
We use JEDI VCS (open source, free). To be fair, JEDI VCS actually
integrates into the Delphi IDE, which is what we use mostly. However, the
standard installation also installs a
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 the .obj files for the
DLL.
Hi all
I saw it on a webpage a few days ago, can't seem to find it again. Tried
a google search for
pypy needed translate C modules
but that didn't turn up what I was looking for. Anyone have that page
ref handy listing the C modules that the pypy team need translated into
python?
Hi m
Speed is a contentious issue here. Point is, if you really need raw
speed, why stop only at Perl and Python? There are plenty of statically
compiled languages that will produce native binaries.
The relative difference in speed between Perl and Python, whatever it is,
is completely
is it possible to write python code without any indentation?
Xah
You can, of course, write a silly little inline script without
any control structures that will all line up at the left
margain. So what?
John Roth
I agree, John, I don't get it. The vast majority of programmers (albiet
from my
Jim
Someone on this list (SteveB) helped me quite a bit with a list
comprehension on a recent thread. Roy said it can be hard to read, and I
agree in part because I always thought they were hard to read, when in
actual fact I had just never bothered to learn properly. Here is a
Jean, Paddy
I use pym to extract bits of pascal out of delphi code for documentation
purposes. You have to add some stuff to the delphi code (in your case, C
header), but these are added within comment blocks, and the interesting
thing is that you add python code(!) as a kind of dynamic
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
Alexander
PowerOfGenerator=TakeFromSensor()
if PowerOfGeneratorxxx:
RecalcPower(PowerOfGenerator)
PutToTheDatabase(PowerOfGenerator)
Here, python will not help you. The worst thing is that in such
calculations
you often receive plausible results.
(I think PyChecker has
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. The equivilence actually
looks like:
' a = []
' l1 = range(4)
' l2 = range(3)
'
Jeff
I fully agree. As I stated in a message to alexander, it is quick and
easy even to write a simple project-specific tool for checking that only
allowed variable names exist in all the project files.
Compared to having to work with tons of effectively useless variable
declarations
Hi Fredrik
*sigh* I think I will stop writing mini-tutorials :)
You are, of course, correct. And I really like your method of
explaining how to mentally juggle the LC into explicit loops.
I shudder to think how mnay people I confused with my incorrect
examples - I really should have tested
Wow, Steve, thanks, you went to some effort here.
I prefer to give names to the values produced by os.walk -- I think it
makes the usage much clearer. However, since I don't use 'dirnames', I
use '_' to indicate this:
Actually, I feel silly for not recognising this - I read about the Python3
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
Hi Anthony
Here is some stuff to get you started (this is from memory, I'm not
checking it, but should be mostly helpful):
***
import os
os.chdir('C:\My Documents') # Can use this to jump around to different
folders
fileNames = os.listdir('.') # Checks the now current folder
namesToMatch =
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
Hi Philip
C++ to Python is a steep 'unlearning' curve...
That's worthy of QOTW. I decided not to reply to this thread earlier, but
you just convinced me otherwise :)
I work in Delphi a lot, which is in a lot of respects very similar to C.
I have come to the conclusion that function
Hi Surfunbear
I don't know about the stuff regarding jobs, resumes, etc, but I will tell
you the same thing I tell everyone I meet regarding python:
Set aside a morning, and work through the python tutorial that comes with
the documentation. People like me are going to tell you this and
Sure Steve
Lemme see ... (indentation changed so comments associate with correct bits)
Out of curiosity, do you find:
filenames = [os.path.join(dirpath, filename)
# This is cool
for dirpath, _, filenames in os.walk('.')
# This is getting tricky,
Olivier
But the problem is about modules thats are developped from others with
distutils...
Yes, sorry, I reread your original post and now realise that you were
referring to other people's modules. And with your comments there, I
agree with you - MSVC as a requirement is unfortunate.
thx
Gurpreet
You can manage the namespace more formally. Or to put it another way,
global gives me the heebie-jeebies. I recently worked on a project
replacing a legacy reactor model in FORTRAN, and between COMMON blocks,
and GOTO statements, I didn't know up from down.
How about this:
***
Hi
It would help if you could describe the purpose you have in mind for doing
this. There is a cute way of doing what you want:
===file: a.py===
# module a.py
test = 'first'
class aclass:
def __init__(self, mod, value):
mod.test = value# Is there another way to
Olivier
If you consider using the ctypes module, you can write a dll (windows) or
a shared object (linux) using anything that can make one of those.
For example, I have successfully used FreePascal to make a dynamic library
on both windows and linux and use that library within python on both
Steven, thanks for your help once again :)
so you could write the code like:
test = 'first'
class aclass:
def __init__(self, value):
mod = __import__(__name__)
mod.test = value
This is sweet. I really like this technique for manipulating module-scope
identifiers (from
Hi Alex
Assuming you have a file called data.txt:
***
f = open('data.txt','r')
lines = f.readlines()
f.close()
for line in lines:
print line
***
Will print each line of the file.
You can make a huge investment by setting 2 or 3 hours aside to go through
the Python tutorial, which gets
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 writable - Do you know why this is? I
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
--
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
Caleb
--
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
and with
popen it comes with an error.
I haven't been able to read the stdin either so the problem so far is
unsolved for my point.
But the newline command would explain my problems with the program.
Can it be a problem under windows since I'm using XP and the winpython
Hopefully Lars
Caleb Hattingh [EMAIL
Peter, I second that.
Nick
In what way is it unreliable? I can't seem to create a situation where
the update through globals and locals doesn't work. Are you referring
perhaps to the possibility of variables being garbage collected and then
not being around later when one tries to access
Steve,
I don't think I understand. Here is what I just tried:
' def f():
x = 3
d = locals()
print x
print d['x']
d['x'] = 5
print x
' f()
3
3
3
'
In your example, x had not yet been initialised, maybe. What I am seeing
is that x does not
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
unreliable?Ican'tseemtocreateasituationwhere
the update through globals
Sure, ok, I think I am with you now.
You get a (e.g.) variable name as a string, and you KNOW how to evaluate
it with eval, but you also want to be able to assign back to (through)
the string representation?
One way (if I understand you correctly) is with the globals or locals
dicts. Try
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, Tom Hanks [EMAIL PROTECTED]
wrote:
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
101 - 147 of 147 matches
Mail list logo