We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2be1ff1 commit dc7209fCopy full SHA for dc7209f
+stdlib/hostname.m
@@ -10,10 +10,12 @@
10
if stdlib.has_dotnet()
11
n = System.Environment.MachineName;
12
% https://learn.microsoft.com/en-us/dotnet/api/system.environment.machinename
13
+elseif stdlib.has_java()
14
+ n = javaMethod("getLocalHost", "java.net.InetAddress").getHostName();
15
+elseif stdlib.has_python()
16
+ n = py_hostname();
17
elseif stdlib.isoctave()
18
n = gethostname();
-elseif stdlib.has_java()
- n = java.net.InetAddress.getLocalHost().getHostName();
19
end
20
21
try %#ok<*TRYNC>
+stdlib/private/py_hostname.m
@@ -0,0 +1,5 @@
1
+function n = py_hostname()
2
+
3
+n = py.socket.gethostname();
4
5
+end
0 commit comments