Category: Uncategorized

Change a value with configparser for python

configparser is a great module to store configuration information into a filehttps://docs.python.org/2/library/configparser.html a config file could look like this: To load the value from the file To change the value in the file:

Tagged with:

Dictionary changed size during iteration while using pop() in python

Running through a json file remove all keys but one This is fine running python2 but in python3 you will run into this error Calling keys() in python2 makes a copy of the keys that we iterate through. This is

Tagged with:

Remove non letter characters before and after characters in Python

To remove none letters characters from the beginning and end in python use regex from the re.py library. I needed it to remove spaces as well but not in between the words. Here’s what I did: Output:

Tagged with:

Xcode UIToolbar Set Height Is Locked

The object in Xcode: UIToolbar is locked when using the Interface Builder at 44 px tall. You can easily change this programmably by using setFrame [myToolbar setFrame:CGRectMake(0,50,320,30)]; However you are able to do this in the Interface Builder as well

Set The Text Of A Back Button On A UINavigationBar

To set the text of a back button on a UINavigationBar you can set it like this for you iPhone app: UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle: @”Back Button Text” style: UIBarButtonItemStyleBordered target: nil action: nil]; [self.navigationItem setBackBarButtonItem: backButton]; [backButton

Tagged with: , ,
Top