Re: PyChart into web site error



On 2005-04-13, Michele Petrazzo <michele.petrazzo@xxxxxxxxxxxxxx> wrote:
> Lee Harr wrote:
>> On 2005-04-12, Michele Petrazzo <michele.petrazzo@xxxxxxxxxxxxxx> wrote:
>>
>>>I'm using PyChart like a module for create charts into a little web
>>>site, but when I try to create one, I have this error:
>>>
>>>/var/www/html/lgt/draw.py:19, in draw:
>>>can = canvas.init(self.file_name)
>>>/usr/lib/python2.3/site-packages/pychart/canvas.py:60, in init:
>>>can = pngcanvas.T(fname)
>>>/usr/lib/python2.3/site-packages/pychart/pscanvas.py:25, in __init__:
>>>basecanvas.T.__init__(self)
>>>/usr/lib/python2.3/site-packages/pychart/basecanvas.py:70, in __init__:
>>>self.title = re.sub("(.*)\\.py$", "\\1", sys.argv[0])
>>>
>>>AttributeError: 'module' object has no attribute 'argv'
>>>
>>>Why my script doesn't have sys.argv?
>>>
>>>Is there another way to use PyChart into my script?
>>>
>
>
>> You are probably going to have to give more details.
>>
>> Is there a file in your html/lgt folder called sys?
>
> No.
>
> >>> os.listdir('/var/www/html/lgt/')
> ['engine.py', 'db.py', 'index.spy', 'linetest.py', 'index.html',
> 'db_mysql.py', 'mysession.spy', 'cds.html', 'templates', 'tmp', 'draw.py']
> >>>
>
>>
>> How are you serving the pages?
>
> Apache 2.0.48, mod_python 3.1.3 and Python 2.3.3
> on my mdk 10.0
>


Have you tried just running the script from the command
line and not through mod_python?

If that works, there may be some security setting in
mod_python that restricts access to certain modules.
You might want to ask on a more mod_python oriented
list....
http://mailman.modpython.org/mailman/listinfo/mod_python

.



Relevant Pages

  • RE: Print all charts in a workbook (multiple worksheets)
    ... Thanks, John, but this script prints each page one at a time - which is fine ... when printing to a printer, but when printing to a file it creates ... one file containing all charts, with each chart printing full page. ...
    (microsoft.public.excel.charting)
  • Re: AWK problem need help
    ... The script is as follows: ... printf ("PAT:%s\n", $prev) ... The latter would print the field at whatever position "var" contains, and the whole record if var is zero or unset. ... Also, you don't need the " " as the final argument to splitas that's the default, and awk arrays start at 1, not 0 so "lastline" will always be empty. ...
    (comp.unix.shell)
  • RE: Print all charts in a workbook (multiple worksheets)
    ... John Mansfield ... > when printing to a printer, but when printing to a file it creates ... I'm hoping to find script which prints ... > one file containing all charts, with each chart printing full page. ...
    (microsoft.public.excel.charting)
  • Re: Creating charts?
    ... >script this if possible. ... >excel charts via cmd or some reskit util, ... Hello Henry, ... For help on nt commands enter in a cmd window: ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Rules Wizard - delay in running VBA macro
    ... My box is not under any load, ... assumption is the script should fire immediately. ... Jim ... Prev by Date: ...
    (microsoft.public.office.developer.outlook.vba)