This file contains hidden or 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
""" | |
Interface to the FreshDesk API. | |
Author: Ed Menendez ([email protected]) | |
Company: Digital Haiku | |
Created: September 1, 2014 | |
Example settings: | |
FRESHDESK_URL = 'https://wpt.freshdesk.com' |
This file contains hidden or 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
# The version I did during the class. | |
# This is only the regex. Replace it in the above code for it to work. | |
# Note: this is untested!!! Might have some bugs or missing '\s*'s | |
%r{ | |
# Named Groups declarations | |
(?<sign> | |
[-+]? | |
){0} |
This file contains hidden or 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: | |
import pygame | |
from pygame.locals import * | |
import sys, os, random | |
except ImportError as err: | |
print ('{0} Failed to Load Module: {1}').format(__file__, err) | |
sys.exit(1) |
This file contains hidden or 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
#Example 3: | |
#Wrong way | |
if True: | |
print("Hello, ") | |
print("World!") | |
else: | |
print("Bye, ") | |
print("World!") |
This file contains hidden or 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
#Example 2: | |
#First row of the block - 4 spaces, second row - tab (or was it vice versa?): | |
if True: | |
print("Hello") | |
print("World!") |
This file contains hidden or 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
#Example 1: | |
# Wrong way: | |
if 1 > 0: print("Hello, World!") | |
# Correct way: | |
if 1 > 0: | |
print("Hello, World!") |