-1

I have a python script that reads in a file, should then detect the language of the code in the file, get the language ID from https://ghostbin.com/languages.json and upload it to https://ghostbin.com with the language ID as a parameter. The problem is detecting the programming language used. I haven't found any lib to help me out.

kenjoe41
  • 280
  • 2
  • 8

1 Answers1

0

Here is a module that uses a Naive Bayes classifier to do what you want, with a corresponding discussion. The caveat is that the module needs to be trained on code samples. It should be easy enough to modify it to retain its training.

Community
  • 1
  • 1
Boa
  • 2,609
  • 1
  • 23
  • 38