Posts

Showing posts from February 2, 2019

JavaFX not Recognized by Eclipse

Image
2 Even though I've installed ec(fx)lipse, Eclipse is unable to resolve any import statements with JavaFX. I am running Eclipse version 2018-09 (4.9.0) on Ubuntu 18.04. The Java I'm using is openjdk version "10.0.2". I have also installed OpenJFX. How can I use JavaFX in Eclipse? A screenshot of my program: java eclipse ubuntu javafx javafx-11 share | improve this question edited Nov 23 '18 at 9:59 kleopatra 44.7k 16 75 160 asked Nov 22 '18 at 20:33

Caching results from a web API using with open

Image
1 I am using a lot of data returned from a WEB-api.The function below calls the API 22 times, decodes and loads json into python format. Then I store the results in a big list of 22 pages with each 100 art objects as data. fourteen_list = return_14th_century_works_list() To limit the necessary API-calls, I want to build a function that stores this list as a file if it is not present, and when it is present I want to load the file from my computer. I came up with the following: with open('fourteenth_century_list.txt', 'w') as fourteenth_century_file: print(fourteen_list, file=fourteenth_century_file) try: with open('fourteenth_century_list.txt', 'r') as fourteenth_century_file: fourteenth_list_cache = fourteenth_century_file.read() count_objects(f