14,948 Topics

Member Avatar for
Member Avatar for Daocsm

im creating a 2d side scroller in my class, and i have a image list out of a sprite sheet. and when the player goes forward the images show up fine, but i cant seem to get each image to flip when the player turns around and goes back, any …

0
56
Member Avatar for marf

Ok I have narrowed the problem down, and I'm hoping somebody knows the solution. Basically I have a pyGTK application, using widgets and all of that. I have stripped all of the gtk objects out except the gtk.main() initializer. I basically want to start a threading process, and still have …

Member Avatar for snakerdlk
0
312
Member Avatar for henryford

Am I able to read or write to a file with this code or what is stumping me. The following is what I am suppose to do. Calculate each employee’s pay, and write it out to a sequential file. Be sure to include file I/O error handling logic. Include only …

Member Avatar for slate
0
171
Member Avatar for ekkanh

Hi I am fairly new to python. I want to do a seating reservation program containing 32 seats so the users can reserve seats and unreserve seats. I know I need a class that sort of contains the seats, but I dont know how to make it.... I have made …

Member Avatar for slate
0
7K
Member Avatar for jrp370

i have this code to simulated a walk going either forwards or backwards amd i need to modify it so that it can go either up, down, left or right. only problem is im stuck can you offer any advice? thanks [code] import random filename="walk1.txt" def randWalk(n): steps = 0 …

Member Avatar for group256
0
94
Member Avatar for ljjfb

Hello, all professionals, I used subprocess.Popen to launch a process, right now I am planning to shut it down after a given time. Can I use subprocess.kill() to fulfill that? (I do not know how to do that cuz every time I will receive a error message.) [CODE] import subprocess …

Member Avatar for ljjfb
0
16K
Member Avatar for king_koder

I tried to generate permutations by using itertools module but its not working. [CODE=python] >>>print(permutations([1,2,3],3)) <itertools.permutations object at 0xa917c5c> [/CODE] Why is it so? and how do I make it work properly?

Member Avatar for slate
0
192
Member Avatar for hnnh_km

hi so i need to write a rock paper scissors game. when played in the command prompt it should look something like this user input is in [B]bold[/B] press q at any time to quit please choose rock(r), paper(p) or scissors(s): [B]r[/B] computer chose paper. you lose! your score: 0 …

Member Avatar for woooee
0
129
Member Avatar for johnwoods87

Hi I'm new to python, I need a little help, i need to write a function that's has a radius parameter and retunes the circumference of the circle. anyone that's able to help ? sorry its not a lot of info to go on.

Member Avatar for catintp
0
120
Member Avatar for nejger

hello, can someone help me to do the graphic part of my program from latin letters to arabic numbers and visesersa? You write in the number/letters and then you push the arabic button or the latin botton and then it transelate.... Also i need a latin calculator which can + …

Member Avatar for openn0llan
0
67
Member Avatar for pythonbegin

Hi All Hope you all are ok. I have a query on calculating frequency distribution. I have seven different files like the one I have attached which contains items as below in example. I want to know total how many times each pair occurs combining all these files. ex 208015_at …

Member Avatar for TrustyTony
0
186
Member Avatar for yeticannotski

Following the Python3 Tutorial for non-programmers I took on the exercise of creating "quit" and "lock/log out" options for a very simple program, as follows (comments in the code are pretty dumb and obvious, but they are notes for mydumbself): [CODE]#!/usr/bin/python3 # Filename: lockunlock.py password = str() logged = 2 …

Member Avatar for yeticannotski
0
182
Member Avatar for king_koder

How do I sort a list in Python alphabetically? The code that is used for Python 2 doesn't seem to work: [CODE=python] mylist.sort() [/CODE] Since the file I'm working with has all text in the same case, case doesn't matter here. Please help. Thanks.

Member Avatar for king_koder
0
218
Member Avatar for evertron

I am using a sample from my book for testing a car class. I get this error and I am not sure why. I am only giving one argument that I can tell. Here is my error code: Traceback (most recent call last): File "G:\Python_Stuff\car.py", line 79, in <module> myCar.getVIN('V81FDX') …

Member Avatar for evertron
0
91
Member Avatar for convoluted

Hi all. I'm having a bit of trouble implementing the basics of a multi panel GUI. Basically I need a GUI that will act as an in-dash display for a car. The home screen will offer the user the ability to chose a selection of buttons. For example, the 'settings' …

Member Avatar for convoluted
0
284
Member Avatar for Memphis_212

The following def is my assignment .. the problem is the accumulator pattern gets me very lost. I don't know how to write it.. I have asked my instructor for help and he refers me to the sad sad book we have been given. I DO NOT WANT THIS QUESTION …

Member Avatar for TrustyTony
0
1K
Member Avatar for WolfShield

