1234567891011121314151617181920212223242526272829303132 |
- from flask import Flask, render_template, request, redirect, jsonify
- import requests
-
- from flask_sqlalchemy import SQLAlchemy
-
- import datetime
- import json
- import urllib.request
- import os
- import csv
- import sys
- from time import sleep
- from random import sample
- i = 0
- listOfFood = [1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 13, 15, 16, 17, 18, 19]
- while(i < 30):
- randomList = sample(listOfFood, 4)
- url = 'http://136.145.231.48:5000/papelonDeComida'
- data = [{'nombre': 'Prueba',
- 'celular': '(787)-969-0474',
- 'ordenCompleta': {
- 'order1': randomList[0],
- 'order2': randomList[1],
- 'order3': randomList[2],
- 'order4': randomList[3]},
-
- 'peticiones': {
- }}]
- response = requests.post(url, json=data)
- print(response)
- i += 2
- sleep(1)
|