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 threading | |
import time | |
def say(msg): | |
while True: | |
time.sleep(1) | |
print(msg) | |
for msg in ['you', 'need', 'python']: | |
t = threading.Thread(target=say, args=(msg,)) |
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 turtle as t | |
import random | |
def turn_up(): | |
t.left(2) | |
def turn_down(): | |
t.right(2) | |
def fire(): |
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 turtle as t | |
def turn_right(): | |
t.seth(0) | |
t.fd(10) | |
def turn_up(): | |
t.seth(90) | |
t.fd(10) | |
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 thread | |
import time | |
# Define a function for the thread | |
def print_time(threadName, delay): | |
count = 0 | |
while count < 5: | |
time.sleep(delay) | |
count += 1 | |
print "%s: %s" % (threadName, time.ctime(time.time())) |
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
Sub sbADOExample() | |
Dim sSQLQry As String | |
Dim Conn As New ADODB.Connection | |
Dim mrs As New ADODB.Recordset | |
dim DBPath As String, sconnect As String | |
DBPath = ThisWorkbook.FullName | |
sconnect = "Provider=MSDASQL.1;DSN=Excel Files;DBQ=" & DBPath & ";HDR=Yes';" | |
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 pickle | |
f = open("test.txt", "wb") | |
data = {1: 'python', 2: 'you need'} | |
pickle.dump(data, f) | |
f.close() |
.
.