Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7902039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:23:31+00:00 2026-06-03T09:23:31+00:00

Im trying to fire a python function using a button created with MEL. So

  • 0

Im trying to fire a python function using a button created with MEL.
So I just wanted to know whether or not im understanding the docs correctly, so I just used a simple print call to test whether or not im correct in my assumption; this is what I tried out:

button -label "TransX" -w 100 -c python ("print 'Hello You!'");

However this won’t fire at all (or if it does, it’s doing something different than printing it in the script editor :/)

Even more curious to me was that if I wrapped it up in ticks like this:

button -label "TransX" -w 100 -c `python ("print 'Hello You!'")`;

it fired immediately (upon sourcing) and not while pressing the button.
If anyone could explain that behaviour, that would be neat.

So what it boils down to is this:
1.How do I run a python function using mel properly?
2.Why the heck does the wrapping in ticks fire the python immediately?

Thx for your help 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:23:32+00:00Added an answer on June 3, 2026 at 9:23 am

    Using backticks will evaluate the contents as it’s being executed, thats why you are seeing the print statement as soon as you run it

    The first command doesn’t work because you aren’t encoding the argument to the “-c” flag properly, it should be like this :

    button -label "TransX" -w 100 -c "python(\"print hello\");";
    

    This way everything between the quotes gets passed to the “button” command to be used with the “-c” flag, and thats why you have to escape the inner quotes, so when the button command evaluates it, it will be evaluated as :

    python("print hello");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to fire an event from a unmanaged function using a pointer
I'm trying to fire a new event I created for when a button is
I am new to jQuery and am trying to fire a function on a
I am trying to fire Update Query using cfquery like below <cfquery name =
I'm trying to fire a function when the keyup event happens. This works fine
I was just trying to fire an event after the qooxdoo application is ready,
im trying to fire a function when a div reaches a certain level in
I am trying to fire a second jquery function after my Fancybox is completely
I'm trying to fire hyperlinks in a JEditorPane using the Enter keystroke. So that
I'm trying to fire custom events using jquery but for some reason I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.