14,945 Topics

Member Avatar for
Member Avatar for haze man

Hi guys I have already posted code to do with a solar system but this is my second go at it to make it better and more clean but i am have trouble making it actually print out the result in turtle. Could some one please help me? I think …

0
146
Member Avatar for vegaseat
Member Avatar for kostas89
2
12K
Member Avatar for novicecoder10

#### Function secondLoop has the same components with the additional lines # number = len(sentence) while number != 0 #While flag==True letter = input("Enter letter: ") # letter is asked in function again if letter not in enteredLetters: find = sentence.find(letter) if find == -1: print("Letter is not in word") …

Member Avatar for woooee
0
231
Member Avatar for takumi05

hey with this code that ive written, im not sure why its not outputting a value for the BMI.. can anyone help?? thanks def application(environ, start_response): headers = [('content-type', 'text/html')] start_response('200 OK', headers) formdata = cgi.FieldStorage(environ=environ, fp=environ['wsgi.input']) if formdata.has_key('Mass') and formdata.has_key('Height'): Mass = float(formdata.getvalue('Mass')) Height = float(formdata.getvalue('Height')) BMI = formdata.getvalue('Mass/(Height*Height)') …

Member Avatar for nadeem.lalani.3
0
211
Member Avatar for varshaholla

I wanted to display the blue mean value in the text box, but it is giving me an error blue.set(B_mean1) AttributeError: 'numpy.ndarray' object has no attribute 'set' And this is my code: from Tkinter import Tk, Frame, BOTH from Tkinter import * import cv2 from collections import * from CBIR …

Member Avatar for woooee
0
3K
Member Avatar for varshaholla

i'm taking the image from the user, and displaying it using label. Now i have to use that image for further processing. my code is: from Tkinter import Tk, Frame, BOTH from Tkinter import * import cv2 from collections import * from CBIR import * from experiment import * from …

Member Avatar for vegaseat
0
886
Member Avatar for John A.

Hey guys, I'm trying to get all links on a website using BeautifulSoup, Queue, Threading, and urllib2. I am specifically looking for links that lead to other pages of the same site. It runs for a few seconds, going through about 3 URLs before giving me the error: Traceback (most …

Member Avatar for Sky Diploma
0
729
Member Avatar for nouth

It is possible to read/write the binary of any file with using Python? `open(file, "b")` only works for windows `"rb"` `"rb+"` `"wb"` `"wb+"` `"ab"` `"ab+"` works but `.read()` just prints the file contents not its binary

Member Avatar for nouth
0
696
Member Avatar for rogerg

Hello, I have a mac os specific problem with iPython. The code I have works fine by using iPython on a PC by launching it with --pylab. On mac os, I try to do it with ipython-qtconsole-1.0.0-py27_0 My code is made for recognizing characters on an image. The part of …

Member Avatar for rogerg
0
292
Member Avatar for heycooldude

I have my outlook mailboxes in this structure mailbox1 -Inbox Mailbox2 -Inbox Current script is able to access Inbox of mailbox1 as it is my main mail box where as mailbox2 has been added into my profile. I want to be able to access Inbox of Mailbox2 import win32com.client import …

0
180
Member Avatar for varshaholla

hello, i want to know whether i can display an image from the path i have selected? like, i have a path for example: c:\user\desktop\33.jpg, and i want to take only that jpg file and i have to display that image using label or something. If it is possible, i …

Member Avatar for varshaholla
0
330
Member Avatar for Diego_4

position = 0 tasks = [] task = [task1,year,month,day, hour, minute, second, microsecond,str(cuando),cuando]# this is a list that is filed into another list# while k < CantTareas : ans = raw_input ("did you finish any of your tasks? (yes or no) ") if ans == "yes": k = k + …

Member Avatar for snippsat
0
228
Member Avatar for veledrom

Hi, I'm about to start learning Python and want to find an IDE. For example something Visual Studio like stuff. WYSIWYG so when I write code, I should have a button somewhere to click and see the output. For free and for Windows and Linux platforms. I downloaded Komodo Edit …

Member Avatar for Tcll
0
509
Member Avatar for jtran57

I am trying to make the shape move here is my coding bif="space.jpg" import pygame, sys from pygame.locals import * points=[(-60,20),(-60,-20),(-20,60),(20,60),(60,20),(60,-20),(20,-60),(-20,60)] colour=(0,191,255) pygame.init() screen=pygame.display.set_mode((1280,800),0,32) background=pygame.image.load(bif).convert() x,y=0,0 movex,movey=0,0 while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() if event.type==KEYDOWN: if event.key==K_LEFT: movex=-1 elif event.key==K_RIGHT: movex=+1 elif event.key==K_UP: movey=-1 …

