LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a python function with a filename parameter

I have been given a python function whose parameter is a filename.  
How do deal with the filename when the file data type is not supported?

I believe this is a common use case.  Basically I just need to know how to call a python function with a filename parameter.

 

I have tried to use a string (see code example below), but to no avail.  

 

I get Error 1667 occurred at Python Node in MyString.vi->Call MyString.vi

 

Python code

--------------------

import math
import numpy as np
from pathlib import Path

def load_my_file(my_string):
"""Loads a file and returns the name."""

    filepath = Path(my_string)
    return my_string

 

 

 

From Help >>>>

 

Python Node Details

Supported Data Types

The Python Node supports a large number of data types. You can use this node to call the following data types:

  • Numerics
  • Arrays, including multi-dimensional arrays
  • Strings
  • Clusters
  • Booleans
0 Kudos
Message 1 of 3
(113 Views)

LabVIEW node Path To String. That's it!

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 3
(87 Views)

Thank you.  I will check that out.

0 Kudos
Message 3 of 3
(33 Views)