Open vinoshuai-NLP opened 2 years ago
This part of code is kind of old and wouldn't run, if you want to use it through python, you might want to refer to colab files, not py files in the project.
Could you tell me where it is? Since I would like to build the tree by myself, then run the solver. Thanks
Could you tell me where it is? Since I would like to build the tree by myself, then run the solver. Thanks
It's possible. Follow the ipynb file above.
Building tree by python is also possible, I would refer to https://github.com/bupticybee/TexasHoldemSolverJava/blob/master/src/test/resources/python/java_interface.py#L97
Please take a look.
Hi @bupticybee, thanks for all the work you have put into this project. It's awsome!
I've tried to follow the colab files to run a python script on windows and am stuck unfortunately. Setting the global, flop, turn and river settings all seem straight forward python. When I get to start solving, I run into problems and am not sure if there is a way to directly call the windows TexasSolver files or try do it directly through the console?
I tried through the console by adding different methods from subprocess with no luck:
from subprocess import Popen, PIPE
p = Popen([../TexasSolver-v0.2.0-Windows/console_solver.exe, '-i', '../TexasSolver-v0.2.0-Windows/resources/text/commandline_sample_input.txt'], stdout=PIPE, stdin=PIPE)
Any help or direction on to how I could use the solver and access the results in a python script on windows would be great? Thanks again.
Hi @bupticybee, thanks for all the work you have put into this project. It's awsome!
I've tried to follow the colab files to run a python script on windows and am stuck unfortunately. Setting the global, flop, turn and river settings all seem straight forward python. When I get to start solving, I run into problems and am not sure if there is a way to directly call the windows TexasSolver files or try do it directly through the console?
I tried through the console by adding different methods from subprocess with no luck:
from subprocess import Popen, PIPE
p = Popen([../TexasSolver-v0.2.0-Windows/console_solver.exe, '-i', '../TexasSolver-v0.2.0-Windows/resources/text/commandline_sample_input.txt'], stdout=PIPE, stdin=PIPE)
Any help or direction on to how I could use the solver and access the results in a python script on windows would be great? Thanks again.
Hmm, wired problem. First I'm not sure what kind of error you get here, suggest also paste all the error.
Second, without the "-i" option, the solver would auto load compair file and wait for stdin, and now if you feed the content of the config file(in your case, commandline_sample_input.txt) directly into the stdin, the solver will start to solve, and it's the suggested way to run under script.
Hi @bupticybee, thanks for all the work you have put into this project. It's awsome! I've tried to follow the colab files to run a python script on windows and am stuck unfortunately. Setting the global, flop, turn and river settings all seem straight forward python. When I get to start solving, I run into problems and am not sure if there is a way to directly call the windows TexasSolver files or try do it directly through the console? I tried through the console by adding different methods from subprocess with no luck:
from subprocess import Popen, PIPE
p = Popen([../TexasSolver-v0.2.0-Windows/console_solver.exe, '-i', '../TexasSolver-v0.2.0-Windows/resources/text/commandline_sample_input.txt'], stdout=PIPE, stdin=PIPE)
Any help or direction on to how I could use the solver and access the results in a python script on windows would be great? Thanks again.Hmm, wired problem. First I'm not sure what kind of error you get here, suggest also paste all the error.
Second, without the "-i" option, the solver would auto load compair file and wait for stdin, and now if you feed the content of the config file(in your case, commandline_sample_input.txt) directly into the stdin, the solver will start to solve, and it's the suggested way to run under script.
You can experiment it by something like:
cat commandline_sample_input.txt | ./console_solver
in Linux, I'm sure there are way to do it in windows
Thanks for getting back to me and the tips. I tried doing as you say but am still having the problem. Here's what I used:
from subprocess import Popen, PIPE
command = '../TexasSolver-v0.2.0-Windows/console_solver.exe'
p = Popen(command, shell=True, stdout=PIPE, stdin=PIPE)
# input_str comes from the TexasSolver colab code
p.stdin.write(input_str.encode())
p.stdin.close()
output = p.stdout.read()
p.wait()
print(output.decode())
The output I get is:
<<<START SOLVING>>>
Using 2 threads
Iter: 0
It then just finishes, so I'm not sure what is happening if you have any ideas? I'm using sublime editor build to run the script.
No way... can you give a minimal example of your project? I'd like to debug it myself in my PC.
Yeah sure, I added a minimal version for testing here https://github.com/Sam44y/minimal-example-for-testing-TexasSolver-python.git
Thanks heaps for your help! I appreciate it
Yeah sure, I added a minimal version for testing here https://github.com/Sam44y/minimal-example-for-testing-TexasSolver-python.git
Thanks heaps for your help! I appreciate it
Nice, I will test it on weekends.
hi @bupticybee, any luck at all with this by any chance?
hi @bupticybee, any luck at all with this by any chance?
Havn't got the time, will get back to this after testing
no worries at all, thanks
Hi, Thanks for your woke. I am trying to run your python file to test it.
import bindSolver
But I did not find any folder or package named Bindslover. We are looking forward to your reply.