Küçük bir JS fonksiyonunu python'a çevirebilecek/python'la yazabilecek olan var mı?

https://jsfiddle.net/1xf5su48/

Edit fiddle - JSFiddle - Code Playground

Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
BeğenFavori PaylaşYorum yap
  • Özgür'üm, Özgür'sün, Özgür @ozgurg

    Python bilmiyorum. Şu siteden çevirdim: http://piter.io/projects/js2py

    from js2py.pyjs import *
    # setting scope
    var = Scope( JS_BUILTINS )
    set_global_object(var)

    # Code follows:
    var.registers([u'encrypt'])
    @Js
    def PyJsHoisted_encrypt_(str, this, arguments, var=var):
    var = Scope({u'this':this, u'arguments':arguments, u'str':str}, var)
    var.registers([u'str', u'char_i', u'i', u'str1', u'encryStr', u'key', u'num_char_i'])
    if ((var.get(u'str')==Js(u'')) or (var.get(u'str')==var.get(u'undefined'))):
    return Js(u'')
    var.put(u'key', Js(u'abcdefghijklmnoprs'))
    var.put(u'str1', Js([]))
    var.put(u'encryStr', Js(u''))
    #for JS loop
    var.put(u'i', Js(0.0))
    while (var.get(u'i')>Js(4.0))^(var.get(u'key').get((var.get(u'i')%var.get(u'key').get(u'length'))).callprop(u'charCodeAt')&Js(15)))))
    finally:
    (var.put(u'i',Js(var.get(u'i').to_number())+Js(1))-Js(1))
    #for JS loop
    var.put(u'i', Js(0.0))
    while (var.get(u'i')<var.get(u'str1').get(u'length')):
    try:
    var.put(u'encryStr', var.get(u'String').callprop(u'fromCharCode', var.get(u'str1').get(var.get(u'i'))), u'+')
    finally:
    (var.put(u'i',Js(var.get(u'i').to_number())+Js(1))-Js(1))
    return var.get(u'encryStr')
    PyJsHoisted_encrypt_.func_name = u'encrypt'
    var.put(u'encrypt', PyJsHoisted_encrypt_)
    pass
    pass

  • Temp @temp

    Telegram adresin neydi dostum seni bulamıyorum.