15,194 Topics
![]() | |
hello friends i just start learning Python and i am going through book "how to think like a computer scientist", in forth chapter it start using "GASP" which needs to be installed and book totally ignored the need of a newbies regarding installation. so after some mucking around i did … | |
I know this is like an idiot question, but i'm like totatlly stumped by it for some reason. First and foremost, i'm a total newbie at coding(1st month and would be grateful if someone could at least help me with the first part of the project to help me get … | |
I have been trying to create a program that asks for a username and password, and if the user gets it right exits the program, if they get it wrong asks again, and if they get it wrong again logs out of the system. TWO QUESTIONS: 1: is this possible? … | |
i am trying to do this consider a=[[(34,5),(34,6)],[(35,5),(35,6)]] b=[(36,5),(36,6)] i want to put elements of b in a so i do a.append(b) now if i do b.pop() why does it effect a? a ends up being `a=[[(34,5),(34,6)],[(35,5),(35,6)],[(36,5)]]` WHY?? is there a way around it?? i don't think i had this … ![]() | |
Why does this return None? [CODE]list1 = ['Herring','used','to','be','abundant','in','the','AtlAntic','Ocean','then','herring','got','overfished'] print list1.sort(key=lambda s : s.count('a'))[/CODE] | |
everytime i click to open one it says it cannot open the file and when i search for a program online to open it none come up wat do i need to open it thanks all for your help | |
I am trying to use the fileinput.input() module to read in the lines from a bunch of files in a directory and occasionally receive an IOerror exception. What is the best way to handle this exception so that if 1 of the items in the list i'm feeding fileinput,input() generates … | |
Greetings, I'm a python newbie struggling with the obvious. I have a txt file with fixed width whitespace between the elements. Excel can't import directly because the size of the whitespace varies between columns. I have stripped the header out leaving only data. This is the code I've tried to … | |
Hey everyone, I've been using python quite a bit to develop scientific applications. As of late, the Enthought Tool Suite is proving to be one of the handiest set of development tools out there. One question I have is, with commercial software, I often see the ability to plugin output … | |
Hi, I'm trying to code a little Python script using the PyHook library. My script prints in the program every key pressed by the user, and the name of the window where he did it. But what I want for the program to do is to print the name of … | |
Write a program that prompts the user for their monthly deposits and withdrawals from their checking account. After each transaction, output the balance and the amount withdrawn or deposited. At the end of the program, output a formatted table of the transactions. Use the Python format function to only display … | |
Hi, i don't know how to start with this problem. Lets say i have 6 random letters in any order, "mnador" and i need to find all words those letters can make e.g. "random", "roam", "man", "and" etc. from a wordlist.txt that i have. Any tips? | |
The short of it is that I have a widget, with source, written in Tk, specifically an analogue gauge, that I would like to use in a TKinter gui. Is this even possible? If so, how? Thanks for any insight you might have. | |
I'm trying to figure out how to allow users to upload images, I'm starting easy with something I know tkinter can handle with no coercion, gif files. I've figures a bit out, but I'm having issues getting the image to actually SHOW. [CODE]from tkinter import * from tkinter.filedialog import askopenfilename … | |
hi guys. can anyone tell me why this code doesn't work? It doesn't raise any error but neither does it provide the expected results. [CODE] my_list= ['a','b'] class my_class: def __init__ (self): self.name = ' my name is hi' for a in my_list; a = my_class() [/CODE] a.name() gives and … | |
Hello, I am new to this site, and new to programming. I am currently pursuing an associates in associates in programming and am taking an intro class to python, but i am having a serious issue with raw_input. For some reason i am having a hard time understand raw_input and … | |
I'm new to python and need help using the turtle graphics that is on python. I don't know how to start it up or anything. Python is completely new to me and so is programming. | |
Hi everybody, can someone help me pls finding a goot RATing tutorial for a beginner??? I wanna code a rat in python but i have no sources. | |
How would I define the command of a given button in a messagebox window? i.e. if I were using askokcanel how would I make the ok do a certain action and cancel another? | |
I did some transformation of overcomplicated Rosetta code version | |
there are xls files saved in a folder and all of them have have values in the 1st, 2nd, and 3rd columns. in the folder there are about 100 excel files, the first five number of excel file names represent the patient id.there are about 5 to 10 excels for … | |
How would I access the string that is in the [1] position of a tuple at a given index of a listbox. What I'm trying to do is something like this:[CODE] a=Lb1.curselection()[1] a=int(a) print(Lb1[a])[/CODE] Lb1 is obviously the listbox. This particular attempt claims 1 is out of range "although I … | |
Roman numbers is a standard programming exercise, to give it a small twist, we input roman numeral, turn it to value and prepare minimal version of it using the substraction rule. Correctness of the input is not checked so Garbage in - Garbage out. | |
I don't know if I can't find my problem, or I'm just getting my keywords wrong when searching for a solution, but I can't solve it. I'm getting problems with adding values to lists, here is my code: [CODE=Python]x=[] a=raw_input ("Hello, add your first database entery") b=raw_input ("Hello, add your … | |
While looking stuff about idlelib, I came to [URL="http://stackoverflow.com/questions/3431498/what-code-can-i-use-to-check-if-python-is-running-in-idle"]this thread in stackoverflow[/URL], so I posted own solution. I post it also here, as maybe somebody needs it (as for example \b looks ugly in IDLE) | |
I made a simple ThreadManager class that receives tasks and spawns threads to complete the tasks. Currently it keeps all the threads alive until I explicitly set threadmgr.waiting=False and all of the tasks are complete. I'm trying to eliminate the need for the former. What I would prefer is that … | |
I have run my codes (written in Python) in my Notebook (3 GB Ram, Dual-core CPU T4500 @ 2.3 GHz) and in my lab machine (11.57 GB Ram, i7-920 CPU @ 2.67 GHz). However, I have found execution time in Notebook 250.3 seconds, and in Lab machine 333.2 seconds. How … | |
I would like to make a selection menue for 2 programs that i have. A menu similar to the one below. [CODE]import sys print """Menu 1) Random 2) Search""" answer = raw_input("Make a selection> ") if "1" in answer: print "This will contain program 1" elif "2" in answer: print … | |
So this is my first post and I have only begun using python. One of my first assignments is to design a program which will count the most used words in the given text file. In my case we are using the Declaration of Independence. Here is what i have … | |
I just finished a program, it worked perfectly, then I changed a bit of it, and now it won't work at all, even if I change it back. [CODE]self.secret_txt = Text(self, width = 35, height = 5, wrap = WORD).grid(row = 3, column = 0, columnspan = 2, sticky = … |
The End.