14,952 Topics

Member Avatar for
Member Avatar for mark.mcrae.92

I have a path I trying to hook up to marathon (an automation testing tool) to locate a folder on an SVN but I keep getting a name error here is the module code def LookUpPathPrefix(pathToFind): from marathon.playback import * inFile = open("paths.txt", "r") mountPointName = "start" while (mountPointName): mountPointName …

Member Avatar for mark.mcrae.92
0
291
Member Avatar for Vish0203

Hello everyone! I got this question in a book.. I thought of doing it using map() or using loops return the first count multiples of number in desc order in a list. e.g call with input (3,2) returns [6,3] call with input(5,3) returns [15,10, 5] but the hint along with …

Member Avatar for rrashkin
0
238
Member Avatar for Sharjeel Ali

in web2py table when i m renaming field causes data to be lost and then i m not able to recover data for that table is their any solution that my data should be recover after field change in database

Member Avatar for Gribouillis
0
70
Member Avatar for Eric_8

Hi, I'm newbie in Python Programming. I created the below code. I want to optimize it, but dont know where to start. I am sure, I can do the same with less lines of code. Please advise on best practices and ways on how to optimize it. import math def …

Member Avatar for Eric_8
0
378
Member Avatar for 26bm

Hi, I am wondering if there is any easy way to up the frame rate of a pygame program. For example locking the frame rate? I don't know. Thanks in advance! 26BM

Member Avatar for 26bm
0
244
Member Avatar for charlie1329

Hi, the following is the code for my a2 computing project. Essentially what I have tried to do is set up two basic structures of GUIS and then inherit them into other classes so I can add components to the basic structure. However, when I create a MainMenu object, only …

Member Avatar for charlie1329
0
4K
Member Avatar for dashing.adamhughes