0
46
Member Avatar for kxjakkk

file_spellcheck = input("Name of the document to be spell-checked: ") with open(file_spellcheck, "r") as i: spellchecking = i.read() for item in spellchecking: items = item.split() if items in with open("file.out", "w") as i: i.write() I need to make a spell checker that uses another file as a dictionary. So let's …

Member Avatar for vegaseat
0
271
Member Avatar for rbyrd

I'm trying to write a program in which a message box is to appear on the application window when the application is launched. The code below produces the message box, but it appears as a separate window that is not over the application window. Is there a way to fix …

Member Avatar for woooee
0
310
Member Avatar for kxjakkk

#Import Story text = open('./alice.txt', 'rb').read() #Split the text into individual words def split_text(text): #Import known words index index = open('./words.dat', 'rb').read().split() index_file = open('./words.dat','wb+') for word in index: index_file.write(word) index_file.write('\n') import string #Remove punctuation out = "".join(c for c in text if c not in string.punctuation).lower() # split the …

Member Avatar for snippsat
0
2K
Member Avatar for asadmoosvi

I have been programming for quite a while in Python but have just started to learn OOP properly. I find it really confusing and I don't really understand it. Especially the implicit self that python automatically passes. It just isn't clicking, really. May someone provide an easy explanation of what …

Member Avatar for vegaseat
0
321
Member Avatar for tutsie12
Member Avatar for tony75

Hi I got this error ImportError: No module named Crypto.Cipher Where can I find the module for windows and debian linux? How can I fix error both in windows and Linux? importerror no module named crypto.cipher windows Traceback (most recent call last): File "C:\Users\Win/\Desktop\client.py", line 2, in <module> from Crypto.Cipher …

Member Avatar for tony75
0
16K
Member Avatar for kxjakkk

I'm trying to create a program that will prompt the user for a list of text files to read from, then read those text files and build a dictionary of all the unique words found. Then finally put those unique words into another file and make it alphabetical order from …

Member Avatar for kxjakkk
0
637
Member Avatar for knan

I have a dictionary [CODE]dict1={'18':['4000','1234'],'12':['7000','4821','187','1860','123','9000']}[/CODE] I want to sort the keys and values such that, the output is, [CODE]dict1={'12':['123','187','1860','4821','7000','9000'],'18':['1234','4000']}[/CODE] I tried something! but it didn work [CODE]>>> for values in dict1: ... dict1[values].sort() ... >>> dict1 {'18': ['1234', '4000'], '12': ['123', '1860', '187', '4821', '7000', '9000']}[/CODE] Full sorting happens for …

Member Avatar for grantjenks
0
806
Member Avatar for PC

My code has a raw_input in it - when I press Enter, it completely ruins the code which says that the string index is out of range. The annoying thing is that if you don't press Enter and type something in, it works perfectly fine. So my question is - …

Member Avatar for Gribouillis
0
182
Member Avatar for alagez

Hi there, I am planning to create one robot choosing center. But I do not know how to use the idea to execute in python software. my idea is, let say a customer wants to choose a robot how to use the rule below to execute in python: IF the …

Member Avatar for alagez
0
274
Member Avatar for abaddon2031

I have a python code that reads several csv files and writes teh data to a single file but every time it loops back around to the next file it prints the headers again. Is there a way to stop this I can post my code if it is nessisary.

Member Avatar for abaddon2031
0
280
Member Avatar for Spencer_3

Hello I'm currently working on a Interface for fun as a side project using Tkinter. I was wondering if anyone had a small code for a password and shutdown button I do have the button however it doesnt shut down the program. the password has a text box and is …

Member Avatar for Spencer_3
0
1K
Member Avatar for Nafisa Morsalin
Member Avatar for reham.mostafa.14268

I have two text files and I want to compare them and save the matched columns to a new text file. file1: 114.74721 114.85107 114.85107 2.96667 306.61756 file2: 115.06603 0.00294 5.90000 114.74721 0.00674 5.40000 114.85107 0.00453 6.20000 111.17744 0.00421 5.50000 192.77787 0.03080 3.20000 189.70226 0.01120 5.00000 0.46762 0.00883 3.70000 2.21539 …

Member Avatar for vegaseat
0
488
Member Avatar for aditya369

Hello all, please help me in writing a tic-tac-toe python program which actually learns as it plays with the user. So, starting as a dumb opponent, the program should be able to learn from the games being played against the user and evolve as a clever opponent it plays along... …

0
165
Member Avatar for begueradj

Hello How can we know which GCC version is compatiable with a given Python version ? Regards

-1
123

The End.