15,181 Topics

Member Avatar for
Member Avatar for Anteater7171

I put in a partially transparent PNG image in Tkinter and all I get is what is in the attached image. How do I make the dark triangle on the right clear? (like it's supposed to be) This is python 2.6 on Windows 7, btw.

Member Avatar for ultimatebuster
0
71
Member Avatar for SoulMazer

Hi, I've just finished writing a Pong game with Python and pygame and thought it would be cool to make it multiplayer over the net with a friend. So, I changed my old asynchat-based instant messaging server into a server for this multiplayer Pong game. The only bad thing about …

Member Avatar for ultimatebuster
0
137
Member Avatar for ultimatebuster

I'm kind of confused over the iterator object/concept and the yield statement and its usage. According to my understanding, all the python sequence are iterators, as they don't need the classic [icode=java]for (int i=0; i<list.length; i++)[/icode] to iterate through lists/arrays. Am I correct over this? Am I missing anything? Also …

Member Avatar for ultimatebuster
0
98
Member Avatar for wolfeater017

Im having troubles learning how to make an executable so can someone show me what Im doing wrong [import time from cx_Freeze import setup, Executable setup( name = "hello", version = "0.1", description = "the typical 'Hello, world!' script", executables = [Executable("hello.py")]) [GO AHEAD AND IGNORE THE REST OF THE …

Member Avatar for wolfeater017
0
1K
Member Avatar for prashanth s j

Hi all, I wanted to write the following line to the file. [code] sys.stdout.write("123: The metro polis\n") [/code] But the line that was written is: [code] sys.stdout.write("100: The metro polis ") [/code] How do I get the \n to be written in the text form to the? file(ie it should …

Member Avatar for TrustyTony
0
97
Member Avatar for Tommymac501

When I read a record, no mater what switch I use in the Open, large numbers are converted to scientific notation. These numbers are for mailing, so it's a combination of a zip, plus4, delivery point, etc. I need to keep the number intact Is there some way to read …

Member Avatar for Tommymac501
0
2K
Member Avatar for jazzvibes

Hi Daniwebers I'm trying install pygame into my Python 2.6 installation. I'm running Windows 7 64bit. I had everything working before, but I was trying to install pygame into a into a Python 3.1 installation and i kept getting an error, so I thought i'd uninstall everything and try again. …

Member Avatar for jazzvibes
0
399
Member Avatar for Dragazarth

Okay I was just mucking around on python. I have no programming experience at all, and I havent yet finished school anyhow, but I was interested in python and many say that it is great and everything... So I was trying to make a code that would solve this problem …

Member Avatar for Dragazarth
0
161
Member Avatar for AlanWilhelm

Hello, I put together a small tutorial that I wanted to share. I found only scattered information on this and put a more complete tutorial together with code and comments. [URL="http://blog.ajwilhelm.net/archives/7"]Parsing Excel files with Python[/URL]

1
86
Member Avatar for wolfeater017

[This is a really long code so im just going to put the traceback part in and where I think the problem is] [def directions(): enter=0 nwscreen() Font1 = pygame.font.SysFont('ActionIsShaded', 25) d1 = basicFont.render('Directions',False,WHITE,BLACK) d2 = Font1.render('Directions',False,WHITE,BLACK) d3 = Font1.render('ALL ANSWERS MUST BE LOWERCASE',False,RED,BLACK) d4 = Font1.render ('Press enter to …

Member Avatar for TrustyTony
0
180
Member Avatar for matto.g1456

I was hoping some one could help me out, I need to search a column in .csv and.las files, return the maximum and the corresponding value in another row. Thank you

Member Avatar for TrustyTony
-1
125
Member Avatar for kumarantechie

Hi, I want to decompile an python application which consits of pyc files. Since i am working in a conversion project .. from python to java i need to decompile pyc files to py files. The application contains number of pyc files. Any decompiler or free decompiling source available in …

Member Avatar for kumarantechie
0
153
Member Avatar for GrahamAddy

Hi I'm having a problem with PyQt QProcess taking over. I want it to run several process one after the other and return each time so that I can refresh the display with the information that the process has finished. Here is the code:- [CODE] def _writeCDtoDatabase(self): Dic = {} …

0
79
Member Avatar for GrahamAddy

The solution to my problem is probably very simple, but I am having great problems solving it. I have a [B]MainWindow[/B] Class calling a [B]Dialog[/B]. I send the contents of a list from a loop to the Dialog lineEdit for a user to accept or change as required and return …

Member Avatar for GrahamAddy
0
1K
Member Avatar for gunbuster363

I am crawling a website I found out that the source code of the website is different to the content of the website. obviously the content were generated through some script, does anyone know how to simulate the action and get the content of it? For example, there is a …

Member Avatar for gunbuster363
0
108
Member Avatar for wolfeater017

I've heard of the working file in python before and was just wondering what it was and where I can find it in python

Member Avatar for vegaseat
0
135
Member Avatar for ganeshredcobra

hai, i want to create a code to searcha big document in text format and sort one word say "error" and need to print that whole line ....how can i implement this simply in python openfile = open('/home/space/Desktop/test.txt', 'r') data=openfile.read() words=data.split() #print words if "error" in data:

Member Avatar for TrustyTony
0
147
Member Avatar for Khalid_B

I am learning to use python for gis application. I want to create an application based on wxpython and matplotlib which is able to select shapefile layers from the directory and render them, calculate the distance between points and extract the x y value of the points. In the past …

0
23
Member Avatar for jcao219

This is not my code! Taken from [URL="http://stackoverflow.com/questions/3230978/code-golf-four-is-magic/3231355#3231355"]this SO post[/URL]. You can use this to get the number of letters in the English representation of an integer, from 0 to 99. So for example 5 (five) is [icode]len("five")[/icode] which is 4.

Member Avatar for TrustyTony
0
174
Member Avatar for NewbieXcellence

Hello, thanks for reading my post. My troubles have to do with using a python script to gather information from a web page. I'm using the 'IEC' (Internet Explorer Controller) module to handle the 'COM' stuff for me. The script looks like this: [code=python] import IEC from BeautifulSoup import BeautifulSoup …

Member Avatar for NewbieXcellence
0
328
Member Avatar for wolfeater017

Im trying to use a different font in pygame but every time I run it I get this syntax error message [Traceback (most recent call last): File "C:\Python31\pytest.py", line 22, in <module> font1 = pygame.font.Font('C:\ActionIsShaded.ttf', 12) IOError: unable to read font filename] I tried getting rid of the qoutes around …

Member Avatar for vegaseat
0
5K
Member Avatar for acrocephalus

Hello! I have written a piece of code that creates 3 folders in the working directory, asking the user to proceed even if it may overwrite existing folders. The problem is that the more pictures there are the more time it needs to create the folders. Is there any way …

Member Avatar for TrustyTony
0
86
Member Avatar for Simes

I have written some code in Python for a tanks game and I need to write pseudocode for the Tank's move method and main game functions (battle and bonuses). What is bold and underline are what I need to do pseudocode for in the quoted text. I know what pseudocode …

Member Avatar for Simes
0
489
Member Avatar for wolfeater017

:SHave they made a py2exe 3.0 yet and if so where in the internet can you find or have they just not made one yet?:confused: If not how else can I turn my programs into executables?:-/

Member Avatar for Beat_Slayer
0
197
Member Avatar for TrustyTony

Here is my try of changing integers to English written numbers. Here corrected version 3 check: [CODE]from __future__ import print_function import random,sys if sys.version_info[0]==3: raw_input=input to_19 = ["zero", "one","two","three","four","five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" ] tens = ["","","twenty", "thirty", "forty", "fifty", …

Member Avatar for TrustyTony
0
1K
Member Avatar for Pytho

Hi again This time I have one kind of bigger problem. I have to bind single click and double click with Tkinter. So, I tried this: [code=python] root.bind("<Button-1>", single_click) root.bind("<Double-Button-1>", double_click)[/code] That doesn't work. What I can try next? How to execute function X on double click and function Y …

Member Avatar for Pytho
0
105
Member Avatar for acrocephalus

Hello! I am trying to write a piece of code to open a file using a 'while' loop. It should ask for the file name and, if it does not exist, ask for it again. This is the code: [CODE]while True: try: fhand = open(markFile) except: print 'File', markFile, 'cannot …

Member Avatar for acrocephalus
0
140
Member Avatar for prashanth s j

Hi all, the following is the result of executing a command on cli of a machine 192.148.2.10: [code] PGK:1200>> show employee record show employee record EmIL Desig Street Street2 Occupation Avialability ------ ----- ------------- ------------- ---------- ------------- ----------- 3222 HOD MorganLayout HB colony Engineer Yes 3321 Read Banker's colony James …

Member Avatar for TrustyTony
0
271
Member Avatar for acrocephalus

Hello! I have this piece of code, which asks the user to continue with the program even if it may overwrite some folders. [CODE]print w.fill('WIP will create Backup, Resized and Watermarked folders to store the original, resized and watermarked pictures. It will overwrite them if they already exists. Are you …

Member Avatar for TrustyTony
0
140
Member Avatar for keith1569

So basically what i want wanting to do is import a csv file and then have the user specify what year they want to add up all the total revenue. here is what is in my csv file [quote] 2009|1|22|56.23 2009|4|12|86.24 2009|5|20|34.67 2009|6|22|12.67 2009|3|21|795.12 2008|7|4|753.43 2008|8|9|2345.45 2008|9|1|2357.23 2010|5|2|7552.21 2010|3|15|666 2010|4|17|2323.75 …

Member Avatar for TrustyTony
0
318

The End.