15,181 Topics

Member Avatar for
Member Avatar for Niloofar24

Hello. How can i set an image as a Tkinter window background? I mean the whole background of the window not a photo area.

Member Avatar for HiHe
0
49K
Member Avatar for vegaseat

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 …

Member Avatar for Ene Uran
4
7K
Member Avatar for TrustyTony

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 …

Member Avatar for TrustyTony
0
268
Member Avatar for Rohit_17

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 …

Member Avatar for Lardmeister
0
211
Member Avatar for Niloofar24

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 …

Member Avatar for Gribouillis
0
12K
Member Avatar for Niloofar24

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 …

Member Avatar for Lardmeister
0
261
Member Avatar for vegaseat

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. …

Member Avatar for Lardmeister
3
1K
Member Avatar for Niloofar24

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 …

Member Avatar for Niloofar24
0
257
Member Avatar for Niloofar24

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 …

Member Avatar for Niloofar24
0
563
Member Avatar for Niloofar24

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?

Member Avatar for snippsat
0
5K
Member Avatar for fonzali

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 …

Member Avatar for fonzali
0
719
Member Avatar for Niloofar24

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?

Member Avatar for Niloofar24
0
10K
Member Avatar for marcelocent

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 …

Member Avatar for glenn_3
0
282
Member Avatar for marcelocent

## 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 …

Member Avatar for vegaseat
0
250
Member Avatar for ben.juarez.773

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 …

Member Avatar for richieking
0
518
Member Avatar for Niloofar24

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 …

Member Avatar for sneekula
0
11K
Member Avatar for Niloofar24

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 …

Member Avatar for Niloofar24
0
2K
Member Avatar for vegaseat

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.

3
2K
Member Avatar for vegaseat

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.

2
4K
Member Avatar for kouty

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 …

Member Avatar for sneekula
0
203
Member Avatar for snippsat

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 …

3
291
Member Avatar for kouty

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 …

Member Avatar for Gribouillis
0
407
Member Avatar for bahubali.mangave.9

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 …

Member Avatar for woooee
0
159
Member Avatar for Niloofar24

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 …

Member Avatar for sneekula
0
176
Member Avatar for Gribouillis

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 …

Member Avatar for Gribouillis
4
518
Member Avatar for vegaseat

Using the Python win32 extensions it is relatively simple to copy to and from the clipboard. Sorry. the Windows OS is a requirement.

0
2K
Member Avatar for vegaseat

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 …

Member Avatar for vegaseat
2
3K
Member Avatar for sneekula

You can accesss the clipboard simply by using the Tkinter GUI toolkit that comes with your Python installation.

Member Avatar for TrustyTony
1
14K
Member Avatar for shafter111

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 …

Member Avatar for sneekula
0
31K
Member Avatar for nugnug1616

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, …

Member Avatar for TrustyTony
0
448

The End.