Category : syntax-error

I have a "item" object (<class ‘zenpy.lib.api_objects.Comment’>) coming from an API call (JSON) like this: { "id": 1, "type": 10, "via": { "from":{ "id": "511", "name": "a" }, "to":{ "id": "999", "name": "b" } } } So, when I do print(item.via.to[‘id]) it works properly, but when I try to do: print(item.via.from[‘id]) I’m getting an error ..

Read more

md5 to receive CTF for classwork import hashlib flag = 0 counter = 0 pass_hash = input("Enter md5 hash: ") wordlist = input("filename: ") try: pass_file = open(wordlist, "r") except: print("No file found") quit() for word in pass_file: enc_wrd = word.encode(‘utf-8’) digest = hashlib.md5(enc_wrd).hexdigest() if digest == pass_hash: print("Password has been found!") print("Password:" + word) ..

Read more

I’m quite new to Python so the answer to my question might be simple or impossible. In below shown example I would like to substitute the object name "myBox" with a variable boxName. boxName = "myBox" FreeCAD.ActiveDocument.addObject("Part::Box", boxName)* This works: FreeCAD.ActiveDocument.myBox.Length = 150 This doesn’t: FreeCAD.ActiveDocument. + boxName + .Length = 150 I get a ..

Read more