Skip to content

Instantly share code, notes, and snippets.

View batok's full-sized avatar

Domingo Aguilera batok

  • Consultant
  • Guadalajara, Mexico
  • X @batok
View GitHub Profile
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)
try:
int(a)
if a > 10:
raise
except:
a = 0
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)
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)
import clr,socket
clr.AddReferenceByPartialName("System.Windows.Forms")
from System.Windows.Forms import Application, MessageBox
MessageBox.Show(socket.gethostbyname(socket.gethostname()))
Application.Run()
import wx, socket
app = wx.PySimpleApp()
wx.MessageBox( socket.gethostbyname(socket.gethostname()))
app.MainLoop()
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))
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))
# 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"
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()]