15,185 Topics

Member Avatar for
Member Avatar for sam.tubb.75

Hello everyone! I have made a game intended for the Rasberry pi in python. It is called Pi Blocks, but all of my friends with windows want to play it, so I've been trying and trying to get the game into an exectutable format, but nothing seems to work! I've …

Member Avatar for sam.tubb.75
0
330
Member Avatar for rwe0

I am using Beautiful Soup 4, python 3.x on a project just to learn it. 1. soup = BeautifulSoup(s ) # use default parser 2. soup = BeautifulSoup(s, 'html5lib') # specified parser Actually #2 solved my problem already. But, when using the first approach I got different behavior on my …

Member Avatar for rwe0
0
397
Member Avatar for 123pythonme

I've been set an assignment to find all the prime numbers smaller than N We've been told to first create a function to test if it is divisble by any numbers in my primes list and then second to create a function to test each integer from 2 to N, …

Member Avatar for vegaseat
0
579
Member Avatar for slate

The most efficient static sieve generator in python I have seen so far. Returns the list of primes, that are not greater than n.

Member Avatar for vegaseat
1
493
Member Avatar for nitin1

hello, I have started learning python these days. Although i am following a course on coursera.org for learning it , but that course is going very very slow. Also, I don't know if that course contains all things which is need to build codes in python. I have very good …

Member Avatar for nitin1
0
412
Member Avatar for mdfaisalamin

I have a database with some entry. In my web application I log in with a page and show the corrosponding entries for that user on another page. I am using Jinja werkzueg for my light weight example. And using SQL alchemy. Here is my code for showing the password …

0
110
Member Avatar for krystosan

I hav amde this alias : test='python -m nose.core --tests $1 -s --with-coverage' this runs but gives an OS Error saying: $ test test_filterList.py nose.plugins.cover: ERROR: Coverage not available: unable to import coverage module ....E ====================================================================== ERROR: Failure: OSError (No such file /Users/sanjeevkumar/Development/python/-bash) ---------------------------------------------------------------------- Traceback (most recent call last): File …

Member Avatar for krystosan
0
561
Member Avatar for nitin1

import sys i=0; def func1(i): print "i am in function func1" if i<5: i=i+1 func1(i) else: return return def main(): print "beginnning the function\n" func1(i) print "hello Daniweb" s='aman' print "hahha" main() it is giving me syntax error in print "hahha" statement. WHat is that ? According to me, it …

Member Avatar for nitin1
0
203
Member Avatar for iwavetostars

Good day everyone - Since this is my first post, I must say hi. I just started learning Python 8 hours ago and I like to challenge myself, so following a guide on playing with files, I decided to make a program that would open a .txt and it would …

0
167
Member Avatar for krystosan

I am trying to run python -m nose.core --tests test_module.py -s --with-coverage but I keep getting error message saying /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named nose but then i installed nose like this $ sudo easy_install nose Searching for nose Best match: nose 1.3.0 Adding nose 1.3.0 to easy-install.pth file Installing nosetests …

0
68
Member Avatar for happygeek

In what has been called by some commentators the ‘most significant update in five years’ the latest version of Python finally come of age. Python 2.5 not only apparently fixes some 450 bugs discovered since the 2.4 release was, err, released, but also throws in some 350 patches for good …

Member Avatar for vegaseat
0
726
Member Avatar for toll_booth

Hi everyone, I just downloaded and installed numpy, and I'd like to give it a try. But I can't seem to import it. When I try, this is what happens: Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for …

Member Avatar for vegaseat
0
338
Member Avatar for wrathofmobius

First of all, I should say I'm brand new to PyGame and am pretty new to advanced Python. I'm trying to make a side-scrolling game but just making a sprite move back and forth with keyboard input is proving to be a problem. It appears that the loop is running …

Member Avatar for vegaseat
0
890
Member Avatar for Krontical

Hello everybody~! I'm trying to install the latest version of pyHook for my Python 3.3.2 shell. I am a new coder in Python, all though I am rather experienced in lua. Unfortunately, after multiple attempts of trying to install pyHook (1.5.1), I am unable to do so as I get …

Member Avatar for snippsat
0
727
Member Avatar for Spider_14

I made a button "yes". If the button is clicked, how do I insert "5" into an entrybox (aldready existing).

Member Avatar for woooee
0
125
Member Avatar for TheCodeCrimson

Hello! Pretty new to Python but I'm kind of loving it. Already involved in illustration, design, and creating web content for clients, but I'm hoping to expand beyond that into full-fledged web development as well. I know a fair amount of html/css, and was looking for advice on other languages …

Member Avatar for TheCodeCrimson
0
281
Member Avatar for AcmeUK

Hi Guys I want to use ModemDriver.py (v2.0.13) to send and receive SMS via a Mobile Broadband modem. Please don’t tell me to use Wammu/Gammu etc. I have wasted weeks trying to get then to work correctly! I can get things working via the command line. What I want to …

