Advertisement
Glenpl

Untitled

Aug 14th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1. */
  2.  
  3.     std::cout << "ahoj\n";
  4.     try
  5.     {
  6.         Python py(argc, argv);
  7.         py.run_file("gut.py");
  8.  
  9.         std::string ilosc_pilkarzy = std::to_string(pilkarze_all.size());
  10.         py.run_string("ws1.cell(row = 1, column = 2, value = " + ilosc_pilkarzy + ")");
  11.         int r = 2;
  12.         for(auto gracz : pilkarze_all)
  13.         {
  14.             std::string row = std::to_string(r);
  15.             // brakuje ID
  16.             py.run_string("ws1.cell(row = " + row + ", column = 2, value = " + gracz["name"] + ")");
  17.             py.run_string("ws1.cell(row = " + row + ", column = 3, value = " + gracz["age"] + ")");
  18.             py.run_string("ws1.cell(row = " + row + ", column = 4, value = " + gracz["birth_city"] + ")");
  19.             py.run_string("ws1.cell(row = " + row + ", column = 5, value = " + gracz["birth_state"] + ")");
  20.             py.run_string("ws1.cell(row = " + row + ", column = 6, value = " + gracz["birth_date"] + ")");
  21.             r++;
  22.         }
  23.  
  24.         py.run_string("wb.save('document.xlsx')");
  25.     }
  26.     catch (Python_exception ex)
  27.     {
  28.         std::cout << "\nerr\n";
  29.         std::cout << ex.what();
  30.     }
  31.  
  32.     curl_global_cleanup();
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement