File: interpreter.py

package info (click to toggle)
minetest-mod-pycraft 0.22-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,744 kB
  • sloc: python: 79,282; makefile: 10
file content (21 lines) | stat: -rwxr-xr-x 497 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# Code under the MIT license by Alexander R. Pruss
#
# Useful for checking which interpreter RaspberryJamMod's /py command is picking up.
#

import mc
import sys
import os

mc = mc.Minecraft()
mc.postToChat("Python interpreter "+sys.executable+" "+sys.version)
try:
    userName = os.environ['MINECRAFT_PLAYER_NAME']
except:
    userName = "unspecified"
try:
    userId = os.environ['MINECRAFT_PLAYER_ID']
except:
    userId = "unspecified"
mc.postToChat("Invoked by user "+userName+" "+userId)