Skip to content
Discussion options

You must be logged in to vote

assumed that we could just import all the mission files, and then use the menu to select which one to run. While this would infact be trivial if we were using code, I can't figure out how to do it with blocks.

You can technically do that like this. The main program will be a Python listing of the file, but all the programs can use blocks as illustrated in that example.

(I can see this is confusing. In the mean time, we're working on alternatives to simplify this, no menu program required.)

Is there anyway to access the __name__ variable

I don't know exactly what you would like to build, but yes you could make an is_main block available to all your programs, like this:

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@derrickgw
Comment options

@laurensvalk
Comment options

Answer selected by derrickgw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants