python: fix test_python with python2.7

This commit is contained in:
Corentin Le Molgat
2018-08-30 10:11:24 +02:00
parent 09459919d1
commit 4320b494af
4 changed files with 4 additions and 8 deletions

View File

@@ -51,6 +51,7 @@
http://www.hakank.org/google_or_tools/
"""
from __future__ import print_function
import sys
from ortools.constraint_solver import pywrapcp

View File

@@ -40,11 +40,10 @@
http://www.hakank.org/google_or_tools/
"""
from __future__ import print_function
from ortools.linear_solver import pywraplp
def main(unused_argv):
# Create the solver.
# using CBC
@@ -97,6 +96,5 @@ def main(unused_argv):
print('walltime :', solver.WallTime(), 'ms')
# print 'iterations:', solver.Iterations()
if __name__ == '__main__':
main('coin grids')

View File

@@ -67,8 +67,8 @@
http://www.hakank.org/google_or_tools/
"""
from __future__ import print_function
import sys
from ortools.constraint_solver import pywrapcp
#

View File

@@ -1,15 +1,13 @@
from __future__ import print_function
from ortools.constraint_solver import pywrapcp
def main():
# Create the solver.
solver = pywrapcp.Solver('Vendors scheduling')
#
# data
#
num_vendors = 9
num_hours = 10
num_work_types = 1
@@ -96,6 +94,5 @@ def main():
print('branches:', solver.Branches())
print('WallTime:', solver.WallTime(), 'ms')
if __name__ == '__main__':
main()