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
/* getenv example: getting path */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main () | |
{ | |
char * pPath; | |
pPath = getenv("PATH"); | |
if (pPath!=NULL) | |
printf ("The current path is: %s",pPath); |
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 | |
def has_balanced_delimiters(string, delimiters={'(': ')', '[': ']', '{': '}'}): | |
""" | |
Parses a string to determine if it contains balanced delimiters. | |
A balanced delimiter string starts with an opening character ((, [, {), ends | |
with a matching closing character (), ], } respectively). A balanced | |
delimiter string may contain any number of balanced delimiters. | |
""" |
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
try: | |
# some code that might raise exception | |
except: | |
# code to handle exception | |
finally: | |
# code to run regardless of exception |