This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# adb_with_reconnect.sh: Wrapper around Android Debug Bridge which auto reconnects when network connection has to reestablished (Useful in case of unstable Android device or poor network connection. Also makes use of nmap for an analysis of the Android device, so installation of nmap is recommended | |
# | |
# Copyright (C) 2016 Sander Bel | |
# | |
# This program is free software: you can redistribute it and/or modify it under the terms of the | |
# GNU General Public License as published by the Free Software Foundation, either version 3 of the | |
# License, or (at your option) any later version. | |
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""football-data.co.uk_convert.py: Convert xslx files to one or more workable csv file(s) | |
Copyright (C) 2016 Sander Bel | |
This program is free software: you can redistribute it and/or modify it under the terms of the | |
GNU General Public License as published by the Free Software Foundation, either version 3 of the | |
License, or (at your option) any later version. | |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir([object]) | |
# Example | |
class test_class: | |
def __init__(self, test_property): | |
self.__test_property = test_property; | |
@property | |
def test_property(self): | |
return self.__property_value | |
@test_property.setter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__file__ | |
# Example | |
$ cat test_script.py | |
#!/usr/bin/python | |
print(__file__) | |
$ python test_script.py | |
test_script.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id(object) | |
# Example | |
>>> test_dict1 = {"a": 1, "b": 2} | |
>>> test_dict2 = test_dict1 | |
>>> test_dict3 = dict(test_dict1) # intiliaze a new dictionary based upon test_dict1 | |
>>> test_dict1 | |
{'a': 1, 'b': 2} | |
>>> test_dict2 | |
{'a': 1, 'b': 2} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isinstance(object, classinfo) | |
# Example | |
>>> test_dict = dict() | |
>>> dict # just showing what is a type object is | |
<type 'dict'> | |
>>> isinstance(test_dict, dict) | |
True | |
>>> isinstance(test_dict, list) | |
False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type(object) | |
# Example | |
>>> test_dict = dict() | |
>>> test_int = 0 | |
>>> test_str = "" | |
>>> test_tuple = tuple() | |
>>> test_list = list() | |
>>> type(test_dict) | |
<type 'dict'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip([iterable, ...]) | |
# Example | |
>>> test_list1 = ["a", "b", "c"] | |
>>> test_list2 = [1, 2, 3] | |
>>> zip(test_list1, test_list2) | |
[('a', 1), ('b', 2), ('c', 3)] | |
>>> dict(zip(test_list1, test_list2)) | |
{'a': 1, 'c': 3, 'b': 2} | |
>>> test_list2 = [1, 2, 3, 4] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dbus | |
class dbus_parse(object): | |
__slots__ = ("__dbus_parse_dict", "__parse_dbus_dict", "__parse_dbus_list", "__parse_dbus_tuple", "__parse_dbus_var", "parse_dbus_vars") | |
def __init__(self): | |
self.__dbus_parse_dict = { dbus.String: str, | |
dbus.Int16: int, dbus.Int32: int, dbus.Int64: int, | |
dbus.UInt16: int, dbus.UInt32: int, dbus.UInt64: int, | |
dbus.Double: float, | |
dbus.Boolean: bool, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var = <any valid Python syntax you can place here is an expression> |
OlderNewer