Hi, I built a Polygon() class that originally only was initialized with veriticies: Polygon(verts=(1,2,3,4) But as the code evolved, I added a few @classmethods to construct the Polygon from other inputs. For example: Polygon.from_center(center=(1,2), length=5) Now my problem is that I'm trying to find the canonical way to choose which …

Member Avatar for dashing.adamhughes
0
252
Member Avatar for Fakeyede

Assume that there are n tyres that could be used by car, tricycle and bicycle. Write a program to accept n tyres and generate all the combinations (i.e. the number) of car(s), tricycle(s) and bicycle(s) that could exhaust the n tyres. Ensure that all the objects have fair share where …

Member Avatar for TrustyTony
0
281
Member Avatar for lewashby

In the following program how does the line `r.size = 150, 100` actually set the values using this line -> `size = property(getSize, setSize)`? property has two arguments, getSize & setSize, it seems to me that would only allow it so get one value and set one value. #!/usr/bin/python3 class …

Member Avatar for Gribouillis
0
212
Member Avatar for lewashby

I know python is an interpreted language but is there a way to compile your code? What if you write a program in python 3 and the user has python 2.x, or worse yet, doesn't have python at all. How can you create an executable via compiling or any other …

Member Avatar for TrustyTony
0
317
Member Avatar for davidw87

Hi i was wondering if anyone could help me, im wanting to when you click in a certain area it changes the background image thanks import Tkinter as tk from Tkinter import* import urllib import base64 def click(event): if event.x > 100 and event.x < 430: if event.y > 100 …

Member Avatar for vegaseat
0
465
Member Avatar for Waseemaburakia

I'm trying to write a recursive functionthat receives a parameter n and returns the multiple of 5. Example: if we have 5 as the argument, the print out will be : 5 10 15 20 25 My code: def MultiplyRecursive(r): if r == 1: return 5 else: return MultiplyRecursive(r-1) + …

Member Avatar for fonzali
0
214
Member Avatar for lewashby

class MemberCounter: members = 0 def init(self): MemberCounter.members += 1 # m1 = MemberCounter() # m1.init() # MemberCounter.members -> 1 # m2 = MemberCounter() # m2.init() # MemberCounter.members -> 2 # m1.members -> 2 #m2.members -> 2 # m1.members = 'Two' # m1.members -> 'Two' # m2.members -> 2 In …

Member Avatar for lewashby
0
176
Member Avatar for Caulm64

#Name: Calum Macleod #Date : November 6, 2012 #Purpose: A Python program with a loop that lets the user enter a series of whole numbers. #The user should enter the number -99 to signal the end of series. #After all the numbers have been entered, #the program should display the …

Member Avatar for sneekula
0
10K
Member Avatar for hellohellohello

I need to read excel files and compare them and produce new outcomes using Python. i have realized that by suing the following codes I can read an excel file: import xlrd wb = xlrd.open_workbook('values.xls') wb.sheet_names() But i keep getting error of: [COLOR="Red"]Traceback (most recent call last): File "C:/Python26/Atest/filename.py", line …

Member Avatar for akiva.berger
0
5K
Member Avatar for fheppell

I'm writing a script that downloads files for web design, and this line produces Traceback (most recent call last): File "bootlace.py", line 60, in <module> download(data['jquery'], 'Downloading jquery. (File size %s)', 'js/') File "bootlace.py", line 11, in download file_size = int(meta.getheaders("Content-Length")[0]) IndexError: list index out of range That line is …

Member Avatar for snippsat
0
2K
Member Avatar for fheppell

I'm learning django and for the latest version of the tutorial i'm using, you must have python 3 installed. Despite the fact I have python 3 installed, python 2.7.6 is being loaded. My path originally had no reference to python, so I added it. C:\Ruby200-x64\bin;C:\Users\Freddy\AppData\Roaming\npm;C:\python33\python.exe However, python 2.7.6 is still …

Member Avatar for slate
0
350
Member Avatar for sravan953

Can the sibprocess.call('') function be used to execute .mp3 files, it doesn't work for me. Which function is used to run any video or audio file from within Python?

Member Avatar for aru123
0
2K
Member Avatar for DTSCode

so i "finished" my irc bot in python. by finished i mean it only connects to irc.quakenet.org #cplusplus (you can see it if you connect. its called DTSCode-Bot). however, the point of my class isnt just to create a bot. i also want to create a client. so i cant …

0
112
Member Avatar for bryann

I am trying to create a Caesar Cipher in Python. I have managed to put together my program with the help of some other websites but have hit a bit of a wall. My code allows me to encrypt a single character and will then ouput this and write it …

Member Avatar for mathijs
0
248
Member Avatar for marigold23

Hey there everyone. well i have been working on python for about 2 months now and i just cant seem to get my background image to work. I have created the GUI with Tkinter and put a label in it with my name etc, but the idea was to have …

Member Avatar for mrv8corvette
0
6K
Member Avatar for moustafaalsayeh

Hi there, I am a novice in python. I want to use python in web development but I don't know where I start. Please help me.

0
103
Member Avatar for WILLIAM_5

Hi everyone, I recently installed Python on Windows. I wanted to develop a gui program using Tkinter. The problem is that when I try to import Tkinter module. It gives me a 'module not found' error. But I thought Tkinter was preintalled within Python's installation. It is even more confusing …

Member Avatar for nichom
1
622
Member Avatar for Freaky_Chris

Hey, im having a problem retrieving information about some files due to the fact either the file name or the extension is too long. For example i want to retrieve the size of a file only i call [CODE=Python]os.path.getsize("somelongfilename.txt")[/CODE] Note that it may not be a .txt extension, but it …

Member Avatar for johnres
0
4K
Member Avatar for lewashby

In the following program why is pwd.getpwuid returning my user and group names followed by three commas? Where ar ethe commas coming from? #!/usr/bin/python3 import os, stat, pwd dirList = os.listdir() permissions = (stat.filemode(os.stat(dirList[1]).st_uid)) string = permissions + ' ' string = string + dirList[1] print(string) temp = os.stat(dirList[1]) print(temp.st_uid) …

Member Avatar for robertwehner
0
105
Member Avatar for srinu_1
Member Avatar for robertwehner
0
197
Member Avatar for srinu_1

hi, **please help me to solve the error for:** **text1.txt:** line1 <data> line2 <items> line3 <match name="item1" rhs="domain.com"></match> line4 <match name="item2" rhs="domainn.com"></match> line5 <match name="item2" rhs="1010data.com"></match> line6 </items> line7 </data> **text2.txt:** line1 djshjsdf line2 sdfngjfg check domain.com,domain.com,1010data.com in text2.com, if not there print domain.com,domain.com,1010data.com in to the 3rd text file(text3.txt) …

Member Avatar for snippsat
0
371
Member Avatar for alon.lavi.7

I'm trying to create a window with QWebView as its central widget and set inside it only the youtube clip box without the rest of the information on that youtube webpage. The YouTube links can change by request of the user. I found this [example](http://stackoverflow.com/questions/15983148/the-sound-dont-stop-when-qwebview-window-closed-loaded-with-youtube-video) where it works that way. …

0
39
Member Avatar for Tcll

so.. to put this simply: >>> BU5 = bu(5) >>> BU5() 0 >>> BU5(1024) 1024 >>> BU5 == bu(5) False >>> BU5 <__main__.bu instance at 0x00AC5E40> >>> bu(5) <__main__.bu instance at 0x012C6788> BU5 == bu(5) is supposed to return True due to it's expected usage: >>> var = bu(5)() #read …

Member Avatar for Tcll
0
184
Member Avatar for vegaseat

The End.