15,181 Topics
| |
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 … | |
A sparse vector is a vector whose entries are almost all zero, like [1, 0, 0, 0, 0, 0, 0, 2, 0]. Storing all those zeros wastes memory and dictionaries are commonly used to keep track of just the nonzero entries. For example, the vector shown earlier can be represented … | |
I have a simple class that stores attributes: In [1]: class Test(object): ...: a=10 ...: b=20 I have a function that returns attributes using attrgetter, and it accepts these through the args parameter to allow a user to pass various attribute fieldnames in. For example: In [4]: def getstuff(*args): ...: … | |
I work in the AV industry and there is a whole set of hardware/software for controlling Ip and serial devices. I'm interested in writing some python code for bench testing projectors and video teleconference unuts, as I think it would be easier and more efficient and a good way to … | |
I need help writing this program, any hints, help, guidance will be appreciated. The program needs to provide a menu to the user with the following options: Reset the deck Shuffle the deck Cut the deck Cut to a card. Cut against the computer Exit Each of these options must … |
The End.