|
From: Joakim P. \(LD/EAB\) <joa...@er...> - 2005-12-19 14:47:43
|
Hello Ian and Rolf,
Good to hear from you Rolf and thanks for a nice open-source package! It
would be great if you could find sime time to have a look at the Python
2.3.5 problem.=20
Downgrading Python from 2.4.1 to 2.3.4 was a good workaround for me,
LabVIEW doesn't hang anymore when I close my script VIs. Thanks Ian for
the investigation!
The input() problem can actually be fixed: If the input is known before
execution or can be supplied through an external file, try redirecting
sys.stdin for example like this:
Test with stdin =3D "1\n" (supplied as a LabVIEW string).
--- script ---
try:
sys
except:
import sys
from StringIO import StringIO
version =3D sys.version
sys.stdin =3D StringIO ("".join (stdin)) # StringIO wants ASCII, LabVIEW
has UNICODE
sys.stdout =3D StringIO ()
sys.stderr =3D StringIO ()
print "Hi there!"
try:
x =3D input ("Wazzup?")
except:
sys.stderr.write ("Invalid input")
stdout =3D sys.stdout.getvalue ()
stderr =3D sys.stderr.getvalue ()
sys.stdin =3D sys.__stdin__
sys.stdout =3D sys.__stdout__
sys.stderr =3D sys.__stderr__
--- end script ---
Result: x =3D 1
Adding to a wishlist for labpython: A Variant data type in the pop-up
menu (on script node variables and the polymorphic "Python Set/Get data"
VI). Would be really great to have! Is this feasible Rolf?
Best regards,
Joakim
-----Original Message-----
From: lab...@li...
[mailto:lab...@li...] On Behalf Of Rolf
Kalbermatter
Sent: den 16 december 2005 20:24
To: lab...@li...
Subject: RE: [LabPython-Users] Hello
I Phillips wrote:
>I have tracked down the bug to Python 2.3.5.=20
>i.e. if you install any version upto and including Python 2.3.4, then
the bug isn't present.=20
>
>The big thing that sticks out in the python release between v.2.3.4 and
>v2.3.5 is a security patch
(http://www.python.org/security/PSF-2005-001/).
>"Note that these patches disable recursive traversal."=20
>
>I am not an expert in python or programming, but think that this may be
worth investigating.=20
>
>Are any of the original developers still subscribed to this user group?
>Would you see this as a possible issue?=20
I'm still subscribed and the main original developer but my time is
limited and labpython is not at the top of my priority list.
I will take a look at the mentioned patch when I have some time and see
if that might be the problem. I'm not specifically aware that I used
something called recursive traversal.
Instead I suspect something strange going on with the Python thread
protection or session management. Above mentioned patch might have some
indirect influence on these things though.
>A second bug I have found, is that if the python input("Please enter=20
>your name") command is used, and executed using the Labpython Execute
script.vi then Labview crashes.
This might be a hard one to fix. I suspect some issues with standard IO
clashes as python is really called as a client inside the LabVIEW
process and as such as no default standard IO anymore. Maybe that one
could provide some standard IO redirections going to dialog boxes or
such but that seems like a huge hassle.
Rolf Kalbermatter
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files for problems? Stop! Download the new AJAX search engine that
makes searching your log files as easy as surfing the web. DOWNLOAD
SPLUNK!
http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick
_______________________________________________
LabPython-Users mailing list
Lab...@li...
https://lists.sourceforge.net/lists/listinfo/labpython-users
|