python list problem

Błażej
2011-10-19
2012-11-18
  • Błażej

    Błażej - 2011-10-19

    Maybe it's the case of not knowing Python (i'm learning just now just because I want to write some scripts for SciDavis), but I want to make a list:

    nt=[265, 284, 297, 317, 360, 380, 393, 465]
    

    and I get an error:

    #> Undefined token "[265, 284, 297, 317, 360, 380, 393, 465];  " found at position 3.
    

    I don't know where I can be wrong, if it's my mistake.

     
  • Dominik K.

    Dominik K. - 2011-10-19

    Hi Błażej,

    your Python code is ok. You just need to activate the Python language: Double-click on Scripting > Scripting Language > Python. For starting with Python code in SciDAVis, please have a look in the user manual .

    Regards,

    Dominik

    http://scidavis.sourceforge.net/help/manual/x4705.html

     
  • Błażej

    Błażej - 2011-10-20

    Thank you. I just thought that if I switched it once (for another project), it will remain.
    But I have another question - when I'm trying to use importASCII it returns

    #> <type 'TypeError'>: importASCII() takes no keyword arguments
    

    but deleting all keyword arguments result just in empty table,

     
  • Dominik K.

    Dominik K. - 2011-10-22

    The error message means that you can't use function arguments in the way  > variable="value" <. Instead, you need to take only the values as arguments, like in C(++), because the internal SciDAVis function are written in C++. So, you have to stick to the order of the arguments.

    As an example, taken from the manual, write

    t.importASCII("data.csv", "\t", 0, False, True, False, False)
    

    instead of

    t.importASCII("data.csv", sep="\t", ignore=0, renameCols=False, stripSpaces=True, simplifySpace=False, newTable=False)
    

    .

    By the way: You can find a much more bigger SciDAVis Python reference in the 0.2 manual . Download the Tarball, extract all files and create the HTML files with GNU make. If you don't know how to do this, please tell me which system do you use, so I can hopefully help you.

    http://scidavis.svn.sourceforge.net/viewvc/scidavis/manual/0.2/

     
  • Błażej

    Błażej - 2011-10-22

    Vista.
    I downloaded GNU make but I don't know how to use that.

     
  • Błażej

    Błażej - 2011-10-23

    1. The make that was installed via Cygwin setup, was not working.
    2. Simple Google search returned this:
    http://cs.nyu.edu/rgrimm/teaching/fa05-oop/windows-make.html
    I installed the new make, although omitted the middle part about directories of OOP files (what are they)?
    3. The result is:

    "Nie można odnaleźć określonego pliku" means something like "File not found"

     
  • Błażej

    Błażej - 2011-10-23

    Alright, bad image link. Correct one:

     
  • Dominik K.

    Dominik K. - 2011-10-23

    Hi Błażej,

    I answered again at the other forum thread, because this is quite another, more general topic than a Python coding problem. So, please answer at the >other< thread if it now works for you. Sorry that I tell also easy steps and this might bother you. Its just I think of other readers which maybe benefit of these extra informations.

    Regards,

    Dominik

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks