15,185 Topics
| |
Hey everybody. I'm currently working on making a simple 2D "engine" of sorts in which I can assign certain objects to certain coordinates and it will render them out there. It's mainly to be about 2D animation and the like, but that's besides the point. I'm working on a coordinate … | |
def binding_locations(strA, strB): The first parameter represents a strand of DNA. The second parameter is one strand from a recognition sequence. Return a list of all the indices where the recognition sequence appears in the DNA strand. (These are the restriction sites.) For example, if the DNA palindrome appears at … | |
from turtle import * import random def allTriMedian (w=300): speed (0) vertices = [] point = turtle.Point(x,y) for i in range (3): x = random.randint(0,300) y = random.randint(0,300) vertices.append(trutle.Point(x,y)) point = turtle.Point(x,y) triangle = turtle.Polygon(vertices) a = triangle.side() b = triangle.side() c = triangle.side() m1 = tirangle.median m2 = triangle.median … | |
It would be good for some people to help me out on putting sounds in my application without Pygame, because it doesn't work on my PC. If you can then it would be highly appreciated for your help. If you could not reply then you could do a download for … | |
I'm new to python, for my project I need to send mail from python.. I'm getting the following error can someone please help me how to get out of it.. Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for … | |
I need to comput and display the sum and average of the cubes of the even natural numbers between 2 and n. Where n is entered by the user. Im stuck on how to average the sum of the cubes. Help Please. This is what I have so far. def … | |
I want to convert letters "M", "E" and "D" into maritime flags from turtle import * def drawInitials (ref=(0,0), w=100, spacing=10): """Params: ref (int 2-tuple): bottom right corner, the reference point w (int): width of each letter, in pixels spacing (int): separation between consecutive letters, in pixels """ speed(0) drawInitials … | |
I am trying to send a message to my websocket server but I keep getting this error. Traceback (most recent call last): File "send.py", line 5, in <module> ws = websocket.create_connection("ws://ipaddress:9001") AttributeError: 'module' object has no attribute 'create_connection' I created a python server file server is started but when I … | |
Using Python, create a program that simulates a bank machine and transactions on a bank machine. Requirements: · Your bank machine must have an intro message that welcomes you. · The account balance is given at the beginning of the transaction and it should start at $1000.00. · It must … | |
import requests import pandas as pd import csv from bs4 import BeautifulSoup from pandas import Series,DataFrame import unicodecsv def name1(): url="https://www.agoda.com/zh-tw/pages/agoda/default/DestinationSearchResult.aspx? asq=%2bZePx52sg5H8gZw3pGCybdmU7lFjoXS%2baxz%2bUoF4%2bbAw3oLIKgWQqUpZ91GacaGdIGlJ%2bfxiotUg7cHef4W8WIrREFyK%2bHWl%2ftRKlV7J5kUcPb7NK6DnLacMaVs1qlGagsx8liTdosF5by%2fmvF3ZvJvZqOWnEqFCm0staf3OvDRiEYy%2bVBJyLXucnzzqZp%2fcBP3%2bKCFNOTA%2br9ARInL665pxj%2fA%2bylTfAGs1qJCjm9nxgYafyEWBFMPjt2sg351B&city=18343&cid=1732641&tag=41460a09-3e65-d173-1233-629e2428d88e&gclid=Cj0KEQjwvve_BRDmg9Kt9ufO15EBEiQAKoc6qlyYthgdt9CgZ7a6g6yijP42n6DsCUSZXvtfEJdYqiAaAvdW8P8HAQ&tick=636119092231&isdym=true&searchterm=%E5%A2%BE%E4%B8%81&pagetypeid=1&origin=TW&cid=1732641&htmlLanguage=zh-tw&checkIn=2016-10-20&checkOut=2016-10-21&los=1&rooms=1&adults=2&children=0&isFromSearchBox=true&ckuid=1b070b17-86c2-4376-a4f5-d3b98fc9cf45" source_code=requests.get(url) plain_text=source_code.text soup=BeautifulSoup(plain_text,"lxml") for a in soup.find_all("h3",{"class":"hotel-name"}): b=a.string.strip() print(b) csvfile=open('hotel.csv','w') wr=unicodecsv.writer(csvfile,encoding='utf-8') for item in b: wr.writerow(b) csvfile.close name1() I use python3 and win10 to write this code. I … | |
How can i set a frame according to parent window size? I was trying to set it but it is taking only region where button displayed from Tkinter import * class Example: def __init__(self, parent): self.parent = parent self.parent.title("CBLFinder") self.initUI() def initUI(self): self.frm1=Frame(self.parent,background="white",\ borderwidth=5,relief="sunken",\ width=400,\ height=500) #print self.parent.winfo_reqwidth(),self.parent.winfo_reqheight() btn=Button(self.frm1,text="Submit",command=self.update_frame) btn.grid(row=2,column=2,padx … | |
Alright. I'm teaching myself python from 'Learn Python the Hard Way: 3rd Edition' by Zed Shaw.. it's been informative so far. Definitely learning. After his lessons, he gives study drills, extra project to put your learning to use. He challenged us to: "Find out what Zork and Adventure were. Try … | |
Dear All, I have a very long list of values as follow (43, 560) (516, 1533) (1316, 3047) (520, 1528) (3563, 1316) (45, 557) (3562, 1312) (2686, 1964) (2424, 3340) (3559, 1317) (50, 561) (2427, 3336) (1313, 3046) (3562, 1313) (3559, 1318) (2689, 1962) (2429, 3339) (3721, 2585) (1317, 3048) … | |
Is there a way I can fix the way ji get neighbors of a 2d coordinate? """6.009 Lab 5 -- Mines""" def dump(game): """Print a human-readable representation of game. Arguments: game (dict): Game state >>> dump({'dimensions': [1, 2], 'mask': [[False, False]], 'board': [['.', 1]]}) dimensions: [1, 2] board: ['.', 1] … | |
I have generated checkbutton from inputstatus dictionary to set as default values.After tht once it get display on GUI when i select it respected text and status will be added to new dictionary '''inputstatus = { 'maggi': 1, \ 'pizza': 1, \ 'cold drinks': 1, \ 'fries': 1, \ 'chapati': … | |
Suppose i have one dictionary menu={'pizza':1,'Burger':1,'sandwitch':0} when i run tkinter gui these all key will be displayed on GUI. If value is 1 then respected key must be ticked rest will be unticked | |
There is one application where two radio buttons are available.i.e default and custom. If custom is selected then one panel will be visible which contain available drives list of not selected checkbox which are generated based on list but while i am doing such things it generate checkbox many time … | |
Write a program that prints a table of Celsius temperatures from 0 to 20 degrees and prints the corresponding temperature in Fahrenheit. This program MUST use a loop. The first digit in each temperature must line up with the first digit of the temperatures above it so the output forms … | |
from Tkinter import * from ttk import Style class Example(Frame): def __init__(self, parent): Frame.__init__(self, parent, background="#333") self.parent = parent self.parent.title("sample") self.parent.iconbitmap('sample.ico') self.pack(fill=BOTH, expand=1) self.centerWindow() self.initUI() def centerWindow(self): w = 500 h = 450 sw = self.parent.winfo_screenwidth() sh = self.parent.winfo_screenheight() x = (sw - w)/2 y = (sh - h)/2 self.parent.geometry('%dx%d+%d+%d' … | |
Hello, I'm totally new to programming and wanted to make a text-based game based on what I know, but I've met a problem I don't know how to fix. Also this code is not finished, I'm just trying to get it to work first. Basically, I want the loop to … | |
Okay, I'm trying to make a python game (not with pygame), I want it to use the arrow keys. But the thing is, I don't know how to get it to respond to the arrow keys. So here's what I want to do. If the user presses the up arrow … | |
Hello, I'm trying to use md5 in python3 using the attached code from hashlib import md5 password = 'pa$$w0rd' h = hashlib.md5() print(h.hexdigest()) put it gives me this error (cannot import name 'md5') and when i try to import hashlib only it gives this error (module 'hashlib' has no attribute … | |
My current program is text based, is there a way to convert it to a GUI based one? import sqlite3 from tkinter import* import sys import random from random import shuffle import time #------------------------------------------------------------------------------------------------------- def database1(): conn = sqlite3.connect("Database1.db") #connection to database #directory will need to be changed in order … | |
hello im harambe and need help with some course work for my GCSE's i like memes and message me if you can help as im 16 and my fianl exam is next week and i dont know aht an array is help!!!!!!!!!!! | |
Hi all, Ive been looking to convert one of my programs to include a GUI, and am having issues with the timing aspects of it. Ive included a mock scenario of what my problem is below: Ive defined my GUI as an object via a class, and am using the … | |
How to read properties file in Python? I found ConfigParser() but it has a 'section' limitation, so looking for other alternatives. Thanks, Harsh | |
How to update jquery on windows 7? my jquery stil 1.4.3 i want to change it become version 1.7.3 thanks before | |
suggest me whitch course is useful and booming in software industry...</> | |
Need to know steps of generating HTTP request multiple times in python | |
have a code that loads an image online with the AsyncImage module in kivy. i wrote the code in python3 which runs well on the pc but doesnt work on a packaged apk. i think this is because i packaged it using python2.7 buildozer. thanks an image showing the error … |
The End.