python xput & xrun working differently in EViews 14?

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

amrsherif
Posts: 105
Joined: Mon Jul 23, 2018 4:34 pm

python xput & xrun working differently in EViews 14?

Postby amrsherif » Thu Nov 28, 2024 8:20 am

Hello,

I have been using an addin for the past several years. It passes an EViews string to python as a list, which then gets processed and data is returned back to EViews.

I am noticing that it does not work in EViews14.

my code is simple:
xput(name=series, ptype=list) input
xrun "data = fetch_2(series)"

I am getting a "NameError: name 'series' is not defined"

I get the same error if i try: xrun "print('series')"

Any ideas would be greatly appreciated.

EViews Steve
EViews Developer
Posts: 824
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: python xput & xrun working differently in EViews 14?

Postby EViews Steve » Thu Nov 28, 2024 12:20 pm

It looks like XPUT's name option is being ignored. Running your XPUT command is creating an object named 'input' instead of 'series'. This does not happen in EViews 13.

We'll get this fixed.

Steve

amrsherif
Posts: 105
Joined: Mon Jul 23, 2018 4:34 pm

Re: python xput & xrun working differently in EViews 14?

Postby amrsherif » Thu Nov 28, 2024 1:25 pm

Ok thanks. Will wait for the fix

EViews Steve
EViews Developer
Posts: 824
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: python xput & xrun working differently in EViews 14?

Postby EViews Steve » Mon Dec 02, 2024 2:40 pm

Fix has been released in today's 14 patch.

amrsherif
Posts: 105
Joined: Mon Jul 23, 2018 4:34 pm

Re: python xput & xrun working differently in EViews 14?

Postby amrsherif » Wed Dec 04, 2024 9:13 am

Thanks, but there is still an issue (my script still works in older versions but not 14).

Right now, i am calling back to python objects:
xget(type=series) datalist
xget(type=alpha) dateslist

printing the objects in python works: xrun "print(datalist[0:10])"

However, I cannot use them in EVIews after calling them.
I get an error: "datalist is not defined"


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests