15,190 Topics
![]() | |
import pygal data = [ ["Python", 30.3], ["Java", 22.2], ["C++", 13], ["Ruby", 10.6], ["Javascript", 5.2], ["C#", 5], ["C", 4.1], ["PHP", 3.3], ["Perl", 1.6], ["Go", 1.5], ["Haskell", 1.2], ["Scala", 1], ["Objective-C", 0.4], ["Clojure", 0.2], ["Bash", 0.1], ["Lua", 0.04], ["TCL", 0.03] ] # Make a Pygal chart pie_chart = pygal.Pie() # add … | |
I have code that when executed will give me a long list output, which is fine, but how can I get it to print without the parenthesis and commas? example: answer =('7', 'Q', '5', 'H', '9', '4', '3', '8', 'L') but I'd like it to print like this: 7 Q … | |
The code: print [c[i] for c in ['as','df'] for i in range(len(c))] outputs: ['a','s','d','f'] while, print [c[0] for c in ['as','df']] outputs: ['a','d'] - The first letter of each word. shouldn't the output be ['a','d','s','f'] - Why is this different? | |
A simple code example on how to play wave sound files with the Python module PyGame. | |
Hey guys I have a program download link here... (link deleted) This program is used to purchase a pair of sneaker on adidas.com. I am a rookie in coding and have no idea what to do with it. I know it is a python file and you are supposed to … | |
I'm new to Python, but have a long background in Perl, Ksh &c, C, and others. """One of the different things about Python is the import statement. How do you tell where a function or class name should be imported from? Some are obvious, like sys and math, but others … | |
I'm working on a program to log the work i do as well as email the monthly log. The problem i'm having is that every time i try to test out the smtp i get an error ` Traceback (most recent call last): File "C:/Users/palmer_a/Documents/App/testy.py", line 5, in <module> import … | |
Hello. I have a list: mylist = [2,4,4] How can i take number 244 out from the list? Something like: number = 244 Here 244 is integer. | |
A simple way to find out a Python module's location on your drive. | |
I am learning python and trying to connect my satellite decoder using telnet. When I tried to connect my device through telnet python script, I could successfully connected to the device. But i want to capture/save as well as read the output and logs of device (connected thru telnet) from … | |
I started to learn python today by myself using this course: https://www.youtube.com/watch?v=bX3jvD7XFPs&list=PLB2BE3D6CA77BB8F7 Is that a good start? which book for beginners do you recommend ? *the problem with that course is that i found a lots of things in that code i do not understand i need a book which … | |
Hello again. How can i limit my list indexes? I want my list to take only 3 indexes for example. | |
Hi, me again :) Look at this error please: File "./kivycal-1", line 103, in number_two self.check() TypeError: check() takes exactly 2 arguments (1 given) The error is pointing to here: def number_two(self, event): global numbers numbers.append(2) print numbers self.check() This is a part of a class in a .py file. … | |
Here is my encryption program. The decryption program is what is giving me some trouble. Here is the description of the first part: # encrypt.py - ENCODE MESSAGE AND WRITE TO FILE # # initialize a cipher list to store the numeric value of each character # input a string … | |
Hello. mylist = [6, '/', 3, '+', 9, '+', 8, '+', 1, '/', 2] How can i delete that list indexes? I tried: def clear(self, event): global numbers for i in numbers: print i del numbers[i] But it didn't work: File "./kivycal", line 83, in clear del numbers[i] TypeError: list … | |
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? | |
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 … | |
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 = … ![]() | |
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 … | |
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 … | |
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 … | |
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?? | |
![]() | 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, … |
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 … | |
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. | |
I started learning python a few days ago, i want to learn both python and C++ What is your advice ? | |
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. | |
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 … | |
How can i create a drop-down menu in Tkinter? | |
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 … |
The End.