15,190 Topics

Member Avatar for
Member Avatar for -ordi-

Hei, [CODE]list = [line.split() for line in open(file) if line is not None][/CODE] and output: [CODE][linux@localhost ~]$ [[], ['text'], ['text', 'text', 'text', 'text'], ['text', 'text', 'text', 'text']][/CODE] How to remove none types [] or something.

Member Avatar for -ordi-
0
137
Member Avatar for andrewtrench

I have a perplexing problem which may turn out have a simple solution (hopes!). I am writing a little GUI to allow a user to enter information which will get built into an XML file which is linked to flash-based graphic. One of the fields I have is a Tkinter …

Member Avatar for andrewtrench
0
130
Member Avatar for reviloera

I have started programming in python . I want to know the best GUI binding to use .pyqt and wxpython which one is the best and easy to learn and install on federa 13

Member Avatar for vegaseat
0
84
Member Avatar for andrewtrench

Hi. I'm fiddling around with Python and MySql. I keep getting an error with this little script to try and read the rows in a table. The error is: TypeError: unsupported operand type(s) for +: 'int' and 'tuple' Here is the code snippet. Any help would be hugely appreciated [CODE]import …

Member Avatar for andrewtrench
0
248
Member Avatar for eldeingles

Would like to be able to replace every [I]nth[/I] word in a text file with a blank space. I'm sure python is so capable.

Member Avatar for TrustyTony
0
317
Member Avatar for xheavenlyx

Before I ask the question I realize that selection of a programming language depends on the context of a problem at hand. Related to this I would like to know (if anyone) how many of you use which language for programming microcontrollers, embedded systems and even generally on PC. Here …

Member Avatar for stevephillips
0
216
Member Avatar for sebcbien

Hi, I've got some trouble opening files saved by The Gimp in BMP 16bits 565. I've test some various bmp they all work except those saved from The Gimp and I really don't know why the format might be different from the one found there:[URL="http://wvnvaxa.wvnet.edu/vmswww/bmp.html"]http://wvnvaxa.wvnet.edu/vmswww/bmp.html[/URL] Bleu.bmp and Mire.bmp are some …

Member Avatar for sebcbien
0
405
Member Avatar for err1100

Hello all - I've been coding in Python for a couple of months now, and I recently ran across the following piece of code (where x is a set or list): [CODE]f = lambda x: [[y for j, y in enumerate(x) if (i >> j) & 1] for i in …

Member Avatar for jcao219
0
128
Member Avatar for personx1212

hi, i want to be able to intercept IE connections and get the URL before the contents are downloaded, either when clicking on a link or entering the address directly in the Addressbar, i found some examples on the web and made some changes but still some things are not …

0
61
Member Avatar for ke24126

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 …

Member Avatar for bpatt22
0
4K
Member Avatar for akls578

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

Member Avatar for TrustyTony
0
406
Member Avatar for cleve23

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

Member Avatar for vegaseat
0
149
Member Avatar for Tommymac501

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 …

Member Avatar for Beat_Slayer
0
571
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for Stefano Mtangoo
0
290
Member Avatar for johnroach1985

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 …

0
121
Member Avatar for Namibnat

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 …

Member Avatar for Namibnat
0
221
Member Avatar for jop-pop

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 …

Member Avatar for Beat_Slayer
0
444
Member Avatar for sebcbien

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 …

0
61
Member Avatar for ryuurei

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 …

Member Avatar for tls-005
3
451
Member Avatar for NightKev

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 …

Member Avatar for tls-005
0
162
Member Avatar for Tech B

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

Member Avatar for tls-005
0
218
Member Avatar for frogy

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 …

Member Avatar for ultimatebuster
0
142
Member Avatar for Fearx351

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(): ## …

Member Avatar for Fearx351
0
140
Member Avatar for lewashby

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

Member Avatar for lewashby
0
1K
Member Avatar for lewashby

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

Member Avatar for TrustyTony
-1
306
Member Avatar for WildBamaBoy

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 …

Member Avatar for WildBamaBoy
0
78
Member Avatar for Musing888

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 …

Member Avatar for TrustyTony
0
285
Member Avatar for vegaseat

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.

2
707
Member Avatar for davidkhan

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 …

0
48
Member Avatar for leegeorg07

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

Member Avatar for leegeorg07
0
120

The End.