15,175 Topics
| |
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, … | |
A dictionary in Python is an unordered set of key:value pairs. I show you how to initialize, create, load, display, search, copy and otherwise manipulate this interesting container. Like the name says, it is the closest thing to a dictionary. | |
Python's double ended queue module makes Caesar's cipher easy. | |
I need help with this program I am doing. I need to be able to select encrypt or decrypt(ive only done encrypt at the momment) and need to be able to select an offset here what ive got so far and I have a number of problems. http://imgur.com/a/N3Tul 1 is … | |
I am trying to change the first character of each word in a list to upper case using Python 2.7. I am able to change the entire list to lower case, but I am not getting what I want - i.e the first character of each word to be upper … | |
Hi everybody. I've created a .py file with a simple function in it. Now i want to call that function from linux shell scripting. How should i do that? please help me, thank you. | |
Hi to the forum; A simple question: I want to make a prime number checker: So if I want to test if 25 is a prime number. i should to verify if 2 is a factor. if it is not, i verify with 3 and 4 (not my subject if … |
The End.