this post was submitted on 04 Dec 2024
24 points (96.2% liked)

Programming

17651 readers
362 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
 

I am fairly new to programming and for my cs class i need to run individual programs. they don't need to interact with anything else, so i am trying to just run the file I'm currently on but Kate just greys out the option. I really want to avoid using projects if i can because they're just extra effort for no reason when I only need to run a single file. I did try using one, but Kate doesn't have a new project button for some reason and i had some trouble with Cmake.

I'm aware that these are actually pretty basic things, but I can't find anything online that actually explains how to use Kate at all. I would try using something else, but every IDE seems to have this same issue where by default it can't run code and it has no documentation of any kind regarding actually running code, so i'll just stick with the one that came with my distro.

also as a bonus question, why does every IDE seem to require you to configure every single option before it can run code and why do they all seem to discourage doing anything less than making an entire app?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 1 week ago* (last edited 1 week ago)

From my experience and understanding there are generally two ways to 'run' a file.

Firstly, the output is an executable itself. Assuming the permissions are valid you can just do ". /yourFile" and it'll just execute. If the file doesn't have the proper permissions, just do "chmod +x ./yourFile" to allow execution.

Secondly, some executables require you to run them through a specific program. Such as Java or Python. If Java, it'd be something like "java ./yourFile.jar" If Python, it'd be something like "python ./yourFile.py"

Sometimes it requires extra flags like "-jar" or similar. You just gotta look it up at that point. ¯_(ツ)_/¯

In Kate, you can toggle the terminal through a shortcut for easy access.