ask help for a proble with invalid syntax

2009-10-13 Thread leo zhao
I  try to a run a python numpy programe, however the python can't run
this program.
my python version is 2.6.2 , numpy  version is 1.3.0, however, the
program can run in previous numpy version(1.2.0), who can help me to
solve the problem, I will deeply appreciate!
the program is below:



import sys
import os
from datetime import *
from random import *
from numpy import *
import py4cs.multipleloop as mp


class ConsProd(object):
total_production =[0.0,0.0,0.0]
tech = 1.0
goods =['z','x','y']
def __init__(seld,identifier):
self.identifier = identifier
self.demand_veector = array([0.0,0.0]
if len(G.cps1) > number_of_1individuals:
   self.make = ConsProd.goods[0]
   self.tech = ConsProd.tech
   self.gross_production = (self. tech*G.L,0.0,0.0)
   ConsProd.total_production[0] += self.gross_production
[0]
   G.cps1[self] = self.gross_production[0]
elif number_of_1individuals >= len(G.cps1) and len(G.cps2) <
number_of_2indibiduals:
   self.make = ConsProd.goods[1]
   self.tech = ConsProd.tech
   self.gross_production = (0.0,self. tech*G.L,0.0)
   ConsProd.total_production[1] += self.gross_production
[1]
   G.cps2[self] = self.gross_production[0]
else:
   self.make = ConsProd.goods[2]
   self.tech = ConsProd.tech
   self.gross_production = (0.0,0.0,self. tech*G.L)
   ConsProd.total_production[2] += self.gross_production
[2]
   G.cps3[self] = self.gross_production[2]

the hint is the small window at python:


syntax error:
There' an error in your program: invalid syntax.



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


ask a question about the module

2009-11-11 Thread leo zhao
when I run a program, it list the hint:



Could not import module "Gnuplot" - it is not installed on your
system. You need to install the Gnuplot.py package.
\easyviz\gnuplot_.py(41) :
Traceback (most recent call last):
  File "E:\study\python\commodity modle 10.23.py", line 3, in 
import multipleloop as mp
  File "E:\study\python\multipleloop.py", line 81, in 
from scitools.misc import str2obj
  File "C:\Python26\lib\site-packages\scitools\__init__.py", line 67,
in 
import sys, std
  File "C:\Python26\lib\site-packages\scitools\std.py", line 26, in

from scitools.easyviz import *
  File "C:\Python26\lib\site-packages\scitools\easyviz\__init__.py",
line 1819, in 
exec(cmd)
  File "", line 1, in 
  File "C:\Python26\lib\site-packages\scitools\easyviz\gnuplot_.py",
line 42, in 
import Gnuplot
ImportError: No module named Gnuplot


the above is the hint from python window, I know Gnuplot is a software
and it can help us to make graphs, however, after I download Gnuplot
and run it, the problem still exist. Is there any expert can help me
solve this problem?
Thank you very much!
-- 
http://mail.python.org/mailman/listinfo/python-list