Category : argv

I am trying to run a python script from my .bat file but I cannot pass the arguments. Please find my code below: .bat File set fileDestination = "homea.." set fileLocation = "homeb.." set fileName = "myFile.xlsx" "C:SwdtoolsPython3.6.3 X64Python" fileTransfer.py %fileDestination% %fileLocation% %fileName% fileTransfer.py import sys print(sys.argv[2]) The above print statement gives me IndexError: list ..

Read more

my code ofstream fout("output.txt"); class Cards{ public: char suit; int number; int visibilty; public: Cards(){ number=0; suit=’A’; visibilty=0; }; Cards(char suitName, int suitNumber, int cardVisibility){ suit=suitName; number=suitNumber; visibilty=cardVisibility; } //class function virtual void printIt(){ if(number<10&&visibilty==1&&suit!=’A’) fout << Cards::suit << 0<<Cards::number; else if(number>=10&&visibilty==1&&suit!=’A’){ fout << Cards::suit << Cards::number; } else if(suit==’A’){ } else fout<<"@@@"; } //creating ..

Read more

I have the following code: void parseOptions(int argc, char* argv[]) { std::string mob; int option, index; struct option long_options[] = {{"version", no_argument, 0, ‘V’}, {"mobile-interface", required_argument, 0, ‘m’}, {0, 0}}; while ((option = getopt_long(argc, argv, "Vm:", long_options, &index)) != -1) { switch (option) { case ‘V’: printVersion(); break; case ‘m’: if (strlen(optarg) == HASHED_MOB_SIZE) { ..

Read more