15,181 Topics
| |
Hello. How can i set an image as a Tkinter window background? I mean the whole background of the window not a photo area. | |
Two third party Python modules imageio and visvis make it easy to load and view images. The modules come with the pyzo scientific package or can be downloaded separately. Module imageio can read many image file formats as shown in http://imageio.readthedocs.org/en/latest/formats.html You could also replace your image file name directly … | |
Python helps in real life situation to automate things. This program helps you to prep up your kids ability to go over/under ten, which is essential not only by itself, but also when calculating with bigger numbers. Program is not any special, but shows how useful Python can be in … | |
Hi, I don't know that this discussion is relevant or no in this community, if not I am really very sorry. I work in a software company from past 1 year. From last few days I start learning python. I know little bit of unix & shell scripting. My quesions … | |
Hi everybody. How can i install ttk module on linux? When i try to import and use it on my Tkinter window, the error says sth like there is no module named ttk. So it means i should install it right?! I'm using python 2. I want to use ttk … | |
Hello. Imagin we have a python file with many alphabet letters like this: (Which is infact meaningful like i am a programmer) i a m a p r o g r a m m e r How can i print them randomly that nobody could read it? sth like this … | |
With just about everybody snooping around your emails today with the excuse of hunting the bad guys, coding to keep some resemblance of privacy is getting important. I will start out with some simple encryption examples to get this started. You are invited to give us your thoughts and codes. … | |
Hi friends! I'm coding a program; i have a Tkinter window with a view button and i can add names with entry box and add button into a list that will be saved on a db file. Now i want the program to show the list names otomaticly when the … | |
Hello! My this time question is about breaking a list. I have a list with the name favorite_movies. Here is 2 functions of all functions from the file: def add(): load_favorite() favorite_movies.append(ent.get()) dump_favorite() #print (colors) def view(): load_favorite() from Tkinter import * v = Tk() v.geometry('300x300') v.configure(background = 'white') top … | |
Hi everybody. How can i creat e text file to use as a database in python? I want to save my project's data changes into hard disk. What should i do? | |
hi , I am trying to write " hi " in persian using unicodes like this : print('\uFEB3\uFEFC\uFEE1') but it prints from the left side and in reverse order like " ih " ( in persian or farsi language we write from right to left ) how can I fix … | |
Hello friends :) This is my code: #!/usr/bin/env python3 # -*-coding: utf8-*- def callback(): lbl.configure(text = 'button clicked!') import Tkinter window = Tkinter.Tk() window.geometry('300x300') window.configure(background = 'PeachPuff3') lbl = Tkinter.Label(window, text = 'Nothing yet!') btn = Tkinter.Button(window, text = 'add', command = callback).pack() window.mainloop() Why it doesn't work? | |
The script keep closing after the info gets copied to the clipboard. How can I prevent this to happen? import sys import Tkinter from string import * def Load_WordList(): wordList = open("wordlist.txt", "r") wStr = wordList.read() wList = split(wStr,"\n") return wList def compare(x,y): x1=0 x2=0 y1= [] y2= [] j … | |
## solution 1: fast enough response, simple function, fail fast from time import clock def isanaword(k,s): """ goes through the letters of second word (s) and returns it if first word (k) contains exactly same letters in same number """ for c in s: pos = k.find(c) if pos==-1: return … | |
Hello, I'm working on a small project to acquire information from regulations.gov using their API. It's fairly simple (codewise) what I'm trying to do. However, I get stuck with a "HTTP error 403: Forbidden". It means I'm connecting, but something seems to be the matter. I've been in contact with … | |
Hi everybody! How can i call a function from Tkinter without using Buttons? I have a test.py file and there is a function def message in it: def message(): print('Good morning') from Tkinter import * tk = Tk() tk.mainloop() I want to type test.py message from linux terminal and the … | |
Hello everybody! Me again with an other question :) I have a file with a list and 3 functions in it; view, sort, append. I used pickle to save data changes in to an other file (films.db). Imagine you want to use this programe for the first time on your … | |
Knowing the longitude and latitude coordinates of two cities you can calculate the distance between them. Use the code in https://www.daniweb.com/software-development/python/code/490561/postal-code-zips-and-location-python to find the coordinates. | |
Using http://download.geonames.org/export/zip/ you can get postal information for most countries in the world. The raw data string can be transformed into a Python list of lists that can be searched for zip codes, locations, longitude and latitude coordinates. | |
Hello friends. I want to create a list of sublists E.G. i = 0 pack = [] list = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] while i < 17: sublist = list[list[i]: list [i + 3]] pack = pack + sublist i += 1 print (pack) the output is: Type "copyright", "credits" or "license()" for … | |
A look at [Dataset](http://dataset.readthedocs.org/en/latest/) and easy and Pythonic way to create a database. Other candidates in this categorie,i will mention [pyDAL](https://github.com/web2py/pydal) and [Peewee](https://peewee.readthedocs.org/en/latest/). I did some test of Dataset in this [post](https://www.daniweb.com/software-development/python/threads/490219/how-can-i-creat-e-text-file-to-use-as-a-database-in-python) to look at. So here a common task some web-scraping of food recipes(just a task i did help … | |
Hello Daniweb! I learn in the Computer Sciences Circle, [Click Here](http://cscircles.cemc.uwaterloo.ca/) in the chapter 8. there strings, for exemple "sse" and "assessement" or "an" and "trans-panamian bananas", and we just need to count the occurences of thr furst in the second. My wrong code is """ Cet exercice consiste a … | |
hey guys i have written progam from sys import argv script, user_name = argv prompt = '> ' print "Hi %s, I'm the %s script." % (user_name, script) print "I'd like to ask you a few questions." print "Do you like me %s?" % user_name likes = raw_input(prompt) print "Where … | |
Hello! I have a file with a list and 3 functions in it; view, append and sort functions. I want to use pickle to save data changes in to another file inorder to retrive it next time. I have a list, when i call function VIEW, i see the primary … | |
I uploaded a module named [symboldict](https://pypi.python.org/pypi/symboldict) to the python package index (pypi). This snippet shows how to use it to create a dictionary of symbols from various modules. This dictionary can be used as a common language shared by several modules. It can be used to load python libraries in … | |
Using the Python win32 extensions it is relatively simple to copy to and from the clipboard. Sorry. the Windows OS is a requirement. | |
Just a small mildly optimized function to check if an integer is a prime number. For very large numbers use the Miller-Rabin primality test. There have been questions why I used `not n & 1` to check for even integer n. The more tradional` n % 2 == 0` is … | |
You can accesss the clipboard simply by using the Tkinter GUI toolkit that comes with your Python installation. | |
Hi.....I am a newbie...really confused with do while loop in python. Does it even exist? [CODE] J=[] do: finished = "false" while finished != "true": finished="true" for j in xrange(len(lis2)): cenP2 = G[i+G0] if ((cenP2 == 0) & (sigma2 > 0) J.append(1) finished = "false" print 3 # test code … | |
This sort of works but my tkinter window kees freezing. heres my code: import pygame, sys, time, random#Imports the modules pygame, sys, time and random form the python libary from pygame.locals import *#Imports all of the pygame modules global randomNumber #randomNumber = random.randint(1,4) redandBlackCounters = [120, 735, 250, 735, 560, … |
The End.