Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inputting output from other languages
#1
Hi,
I have several programs that call python programs, the python program writes its results to disk and then the basic reads the results and uses them.  (some of the python libraries are very useful). In particular I am using pyephem, a library that calculates astronomical date on stars and planets.  
Is there a way to do this without the intermediate step of writing the information to disk?  Can the output of an external program be ported directly into a basic array or other structure?
John
Reply
#2
Hi John
Ready here you can declare external library and communicate with them using the right kind of data.
https://qb64phoenix.com/qb64wiki/index.php/Libraries
Reply
#3
pyephem wraps the C library libastro, why not compile that as a dynamic library and use that from QB64?
if you are on Linux then the library may already be available through the package manager
Reply
#4
how about a Shared memory mapped file ?
Reply
#5
I would love to do this if I knew how (compile as a dynamic library and use that).  I have not been successful in my rather feeble attempts to do that. Was not sure it was possible, so failure is an option.    I am on linux (choice of debian or fedora, I use both).   If you can suggest how to include libastro and access it from qb, that would be a godsend.

John
Reply
#6
Helium5793
I am on Windows with msys2 as one of my tools, I built libastro without problems, was also able to translate astro.h to FreeBasic thanks to fbfrog by DKL
the translated header could be a starting point to port to QB64, but I have zero knowledge on using libastro.
Reply
#7
why not use pipe to pipe the output to QB64 ?
I don't know how but someone familiar with piping on Linux could possibly help
Reply
#8
#5... you can use also external library compiled, not only DLL
read better wiki..using external C library
and TADA a google research show me this libastro by Corto Maltese  libastro in C on Gitub

Well looking at wiki you can recognize how to declare Type of data in QB64pe to exchange with external C library, and the examples show how code this interfacing with external C libraries.

Good luck for your goal
Reply
#9
Looks like I got my work cut out for me.  Thanks for the tips everybody.  I have some learning to do!
John
Reply




Users browsing this thread: 1 Guest(s)