Home > Back-end >  Run script python in web browser
Run script python in web browser

Time:02-04

I have a script python for Reading biometric identity card with a card reader this script use this https://github.com/roeften/pypassport, i want to creat a web app with django and use this script and run it on client machine (on web browser) , each user can read his card with a card reader on this web application. how can i do that ? any idea can be useful looked at this part of script that I want to run on the client browser:

from pypassport.reader import ReaderManager
from pypassport.reader import ReaderManager

from pypassport.epassport import EPassport, mrz
r = ReaderManager()
reader = r.waitForCard()
p = EPassport(reader,"YOURMRZINFO")
p.register(print)
p.setCSCADirectory("C:\\TEMP")
p.doBasicAccessControl()
p.doActiveAuthentication()

p['DG2']

CodePudding user response:

if you want to run it in common browsers like "Chrome, Firefox, Opera, Edge ...", that's impossible. python must in python Virtual Machine, Browser doesn't contain that.

CodePudding user response:

you cant run python natively in the browser.

but ofc, there are workarounds, like pypy.js (this compiles python script to javascript and then runs the js)

  •  Tags:  
  • Related