15,175 Topics

Member Avatar for
Member Avatar for ashdane.beckford
Member Avatar for Schol-R-LEA
0
111
Member Avatar for hmx7

class student_name: def __init__(self,student): self.student = student def student_name(self): print('Student Name: ', self.student) class Majors: def __init__(self,name1,name2): self.name1 = name1 self.name2 = name2 def major(self): pass def major2(self): print('Majors: ',self.name1, self.name2) class School: def __init__(self,school): self.school = school def school_name(self): print('School Name: ', self.school) class Student_Track: def __init__(self, School, student_name, …

Member Avatar for hmx7
0
169
Member Avatar for glez_b

I have a long list of data structured in the following way Date , Time, Temperature, Moisture, Accumulated precipitation 1/01/2011, 00:00, 23, 50, 2, 1/01/2011, 00:15, 22, 45, 1, 1/01/2011, 00:30, 20, 39, 0, 1/01/2011, 01:00, 25, 34, 0, 1/01/2011, 01:15, 23, 50, 0, . . . . 1/01/2011, 23:45, …

Member Avatar for glez_b
0
3K
Member Avatar for pygeek

Hi, im new to this forum, im trying to make a text editor in python for my school, and its nearly finished, but whenever i save a text file then open it again it makes weird square symbols at the end of each line. Thanks in advance. And i didn't …

Member Avatar for pygeek
0
480
Member Avatar for james.lu.75491856

Traceback (most recent call last): File "C:\Users\James\Desktop\pvz.py", line 64, in <module> Pea((10,20)) File "C:\Users\James\Desktop\pvz.py", line 48, in __init__ Projectiles.add(self) File "C:\Python27\lib\site-packages\pygame\sprite.py", line 319, in add sprite.add_internal(self) File "C:\Python27\lib\site-packages\pygame\sprite.py", line 147, in add_internal self.__g[group] = 0 AttributeError: 'Pea' object has no attribute '_Sprite__g' import pygame,traceback width = 480 height = 640 …

Member Avatar for james.lu.75491856
0
563
Member Avatar for sreetha

sir please give me a code for finding bigrams in a given file. example .. if the word is I AM AN OLD MAN.. output should be in a list as [I AM] [AM OLD] [OLD MAN]. i have seen some programs but its giving bi grams of a word. …

Member Avatar for Gribouillis
0
112
Member Avatar for talat.zaitoun

def my_startswith(s1, s2): if s1[0] == s2[0]: return True elif s1[0] != s2[0]: return False elif s2 == '': return True elif s1 == '' and s2 == '': return True Iam having trouble with the third and fourth elif. Third elif: i need to say that if s1 is …

Member Avatar for Gribouillis
0
223
Member Avatar for Caoimhe

I am recently new to python and as part of my college work i need to design and implement a python program relating to computer system administration. I would be grateful if anyone has ideas of a project. Thank You

Member Avatar for Caoimhe
0
195
Member Avatar for glez_b

I have a monthly database and the daily data are every 15 minutes. Develop a script to calculate the average and sum of some variables. The data have the following structure: MagViento, DirViento, u, v, Humedad, Precipitacion 5.67, 245 , 7.7898, 6.5660, 100, 4.1 When I run the script, I …

0
67
Member Avatar for onalenna_1

create a program that gets the marks the user has for their classes this year. Tell them how many classes they are failing (despite what many o f you think a fail is 50%) Save as Name_Surname_Repetition_Problem1.py................i seriuosly need help with this program,python is giving me a hard tym

Member Avatar for sneekula
0
141
Member Avatar for krystosan

how do I make a class return as `Namespace(filter='b', list="['hi','by']")` class NameSpace(object): """Mock for argparse's NameSpace """ def __init__(self, lst=None, flter=None): super(NameSpace, self).__init__() self._filter = flter self._lst = lst Is it possible what I am thinking, i guess we have to do something using special method call ?

Member Avatar for krystosan
0
320
Member Avatar for Gribouillis

You can teach your linux system that executable python files must be executed with /usr/bin/python. This allows you to write python scripts without the shebang line [icode]#!/usr/bin/env python[/icode]. This snippet shows you how to do it !

Member Avatar for Gribouillis
0
1K
Member Avatar for 123pythonme

I am doing an assignment for university, so I can't exactly post the code. So I will have to explain the best I can. I have to draw 3 stars in a row, 5 points, 6 points, 7 points. We have to do it using a for loop and the …

Member Avatar for vegaseat
0
269
Member Avatar for vegaseat

Python module turtle makes it simple to draw graphics art similar to art done by the Logo language.

1
400
Member Avatar for vegaseat
Member Avatar for krystosan

In the scripts ddirectory of my dummy project I have created this file without extension and has given executable permission using chmod +x filterList #!/bin/env python print "Hello World!" 'python ~/Development/python/listFilter/python/filterList.py $1 $2' but still when I run this i get error message saying $ filterList -bash: filterList: command not …

Member Avatar for krystosan
0
797
Member Avatar for Spider_14
Member Avatar for 123pythonme

I have created a program to find all the prime numbers less than N. When N is around 10^4, the program runs fast and efficiently. If I increse it to 10^5 no output is given, even if i let it run for an hour or so. Is there anyway I …

Member Avatar for vegaseat
0
261
Member Avatar for Hashim Javed
Member Avatar for vegaseat
0
289
Member Avatar for sophia_sin

I'm having a hard time creating a program that will draw all of the stars from 3 to 7. The program needs to have: * The variables numberOfSides, numberOfTrips, firstNumberOfSides, and lastNumberOfSides. * A series of stars one after the other for 3 to 7 sides * The screen must …

Member Avatar for woooee
0
172
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
491
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
406
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
166
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

The End.