Subject: Re: Sparky python extensions
From: dongyi2827
Date: May 13, 2008
Previous: 498
yes,thats the problem!
thanks a lot!
--- In nmr_sparky@yahoogroups.com , Jonathan Helmus jhelmus@... wrote:
It looks like your startup script isnt valid python code, specifically
when defining a function you need at least one executable statement.
Try changing
def initialize_session(session):
# pass
to
def initialize_session(session): pass
Also I think youll need to indent (one tab is enough) the following
lines:
import csi_output
csi_output.write_csi_shifts(s)
Cheers,
-Jonathan Helmus
Chemical Physics Graduate Student
Ohio State University
http://www.chemistry.ohio-state.edu/~jhelmus/
dongyi2827 wrote:
Hi,everyone,
when I do following the suggestions in the cis_output.py ,sparky gives
the error message below:
Traceback (most recent call last):
File
/usr/local/src/sparky/platforms/linux-2.6.9/sparky-install/python/sparky/pythonshell.py,
line 268, in invoke_module_function
File string, line 1, in ?
IndentationError: expected an indented block (sparky_init.py, line 14)
My sparky_init.py is:
#
-----------------------------------------------------------------------------
# When a Sparky session starts the initilize_session() routines are
invoked
# from the following files.
#
# sparky_site.py - site initialization file
# sparky_init.py - user initialization file
#
# Typically a user has a sparky_init.py file in ~/Sparky/Python.
# If they dont then this file (which does nothing) is loaded.
#
def initialize_session(session):
# pass
def CS_command(s = session):
import csi_output
csi_output.write_csi_shifts(s)
session.add_command(CS, AJP/Write CSI format shift file (CS),
CS_command)
anyone can give somr suggestions,thanks in advance!