15,175 Topics

Member Avatar for
Member Avatar for Cup of Squirrel

I've skimmed the manual and cant find the answer to this anywhere: In basic, to add an Input function you would do (for example): [CODE] Input "What is your name? " name$ [/CODE] How do I do this in Python?

Member Avatar for Jason_15
1
18K
Member Avatar for Niloofar24

Hello. I have a list like this: mylist = [7, "+", 2, "+", 1] I want to take them out of the list inorder to run the operation and get the real result; something like this: result = 7 + 2 + 1 So the result variable will be set …

Member Avatar for Niloofar24
0
333
Member Avatar for mryjyc

where sending data to the client but we cant receive the data why? code for client from Tkinter import * import random import tkSimpleDialog import socket import threading class Client(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.root = Tk() self.root.geometry('700x350') self.txtName = Entry(self.root) self.txtName.pack() self.txtPass = Entry(self.root) self.txtPass.pack() self.btnReg = Button(self.root, command = …

Member Avatar for iamthwee
0
184
Member Avatar for Pablo_2

Hello peoples, I'm thinking of starting do dvelop a new game. Specifically a 16bit RPG I'm thinking of programming it using Python because I'm more familiar with it but if any of you think that using a different language like c++ or Javascript would be better then please reply and …

Member Avatar for Teiman
0
183
Member Avatar for Odyssey2001

Hello!First of all,I'm so sorry for this huge post!!I wrote the whole code from the book,that's why the post is so big!!I'm reading this book : Rapid Gui Programming with Python and Qt.And I have problem understanding some parts of the code.I would be really thankful if someone could help …

Member Avatar for Odyssey2001
0
598
Member Avatar for Niloofar24

Hello. I have a Class in my python file. That Class contains some functions. How can i set the command of a Tkinter butten so that call a function of that class? I tried this but it didn't work: class calculating(object): def __inint__(self): self.current = 0 def addition(self, amount): self.current …

Member Avatar for HiHe
0
10K
Member Avatar for php_student

Hi, I am very new to Pyhton and wants to run a simple script.. but it gives me error.. def main(): print("This is simple python") if__name__ == "__main__": main() Its on the 3rd line.. Any help??

Member Avatar for Gribouillis
0
41
Member Avatar for ShilohAmi

Hi, I have data like these: data_past = [[62.0, 144.0, 3, 0]] where data_past=[[red_circle_x , red_circle_y , id_of_rectangle , status]] data_current = [[60, 148, 0], [148, 127, 0]] where data_current=[[red_circle_x , red_circle_y , status]] And I want to compare each row of data_current to all data_past to get minimum distance, …

Member Avatar for TrustyTony
0
227
Member Avatar for YouGotSnails

I am trying to use a loop to write randomly generated numbers to a text document. Then, using a different program, I need to use a loop to read the numbers. The first program needs to output the numbers in the SAME LINE, the second program needs to output them …

Member Avatar for snippsat
0
316
Member Avatar for Santanu.Das

Hello members, Presently I do my projects with vb.net. I am not familier with Python. I want to learn python. Would you help me to learn python? I know nothing about python and I donot understand where from I will start.

Member Avatar for vegaseat
0
272
Member Avatar for MustafaScript

I started learning python a few days ago, i want to learn both python and C++ What is your advice ?

Member Avatar for rubberman
0
199
Member Avatar for Niloofar24

I'm going to learn kivy programming language. Could you introduce some good tutorials to me please? Except the kivy.org. And also i'm looking for a good Kivy forum.

Member Avatar for Ene Uran
0
300
Member Avatar for 00Gambit

I Started to learn my first programming language - Python about 2 months ago and I'm 3/4 the way through my book Introduction to Programming using Python - Daniel Liang and I've started to lose interest. I don't actually find programming fun par se, just when I figure something out …

Member Avatar for ~s.o.s~
0
405
Member Avatar for Niloofar24
Member Avatar for Decode098

im currently making a program that takes in the names and scores of the student but i dont know how to get the top 3 scores when the scores starts to get the same ex student 1 is 100 student 2 is 99 student 3 and 4 is 98 i …

Member Avatar for Decode098
0
109
Member Avatar for 00Gambit

from tkinter import * from random import randint #Return random color #RRGGBB def getRandomColor(): color = '#' for j in range(6): color+= toHexChar(randint(0, 15)) return color #Convert an integer to a single hex digit in a character def toHexChar(hexValue): if 0 <= hexValue <= 9: return chr(hexValue+ord('0')) else: return chr(hexValue …

Member Avatar for vegaseat
0
171
Member Avatar for ebaum2112

i am trying to make a checkerboard that centerss automaticly no matter what the sideLength is. also i am tryiing to put the checker in the squares...im only a beginner!!!! have mercy heres what i have [code] def drawCheckerBoard(myTurtle,sideLength): myTurtle.speed(0) for i in range (8): myTurtle.forward(sideLength) myTurtle.right(90) myTurtle.forward(sideLength) myTurtle.right(90) myTurtle.forward(sideLength) …

Member Avatar for ilona.lizard
0
219
Member Avatar for Tcll

as the title states, I know runpy can run a module's code w/o importing it, but what I'm trying to do is send the module object to a... function supplied by my interface which is directly called by the module. what I'm talking about is: my interface provides these functions …

Member Avatar for Tcll
0
537
Member Avatar for Amulya_1

Hi, I'm trying to compare two CSV files (and many more like these below). I tried many ways, using lists, dictreader and more but nothing gave me the output I require. I want to compare all those rows that have same !Sample_title and !Sample_geo_accession values (whose positions vary). I've been …

0
181
Member Avatar for johnny blaz97

import tkinter top=tkinter.Tk() t=tkinter.Text(top,height=1,width=1,bd=2,font=10) t.grid(row=0,column=0) b1=tkinter.Button(top,height=2,width=8,bd=2,text="MC",fg="Red") b1.grid(row=1,column=1) b2=tkinter.Button(top,height=2,width=8,bd=2,text="Backspace",fg="Red") b2.grid(row=1,column=2) b3=tkinter.Button(top,height=2,width=8,bd=2,text="CE",fg="Red") b3.grid(row=1,column=3) b4=tkinter.Button(top,height=2,width=8,bd=2,text="C",fg="Red") b4.grid(row=1,column=4) b5=tkinter.Button(top,height=2,width=8,bd=2,text="MR",fg="Red") b5.grid(row=2,column=1) b6=tkinter.Button(top,height=2,width=8,bd=2,text="7",fg="Blue") b6.grid(row=2,column=2) b7=tkinter.Button(top,height=2,width=8,bd=2,text="8",fg="Blue") b7.grid(row=2,column=3) b8=tkinter.Button(top,height=2,width=8,bd=2,text="9",fg="Blue") b8.grid(row=2,column=4) b9=tkinter.Button(top,height=2,width=8,bd=2,text="/",fg="Red") b9.grid(row=2,column=5) b10=tkinter.Button(top,height=2,width=8,bd=2,text="sqrt",fg="Blue") b10.grid(row=2,column=6) b11=tkinter.Button(top,height=2,width=8,bd=2,text="MS",fg="Red") b11.grid(row=3,column=1) b12=tkinter.Button(top,height=2,width=8,bd=2,text="4",fg="Blue") b12.grid(row=3,column=2) b13=tkinter.Button(top,height=2,width=8,bd=2,text="5",fg="Blue") b13.grid(row=3,column=3) b14=tkinter.Button(top,height=2,width=8,bd=2,text="6",fg="Blue") b14.grid(row=3,column=4) b15=tkinter.Button(top,height=2,width=8,bd=2,text="*",fg="Red") b15.grid(row=3,column=5) b16=tkinter.Button(top,height=2,width=8,bd=2,text="%",fg="Blue") b16.grid(row=3,column=6) b17=tkinter.Button(top,height=2,width=8,bd=2,text="M+",fg="Red") b17.grid(row=4,column=1) b18=tkinter.Button(top,height=2,width=8,bd=2,text="1",fg="Blue") b18.grid(row=4,column=2) b19=tkinter.Button(top,height=2,width=8,bd=2,text="2",fg="Blue") b19.grid(row=4,column=3) b20=tkinter.Button(top,height=2,width=8,bd=2,text="3",fg="Blue") b20.grid(row=4,column=4) b21=tkinter.Button(top,height=2,width=8,bd=2,text="-",fg="Red") b21.grid(row=4,column=5) b22=tkinter.Button(top,height=2,width=8,bd=2,text="1/x",fg="Blue") b22.grid(row=4,column=6) b23=tkinter.Button(top,height=2,width=8,bd=2,text="M-",fg="Red") …

Member Avatar for vegaseat
0
1K
Member Avatar for iamthwee

Has anyone ever used tkdocs... http://www.tkdocs.com/ And if so what have been your opinions thanks.

Member Avatar for vegaseat
0
144
Member Avatar for MustafaScript

x = 25 epsilon = 0.01 numGuesses = 0 ans = 0.0 while abs(ans**2 - x) >= epsilon and ans <= x: ans += 0.00001 numGuesses += 1 print 'numGuesses =', numGuesses if abs(ans**2 - x) >= epsilon: print 'Failed on square root of', x else: print ans, 'is close …

Member Avatar for vegaseat
0
2K
Member Avatar for Niloofar24

Hello. I'm using Linux OS, Python 2 and the last version of Kivy framework. Here i have 2 files that i have typed them exactly as what i watched on a kivy tutorial video. Fist file is "main.py": from kivy.app import App from kivy.uix.scatter import Scatter from kivy.uix.label import Label …

Member Avatar for vegaseat
0
4K
Member Avatar for steven.rose.94

Good Day:) I'm trying to figure out how to remove the % sign that is returned from scraping Yahoo Finance **without** removing the decimal point (or a possible negative sign in front of number returned as netProfit). My goal is to convert the string without the % sign a float …

Member Avatar for Slavi
0
2K
Member Avatar for MustafaScript
Member Avatar for Niloofar24

Hi. How can i open a mp3 file and play it in python? There is a mp3 file on my Linux desktop and i want to open it from a python file and play it. What should i do?

Member Avatar for Niloofar24
0
30K
Member Avatar for Niloofar24

Hi everybody. I have problem with .pack() and .grid(). I have to use this line: mywin.pack(fill=BOTH, expand=YES) I have used .grid every where on my file but now here i have copied a pice of code from some where and have pasted to my file, as you see it has …

Member Avatar for vegaseat
0
4K
Member Avatar for Niloofar24

Hello. When we want to insert a vlue into a table in sqlite, we use this line, right? cursor.execute('INSERT INTO colors Values ("red", "blue")') As we can see above, we want to insert 2 words and we type them as when we are typing whole the codes. But i want …

Member Avatar for vegaseat
0
5K
Member Avatar for rhys_1

memoryc = open("cipher.txt", "a") memoryd = open("decipher.txt", "a") #------------------------------------------------------------------------------- choice = input("cipher, decipher or memory") #------------------------------------------------------------------------------- if choice == "cipher": message = input("What is your message?") key = int(input("What is your key?")) coded_message = "" for ch in message: code_val = ord(ch) + key if ch.isalpha(): if code_val > ord('z'): …

Member Avatar for Ene Uran
0
315
Member Avatar for Johnny Blaz

https://friendpaste.com/mTdjXilQ0bVQJpsoCu1Wf i am having the error (float' object has no attribute 'insert').I am getting the same error with append. any solutions??? I am using python 3.4.2 .Thanks in advance.

Member Avatar for Gribouillis
0
201

The End.