args Questions
10
Solved
What if I wanted to parse this:
java MyProgram -r opt1 -S opt2 arg1 arg2 arg3 arg4 --test -A opt3
And the result I want in my program is:
regular Java args[] of size=4
org.apache.commons.cli.Op...
Hygrothermograph asked 7/9, 2011 at 23:43
4
Solved
This is what I'm looking for:
def __init__(self, *args):
list_of_args = #magic
Parent.__init__(self, list_of_args)
I need to pass *args to a single array, so that:
MyClass.__init__(a, b, c) =...
Selaginella asked 18/3, 2013 at 23:49
6
Solved
I have been googling almost an hour and am just stuck.
for a script, stupidadder.py, that adds 2 to the command arg.
e.g. python stupidadder.py 4
prints 6
python stupidadder.py 12
prints 14
...
6
Solved
How would you run a command and pass some custom arguments with Flutter/Dart so they can then be accessed in the main() call such as:
flutter run -device [my custom arg]
So then I can access it ...
Puri asked 5/3, 2019 at 13:45
2
Solved
I have a pandas dataframe 'df' with two columns 'A' and 'B', I have a function with two arguments
def myfunction(B, A):
# do something here to get the result
return result
and I would like to ...
1
I am new to the C# world but have seen other programming languages give access to command-line arguments from places like main function/method, sys.argv, etc.
It was unusual to see the following st...
Kerry asked 15/11, 2021 at 20:18
1
I cannot find any syntax that works. Even suggested solutions on stackoverflow do not work. Running them shows blank output where values are expected.
ENV variables are not persisted in the built i...
Thayer asked 30/8, 2021 at 21:46
6
Solved
I want to pass this JSON String to a Java class through command line arguments.
{"body": "We should definitely meet up, man", "startDate": "2014-05-29 11:00:00", "endDate": "2014-05-29 12:00:00...
Savagism asked 30/5, 2014 at 15:38
6
We can give parameter args[] to the main() method or choose not to. But if we would call any other parameterized method without passing enough arguments, it would give us an error.
Why it is not t...
Villanueva asked 6/9, 2011 at 5:32
1
Solved
The usage of *args and **kwargs in python is clear to me and there are many questions out there in SO (eg Use of *args and **kwargs and What does ** (double star/asterisk) and * (star/asterisk) do ...
Bunyan asked 19/10, 2020 at 7:43
1
Solved
I need the to somehow access the objectId from @Args inside the guard so as to check if the sender has the objectId assigned to his account. Any idea how I could implement it?
@Query(() => [Per...
3
Solved
Okay, I've tried searching for this for quite some time. Can I not pass args and kwargs to a view in a django app? Do I necessarily have to define each keyword argument independently?
For example,...
Azote asked 20/12, 2012 at 17:41
1
Solved
i want to pass some args i define in my .env file to the build process of my container
.env file:
OS_USER_UID=999
docker-compose:
app:
build: .
args:
- OS_USER_UID=$OS_USER_UID
but this ...
Pinhole asked 27/1, 2020 at 15:48
4
Solved
In Python, is it possible to get the command line arguments without importing sys (or any other module)?
6
Solved
I have this code:
public static void Main(string[] args)
{
if (string.IsNullOrEmpty(args[0])) // Warning : Index was out of the bounds of the array
{
ComputeNoParam cptern = new ComputeNoParam...
2
Solved
I'm new to docker/k8s world... I was asked if I could deploy a container using args to modify the behavior (typically if the app is working in "master" or "slave" version), which I did. Maybe not t...
Requisite asked 18/1, 2019 at 15:28
3
Solved
I'd like to pass a tuple (or maybe a list) to a function as a sequence of values (arguments). The tuple should be then unpacked as an argument into *arg.
For example, this is clear:
def func(*arg...
1
Solved
What is the use of * in .format(*)?
When using it in the format function below print(new_string.format(*sum_string)) it changes the value of sum_string in the output from 18 to 1
Why does that happ...
Chaddie asked 24/9, 2018 at 8:29
3
I would like to my function func(*args, **kwargs) return one dictionary which contains all arguments I gave to it. For example:
func(arg1, arg2, arg3=value3, arg4=value4)
should return one dicti...
Durwin asked 7/6, 2017 at 12:27
1
I'm trying upload multiple files with flask_restful, but can't get the files name list in the arguments except the first file name, how can i get the files list with args?
here is my code,
from ...
Alight asked 18/1, 2017 at 2:49
1
Solved
I need to pipe the result of "cat variousFiles" to a perl6 program while requiring the program to take different command line arguments. Perl6 seems to want to take the first argument as a file to ...
1
Solved
I need to store both args & kwargs in a tuple for calling later, so in that case would the appropriate value in the tuple *args or args? In other words, will this work:
def __init__(self, *arg...
Schmuck asked 12/11, 2016 at 16:11
2
def f(a, b, *args):
return (a, b, args)
f(a=3, b=5)
(3, 5, ())
whereas:
f(a=3, b=5, *[1,2,3])
TypeError: got multiple values for argument 'b'
Why it behaves like this?
Any particula...
Hailee asked 7/7, 2016 at 14:12
3
Solved
I have a Python class with a method which should accept arguments and keyword arguments this way
class plot:
def __init__(self, x, y):
self.x = x
self.y = y
def set_axis(self, *args, xlabel="...
Goodhen asked 22/12, 2012 at 15:14
1
Solved
I would like to write a Python script that takes some necessary positional and some optional command-line arguments via argparse:
Let's call the positional args a,b,c, and the optional arguments ...
Nudicaul asked 21/1, 2016 at 18:55
1 Next >
© 2022 - 2025 — McMap. All rights reserved.