has to be available tools like this, but I am not
even sure what such a system is called. Is there anything like this, in python
preferably?
thanks,
Brian Blais
--
Brian Blais
bbl...@gmail.com
http://web.bryant.edu/~bblais
http://brianblais.wordpr
current implementation that wouldn't work as a generator?
bb
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais
http://bblais.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
pers are lazy, or bored!
bb
>
>
>
> --
> Steven
>
> --
> http://mail.python.org/mailman/listinfo/python-list
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais
http://bblais.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
23)
parser.add_option("--opt2", metavar="YOUR_OPTION2" ,default= "abc")
parser.add_option("--opt3", metavar="FLAG", default=True)
parser.save('test.yaml')
newparser=MyOptionParser()
newparser.load('test.yaml')
bb
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais
http://bblais.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
able to suggest more efficient libraries to call for doing these sorts of
models.
bb
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais
http://bblais.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
/python
it's better to use the former, as it will work even as you change versions,
etc... You should avoid using the shebang with a *specific* python version.
just use #!/usr/bin/env python
bb
--
Brian Blais
bbl...@bryant.edu
http:/
On Mon, May 25, 2015 at 11:11 PM, Steven D'Aprano wrote:
>
> Let's compare three methods.
>
> def naive(a, b):
> return math.sqrt(a**2 + b**2)
>
> def alternate(a, b):
> a, b = min(a, b), max(a, b)
> if a == 0: return b
> if b == 0: return a
> return a * math.sqrt(1 + b**2 /
On Sat, Aug 2, 2014 at 2:45 AM, Mark Summerfield wrote:
> Last week I spent a couple of days teaching two children (10 and 13 -- too
> big an age gap!) how to do some turtle graphics with Python. Neither had
> programmed Python before -- one is a Minecraft ace and the other had done
> Scratch.
numpy/matplotlib, is there something which will
locally
package these modules to distribute with the program? What are the options
here?
Are there any good docs for this?
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
verse to
learning
the database end, but I don't want to climb that hill unless I feel there is a
significant benefit. I don't have admin rights on the server, if that makes a
difference.
Any suggestions would be greatly appreciated!
thanks,
Paul Rubin wrote:
> Brian Blais <[EMAIL PROTECTED]> writes:
>> I want to set up a system where I can have my family members write
>> comments about a number of pictures, as part of a family tree project.
>> ...Any suggestions would be greatly appreciated!
>
> How
h.
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
know Macs all that well, but is there something
similar?
Thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
Kevin Walzer wrote:
> Brian Blais wrote:
>> Hello,
>>
>> I have a wxPython program that I would like to give to a friend of mine
>> who has a Mac. Is there a resource out there that can tell me what
>> steps I need to follow to do this?
>>
> Install Py
thinking that 90% of it could be done
by
converting indentation to {}, cdef int X to int X declarations at the top, and
other
simple text-replace features.
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for all who replied to this question about replacing a method. I feel a
little sheepish for not having caught that I have to replace it in the class,
not the
instance, but I have found a very similar problem trying to replace a method
using a
function defined in pyrex. I post all of
Greg Ewing wrote:
> Brian Blais wrote:
>> I have found a very similar problem trying to replace a method using a
>> function defined in pyrex.
>
>
> What *should* work is to define the method inside a
> class in Pyrex (plain class, not extension type) and
>
Daniel Mark wrote:
>
> 1> Does Python provide such Struct in this standard libary.
> Python has "4.3 struct -- Interpret strings as packed binary data", but
> it looks like different
> from what I really want to get.
I like the following version:
class Struct(dict):
def __getattr__(self,na
-colons at the ends of the Matlab lines, and all of
your
arrays will display and scroll like crazy on your screen. :)
thanks all for making such a great set of tools!
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
Phil Schmidt wrote:
>
> I'd love to use Python, but I'm not comfortable with the hardware side
> of that. I'm certain that most, if not all data acquisition hardware
> comes with DLL drivers, which I could interface with using ctypes. I'm
> concerned though about spending more time messing around
ow do others who
teach
Python handle this?
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] wrote:
> Then on your PC you can
>> run a script that loads each of such programs, and runs a good series
>> of tests, to test their quality...
> What happens if someone-- perhaps not even someone in the class-- does
> some version of os.system('rm -Rf /
Paddy wrote:
> It might turn out to be a poor substitute for the personal touch,
> especially If they are just starting to program.
Oh, I didn't mean it to completely replace me grading things, but I think it
would be
useful if there were a lot of little assignments that could be done
automatica
Dan Bishop wrote:
> On Dec 14, 8:36 pm, Brian Blais <[EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] wrote:
>>> [EMAIL PROTECTED] wrote:
>>> Then on your PC you can
>>>> run a script that loads each of such programs, and runs a good series
>>>&g
lead to bad security
problems
(not that it's a big deal in my app, but still...)
string.atof won't do the job. Is there a preferred way of doing this?
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
Numeric.arange(1,11,1)
idx=Numeric.nonzeros(a)
a=a[idx] % doesn't work
and what about meshgrid? Do I use the fromfunction() in some way? Is there a
resource that goes through comparisons like this?
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
Robert Kern wrote:
> A better place to ask would be [EMAIL PROTECTED] . By the
> way, Numeric has undergone a rewrite and is now known as numpy.
>
thanks for the pointer! it is a bit confusing with all of the different
numerical
modules (Numeric, numpy, scipy, ScientificPython, numarray, etc...
Steven D'Aprano wrote:
>
> It is good to be cautious. Big thumbs up. But what exactly are you worried
> about? Do you think your users might enter something Evil and break their
> own system? I'd suggest that's not your problem, and besides, it is hard
> to think of anything they could do with eva
Bas wrote:
> I am also considering a switch from Matlab to NumPy/SciPy at some
> point.
>
> Note that in the last version of Matlab (7?) you don't have to use
> 'find', but you now can 'conditional arrays' as an index, so instead
> of
> idx=find(a>5);
> a(idx)=6;
> you can do:
> cond=a>5;
>
ng on context.
There is
a dialog class which allows you to edit/change the values, and a wrapper
function of
the form: new_params <== wrapper(old_params) which calls the dialog, and
returns
the updated params instance.
thanks,
Bri
u exit the interpreter, the script continues
from
where it left off. Is this possible in python?
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailma
Hello,
In my attempt to learn python, migrating from matlab, I have the following
problem.
Here is what I want to do, (with the wrong syntax):
from numpy import *
t=arange(0,20,.1)
x=zeros(len(t),'f')
idx=(t>5)
tau=5
x[idx]=exp(-t[idx]/tau) # <---this line is wrong (gives a TypeError)
#
Colin J. Williams wrote:
> Brian Blais wrote:
>> In my attempt to learn python, migrating from matlab, I have the
>> following problem. Here is what I want to do, (with the wrong syntax):
>>
>> from numpy import *
>>
>> t=arange(0,20,.1
Robert Kern wrote:
> The traceback tells you exactly what's wrong:
>
> In [7]: x[idx] = exp(-t[idx]/tau)
> ---
> exceptions.TypeError Traceback (most recent
> call
> last)
>
yes, I saw that,
Hello,
I have an odd kind of Heisenbug in what looks like a pretty simple program.
The
program is a progress bar code I got at the Python Cookbook:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/168639
(including the code below)
If you uncomment the one print statement I added in t
John Zenger wrote:
> It works fine for me. You must be having an indentation problem.
>
> Also, get rid of the comma at the end of that last print statement.
>
> Brian Blais wrote:
>> Hello,
>>
>> I have an odd kind of Heisenbug in what looks like a pretty simpl
lse anyone needs to know, I'll post it. I put the main
script,
and a dohebb.pyx code below.
thanks!
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
# Main scrip
an I get the line number in "somefile.py" where the error occurs? When I
do the
above, I get the line number in the script which calls execfile instead.
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
t has
an infinite loop, I don't want to freeze at that point. If it helps, this part
of
the code is already running in a thread, so I guess I could time-out the thread
rather than the execfile. Is there an easy way to do that?
thanks,
Brian Blai
;this','hello','there','that']
The sort method on lists does in-place sorting. Is there a way to do what I
want here?
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
sturlamolden wrote:
>
> Typically a scientist need to:
>
> 1. do a lot of experiments
>
> 2. analyse the data from experiments
>
> 3. run a simulation now and then
>
unless you are a theorist! in that case, I would order this list backwards.
>
> 1. Time is money. Time is the only thing th
Robert Kern wrote:
>
> That said, we have an excellent array object far superior to Matlab's.
>
> http://numeric.scipy.org/
>
I'd like to ask, being new to python, in which ways is this array object far
superior
to Matlab's? (I'm not being sarcastic, I really would like to know!)
I've hear
dict, and take out all of the non-pickleable objects? I could
replace them with something else (a tag of some sort, for me to reconstruct
things
later).
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.
equence field? Am I thinking about this correctly?
Is there a resource I can read that goes through any of this?
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 30, 2007, at 2:31 AM, felix seltzer wrote:
> Does any one know of a good matlab interface?
> I would just use scipy or numpy, but i also need to use
> the matlab neural network functions. I have tried PyMat, but am
> having
> a hard time getting it to install correctly.
>
What problems
led". I have no idea
how to
get this to point to a python function, so I can make the AdxList.OnUpdate call
python code.
Is there a tutorial somewhere about this stuff, or is there a proper place to
ask
such questions?
thanks,
Brian Blais
--
--
ying
the code from Common into the other two directories, and making a link to the
Part1
directory in the Part2 so I can import it. There must be a better way, yes?
thanks,
Brian Blais
--
-
[
Carlos Hanson wrote:
> It looks like you need __init__.py in MyPackage. Then you can import
> starting with MyPackage. For example, you might use one of the
> following:
>
> import MyPackage
> from MyPackage.Common import *
> etc
>
that means that MyPackage must be in the sys path too?
for port 8080, or is
there
only one, and the two apps share it?
Are there any examples that show such a setup? I didn't see a CherryPy mailing
list,
so I'm posting here, but if there is somewhere else better I'd be glad to know!
fumanchu wrote:
> On May 22, 6:38 pm, Brian Blais <[EMAIL PROTECTED]> wrote:
>> I'd like to start trying out some cherrypy apps, but I've
>> been having some setup problems. I think I need some
>> bone-head simple example to clear my understanding. :)
&
fumanchu wrote:
>
> No, you're not missing anything; my fault. I wasn't very awake when I
> wrote that, I guess. Don't include the hostname, just write:
>
> sn = '/~myusername/apps'
> cherrypy.quickstart(Root(), sn, config)
>
yay! Thanks, that works perfectly.
rward,
practical, and pythonic solution out there.
Do others think like me here?
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
rections seems a bit daunting, and I don't want to mess up
something that is already there. Can someone help me?
thanks,
Brian Blais
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
nough to have the headers from the source of tcl? I just don't want
to break something that is already there.
thanks!
bb
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
it isn't
portable, so I'd like to learn how I am supposed to do it.
thanks,
Brian Blais
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
responses from people who have experience teaching programming
in
elementary/middle (or even high) school. Do graphical languages make a big
difference? Do text-based languages put up barriers to young learners? Is it
no big
deal either way?
thanks,
nt to save user-
configuration files, is there a recommended procedure/place for these?
thanks,
Brian Blais
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
readability of it:
value='Even'
other_value='Odd'
for i, (id,name) in enumerate(result):
stringBuffer.write('''
%d
%s
''' % (value,id,name)
value,other_value=other_value,value # swap the value
def main():
a=10
# comment at the end of the file
it seems like a comment at the end breaks the parse command, but not
parseFile. Is this reproducible by others?
am I doing something wrong?
thanks,
Brian Blais
--
Brian Blais
[EMAIL PROTE
On Oct 21, 2007, at Oct 21:1:15 PM, Gabriel Genellina wrote:
En Sun, 21 Oct 2007 13:36:46 -0300, Brian Blais <[EMAIL PROTECTED]>
escribi�:
I am experiencing a problem with the compiler module. Is this a bug,
or am I doing something wrong?
I think it's a well-known fact...
it s
On Oct 21, 2007, at Oct 21:2:05 PM, Gabriel Genellina wrote:
The parseFile function does exactly that, along with this comment:
thanks!
bb
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
E" to start editing it directly.
You shouldn't save things as .txt, because then IDLE will not recognize it is
python
you are writing, and the right-click trick probably won't work either. You
should
never use Notepad, because it is just icky, and doesn't know about any
pro
ck out the cool new features.
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
ctant to make changes...it took me a couple months
to get
them to upgrade to 2.4 from 2.3 last year, even when 2.5 was out.
thanks,
Brian Blais
--
-
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
Jorge Vargas wrote:
> On 2/20/07, Brian Blais <[EMAIL PROTECTED]> wrote:
>> I was wondering if there is a way to run CherryPy/Turbogears on a
>> server that I don't
>> have root access to.
>
> I have never run ANY webapp as root. you should follow that adv
putting a lot of time into
the development.
Any advice for this sort of thing?
Brian Blais
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
of thing, preferably customizable in Python? I can be more
specific about my requirements if that would help.
thanks,
Brian Blais
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
t is implemented. So when
you say:
a=1
it is *really* a pointer to a 1-object, and that
b=1 points to the same 1-object.
In [4]:id(a)
Out[4]:25180552
In [5]:b=1
In [6]:id(b)
Out[6]:25180552
bb
--
Brian Blais
[EMAIL PROTECTED]
http://web.brya
if Touched(): break
but somehow that feels wrong to me, like bypassing the point of the
while: all that power to check for conditions, and you just use it to
check True, and then use a break inside. It's readable, I guess, but
not a programming construct I am immediately drawn to.
out the mex documentation.
Or, you can use Python with numpy for matrices, and use Pyrex for the
c-extensions and make your life a *lot* easier.
bb
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo
ght
3) activepython
Are there advantages/disadvantages? I have used enthought before, but it seems
as if
they are not at 2.4, and may lag behind in versions (which may not be a bad
thing).
Any other recommendations?
thanks,
Brian
Alex Pavluck wrote:
> I am just learning Python and I am using the book, "Thinking like a
> Computer Scientist". There is an exercise that I am not able to get
> working and it is really easy so I thought I would ask for help here.
>
>
> Q: As an exercise, write a single string that:
> Procu
on="Here is a description",
author="Brian Blais",
ext_modules=[
Extension("myproject/train",["myproject/train.pyx"]),
],
packages=['myproject'],
cmdclass = {'build_ext': build_ext}
)
and my project has one directory, m
Brian Blais
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
convenient would be avi, mov, and flv (for youtube videos).
thanks,
Brian Blais
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
What is Eliza?
You: What is Eliza?
Eliza: Does that question interest you?
(http://www-ai.ijs.si/eliza/eliza.html)
bb
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
cking around with the IDLE code
something easy, or a bit of a challenge?
thanks,
Brian Blais
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
Perl's
CGI::Application?
Or would it just be better to roll my own?
I'd strongly suggest webpy (http://webpy.org/). It is easy, works
with CGI, FastCGI, etc... or you can run its own built-in server.
It's very nice!
bb
--
Brian Blais
bbl...@
esn't show. What I did was
to manually edit the file:
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/
idlelib/config-main.def
to include the lines:
font= monaco
font-size= 13
font-bold= 0
(can't remember what the default was).
bb
apps with it.
bb
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
dvice already posted, by
running it directly from the commandline. Another hack is to put:
x=raw_input("pausing...")
at the end of your script, but this is really a hack and it would be
better to use a different solution.
bb
--
Brian Blais
bbl...@
you should be able to right-click and choose Edit/Paste. Not too
convenient, but I think it works.
bb
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
ot;possibly missing 'self' argument."
bb
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
/writing/snake-wrangling-for-kids/
it's specifically for Python, and geared for the age of your son.
bb
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
t use numpy:
from numpy import *
def normal(x):
return x/sqrt(x.sum())
or something like that.
bb
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
go to www.enthought.com and they have a single-download package
geared specifically for scientists.
bb
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
YZ","ABC"])
In [2]:sortedList = unsortedList.sort()
In [3]:print sortedList
None
In [4]:print unsortedList
['ABC', 'XYZ']
or, better, just:
In [5]:unsortedList = list(["XYZ","ABC"])
In [6]:unsortedList.sort()
In [7]:print unsortedList
[
t for more details.
bb
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
won't work: it doesn't mutate the
objects at all. In the case of a list or a dict, then one can mutate
them, and the changes are seen in the caller. In both cases, the
object itself is passed the same way.
bb
--
Brian Blais
bbl...@bryant.edu
http://web
.
bb
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
he
program, because the flow jumps around. It's not just about
aesthetics, but about being able to work with a piece of code.
bb
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 19, 2009, at 4:35 , Hendrik van Rooyen wrote:
Brian Blais wrote:
On Apr 18, 2009, at 5:44 , Hendrik van Rooyen wrote:
to untangle some spaghetti code. He did not mention if
the spaghetti was actually doing it's job, bug free, which
IMO is the only rational test for the qu
g war.
Jean-Michel
I've heard notepad is pretty good. http://www.notepad.org/
I'm sorry, but ed is the standard editor[1]. :)
bb
[1] http://en.wikipedia.org/wiki/Ed_(text_editor)
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bbl
http://wiki.python.org/moin/PythonEditors
and see how it works for you. Depending on what you need, and how
they "feel", you may find what you want with a free editor.
bb
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bbl
0+0.1*cos(t)
y=y0+0.1*sin(t)
if t==0: # first time calling
h=plot(x,y,'o')
else:
h[0].set_data(x,y)
draw()
bb
--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
moving code from Matlab. I
haven't regretted it since.
bb
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
--
http://mail.python.org/mailman/listinfo/python-list
s:
filename='my/path/way/%s/my_file.txt' % x
fid=open(filename,'r')
also, make sure that you do mean the relative path my/path/way/...
# in current folder
as opposed to the absolute path: /my/path/way
# in root folder
bytes more, but
no copy
after this, my python process takes about 80 meg. names like
big_object are just names, and they reference an object in memory.
if you say a=big_object, you are saying that the name "a" should also
reference that same object.
1 - 100 of 138 matches
Mail list logo