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
import wx | |
import socket | |
from wsgiref.simple_server import make_server | |
from threading import Thread | |
from datetime import datetime | |
class WebServer(Thread): | |
def __init__(self, window): | |
Thread.__init__(self) |
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: | |
int(a) | |
if a > 10: | |
raise | |
except: | |
a = 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
import wx | |
import socket | |
from wsgiref.simple_server import make_server | |
from threading import Thread | |
from datetime import datetime | |
class WebServer(Thread): | |
def __init__(self, window): | |
Thread.__init__(self) |
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
import urllib | |
import json | |
import wx | |
login = "your_bitly_login_name" | |
apikey = "your api key" | |
l_url= "http://www.google.com" # just a default url, can be anyone | |
app = wx.PySimpleApp() | |
app.MainLoop() | |
l_url = wx.GetTextFromUser( message = "Please Type URL", caption ="bit.ly shorten", default_value = l_url) |
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
import clr,socket | |
clr.AddReferenceByPartialName("System.Windows.Forms") | |
from System.Windows.Forms import Application, MessageBox | |
MessageBox.Show(socket.gethostbyname(socket.gethostname())) | |
Application.Run() |
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
import wx, socket | |
app = wx.PySimpleApp() | |
wx.MessageBox( socket.gethostbyname(socket.gethostname())) | |
app.MainLoop() |
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
import wx | |
from datetime import datetime | |
from wx.lib.calendar import CalenDlg | |
#this is a simple python script to show how wing ide mac os x version renders and interact bad with | |
#wx.lib.calendar.CalenDlg | |
# If one runs this from wing for mac, the dialog shows incomplete. When run outside wing the dialog shows and behaves ok. | |
# | |
class Frame( wx.Frame): | |
def __init__(self): | |
wx.Frame.__init__(self,None,-1, "Testing Calendar issue", size = ( 400,200)) |
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
import wx | |
from datetime import datetime | |
from wx.lib.calendar import CalenDlg | |
#this is a simple python script to show how wing ide mac os x version renders and interact bad with | |
#wx.lib.calendar.CalenDlg | |
# If one runs this from wing for mac, the dialog shows incomplete. When run outside wing de dialog shows and behaves ok. | |
# | |
class Frame( wx.Frame): | |
def __init__(self): | |
wx.Frame.__init__(self,None,-1, "Testing Calendar issue", size = ( 400,200)) |
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
# Vamos haciendo este programa compatible con python 3. | |
from urllib.request import urlopen | |
import zipfile | |
import sys | |
numeros = dict() | |
MELATE_ZIP_URL = "http://www.pronosticos.gob.mx/pago/Files/melate.zip" | |
REVANCHA_ZIP_URL = "http://www.pronosticos.gob.mx/pago/Files/revancha.zip" | |
MELATE_FILE = "MELATE.CSV" | |
REVANCHA_FILE = "REVANCHA.CSV" |
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
from sqlalchemy import create_engine | |
import logging | |
logging.basicConfig(filename = "sqlalchemypy3.log") | |
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) | |
engine = create_engine("postgresql+pg8000://postgres@localhost:15432/pg8000") | |
c = engine.connect() | |
c.execute("delete from prueba") | |
words = "first look at sqlalchemy from python3 using pg8000 module" | |
aWords = ["('{0}')".format(x) for x in words.split()] |