On 2008-03-22, bsoist [EMAIL PROTECTED] wrote:
On Mar 22, 12:40 pm, jmDesktop [EMAIL PROTECTED] wrote:
For students 9th - 12th grade, with at least Algebra I. Do you think
Python is a good first programming language for someone with zero
programming experience? Using Linux and Python for
On 2008-03-17, WaterWalk [EMAIL PROTECTED] wrote:
Hello. I wonder what's the effective way of figuring out how a piece
of python code works. With C I often find it very useful to be able to
run the code in step mode and set breakpoints in a debugger so I can
watch how the it executes, how the
On 2008-03-08, K Viltersten [EMAIL PROTECTED] wrote:
If you can't/don't look at the source file,
then comments aren't going to help (except
in the case of something like docstrings in
Python).
I strongly disagree. Now, perhaps we're
talking about different things, here?
Usually, in the
On 2008-02-25, mrstephengross [EMAIL PROTECTED] wrote:
I would like to translate the contents of a list. For instance, let's
say I've got a list of strings and I want to append foo to each
element. I might do the following;
list1 = ['a', 'b', 'c']
for i in range(0, len(list1)): list1[i]
On 2008-02-12, Paul Hankin [EMAIL PROTECTED] wrote:
On Feb 12, 10:17 pm, Ben C [EMAIL PROTECTED] wrote:
On 2008-02-12, Paul Rubin wrote:
Paul Hankin [EMAIL PROTECTED] writes:
def genDescendants(self):
return chain([self], *[child.genDescendants()
for child in self.children
On 2008-02-13, Erich [EMAIL PROTECTED] wrote:
On Feb 12, 5:15 am, Ben C [EMAIL PROTECTED] wrote:
I think this works OK, but it seems a bit odd. Is there something more
Pythonic I should be doing?
I have a similar tree to the one you describe here at work. I have a
visit function that is very
On 2008-02-12, Paul Rubin wrote:
Paul Hankin [EMAIL PROTECTED] writes:
def genDescendants(self):
return chain([self], *[child.genDescendants()
for child in self.children])
That is scary. It generates an in-memory list the size of the
whole subtree, at every level. Total
On 2008-02-12, Paul Hankin [EMAIL PROTECTED] wrote:
On Feb 12, 11:15 am, Ben C [EMAIL PROTECTED] wrote:
Suppose I have an object containing an array called children. I can
therefore build a tree out of such objects.
The best I came up with so far is :
def genDescendents(self
Suppose I have an object containing an array called children. I can
therefore build a tree out of such objects.
I thought it might be useful to have a descendent generator, so I could
write:
for thing in self.genDescendents():
foo(thing)
expecting foo to be called for each
On 2007-06-13, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
On Jun 13, 1:28 am, Tim Golden [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
Hi all,
I'm currently using antiword to extract content from MS Word files.
Is there another way to do this without relying on any command prompt
On 2007-05-20, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi all, I'm not skilled at programming, so sorry for my ignorance.
My questions:
(1)
which is the better way to calculate the value of attributes of a class ?
for example:
(A)
def cal_attr(self, args):
#do some
On 2007-04-25, Peter Beattie [EMAIL PROTECTED] wrote:
I am trying to plot something in gnuplot 4.2 using co-ordinates a Python
2.5 program computes. Here's what I'm doing:
py from subprocess import *
py plot = Popen(c:/progs/gp/bin/wgnuplot.exe, stdin=PIPE)
py plot.stdin.write(plot x*x)
On 2006-09-21, Fijoy George [EMAIL PROTECTED] wrote:
Hi all,
I am a bit perplexed by the following behaviour of the 'is' comparator
x = 2.
x is 2.
False
y = [2., 2.]
y[0] is y[1]
True
My understanding was that every literal is a constructure of an object.
Thus, the '2.' in 'x = 2.'
On 2006-08-11, Dean Card [EMAIL PROTECTED] wrote:
[snip]
thanks for the reply. I have been able to use the Image.PERSPECTIVE
transform via trial and error to get it to work properly for each transform.
What I am really looking for I guess is a way to calculate the 8 int tuple
to match
On 2006-08-09, Dean Card [EMAIL PROTECTED] wrote:
Okay, so here is the situation. I have need to do some on-the-fly image
creation. I have everything working great except for the last part of it,
applying a perspective type transform to the image. The transform will take
a rectangular 2D
On 2006-08-11, Dean Card [EMAIL PROTECTED] wrote:
This looks like a correct description of the sources:
In Image.py:
elif method == PERSPECTIVE:
# change argument order to match implementation
data = (data[2], data[0], data[1],
data[5], data[3],
data[4],
On 2006-08-08, Fabian Braennstroem [EMAIL PROTECTED] wrote:
Hi Ben,
* Ben C [EMAIL PROTECTED] wrote:
On 2006-08-06, Fabian Braennstroem [EMAIL PROTECTED] wrote:
Hi Ben,
* Ben C [EMAIL PROTECTED] wrote:
On 2006-08-05, Fabian Braennstroem [EMAIL PROTECTED] wrote:
Hi,
I want to get access
On 2006-08-06, Fabian Braennstroem [EMAIL PROTECTED] wrote:
Hi Ben,
* Ben C [EMAIL PROTECTED] wrote:
On 2006-08-05, Fabian Braennstroem [EMAIL PROTECTED] wrote:
Hi,
I want to get access to my abook address file with python.
Does anyone have some python lines to achive this using
curses
On 2006-08-05, Fabian Braennstroem [EMAIL PROTECTED] wrote:
Hi,
I want to get access to my abook address file with python.
Does anyone have some python lines to achive this using
curses? If not, maybe anybody has small python program doing
it with a gui!?
You can just parse the abook
On 2006-07-17, TG [EMAIL PROTECTED] wrote:
Hi there.
Anyone knows how to use numpy / scipy in order to solve this ?
* A is an array of shape (n,)
* X is a positive float number
* B is an array of shape (n,)
* O is an array of shape (n,) containing only zeros.
A.X - B = O
min(X)
Are we
On 2006-07-17, TG [EMAIL PROTECTED] wrote:
Ben C wrote:
On 2006-07-17, TG [EMAIL PROTECTED] wrote:
Hi there.
Anyone knows how to use numpy / scipy in order to solve this ?
* A is an array of shape (n,)
* X is a positive float number
* B is an array of shape (n,)
* O is an array
On 2006-07-14, Adonis [EMAIL PROTECTED] wrote:
Satya Kiran wrote:
Hello,
I have upgraded to Python2.4 on my Red Hat 9.0 Linux box.
I want to work with IDLE and ran a search to check it's presence.
Here is what I get.
[EMAIL PROTECTED] bin]# find / -iname idlelib
On 2006-07-16, Avi Kak [EMAIL PROTECTED] wrote:
Folks,
Does regular expression processing in Python allow for executable
code to be embedded inside a regular expression?
For example, in Perl the following two statements
$regex = qr/hello(?{print saw hello\n})mello(?{print saw
mello\n})/;
On 2006-07-15, Gerhard Fiedler [EMAIL PROTECTED] wrote:
On 2006-07-15 06:55:14, mystilleef wrote:
In very well designed systems, the state of an object should only be
changed by the object.
IMO that's not quite true. Ultimately, the state always gets changed by
something else (user
On 2006-06-21, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hey guys,
I am absolutely new to Linux programming, with no w##s programming
experience except a small amount of C++ console apps.
Reasonably new to Linux, BSD etc, got good sound networking base of
knowledge and dont have any
On 2006-05-10, Gr�goire Dooms [EMAIL PROTECTED] wrote:
Ben C wrote:
On 2006-05-09, Ben C [EMAIL PROTECTED] wrote:
def clearall():
all = [var for var in globals() if __ not in (var[:2], var[-2:])]
for var in all:
del globals()[var]
since I think magic things always start
On 2006-05-09, Diez B. Roggisch [EMAIL PROTECTED] wrote:
N/A wrote:
Hi all,
I am learning Python. Just wondering how to clear saved memory in
Python? Like in Matlab I can simply use clear all to clear all saved
memory.
You don't - python does it for you. It is called garbage collection.
On 2006-05-09, Petr Jakes [EMAIL PROTECTED] wrote:
I would like to do some action once a minute.
You can try the sched module (import sched).
You give it a time at which to call a callback. Then in the callback you
can reset the alarm for a minute later, using enterabs.
If the task might take
On 2006-05-09, Ben C [EMAIL PROTECTED] wrote:
def clearall():
all = [var for var in globals() if __ not in (var[:2], var[-2:])]
for var in all:
del globals()[var]
since I think magic things always start and end with __.
Oops, got that wrong anyway:
should be:
all
On 2006-04-29, Robin Becker [EMAIL PROTECTED] wrote:
When young I was warned repeatedly by more knowledgeable folk that self
modifying code was dangerous.
Is the following idiom dangerous or unpythonic?
def func(a):
global func, data
data = somethingcomplexandcostly()
def
On 2006-04-26, nikie [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
Here is another non-pythonic question from the Java Developer. (I beg
for forgiveness...)
Does Python have a mechanism for events/event-driven programming?
I'm not necessarily talking about just GUIs either, I'm
On 2006-04-21, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
hi
i wanted to start execute a command and put it in the background. i am
using Unix.
If you use subprocess, or even os.spawn, it should be portable and work
on all systems (although the docs list some restrictions).
Usually i start
On 2006-04-21, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hello,
I need your help understanding lambda (and doing it a better way
without).
f = lambda x : x*x
[...]
# the idea is now to give the definition of the multiplication of
functions and integers
# (f * c)(xx) := f(x)*c
[lambda
On 2006-04-21, Ben C [EMAIL PROTECTED] wrote:
On 2006-04-21, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hello,
I need your help understanding lambda (and doing it a better way
without).
f = lambda x : x*x
[...]
# the idea is now to give the definition of the multiplication of
functions
On 2006-04-21, Alexis Roda [EMAIL PROTECTED] wrote:
Ben C escribió:
On 2006-04-21, Ben C [EMAIL PROTECTED] wrote:
Having said that, I attempted to confirm this using def rather than
lambda, and encountered something I cannot explain at all-- it appears
that the functions are getting redefined
On 2006-04-19, Jeff Groves [EMAIL PROTECTED] wrote:
I'm writing a launcher that should do the following:
1. Activate a .bat file to set environmental variables.
2. Start 3 programs, using said environmental variables as arguments.
However, I can't get the environmental variables to stick
On 2006-04-19, Jeff Groves [EMAIL PROTECTED] wrote:
How about sourcing it from a shell, then using that same shell instance
to run the programs?
How would I do that? As I've said, I haven't found a Python command
that lets you send multiple commands to the same shell yet. If I could,
my
On 2006-04-17, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi All,
I've done a bunch of searching in google and in python's help, but,
I haven't found any function to decode a string like:
Refresh#33; (ihenvyr)
In to plain english.
[...]
I needed to do that the other day, and did it like
On 2006-04-14, Sergei Organov [EMAIL PROTECTED] wrote:
Dennis Lee Bieber [EMAIL PROTECTED] writes:
It always means bind... But if the LHS is a mutable object, AND you
have specified a component of that object, it is the component that is
being rebound...
lst[:] = []
[...]
Me
On 2006-04-13, Thomas Girod [EMAIL PROTECTED] wrote:
Hi there.
I'm trying to use new-style classes, but there is something i'm
obviously missing
here it is :
class Data(list):
__slots__ = [width, height, label]
def __init__(self,width,height,label=None):
On 2006-04-13, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi,
I just started with Python and I am new to OO programming.
Here is a simple code:
class Obj:
myVar = 1
def __init__(self):
myVar = 2
#
myObj = Obj()
print myObj.myVar
The output is of this
On 2006-04-12, Michael Yanowitz [EMAIL PROTECTED] wrote:
Hello:
One topic that has always interested me are the Language translators.
Are there any that convert between Python and C++ or Python and Java?
I remember seeing one that converts from Python to or from Perl but couldn't
find it
On 2006-04-11, Michele Simionato [EMAIL PROTECTED] wrote:
Roy Smith wrote:
snip
That being said, you can indeed have private data in Python. Just prefix
your variable names with two underscores (i.e. __foo), and they effectively
become private. Yes, you can bypass this if you really want to,
On 2006-04-11, Michael McGarry [EMAIL PROTECTED] wrote:
Hi,
I would like to form a regular expression to find a few different
tokens (and, or, xor) followed by some variable number of whitespace
(i.e., tabs and spaces) followed by a hash mark (i.e., #). What would
be the regular expression
On 2006-04-11, Michael McGarry [EMAIL PROTECTED] wrote:
Tim,
for some reason that does not seem to do the trick.
I am testing it with grep. (i.e., grep -e '(and|or|xor)\s*#' myfile)
Try with grep -P, which means use perl-compatible regexes as opposed to
POSIX ones. I only know for sure that
On 2006-04-07, Robin Haswell [EMAIL PROTECTED] wrote:
Okay I'm getting really frustrated with Python's Unicode handling, I'm
trying everything I can think of an I can't escape Unicode(En|De)codeError
no matter what I try.
Could someone explain to me what I'm doing wrong here, so I can hope to
On 2006-04-05, Steve [EMAIL PROTECTED] wrote:
Hello,
I was wondering if there is a wxPython RPM for SuSE 10.0 available. I
Googled for it with no luck, but I'm hopeful that there is one out
there.
http://www.novell.com/products/linuxpackages/professional/python-wxgtk.html
is the
On 2006-04-05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I want to print number 0 to 9 in one line like this
0 1 2 3 4 5 6 7 8 9
if I do like this, it prints in different lines
for i in xrange(10):
print i
for i in xrange(10):
print i,
should work (comma after the i).
so i
On 2006-04-05, Scott David Daniels [EMAIL PROTECTED] wrote:
Ben C wrote:
... But this puts an extra space on the end (so did the print i,
version above).
Actually, no (the trailing-comma prints do a funny dance).
Check it out: [...]
You're right, I tried it! Thanks for that.
Useful
On 2006-03-28, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
hi
i am using this code to run a ps command in unix
def run(program, *args):
pid = os.fork()
if not pid:
os.execvp(program, (program,) + args)
return os.wait()[0]
run(ps, -eo pid,ppid,args)
It runs fine, but
On 2006-03-18, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hello,
I hav a question..How do I write a webbot that logs onto some website,
fills text into a textbox and submit that form, Sorry I am a novice in
python, apparently I have to use urllib, but I hav a few queries on
this, What happens
On 2006-03-14, Kevin [EMAIL PROTECTED] wrote:
i have a python file called pyq which outputs stock quotes, currently i
also have a html file that takes stock ticker inputs, i would like to
bridge the two by building another program that takes the html inputs
and uses them to call the pyq
On 2006-03-11, Michael Spencer [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
Hi All,
First, I hope this post isn't against list rules; if so, I'll take note in
the future.
I'm working on a project for school (it's not homework; just for fun).
For it, I need to make a list of words,
So here's a different approach, which I think does meet the spec:
from itertools import tee
def allwords2(alphabet=abcd, maxlen = 4):
def wordgen():
for char in alphabet:
yield char
for partial in allwordstee[1]:
if len(partial) == maxlen:
54 matches
Mail list logo