Python Forum
does this file look like Python?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
does this file look like Python?
#1
i want to have a command or function that can examine a file and report a probability (and confidence factor would be a plus) that its contents are intended to be Python (as opposed to some other language), even if it has syntax errors. and, of course, without trying to run it. really nice would be a tool that can report the probability of a number of languages. anyone seen anything like that?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
GitHub certainly report the languages used in a repository, so perhaps they've open sourced a library that is useful for you?
Reply
#3
For the start maybe this helps: https://pypi.org/project/guesslang/
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020