15,179 Topics
| |
Hey guys. I'm new to Python. I kinda blundered into a CIS major at the university I attend, and I have to say, I haven't enjoyed the Python class so far. It's so... esoteric. I'm having a TON of trouble grasping what the rest of my class view as simple … | |
[CODE]import pygame from pygame.locals import * from sys import exit pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) font = pygame.font.SysFont('arial', 32) font_height = font.get_linesize() while True: for event in pygame.event.get(): if event.type == QUIT: exit() screen.fill((255, 255, 255)) pressed_key_text = [] pressed_keys = pygame.key.get_pressed() y = font_height for key_constant, pressed … | |
the problem is that of a path planning algorithm. the obstacles will be rectangular shaped boxes. what i need to do is detect the rectangular boxes, and then add a black "aura" around these boxes. any ideas on how i go about doing this? | |
Dear Sir, I would like to extract only unique terms from all sdrf.txt files but this python code outputs unique terms for every file individually. Like Array Data File , Array Design REF ... are repeated in most of sdrf.txt files so i don't wanna print it as unique terms. … | |
Hello Everyone, i would like to make a file in which i move the mouse to coordinates x and y and click the scroll button(middle button). this is what i want but works for left and right i have on idea how to make it work with scroll/medium button. any … | |
Hi guys, new here, and new to python. And I thought I would ask for a bit of guidance on this piece of code I'm working on. The following block of code is supposed to output all positive factors of the entered integer. However, it does not work properly. The … | |
Hi, I have created a program in Python which creates a database called inb104 and loads the data from text files into the mySQL server. The code works perfectly fine. The data is inserted into the table without any issues. The problem is that I would like to place the … | |
Hi there, I would need some help with my code...its in python, and the thing I have to do is to make points of the matrix of the object be displayed in a way to make the first camera position as a start of the coordinate system! to clarify a … | |
Hai all... I want to get different colored bars for labels 'Bill', 'Fred', 'Mary', 'Sue' can any one please tell me ...as soon as possible..... [CODE]#!/usr/bin/env python """ The new ticker code was designed to explicity support user customized ticking. The documentation http://matplotlib.sourceforge.net/matplotlib.ticker.html details this process. That code defines a … | |
This is my code: Vigenere cipher : [CODE]from graphics import * ##def encode(message, keyword): def main(): win= GraphWin("Vigenere cipher", 400,350) messagebox = Text(Point(100, 60), "Enter message to encode") keywordbox = Text(Point(63, 120), "Enter Keyword") encodedbox = Text(Point(75, 250), "Encoded Message") message = Entry(Point(290, 60), 20) message.setText("") keyword = Entry(Point(290, 120), … | |
Hi guys. This is my first post here and I've read through the forum quite a bit and can't wait to get more involved. So here is my main problem: getting my code to take the text I enter into an entry box to be recognized as a string so … | |
Hello I'm trying to make a stem and leaf plot. The first function is supposed to call the other two functions and return the final plot. My code works for the first elemnt in the list and then stops. Is there something I have to do within my for loop? … | |
i have a csv file from where in i read the data and store individual coloumns in list , but for the last coloumn i am getting \n in the list . i want to get rid of that . [CODE] f = open('datagen.txt') for lines in f: line = … | |
I made a wxPython gui to interact with a camera, however the lab is very matlab centric and the professor wants everything to be controllable from matlab. I think this is more of a matlab problem, but it's python related and I thought it might be a little odd to … | |
Hi, all I have been learning the python language for a couple of weeks. For now I only know a little of the language, the syntax, usage of the builtin types such as str, lists, dicts, and tuples, this is fine for writing some simple scripts to process text files. … | |
Hi all. I'm trying install python 3.1.2 on RHEL4 from source, but 'make' failed to build some necessary modules. Followings are from build log: *** WARNING: importing extension "_ctypes" failed with <class 'AttributeError'>: 'module' object has no attribute 'load_dynamic' Python build finished, but the necessary bits to build these modules … | |
Hello, I'm pretty new to programming in general, and I'm trying to get started with python. Whenever I open up IDLE, everything seems to work fine. However, when I go to File>New Window, I just get a blank window and everything freezes up. If I restart my computer, I can … | |
[CODE] b2 = raw_input("Select your action:") if b2 == "Attack": mgeHP = 2500 print "You have decided to attack the mage." while True: dmg = random.randrange(1, 125, 1) mgeHPN = mgeHP-dmg print "You did" , dmg , "damge to the mage, giving it" , mgeHPN , "left" mgeHP = mgeHPN … | |
Hey Daniweb, I'm starting out learning python and have been looking around and saw the thread on printing a line that starts with a specific word, I would like to create something similar except take numbers out of text and print them so I can graph them. So far I've … | |
Ahoy Sailors! So to simplify this right from the start, When someone connects to my Host script, They first send a string with their PC name attached. [code]n:JoeyBlowHole-PC[/code]We'll store this into a variable, Along with any others that are being sent. So it may look like this. [code]JoeyBlowHole-PC:JohnBinBag-PC[/code]Now I'm needing … | |
Dear friends, I am a new programmer and i have a task to make a phonebook with python. Please help me to finish my task. The program should repeatedly ask the user for input. Each primary input is one of the words “help”, “lookup”, “enter”, “remove”, and “quit”. If the … | |
This is my first function in python and i need to get item quantity and price loops into the function Processorderitems. I took out the items loop because I was not doing anything with it. I need to return the subtotal and I have a 3% discount for quantities over … | |
hi, I'm creating a game with pygame and i want to create a matrix that will represent the map(where each tile will be). my pygame code is ok, because if i create the map without loading the tilemap (the matrix file) the game runs ok. that would be good but … | |
Is there any method or library to translate pysnmp OIDs to human readable strings?? | |
Here's the code I need to loop: [CODE] dmg = random.randrange(1, 10, 1) print "You have decided to attack the giant rat." ratHP = 100 ratHPN = ratHP-dmg print "you did" , dmg , "damge to the rat, giving it" , ratHPN , "left" ratHP = ratHPN [/CODE] If you … | |
Hi all, I would like to ask. Im Fairuz and the new member for this forum. I having problems to sort the multi dimentional array in python. ie: [('DcaUiVb_B09398-11', [None]), ('m3sui_R66441-35', []), ('m3sui_r26557-01', []), ('m3sui_R31225-24', []), ('m3sui_r66147-03', []), ('m3sui_R31225-23', []), ('m3sui_R30803-10', [])] I have the list but im having problems … | |
Hi.. Ive been doing python for about 2 days now (my 1st programming language) and im wondering, after ive made the .py file, and all the codes in it, how do i run it? To be honest im not even sure if the term compiling is right... I am doing … | |
This might be a little challenging, but I'd like to know. [code=syntax]from math import sqrt y = int(raw_input("> ")) x = sqrt(y) print x [/code] In this code, say I input 4 for y. The output will be 2, naturally. However, say I have 2 for y. I'd get something … | |
In the book, wxPython in Action (page 65), the following code shows how to bind an event to a frame (self) and to a button. In the case of the frame event (wx.EVT_CLOSE), no source argument is specified because the event is being bound to the object refenced as "self". … | |
The user enters a number and the program should output that amount of rows and colunmns. I have tried a couple of different ways butcant quite get it even though I think I am close. for example if 10 is entered it should look something like this: O OO OOO … |
The End.