<?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 Re: How to use gethostbyname with max script in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-gethostbyname-with-max-script/m-p/11490096#M3602</link>
    <description>&lt;P&gt;Your simplified example works (once the function call is completed with parentheses), what does the complete code that gives you errors look like?&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 10:30:27 GMT</pubDate>
    <dc:creator>Swordslayer</dc:creator>
    <dc:date>2022-10-18T10:30:27Z</dc:date>
    <item>
      <title>How to use gethostbyname with max script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-gethostbyname-with-max-script/m-p/11485583#M3601</link>
      <description>&lt;P&gt;If I wanted to get the IP address of my Windows PC in Python, I would use the following code&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import socket
host = socket.gethostname()
ipaddress = socket.gethostbyname(host)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to do this in Max Script, so I wrote the following code, but it did not work.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;socket = python.import "socket"
host = socket.gethostname
ipaddress = socket.gethostbyname host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message is this&lt;/P&gt;&lt;LI-CODE lang="general"&gt;-- Error occurred in anonymous codeblock; filename: ; position: 14; line: 1
-- Type error: Call needs function or class, got: undefined
-- MAXScript callstack:
--	thread data: threadID:24508
--	------------------------------------------------------
--	[stack level: 0]
--	In top-level
-- Error occurred in anonymous codeblock; filename: ; position: 43; line: 2
-- Unknown property: "gethostname" in undefined
-- MAXScript callstack:
--	thread data: threadID:24508
--	------------------------------------------------------
--	[stack level: 0]
--	In top-level
-- Error occurred in anonymous codeblock; filename: ; position: 75; line: 3
-- Unknown property: "gethostbyname" in undefined
-- MAXScript callstack:
--	thread data: threadID:24508
--	------------------------------------------------------
--	[stack level: 0]
--	In top-level&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I use gethostbyname?&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 03:39:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-gethostbyname-with-max-script/m-p/11485583#M3601</guid>
      <dc:creator>YASUSHI_EMOTO</dc:creator>
      <dc:date>2022-10-16T03:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use gethostbyname with max script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-gethostbyname-with-max-script/m-p/11490096#M3602</link>
      <description>&lt;P&gt;Your simplified example works (once the function call is completed with parentheses), what does the complete code that gives you errors look like?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 10:30:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-gethostbyname-with-max-script/m-p/11490096#M3602</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2022-10-18T10:30:27Z</dc:date>
    </item>
  </channel>
</rss>