Member Avatar for AcmeUK
0
234
Member Avatar for hmx7

I need to restrict this loop from using values greater than 101 and less than zero. The assignment is to make program that finds the average of test scores inputed. I can't figure out what to do, but i feel it's simple. thanks in advance T = 0 GC = …

Member Avatar for hmx7
0
150
Member Avatar for Waseemaburakia

I need help with my homework. Out professor doesn't explain anything and i'm struggeling. TMy homework is: Write, test and debug a program which asks the user to enter three floating point numbers and then reports the largest and the smallest of these values. Here is the example program dialog: …

Member Avatar for slate
0
259
Member Avatar for Waseemaburakia

I need to write a program as following: Write, test and debug a program to calculate and output the minimum, maximum, and average of a list of positive test scores. Ask the user how many scores s/he intends to enter. Assume exactly that many scores will be entered one per …

Member Avatar for Waseemaburakia
0
228
Member Avatar for MSV22

Hi I am getting this error AttributeError: 'module' object has no attribute 'instancemethod' I searched through the forum and found answers for this error, but it is not working in my case. I am using python 2.6 and wxpython 2.8. The program which where running perfectly earlier are also showing …

Member Avatar for soibac
1
2K
Member Avatar for krystosan

import unittest import filterList class TestFilterList(unittest.TestCase): """ docstring for TestFilterList """ def setUp(self): self._filterby = 'B' def test_checkListItem(self): self.flObj = filterList.FilterList(['hello', 'Boy', 1], self._filterby) self.assertRaises(filterList.ItemNotString, self.flObj.checkListItem) def test_filterList(self): self.flObj = filterList.FilterList(['hello', 'Boy'], self._filterby) self.assertEquals(['Boy'], self.flObj.filterList()) if __name__ == '__main__': unittest.main() my above test test_checkListItem() fails , for the below filterList.py …

Member Avatar for krystosan
0
362
Member Avatar for Bhavya scripted

hi i recently found an interesting problem(#19) on the project euler website - projecteuler.net The real answer is 171 and i am getting 175 What is wrong with this code- def sunday(): c=0 sun=0 months=[31,59,90,120,151,181,212,243,273,304,334,365] leapmonths=[31,60,91,121,152,182,213,244,274,305,335,366] for i in range(1901,2001): n=leap(i) #Checking if year is leap year if n == …

Member Avatar for TrustyTony
1
463
Member Avatar for talat.zaitoun

I'm new to python so any help would be appreciated, here is a code i've been working on for calculating gpa, I have to calculate gpa of an inputed number of courses by a user (could be 2-infinte number of courses); btw this is not the whole function but only …

Member Avatar for slate
0
177
Member Avatar for mrgadgets

Hi guy, I need those of you who has below os to help me test run [this new software](https://sourceforge.net/projects/fastfilemanager/). windows os (64 bit/32 bit) windows 7/xp/2000/98 etc linux (64 bit/ 32 bit) It is really simple to install the above software, just download the zip file, unzip it, click on …

Member Avatar for slate
0
139
Member Avatar for krystosan

I want to test the layer filtering feature that I added in the UI, so to test using mox def test_layerFilter(self): """ layer filter Knob changed """ mx = mox.Mox() mx.StubOutWithMock(self.writeTab, '_createElementTypesFilterList') mx.StubOutWithMock(self.writeTab, 'getDetails') mx.StubOutWithMock(self.writeTab, 'updateResolutions') self.writeTab.updateResolutions() # Calls self.writeTab._createElementTypesFilterList().AndReturn(['I', 'IST',]) self.writeTab.getDetails().AndReturn(['I_bar']) mx.ReplayAll() self.writeTab.refresh('layerFilter') self.assertEquals(self.writeNode['layerOption'].values(), ['I_bar']) mx.verifyMox() my test assertion …

0
74
Member Avatar for hmx7

I have an assignment that is very similar to a past assignment. I have to create a for loop to find gpa. The previous assignment was to use a while loop: stop1 = int(input('How many GPAs do want to calculate? ')) totalgp = 0 totalgp1 = 0 while stop1 > …

Member Avatar for hmx7
0
182
Member Avatar for antonio.neal.39

I am working on a program for work and trying to make a massage bar with text can anyone help? I just want the text to move across the screen. from tkinter import * Gui = Tk() Gui.geometry('8000x100+1+600') Gui.title('ALARTS') Gui.config (bg = 'blue') massage = Label(Gui, text = 'this is …

Member Avatar for antonio.neal.39
0
292
Member Avatar for vegaseat

A simple way to find duplicate words in a text. In this case the text is preprocessed to eliminate punctuation marks and set all words to lower case.

Member Avatar for paddy3118
2
4K
Member Avatar for Ismatus3

Hello , I have a question about , if there is possibility , to prepare event , after an insertion in database is done , and how ? , using MySQLdb for python and MySQL .

Member Avatar for Ismatus3
0
120

The End.