About 699,000 results
Open links in new tab
  1. How to pass a JS variable as a parameter to a Python function

    May 21, 2023 · I'm trying to get my html+JS file to communicate with my python file, but I'm stuck on how to take a variable from the JS, use it as a parameter in a python function, and then store the python's output as a JS variable.

  2. How to pass python function argument to javascript

    Dec 16, 2020 · I am trying to execute Jupyter Notebook cell through Javascript code in .py file. The test function works fine for integers. But if i pass a string as argument, the function failed. Why integer is working but not string. what should i do to make the string working.

  3. Passing function as an argument in Python - GeeksforGeeks

    Mar 1, 2025 · By passing a function as an argument, we can modify a function’s behavior dynamically without altering its implementation. For Example: Explanation: process () applies a given function to text and uppercase () converts text to uppercase. Passing uppercase to process with “hello” results in “HELLO”.

  4. Pass a JavaScript function as parameter - Stack Overflow

    Nov 8, 2012 · How can I pass a function as a parameter in JavaScript? This then passes the function without executing it first. refreshCallback(); // You can also pass arguments if you need to. // refreshCallback(id); alert('Hello World'); Based on the question, the callback doesn't accept parameters, which is why I have left them out of the example.

  5. Pass function and arguments from node.js to Python

    Sep 4, 2022 · When we pass a list as an argument to a function in Python, it allows the function to access, process, and modify the elements of the list. In this article, we will see How to pass a list as an argument in Python, along with different use cases.

  6. Python-JavaScript Integration: Guide to WebAssembly and Node.js

    Jan 18, 2024 · Integrating Python functions into JavaScript enriches web applications with Python’s robust capabilities. Methods like WebAssembly and Node.js ‘child_process’ module facilitate this integration.

  7. Passing a condition as a function parameter? : r/learnpython - Reddit

    Jul 30, 2022 · You can pass functions as parameters, and also lambdas (anonymous functions). These differ in how you write them, and how they work. To pass a function, you can just pass the function without parameters. If the function needs parameters, you'll also need to pass these too, as separate parameters.

  8. The arguments object - JavaScript | MDN - MDN Web Docs

    Apr 10, 2025 · arguments is an array-like object accessible inside functions that contains the values of the arguments passed to that function. Note: In modern code, rest parameters should be preferred. The arguments object is a local variable available within all non- arrow functions.

  9. Pyscript/Pyodide and JS Object Passing - jeff.glass

    Aug 21, 2022 · ⚠️ Pass objects from Python running in PyScript to JavaScript, with a little extra work. See the commentary and live demo with the code sample below. For our purposes, an 'object' is anything that can be bound to a variable (a number, string, object, function, etc).

  10. Pass a function into another function as an argument, with

    Oct 31, 2022 · In order to make some of my assignment work, I need to be able to pass a function in as an argument to another function, but have some of the arguments already filled out. So for example, let’s say I wanted to pass the function “foo” to use in a function “bar”.

  11. Some results have been removed
Refresh