roblox-pyc
Docs | Devforum | Github | Tests/Examples | Discord
What is it?
roblox-pyc is like roblox-ts, a library dedicated to added more language functionality to roblox that includes:
- Script editor
- Syntax highlighting
- Error detection
- Warning detection
- Class support
- Function support
- All of the built in functions reprogrammed
- Python list, dict, string reprogrammed in lua.
- Slice support
- Case support
- Supports all VScode sync, including Argon, Rojo.
- pip library support
- Full python 3.13 support
- CLI
- Async function support
- bytes, int, floats etc. support
and way, way more.
Find out the entire list of stuff added in the replies and todo at the end of this post.
Example:
(using 1.0.0, code will have differences from performance improvements and predictive headers if done in current version.)
Python code
"""
Person class:
"""
class Person:
name = []
def set_name(self, user_name):
self.name.append(user_name)
return len(self.name) - 1
def get_name(self, user_id):
if user_id >= len(self.name):
return 'There is no such user'
else:
return self.name[user_id]
person = Person()
print('User Bob has been added with id ', person.set_name('Bob'))
print('User associated with id 0 is ', person.get_name(0))
"""
Print numbers 1-10
"""
for i in range(10):
print(i)
"""
Test the roblox api, change Baseplate color to green after 5 seconds
"""
task.wait(5)
workspace.Baseplate.Color = Color3.new(0,1,0)
Output
--// Compiled using Roblox-py \\--
------------------------------------ BUILT IN -------------------------------
local stringmeta, list, dict, staticmethod, class, range, __name__, len, abs, str, int, sum, max, min, reversed, split, round, all, any, ord, char, callable, zip, float, format, hex, id, map = unpack(require(game.ReplicatedStorage["Roblox.py"])(script))
-----------------------------------------------------------------------------
--[[
Person class:
]]
local Person = class(function(Person)
Person.name = list {}
function Person.set_name(self, user_name)
self.name.append(user_name)
return (len(self.name) - 1)
end
function Person.get_name(self, user_id)
if (user_id >= len(self.name)) then
return "There is no such user"
else
return self.name[user_id]
end
end
return Person
end, {})
local person = Person()
print("User Bob has been added with id ", person.set_name("Bob"))
print("User associated with id 0 is ", person.get_name(0))
--[[
Print numbers 1-10
]]
for i in range(10) do
print(i)
end
--[[
Test the roblox api, change Baseplate color to green after 5 seconds
]]
task.wait(5)
workspace.Baseplate.Color = Color3.new(0, 1, 0)
Headers are not going to be so long because of predictive headers.
Conclusion
I have been working on this project for a long time, It still isn’t complete but I wanted to just upload it so people can try it out and test it. You can read my goals in the TODO section below and answering my poll will be greatly appreciated.
TODO:
- pip libraries support
- game wrapper in python.
- C support (almost done)
Poll
- Yes
- No
- Probably
0 voters
- Looks good
- Could be better
- Other - comment
- Lacks features
- Bad idea
0 voters
I would greatly appreciate it if you comment in this post with suggestions or criticism
Thanks for your time and goodbye