15,181 Topics
| |
hi, i'm writing a poker game project and encountered some problem while i try to sort the cards in hand. so far, i have a deck of 52 cards, each of the player is assigned for 3 cards. the questions, I don't know how to sort the cards in the … | |
Hi, I've been stuck on trying to sort a hand and while I've tried to do a bubble sort, it doesn't seem to work. Here's my code: [code]def rankValue(card): #Converts card value to integer (rank) if card.value == "Ten": return 10 elif card.value == "Jack": return 11 elif card.value == … | |
How do i set the size of my listbox to be the same as my split window? I tried to use sizer but because this is my first time using it and it did not work.please help. THANKS [CODE] class bucky(wx.Frame): def __init__(self,parent,id): wx.Frame.__init__(self,parent,id,'Frame aka window') #panel=wx.Panel(self) self.sp = wx.SplitterWindow(self) … | |
I am having a problem firing off a DOS app. To run a SQL 'SSIS' package, you use the following syntax: C:>dtexec /f "PACKAGENAME.dtsx", the quotes are required. I have tried os.system, os.execlp, os.execl and none of them seem to work. os.system causes an error with 'dtexec' saying the package … | |
I have been Out of real pythoning for a while. My favorite Toolkit is wxpython but It have a huge size due to monolithic nature. So even with simple app, it swells! I was looking if I can have any size difference with Other GUI toolkit, PyGTK! Hope someone will … | |
Hi. I am trying to create some sort of image library/gallery do hickey. Using Glade 3 and Python. I have created a general window. And now I want to add the image object as much as there are image files in a folder. The flow chart will be something like … | |
I am new to working with Django, and have found it really fun and interesting to develop with. But I have been trying to upload it to a hosted server and just not getting it to work. I have followed the instructions they give, but just not getting it to … | |
Hi, Need to do a project where the data from a HTML form is sent to Python, and then repackaged and sent back out as HTML. Problem is, I'm having issues with Python. When I run the form information with Python, I get this error: [QUOTE]There was an error with … | |
Hello I'm currently working on a program which read 16bit(565) BMP files. I've tried hard to read them with pyQt and show them directly but it never worked properly, the image were not read properly even with the good format as argument. So I've decided to call a wx App … | |
I had been working on this program for a while. It was inspired by the slowness of Windows' search feature. I made it so I could simply look for files to see if/where they existed quickly. I eventually added in the feature to delete files. It was no major extension … | |
I've been putting together a player list for a sort of risk-like webgame-type thing me and a friend are working on, and I'm having trouble getting some text to display on a webpage. Here's the code: [CODE=Python]from django.http import HttpResponse class players: def info(self, name, territory, color): self.name = name … | |
I'm going to start learning web development useing Django. I'm following the tutorials on their site and when I run "python manage.py runserver" i get a traceback saying: [code] Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 362, in execute_manager utility.execute() File "C:\Python26\lib\site-packages\django\core\management\__init__.py", … | |
Hi, I am trying to obtain the equation of a best fitted plane to a cluster of 3d points in python. I run into a problem when all of my points are on the same plane, for example z=0. My minimum eigenvalue obtained from my matrix ends up being 0 … | |
I am new to python and am actually using python as a result of taking a computer science class in college. I am writing a program to fit a hypothetical scenario. Well I have ran into a problem..Please help me! the traceback and snippet are below. [code] def high_Priority(): ## … | |
[CODE]import pygame from pygame.locals import * from sys import exit from random import * pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) while True: for event in pygame.event.get(): if event.type == QUIT: exit() random_color = (randint(0, 255), randint(0, 255), randint(0, 255)) random_pos = (randint(0, 639), randint(0, 479)) random_radius = randint(1,200) pygame.draw.circle(screen, … | |
[CODE]import pygame from pygame.locals import * from sys import exit from random import * pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) while True: for event in pygame.event.get(): if event.type == QUIT: exit() screen.lock() for count in range(10): random_color = (randint(0, 255), randint(0, 255), randint(0, 255)) random_pos = (randint(0, 639), randint(0, … | |
I don't really know how to word what I want to ask so please bear with me. I'm making a program that will start up a game server written in Java and read the outputs and edit the packets so that I can modify this game. It will read outputs … | |
Using the following code I am trying to check the users input string (CAcodes) and checking each one individually by assigning each element in CAcodes to a list (CAcode). A for-loop checks the conditions to make sure that the conditions for each code are met. The main for-loop tests several … | |
Python programming can have its lighter moments. Here we use one of those moments to draw an optical illusion using the Tkinter canvas to draw a rectangle, some lines and circles. | |
Hello, can anybody convert python code that read openstreetmap xml file from [url]http://github.com/rory/python-osm/blob/master/pyosm.py[/url] i try to translate but with the lack of knowledge of python , never get it done. Even approximate conversion that will be greate. [CODE]#! /usr/bin/python import xml.sax class Node(object): def __init__(self, id=None, lon=None, lat=None, tags=None): self.id … | |
| Hi all, I currently have some code: [CODE]import time import Tkinter as tk root = tk.Tk() pass_entered= False def show_pw(): pw = pw_entry.get() if pw == "password": label2['text'] = pw pass_entered==True return pass_entered else: label2['text'] = "Sorry, wrong pass" def logoff(mins): lbl1.config(height=3, font=('times', 20, 'bold')) for k in range(int(mins), 0, … |
Hello all, How are you? Hope well. Just a quick question. I have a file which contains abstracts (small texts) and i am looking for certain keywords and their frequency. These keywords are provided from another file. I was thinking to read the keyword file first and the perform a … | |
Hello all Just joined the site - mainly due to the fact that 7/10 times I Google a problem this site comes up :) Not looking for an easy ride, but can someone point me in the direction of a site/tutorial that shows how to run a loop periodically? What … | |
[CODE]totalRows = int(raw_input ("Please enter a number: ")) for currentRow in range(1, totalRows+1): for currentCol in range (1, currentRow+1): print '*', print print for currentRow in range (1, totalRows+1): for currentCol in range(1, currentRow+1): print '*', print[/CODE] Output * * * * * * * * * * * * … | |
I am trying to use an event box with a label inside to create a custom button. I found an example online to create a button using an event box but when I tried to load the event box button into a VBox I ran into errors. Does anyone see … | |
ITunes Library Persistent ID Editor. Sample usage: [CODE]fxml = 'iTunes Music Library.xml' # path to xml file fitl = 'iTunes Library.itl' # path to itl file itk = ITunesLibKeys(fxml, fitl) print itk.file_xml # prints path to xml file print itk.file_itl # prints path to itl file print itk.xml_key # prints … | |
Hey, I've been not so active for the past months, but that's because I was working on a litle project called Deditor. It's a text-editor for linux. The thing that makes it special is that it is made for python and thus has some python-specific features like, syntax-highlighting, interactive interpreter, … | |
i did go thru a google search and found some functions .. but those results where horrifying , i guess i am using a wrong method of finding time . [code] def test(): "Stupid test function" L = [] for i in range(100): L.append(i) if __name__=='__main__': from timeit import Timer … | |
I have a forked child process running which executes a system command killing the child using os.kill(child_pid, SIGKILL) stops the child process but the system process continues ! Can something be done to stop the system process also? A part of the code is something like this: #Child child_pid = … | |
hi, i have this problem with wx.toolbook : this is the first page class : class newPanel(wx.Panel): def __init__(self, Parent): wx.Panel.__init__(self,Parent,id = -1) self.SetBackgroundColour('yellow') frame = wx.Frame(None,size=(400,400),pos=(500,300)) toolbook = wx.Toolbook(frame,-1, style=wx.BK_LEFT) il = wx.ImageList(32, 32) bmp = wx.Image(r'c:\python26\img.png',wx.BITMAP_TYPE_PNG).ConvertToBitmap() index = il.Add(bmp) toolbook.AssignImageList(il) toolbook.AddPage(newPanel(toolbook), 'xxxx', index) ------------------------ the 'img.png' is 32 … |
The End.