<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic dcl / lexical functions / python in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075973#M38661</link>
    <description>If I interactively execute:&lt;BR /&gt;  sh log sys$output&lt;BR /&gt;I get:&lt;BR /&gt;  "SYS$OUTPUT" = "_RIPPLE$FTA40:" (LNM$PROCESS_TABLE)&lt;BR /&gt;&lt;BR /&gt;Likewise if I execute:&lt;BR /&gt;  output = f$trnlmn("sys$output")&lt;BR /&gt;  write sys$output "''output'"&lt;BR /&gt;I get:&lt;BR /&gt;  _RIPPLE$FTA40:&lt;BR /&gt;&lt;BR /&gt;I would like to create a Python interface to f$trnlmn.&lt;BR /&gt;&lt;BR /&gt;If I do:&lt;BR /&gt;  pipe = os.popen('f$trnlmn("sys$output")')&lt;BR /&gt;  output = pipe.read()&lt;BR /&gt;  err = pipe.close&lt;BR /&gt;  sys.stdout.write(output)&lt;BR /&gt;&lt;BR /&gt;I get (as expected):&lt;BR /&gt;  %DCL-W-IVERB, unrecognized command verb - check validity and spelling&lt;BR /&gt;   \F$TRNLMN\&lt;BR /&gt;&lt;BR /&gt;If I do:&lt;BR /&gt;  pipe = os.popen('output = f$trnlmn("sys$output)')&lt;BR /&gt;&lt;BR /&gt;It runs, but I don't know how to get the contents of 'output' back into the Python process?&lt;BR /&gt;&lt;BR /&gt;Suggestions?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;John&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 24 Oct 2007 13:06:29 GMT</pubDate>
    <dc:creator>John Tannahill</dc:creator>
    <dc:date>2007-10-24T13:06:29Z</dc:date>
    <item>
      <title>dcl / lexical functions / python</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075973#M38661</link>
      <description>If I interactively execute:&lt;BR /&gt;  sh log sys$output&lt;BR /&gt;I get:&lt;BR /&gt;  "SYS$OUTPUT" = "_RIPPLE$FTA40:" (LNM$PROCESS_TABLE)&lt;BR /&gt;&lt;BR /&gt;Likewise if I execute:&lt;BR /&gt;  output = f$trnlmn("sys$output")&lt;BR /&gt;  write sys$output "''output'"&lt;BR /&gt;I get:&lt;BR /&gt;  _RIPPLE$FTA40:&lt;BR /&gt;&lt;BR /&gt;I would like to create a Python interface to f$trnlmn.&lt;BR /&gt;&lt;BR /&gt;If I do:&lt;BR /&gt;  pipe = os.popen('f$trnlmn("sys$output")')&lt;BR /&gt;  output = pipe.read()&lt;BR /&gt;  err = pipe.close&lt;BR /&gt;  sys.stdout.write(output)&lt;BR /&gt;&lt;BR /&gt;I get (as expected):&lt;BR /&gt;  %DCL-W-IVERB, unrecognized command verb - check validity and spelling&lt;BR /&gt;   \F$TRNLMN\&lt;BR /&gt;&lt;BR /&gt;If I do:&lt;BR /&gt;  pipe = os.popen('output = f$trnlmn("sys$output)')&lt;BR /&gt;&lt;BR /&gt;It runs, but I don't know how to get the contents of 'output' back into the Python process?&lt;BR /&gt;&lt;BR /&gt;Suggestions?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;John&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Oct 2007 13:06:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075973#M38661</guid>
      <dc:creator>John Tannahill</dc:creator>
      <dc:date>2007-10-24T13:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: dcl / lexical functions / python</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075974#M38662</link>
      <description>'write sys$output f$trnlnm("sys$output")' in&lt;BR /&gt;the os.popen()?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; %DCL-W-IVERB [...]&lt;BR /&gt;&lt;BR /&gt;F$TRNLNM is not a command.  WRITE is.&lt;BR /&gt;&lt;BR /&gt;Note that it _is_ F$TRNLNM, not F$TRNLMN.&lt;BR /&gt;(TRaNslate Logical MiNnesota?)</description>
      <pubDate>Wed, 24 Oct 2007 13:19:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075974#M38662</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-10-24T13:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: dcl / lexical functions / python</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075975#M38663</link>
      <description>Steven,&lt;BR /&gt;&lt;BR /&gt;That's why the error was "expected".&lt;BR /&gt;&lt;BR /&gt;Sorry about the typo, everything else still holds.&lt;BR /&gt;&lt;BR /&gt;Still need to be able to get the contents of 'output' back into the Python process.&lt;BR /&gt;&lt;BR /&gt;John&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Oct 2007 13:52:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075975#M38663</guid>
      <dc:creator>John Tannahill</dc:creator>
      <dc:date>2007-10-24T13:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: dcl / lexical functions / python</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075976#M38664</link>
      <description>&amp;gt; 'write sys$output f$trnlnm("sys$output")' in&lt;BR /&gt;&amp;gt; the os.popen()?&lt;BR /&gt;&lt;BR /&gt;Did you try this instead?</description>
      <pubDate>Wed, 24 Oct 2007 13:56:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075976#M38664</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-10-24T13:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: dcl / lexical functions / python</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075977#M38665</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;Seems to me you are entirely on the wrong track here!&lt;BR /&gt;&lt;BR /&gt;I thought you wanted to get away from DCL?&lt;BR /&gt;[ &lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1159356" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1159356&lt;/A&gt; ]&lt;BR /&gt;&lt;BR /&gt;The F$stuff is strictly and only DCL and requires a process running DCL for you. Yuck!&lt;BR /&gt;&lt;BR /&gt;The F$Stuff is 99% directly built on real system services like SYS$TRNLNM.&lt;BR /&gt;&lt;BR /&gt;Just judging by the examples in the Jean-Francois' OpenVMS article those system services as nicely, directly, available in Python... so cut out the middle man (DCL).&lt;BR /&gt;See: &lt;A href="http://h71000.www7.hp.com/openvms/journal/v6/python-openvms-jfp.html" target="_blank"&gt;http://h71000.www7.hp.com/openvms/journal/v6/python-openvms-jfp.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;But what is worse... if you open a process, you'll talk to it via a pipe and the sys$output logical name for that process will not be same as the one you are trying to look up. It will point to a pipe (mailbox), not a terminal.&lt;BR /&gt;&lt;BR /&gt;You may want to check out 'get_logical'  in the Python Reference manual:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://vmspython.dyndns.org/docs/python_vms/installation_manual.html" target="_blank"&gt;http://vmspython.dyndns.org/docs/python_vms/installation_manual.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;dig dig dig dig&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Oct 2007 13:58:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075977#M38665</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-10-24T13:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: dcl / lexical functions / python</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075978#M38666</link>
      <description>Steven,&lt;BR /&gt;&lt;BR /&gt;Your suggestion worked.  Pretty straightforward, just didn't think of it.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;John&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Oct 2007 14:02:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075978#M38666</guid>
      <dc:creator>John Tannahill</dc:creator>
      <dc:date>2007-10-24T14:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: dcl / lexical functions / python</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075979#M38667</link>
      <description>Hein,&lt;BR /&gt;&lt;BR /&gt;Never fear, in the end the DCL will be gone, but  it will be a while.  Just taking baby steps right now.  Trying to understand things, etc.  I have no prior knowledge of the DCL code.&lt;BR /&gt;&lt;BR /&gt;Thanks for your suggestions,&lt;BR /&gt;John&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Oct 2007 14:05:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075979#M38667</guid>
      <dc:creator>John Tannahill</dc:creator>
      <dc:date>2007-10-24T14:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: dcl / lexical functions / python</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075980#M38668</link>
      <description>pipe = os.popen('write sys$output f$trnlnm("sys$output")') worked.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;John</description>
      <pubDate>Wed, 24 Oct 2007 14:11:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075980#M38668</guid>
      <dc:creator>John Tannahill</dc:creator>
      <dc:date>2007-10-24T14:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: dcl / lexical functions / python</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075981#M38669</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;import vms.rtl.lib&lt;BR /&gt;vms.rtl.lib.get_logical('SYS$OUTPUT')&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;import os&lt;BR /&gt;os.getenv('SYS$OUTPUT')&lt;BR /&gt;&lt;BR /&gt;will do the job,&lt;BR /&gt;&lt;BR /&gt;lib$get_logical puts something in the first 4 characters and then puts the logical translation, it's not a Python bug...&lt;BR /&gt;&lt;BR /&gt;getenv has not the problem.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;JF</description>
      <pubDate>Fri, 26 Oct 2007 02:35:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-lexical-functions-python/m-p/5075981#M38669</guid>
      <dc:creator>Jean-François Piéronne</dc:creator>
      <dc:date>2007-10-26T02:35:43Z</dc:date>
    </item>
  </channel>
</rss>

