Re: tutorial example

2005-11-12 Thread Ruben Charles
On 11/12/05, Max Erickson <[EMAIL PROTECTED]> wrote:
>
> Not in python.
>
> For example, what would you call the following?
>
> def rsum(n, m):
> print n+m
> return n+m
>
>
> In python a method is callable attached to an object. A function is a
> callable object constructed with a def statement.

You are right, i was trying to explain the concept outside the objects.

PD: I would call your example: a function. Without the return
declaration, a routine or a method.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: tutorial example

2005-11-12 Thread Ruben Charles
That is the diference between a method and a function.
A method do something and a function return something.

Example:

def psum(n, m):
print (n + m)

def rsum(n, m):
return (n +m)

Then try this...


>>>  psum(2, 3)

>>> a = psum(2, 3)

>>> a

>>> a = rsum(2, 3)

>>> a

You see it?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: testing C code with python

2005-11-11 Thread Ruben Charles
On 11/10/05, Peter Hansen <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > A simple question - Is it common/good practice to test C code using
> > Python? For example one could wrap individual C functions, and test
> > each of them using python, maybe not for low-level things but at least
> > for algorithmic correctness. Anyone effectively doing this as common
> > practice?

Take a look at swig.org

There are some examples for testing C code y python and/or extend
python with C functions.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need Python Pro for Help!! Plzz

2005-11-01 Thread Ruben Charles
> On the other hand, a group for learning that has no experts in it may
> tend to produce "what works" style of programming as oppsoed to "what is
> a good idea or practise".

What is better?

Good practise doesn't work better?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need Python Pro for Help!! Plzz

2005-10-31 Thread Ruben Charles
A stranger from the land of Woot came to Master Foo as he was eating
the morning meal with his students.

"I hear y00 are very l33t," he said. "Pl33z teach m3 all y00 know."

Master Foo's students looked at each other, confused by the stranger's
barbarous language. Master Foo just smiled and replied: "You wish to
learn the Way of Unix?"

"I want to b3 a wizard hax0r," the stranger replied, "and 0wn ever3one's b0xen."

"I do not teach that Way," replied Master Foo.



http://www.catb.org/~esr//writings/unix-koans/script-kiddie.html


On 10/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Need python Pro at [EMAIL PROTECTED] , if u wanna help, plz
> reply to that address. We are python beginners. need a real good
> Python Programmer for Help. TIA!!
> --
>  * Posted with NewsLeecher v3.0 Beta 7
>  * http://www.newsleecher.com/?usenet
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


[wxPython-users] Web based applications are possible with wxPython?

2005-10-18 Thread Ruben Charles
Hi,


I am reading some essays --http://www.paulgraham.com/avg.html "Beating
the averages"-- and i am very interested in the web-based
applications.

I want to take the advantages having the application on a server. Is
easy to update, maintain, etc...

My questions is

Can i have a wxPython GUI app available on a web browser?

I founded some doc on the www  but the most refers to GUI wrote in
java script and tool kits relates with java. Some java script samples
are interesting but is not what i am looking for.


There is a way for  having wxpython frames, dialogs etc on a web browser?

If not, can you suggest me any kind oh method for have something similar?


Thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list


[OT]Scipy plotting problems

2005-09-19 Thread Ruben Charles
Hi,

I'm using Scipy on Debian Gnu/Linux. (python2.3-scipy) in a program
that have to show plots but while i'm testing capabilities of the
three possible options (gplt, plt an xplt) a couple of questions comes
up.

--
plt:

If a follow the steps of the plotting tutorial everything seems ok in
the first try.

>>> import gui_thread
>>> gui_thread.start() # or gui_thread.wxPython_thread()
>>> from scipy import plt
>>> plt.plot((1,2,3))


But if i close the Plot frame (manually with the cursor) and try to plot again

>>> plt.plot((1,2,3))


The interpreter shows a message: "The C++ part of the code has been
deleted" and i canĀ“t plot again without exit the interpreter and back
again.


How i can solve that?



gplt (gnuplot):

If i create a plot with the Gnuplot program the resulting plot has
responses to mouse events and shows coordinates in the window but if i
create a plot in python

gplt.plot((1,2,3))

The window have not the same response to mouse events (no response at all).

How i can give the same responses?
___




Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Launching Python programs from Linux shell script

2005-09-09 Thread Ruben Charles
Yes...
-
Or... 
Add this line in de source:
#!/usr/bin/env python 
then
chmod +x myscript.py
./myscript.py


On 9 Sep 2005 08:31:27 -0700, Ernesto <[EMAIL PROTECTED]> wrote:
> Does anyone know how to start Python program(s) from a Linux shell
> script?  Is it just
> 
> $python myscript.py
> 
> ??
> 
> Thanks,
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list