problem with gnuplot in XP

2005-10-28 Thread Titi Anggono
Hi all,

I made 2 arrays, which are i and uzuy (both are
float). And I want to plot the graph between those
arrays.
 
I followed from the manual

==

from Gnuplot import Gnuplot, Data

g=Gnuplot()
results=Data(i,uzuy)

g.plot(results) 
=

here I got the message


Traceback (most recent call last):
  File "", line 1, in -toplevel-
g.plot(i,uzuy)
  File
"C:\Python23\Lib\site-packages\Gnuplot\_Gnuplot.py",
line 274, in plot
self.refresh()
  File
"C:\Python23\Lib\site-packages\Gnuplot\_Gnuplot.py",
line 215, in refresh
self(self.plotcmd + ' ' + string.join(plotcmds, ',
'))
  File
"C:\Python23\Lib\site-packages\Gnuplot\_Gnuplot.py",
line 199, in __call__
self.gnuplot(s)
  File
"C:\Python23\Lib\site-packages\Gnuplot\gp_win32.py",
line 125, in __call__
self.write(s + '\n')
IOError: [Errno 22] Invalid argument
==

FYI, I use python2.3 and Gnuplot-py-1.7. Any problems
with my code ??

Thanks





__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
-- 
http://mail.python.org/mailman/listinfo/python-list


need help with mod_python in RH 9

2005-06-21 Thread Titi Anggono
Hi all,

I use apache2.0, mod_python 3.0, and python2.2.2. In
/etc/httpd/conf.d/python.conf, I added following (as I
read in the manual)


AddHandler python-program .py
PythonHandler mptest
PythonDebug On


and create mptest.py under directory
/var/www/html/htdocs, (as I read in the manual)

from mod_python import apache
def handler(req):
  req.content_type="text/html"
  req.send_http_header()
  req.write("Hello World!")
  return apache.OK
---

when I use url
http://192.168.231.3/html/htdocs/mptest.py, I get the
code listing. Apache doesn't execute the file.

Could somebody tell me how to tell apache to execute
the code.




 
Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football 
http://football.fantasysports.yahoo.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: plot module

2005-07-12 Thread Titi Anggono
I just use Gnuplot for plot module. 
Maybe you can visit 
http://gnuplot-py.sourceforge.net/
or the mailing list 
http://lists.sourceforge.net/lists/listinfo/gnuplot-py-users

--- "Shankar Iyer ([EMAIL PROTECTED])"
<[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I am looking for documentation on the plot module. 
> Does anyone know where I can find this information? 
> Thanks.
> 
> Shankar
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
http://mail.python.org/mailman/listinfo/python-list


installing vrmlexport module ??

2005-07-13 Thread Titi Anggono
Hi all,

I've downloaded vrmlexport.py from:
http://www.andrew.cmu.edu/user/mzk/vrmlexport/
and install it under /usr/lib/python2.2/lib-old
directory using command:
python vrmlexport.py

I got the following error:
=
Traceback (most recent call last):
  File "vrmlexport.py", line 662, in ?
print export()
  File "vrmlexport.py", line 653, in export
povray_code += findframes(scene)
  File "vrmlexport.py", line 584, in findframes
vrml_objects += function(obj)
  File "vrmlexport.py", line 220, in export_box
if (new_axis.x!=0 or new_axis.y!=0 or
new_axis.z!=0):
UnboundLocalError: local variable 'new_axis'
referenced before assignment
===

Are there any suggestion ? (note, I am very new to
python :) )

Thanks

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to execute code when a module is imported ?

2005-08-01 Thread Titi Anggono
I tried
>>>foo.codetoexecwhenloaded()
and it worked

--- Arthas <[EMAIL PROTECTED]> wrote:

> How I do it?
> 
> I wanna execute some code when a module is imported:
> 
> -- foo.py --
> #!/usr/bin/env python
> 
> def codetoexecwhenloaded():
> print "bar"
> -- end of foo.py --
> 
> -- in console --
> 
> import foo
> 
> ^ and then it should print "bar"
> 
> Thanks, Arthas
> > -- 
> http://mail.python.org/mailman/listinfo/python-list





Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py2exe: no exe produced?

2005-08-14 Thread Titi Anggono
I never use python2.4, I use python 2.3 and here is
(maybe it works). For example,  the hello.py is under
directory
C:\Python23\latihan\
and put the setup.py under that directory
--
#setup.py
from distutils.core import setup
import py2exe

setup(console=["hello.py"])
---
C:\Python23\latihan>python setup.py py2exe


--- [EMAIL PROTECTED] wrote:

> I tried py2exe the latest version with python 2.4 on
> windows.
> 
> the setup script looks like this:
> ___
> 
> # setup.py
> from distutils.core import setup
> import py2exe
> 
> setup(name="Hello",
>   scripts=["f:\python\hello.py"],)
> 
> 
> 
> when I run the script, the output looks like
> 
> F:\Python>python setup.py py2exe
>

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
http://mail.python.org/mailman/listinfo/python-list


Tkinter and gnuplot module

2005-08-17 Thread Titi Anggono
Hi all,

I have some questions:

1. Can we use Tkinter for web application such as Java
?
2. I use gnuplot.py module for interfacing with
gnuplot in linux. Can we make the plot result shown in
web ? I tried using cgi, and it didn't work.

Thanks





Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 
-- 
http://mail.python.org/mailman/listinfo/python-list


Some questions

2005-08-18 Thread Titi Anggono
Hi all,

I have some questions:

1. Can we use Tkinter for web application such as Java
?
2. I use gnuplot.py module for interfacing with
gnuplot in linux. Can we make the plot result shown in
web ? I tried using cgi, and it didn't work.

Thanks




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re : how to show simulation at web

2005-06-06 Thread Titi Anggono
Here is my code in cgi.
=
#!/usr/bin/python

print "Content-Type:text/plain\n\n"

# python code here (create a simulation or graphics)


The python code is ok when I run it in executable file
.py. 

Friend told me to change the default header in
httpd.conf from text/plain to
application/octet-stream. But, still doesn't work.

thanks

Kern wrote:
>First, read this:
>
>http://www.catb.org/~esr/faqs/smart-questions.html
>
>Then, come back and give us some substantive
>information about your 
>problem. A small example of code that you think
should >work, but 
>doesn't, will help us help you.

>-- 
>Robert Kern
>rkern at ucsd.edu

>"In the fields of hell where the grass grows high
>  Are the graves of dreams allowed to die."
>   -- Richard Harter

Hallo wrote:
> hi all,
> 
> I have tried making a simulation with python. I want
it to be shown at 
> a web. It is ok when I run it. so, I decided using
cgi. but, when I try 
> it using a web browser it doesn't work.
> 
> Is it problem in the header or something else ?
> 
> If there are any suggestions about this problem, I
will be very happy.



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
http://mail.python.org/mailman/listinfo/python-list