# Print all the values a function was called with to stdout (equivalent of python's \`inspect.getcallargs\`)?

**URL:** https://discourse.julialang.org/t/print-all-the-values-a-function-was-called-with-to-stdout-equivalent-of-pythons-inspect-getcallargs/67988
**Category:** General Usage
**Tags:** question, python
**Created:** [September 10, 2021, 3:13pm UTC](https://discourse.julialang.org/t/print-all-the-values-a-function-was-called-with-to-stdout-equivalent-of-pythons-inspect-getcallargs/67988 "2021-09-10T15:13:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mkarikom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkarikom/32/7096_2.png) [@mkarikom](https://discourse.julialang.org/u/mkarikom)
#### Post date: [September 10, 2021, 3:13pm UTC](https://discourse.julialang.org/t/print-all-the-values-a-function-was-called-with-to-stdout-equivalent-of-pythons-inspect-getcallargs/67988/1 "2021-09-10T15:13:13Z")

</div>

Looking for a lightweight way to print all of the following:

```julia
<arg/keyword-arg> .=> <value that was passed or default>

```

here is what the equivalent would be in python:

```julia
print(getcallargs(show_params, *args, **kwargs))

```

---

<div class="post-metadata">

### Author: ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)
#### Post date: [September 10, 2021, 7:47pm UTC](https://discourse.julialang.org/t/print-all-the-values-a-function-was-called-with-to-stdout-equivalent-of-pythons-inspect-getcallargs/67988/2 "2021-09-10T19:47:15Z")

</div>

Perhaps:

```julia
function foo(x, y)
    for (k, v) in Base.@locals
        println("$k => $v");
    end
end

julia> foo(1,2)
y => 2
x => 1

```
