15,185 Topics
| |
I'm learning about Classes and this thing is driving me crazy. Whenever I run this, it will use the __del__ object even though I never used del droid1, del droid2, or del droid3. Can someone please help? class Robots: '''Represents a robot, with a name.''' #A class variable, counting the … | |
I have a problem i wrote a code and copyed some code but now my sprite dosent move anymore....and i dont know why # Import a library functions called 'pygame' import pygame from pygame.locals import * # Initialize the game engine pygame.init() # Define some colors black = (0, 0, … | |
I'm trying to write a script that will search a page for mp3 files, and download the first one. All is fine, but when I'm finding the links the first two are not mp3 files. At the moment I'm doing: for link in page.findAll('a')[:3]: f.write(link.get('href')) This finds the first 3 … | |
Hi I have always been a windows user but a few months ago switch to Ubuntu Linux. I have started learning Python and want to find out from experienced developers what the best way is to setup a development environment on a Ubuntu machine. I am running Ubuntu 12.04 which … | |
This post is a followup to an older dicsussion [on recordmanaging](http://www.daniweb.com/software-development/python/code/429753/custom-named-tuples-for-record-storage). I am writing this to share with colleagues, so it may be a bit fluffy and not straight to the point. I apologize to all the experts. Good programs always start by managing data in a flexible and robust … | |
I recently came across this code on the internet and I'm having a very hard time understand how it works. I was hoping someone could comment the code a bit in order to help me learn it better? I understand most of it, but get lost when any of the … | |
Write a function estimatePi() to estimate and return the value of Pi based on the formula found by an Indian Mathematician Srinivasa Ramanujan. It should use a while loop to compute the terms of the summation until the last term is smaller than 1e-15. The formula for estimating Pi is … | |
So, I would like to start working on a python module to support RFC 2326 (RTSP), in an effort to work on a larger application that I will probably need help with later. I am unsure how to go about making software that is meant to adhere to a specific … | |
Hey guys! I've started writing a 2d platformer game some days ago, and I'm really enthusiastic about it, but I already failed to live up to my own expectations: I just cannot possibly think of a way I could make my character jump. I used the MVC desing is why, … | |
Hi Guys, I have managed to connect to a laser sensor and get data back from the unit into python however i think i need to decode this data. Below is what i have sent and get back. Console Result:- UDP target IP: 192.168.60.3 UDP target port: 9008 message: FF … | |
Hi guys. I'm trying to access some User interface files (.glade) which are in a subdirectory. from gi.repository import Gtk import os path=os.getcwd+'/ui/main.glade' def hurr(): builder=Gtk.Builder() builder.add_from_file(path) # get UI file window=builder.get_object('winlet') window.show() hurr() Gtk.main() This works if i use only 1 glade file, but i have multiple .glade files … | |
For some reason , my code keeps returning a false reply even if the string is in the file. Here's my code: def check(self): self = str(self) if self in config_file: print ('Account exists') if self not in config_file: print ('Account doesn't exist') | |
In the pencil-and-paper game, Tic-tac-toe, 2 players take turns to mark 'X' and 'O' on a board of 3x3 squares. The player who succeeds in marking 3 successive 'X' or 'O' in vertical, horizontal or diagonal stripe wins the game. Write a function that determines the outcome of a tic-tac-toe … | |
I have checked various examples and it appears that my problem is a bit more complex than what I have been able to find. So I'd greatly appreciate your help. I'm a stress engineer and I like to present my results as VRML (WRL) files. I recently discovered how to … | |
Hey, I'm new to Python, as well as this message board, and I was wondering what some of the most useful and frequently-used commands are. I've so far only learned while, if, print, input # and words, and can make some basic programs only. I've previously had experience in TI83 … | |
Hey guys I hope you can give some help, I have read alot and cannot come up with a solution. Here is what I'm trying to do, I return a set of values from a web request [[1, 0, 1], [2, 0, 1], [3, 0, 1], [4, 0, 1], [5, … | |
Write a program that asks the user's name, then prints: Hello, <name>! For example: Enter your name: Tara Hello, Tara! Hint Make sure you give raw_input the same prompt message that is used in the example interaction above. | |
Hi,I have a PYTHON Task http://www.jjoseph.org/misc_projects/meter_reading_with_a_webcam and i need to chnage it to C# the Python code is available in the above mentioned task link or http://www.jjoseph.org/files/gasmeter/meterparser.py please help me as soon as possible i am begginer to C# code please responde as soon as possible.Thanks in Advance | |
I have written the following code for Towers of Hanoi problem using non recursive approach. I guess it is not correct as the number of moves are not 2*n - 1, for eg, for 3 disks to be moved, it has to generate 7 moves. Thanks in advance. ###################### # … | |
Hi, I am working on Protein and DNA sequences. When you have a protein sequence it can be translated in to DNA sequence in many ways. A nice way to express this is using regular expression. I would like to create this long regular expression for a protein sequence, and … | |
Well, here is my code: print "Welcome to the English to Pig Latin translator!" original = raw_input("Please enter a word: ") pyg = "ay" if len(original) >= 1 and original.isalpha() word = original.lower() first = word[0] if word == a or e or i or o or u print "Your … | |
Hi, I want to implement a basic license key verification system into my software. I know the basics of python and pygame, etc, but I've never read anything about implementing this type of drm into my software. Quite frankly, I don't even know where to start. Yes, I understand that … | |
I am converting a program in python that is written and used on another OS that starts with the letter w. The script as written works on that OS, but on Linux it seems to fall flat on its face. First, I do not have access to any non Linux … | |
This code was inspired after several discussions on the forum, and I'm especially indebted to PyTony for all of his help with these aspects. The motivation behind this code is quite simple. I wanted a robust, light and general way of storing CSV data that could be used over and … | |
Hi, I'm very new in Python and I have to write an file interpretor (first ex from university). The file looks like: joker NAME_OF_BLOCK bla bla { block_field abv : bit : R ; block_field acd : byte : RW ; block_field zza : bit : R ; block_field aw … | |
Does anyone have actual experience with pypdf with version 3.x python ? Maybe I am confused, but looked like only a 2.x version is available. thanks | |
i have a input file having words "Olympics,Olympics,Olympics" when i try to count them and use function readlines() it count them as 1 rather than 3 !! what should i do !! this is my code def input_files(file): sum=0 #word=raw_input('enter the word you want to search\n') file=file.readlines() for lines in … | |
I'm working on some simple socket programming. But I'm not on the most effective way to search for strings once I've assigned buff = skt.recv(some_length). On the client I'm writing currently, I am expecting ASCII strings, like 'mem_usage' 'ip_config' etc. Thanks. | |
Hello. I'm trying to make a simple language in Python. I have many functions, that handle arguments, and execute the commands. Although, the old way I was actually CALLING these functions was to have a dictionary of all the keywords to functions, and then get() it. Is these an easier … | |
Hi All, I am a control engineer and i am trying to communicate with a sensor I have spoken to the manufacturer but they cannot help with the python side.I am trying to send a message to the sensor which tells it to connect. The sensors config is ip192.168.60.3 port … |
The End.