Friday, October 22, 2021

[New post] How to import capstone in Python?

Subash Chandran posted: "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 from capstone import * from capstone.arm import * CODE = b"\xf1\x02\x03\x0e\x00\x00\xa0\xe3\x02\x30\xc1\xe7\x00\x00\x53\xe3" md = Cs(CS_ARCH_ARM, CS_MODE_ARM) md.detail = True for i "

[New post] How to interrupt a loop in Python?

Subash Chandran posted: "What i Wanted to know was how to stop a loop using the keyboard keys when it goes to infinte loop"

[New post] How to check runtime of program in Python idle?

Subash Chandran posted: "import time start = time.process_time() # your code here print(time.process_time() - start)"

[New post] Python code snippet – How to count all files on linux?

Subash Chandran posted: "for i in */ .*/ ; do echo -n $i": " ; (find "$i" -type f | wc -l) ; done "

[New post] Python code snippet – How to save all countries from a list in a database ?

Subash Chandran posted: ">>> from iso3166 import countries >>> for c in countries: >>> print c Country(name=u'Afghanistan', alpha2='AF', alpha3='AFG', numeric='004') Country(name=u'\xc5land Islands', alpha2='AX', alpha3='ALA', numeric='248') Count"

[New post] Python code snippet – How to read backslash slash ?

Subash Chandran posted: "#Use the syntax r"\" to treat backslash (\) as a literal character, and #not as an escape character. raw_text = r"abc\123" print(raw_text) OUTPUT abc\123"

[New post] Python code snippet – How to use logarithm?

Subash Chandran posted: "logging.basicConfig(filename="logfilename.log", level=logging.INFO) # Log Creation logging.info('your text goes here') logging.error('your text goes here') logging.debug('your text goes here') "

[New post] Python code snippet – How to convert a matrix string back to a matrix ?

Subash Chandran posted: "from ast import literal_eval as safe_eval string = '[[396, 555], [326, 337], [467, 332]]' print(safe_eval(string)) # will return: [[396, 555], [326, 337], [467, 332]]"

What makes an Instant Coffee "Premium"?

It's in the beans and packing process͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ͏‌  ...