15,179 Topics

Member Avatar for
Member Avatar for mtmalleus

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 …

Member Avatar for Schol-R-LEA
0
182
Member Avatar for lewashby

[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 …

Member Avatar for woooee
0
6K
Member Avatar for iwanttolearnc

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?

Member Avatar for woooee
0
96
Member Avatar for haojam

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. …

Member Avatar for woooee
0
245
Member Avatar for me4ka86

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 …

Member Avatar for Gribouillis
0
104
Member Avatar for ZigZagMan

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 …

Member Avatar for TrustyTony
0
71
Member Avatar for kimmi_baby

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 …

Member Avatar for Gribouillis
0
593
Member Avatar for Don Brooklyn

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 …

Member Avatar for TrustyTony
0
105
Member Avatar for sravi.pearl

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 …

Member Avatar for TrustyTony
0
170
Member Avatar for tomtomisaballer

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), …

0
57
Member Avatar for hbluthi

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 …

Member Avatar for hbluthi
0
112
Member Avatar for barney1

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? …

Member Avatar for TrustyTony
0
540
Member Avatar for rahul8590

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 = …

Member Avatar for TrustyTony
0
201
Member Avatar for OffbeatPatriot

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 …

Member Avatar for uve
0
767
Member Avatar for kevintse

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. …

Member Avatar for kevintse
0
149
Member Avatar for _neo_

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 …

Member Avatar for _neo_
0
755
Member Avatar for thekevinguy

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 …

Member Avatar for Gribouillis
0
151
Member Avatar for DocBreen

[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 …

Member Avatar for cghtkh
0
158
Member Avatar for Bombshock

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 …

Member Avatar for TrustyTony
0
147
Member Avatar for Syphilis

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 …

0
64
Member Avatar for darma001

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 …

Member Avatar for ultimatebuster
0
2K
Member Avatar for evertron

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 …

Member Avatar for woooee
0
83
Member Avatar for matkod

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 …

Member Avatar for Gribouillis
0
181
Member Avatar for novice20

Is there any method or library to translate pysnmp OIDs to human readable strings??

0
59
Member Avatar for DocBreen

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 …

Member Avatar for Gribouillis
0
111
Member Avatar for nor_fairuz

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 …

Member Avatar for Gribouillis
0
186
Member Avatar for Fallen05

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 …

Member Avatar for Fredo699
0
279
Member Avatar for KrazyKitsune

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 …

Member Avatar for KrazyKitsune
0
167
Member Avatar for Reverend Jim

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". …

0
73
Member Avatar for evertron

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 …

Member Avatar for evertron
0
233

The End.