Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View vivosmith's full-sized avatar

vivosmith

View GitHub Profile
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
bool shouldPaint = false;
public Form1()
import socket
s = socket.socket()
host = socket.gethostname()
port = 1231
s.connect((host, port))
print (s.recv(1024))
filename=input('Choose the file')
filez=''.join(filename)
s.send(filez.encode())
import socket
s = socket.socket()
host = socket.gethostname()
port = 1231
s.connect((host, port))
print (s.recv(1024))
filename=input('Choose the file')
filez=''.join(filename)
s.send(filez.encode())
from urllib.request import urlopen
from bs4 import BeautifulSoup
class ehow:
link_collector=[]
url = urlopen("http://www.ehow.com").read()
soup = BeautifulSoup(url,"html.parser")
for line in soup.find_all('a'):
link_collector=line.get('href')
print(link_collector)
@vivosmith
vivosmith / search.py
Created September 28, 2016 17:16
A way to search all articles on ehow
from urllib.request import urlopen
from bs4 import BeautifulSoup
import tkinter
from tkinter import *
class ehow:
ehow_website=Tk()
text=Text(ehow_website)
def website():
link_collector=[]
url = urlopen("http://www.ehow.com").read()
Creating a Custom Widget It would not be difficult to change the labels in the root widget to some buttons and text boxes to create the Add Location form I have in mind. But that would make things rather complicated later, when you need to remove all those widgets from the view to put other data (for example, a forecast) on display. Further, if the user later wanted to add another location, it would be tricky to restore all the Add Location widgets. Instead, create a custom AddLocationForm widget that encapsulates the text entry, search button, location button, and search results into a single widget. Then set the root widget to be an instance of that custom widget instead. Example 1-5 does all of this. Example 1-5. Custom AddLocationForm widget AddLocationForm: # <AddLocationForm@BoxLayout>: # orientation: "vertical" # BoxLayout: TextInput: 12 | Chapter 1: Introducing Kivy www.it-ebooks.info
Page 27
Button: text: "Search" Button: text: "Current Location" ListView: item_strings: ["Palo Alto, MX", "Palo Alto,
@vivosmith
vivosmith / Cramcar.py
Created March 5, 2018 02:58
CramCard File client and server
import PyPDF2
import re
import tkinter
from tkinter import *
import os.path
from client import *
#test sharing pdfs as well as work error correcting codes (failed to connect, not right type of file, etc) , testers for input,also rename and create ico and check file type and filter what is typed and edit how binary looks on the screen and download mode and edit pack_forget for various pages and document also work on multi connections on server . check files to see if real, expand file size, check enteries . get() validity, new pack_forgets in back, and clear inserts after sends or saves, and debinarize files for viewing only, implement IP address connect
top=tkinter.Tk()
var = IntVar()
varchoice=IntVar()