Search code examples
pythonsublimetext3

How to run function with variable of python in sublime


I write a program in python as following:

def describe_pet(animal_type, pet_name):
    print("\n I have a" + animal_type + ".")
    print("My" + animal_type + "'s name is " + pet_name.title() + ".")

It runs smoothly in sublime with ctrl+B, but I don't know how to input variable "animal type" or "pet_name" in sublime


Solution

  • Sublime text currently doesn't allow user input. See this forum post. You can develop a custom build to add this functionality as seen here, or you can install packages, which may make this possible. The last solution would be to use another IDE, such as VS Code.