banananas
Explore posts from serversMModular
•Created by banananas on 10/23/2024 in #questions
Creating files from code
Is there a way to create a file from code? I've tried using a python script:
then:
but I have been getting this error:
10 replies
MModular
•Created by banananas on 10/1/2024 in #questions
Using structs that inherit from a specific trait as a type?
If you have a trait and a struct that inherits from it, could you use that trait's children as a type in, for example, a list? E.g.:
15 replies
MModular
•Created by banananas on 9/28/2024 in #questions
Calling methods from list indexes
When I try running
update
from here:
It returns this error:
ComponentList
is defined here:
BaseComponent
is defined here:
18 replies
MModular
•Created by banananas on 9/25/2024 in #questions
Assigning additional traits to Variants
Is there a way to assign a trait to the
Variant
type? I'm specifically trying to use the __str__
method with List[Variant[types..]]
specifically.6 replies
MModular
•Created by banananas on 9/23/2024 in #questions
"Linking" structs together?
I'm not talking about inheritance from other structs, but is there a way to refer to other structs as well when referring to one of them? For example:
44 replies
MModular
•Created by banananas on 9/23/2024 in #questions
Is there a Struct type or something similar?
I'm trying to create a Set / List which can hold structs, but I'm not sure how to initialise this sort of type.
21 replies
MModular
•Created by banananas on 9/21/2024 in #questions
Using the .append() method on structs
I have the following code:
However, line 12 gives an error even though I think it should be valid. What is the proper syntax in this case?
10 replies
MModular
•Created by banananas on 9/15/2024 in #questions
Setting up SDL2 with Mojo on WSL
SDL is known for being notoriously hard to set up, and I only have experience with doing it in VS using NuGet (which is frankly a lot simpler). Does anybody know how to do it with Mojo and
DLHandle
?5 replies
MModular
•Created by banananas on 9/13/2024 in #questions
Removing a mojo project
Is there a way to remove a mojo project using the
magic
tool? in the directory doesn't seem to do anything.
Thanks in advance.6 replies
MModular
•Created by banananas on 9/13/2024 in #questions
Importing python modules
Whenever I try to import a python module using (
ctypes
used as an example) VSCode gives me an error saying the module is inaccessible, and running mojo [file]
says the same thing. I've checked and Python 3 is installed on both Windows 11 and WSL.
(Using WSL)
Thanks in advance.4 replies
MModular
•Created by banananas on 9/13/2024 in #questions
Adding a .mojo or .🔥file to a magic project
I've created a project using
but how could I add a file to this project / view its directory?
(Using WSL Ubuntu)
Thanks in advance.
5 replies
MModular
•Created by banananas on 9/11/2024 in #questions
Installing Mojo on WSL?
I've got WSL downloaded and I have been trying to install Mojo, but all the tutorials that I find seem to be outdated, and running
mojo
commands isn't possible after installing Magic. Can someone tell me how to install Mojo with WSL?7 replies