Hello everyone, I was wondering, if I wanted to make my code a little smaller in one file, is it possible for me to import another file I made? E.G. (Very simple e.g. just for helping understand what I mean) Let's say I made a program that the user types …

Member Avatar for TrustyTony
0
1K
Member Avatar for mbartz

I am trying to Subclass ElementTree with an abstract method. I have read in several forums that ElementTree is actually both a module and a class. I have been unable to get the subclassing to work. [CODE]from abc import ABCMeta, abstractmethod from xml.etree.ElementTree import ElementTree, Element, tostring class A(ElementTree): __metaclass__ …

Member Avatar for Gribouillis
0
217
Member Avatar for king_koder

Since I am a Python beginner, I was thinking about studying,and possibly working on some real-world software written in Python. So could you guys suggest some simple open source projects that I could use to study and, if possible, get involved with in development. Thanks.

Member Avatar for SgtMe
0
154
Member Avatar for LoveMyPadres

I am trying to implement virtual LEDs on a Python window. I turn the LED "on" by drawing a green oval. I then use root.after() to schedule another call that turns the LED "off" by drawing a dark green oval. I use a 250ms delay. There are 4 active LEDs …

Member Avatar for LoveMyPadres
0
2K
Member Avatar for henryford

I am writing a program for python and need to create a loop that appends pay, hours, and wages to one list called lstEmp,and be able to exit the loop once you type in DONE. I am stuck please help. [CODE]def Input(): try: name=raw_input("Enter your first and last name: ") …

Member Avatar for TrustyTony
0
134
Member Avatar for Babduberance

Hi am a noob working with Apache, mod_wsgi and python. Below is some sample code on the internet that will return "Hello World!" when i go to my local server: [url]www.localhost.com/py[/url] note: I do have WSGIScriptAlias /py "C:/Users/user/site/handler.py" in my httpd.conf [CODE] def application(environ, start_response): status = '200 OK' output …

Member Avatar for Babduberance
0
182
Member Avatar for Bluerain

# I'm trying to extract the url's from the below text, without the added html tags. Is there anyway I can get just parts starting with ( [url]http://)[/url] and ending with (")? # <a href="http://www.gumtree.sg/?ChangeLocation=Y" rel="nofollow">Singapore</a>, <a href="http://www.gumtree.com.au/?ChangeLocation=Y" rel="nofollow">Australia</a>, <a href="http://www.gumtree.co.nz/?ChangeLocation=Y" rel="nofollow">New Zealand</a>, <a href="http://www.gumtree.com" rel="nofollow">England</a>, <a href="http://edinburgh.gumtree.com" rel="nofollow">Scotland</a>, <a …

Member Avatar for aml25
0
165
Member Avatar for cleve23

How can i highlight the whole line in Styledtextctrl in wxpython????I have been researching on it but i still could not get what i want. I want to highlight a whole line of sentence on the line position that i want. Can anyone help me on this???? Please........... Thanks :D

Member Avatar for deonis
0
89
Member Avatar for Syphilis

Ahoy Sailors! So I've been developing a networking application using Twisted. This can be divided into two parts. The Host and the Guest. I normally make and test such on my main Ubuntu Linux computer, Now the time has come to compile it for Windows. But straight out of left …

0
62
Member Avatar for Klustor

So what im trying to do is, if the user select his location then the listbox should be filled in with values. I always get [B]NameError: global name 'listcomputers' is not defined[/B] but i dont understand why. can anybody help me ? [CODE]import os import wx class MyForm(wx.Frame): def __init__(self): …

Member Avatar for Klustor
0
536
Member Avatar for James0l9l

I am attempting to create code where the user can alter the A elements in the list continuously. If another letter in the list is replaced however, it should ask for new input from the user, and go back to the code where the user can alter A elements in …

Member Avatar for TrustyTony
0
145
Member Avatar for Malinka

Hello Everyone, I have a list of digits. What is the most efficient way to count the number of tokens between two known digits? Here is what I came up with: [CODE] def dis(l, a1, a2): i1 = l.index(a1) i2 = l.index(a2) distance = i2 - i1 - 1 return …

Member Avatar for TrustyTony
0
120
Member Avatar for scobie

Hi Folks, I'm a noob but I'm slowly getting addicted to python. I've been hitting a wall for about 4 hours trying various things to no avail. It looks to me like it should work and runs without error but.... I expect the blockcount counter to be high (but it's …

Member Avatar for TrustyTony
0
333
Member Avatar for neocortex

Hello! I wonder if anyone used google-diff-match-patch for fuzzy string comparisons, i.e., for finding a closest/most similar string? Can anyone explain and give some examples? Also, in genera, what would be the best matching algorithm in Python. I tried Levenshtein, but matches are not so good, and I tried difflib.get_close_matches …

Member Avatar for Neil Fraser
0
1K

The End.