15,181 Topics

Member Avatar for
Member Avatar for nekogda

Here's a simple question. Need: => to use scipy special package function in my python prog (python2.6). 1. Downloaded & intalled numpy for python2.6 2. Downloaded & intalled scipy (scipy-0.8.0-win32-superpack-python2.6.exe) tested: import numpy import scipy - everything's ok According to scipy docs, a package needs to be loaded before a …

Member Avatar for nekogda
0
209
Member Avatar for fekioh

Hello, I need to store data in large lists (~e7 elements) and I often get a memory error in code that looks like: [code=python] f = open('data.txt','r') for line in f: list1.append(line.split(',')[1]) list2.append(line.split(',')[2]) # etc. [/code] I get the error when reading-in the data, but I don't really need all …

Member Avatar for ultimatebuster
0
2K
Member Avatar for acrocephalus

Hello! I am trying to creat an "About box" with wxpython. I have defined this function [CODE]def OnAboutBox(self, event): info = wx.AboutDialogInfo() info.SetIcon(wx.Icon('icons/exit.png', wx.BITMAP_TYPE_PNG)) info.SetName('Watermark Image Processing') info.SetVersion('1.0b') info.SetDescription(info) info.SetCopyright('(C) 2010 Daniel Valverde') info.SetWebSite('http://www.acrocephalus.net') licenseFile = open('license.txt') info.SetLicence(license) info.AddDeveloper('Daniel Valverde') info.AddDocWriter('Daniel Valverde') info.AddArtist('Daniel Valverde') info.AddTranslator('Daniel Valverde') wx.AboutBox(info)[/CODE] I know that …

Member Avatar for acrocephalus
0
407
Member Avatar for hondros

Well, since there was no option for "tutorial" in the type of post, it has been created as a simple thread... Obfuscation - confusion resulting from failure to understand obfuscated code - Code that is hard to read In this tutorial, I will show you how to convert something readable, …

Member Avatar for hondros
2
162
Member Avatar for Tarkenfire

Okay, so in all honesty, I began learning Python about 2 days ago, so this is a rather noobish question(well, I've programmed in other languages, so it's not THAT noobish), but I'm making an IRC bot and can't figure out how to make it so that a line of code …

Member Avatar for Tarkenfire
0
213
Member Avatar for lewashby

In the following program can someone help me figure out why the close button [X] at the top right corner isn't working? [CODE] # imports from Tkinter import * from sound_panel import * import pygame.mixer # create gui app = Tk() app.title("Head First Mix") # create mixder mixer = pygame.mixer …

Member Avatar for vegaseat
0
82
Member Avatar for jenzilla

What am I doing wrong? [URL="http://www.daniweb.com/forums/post1298887.html#post1298887"]http://www.daniweb.com/forums/post1298887.html#post1298887[/URL]

Member Avatar for vegaseat
0
54
Member Avatar for PythonNewbie2

Hey guys, I'm parsing some XML using minidom and whenever a comment has a "--" within it, I get an ExpatError. For example, a file may be like this: [CODE] <Label> Hello!</Label> <!-- The above label says Hello. -- It is clear, no? Let's try spicing it up a bit. …

Member Avatar for snippsat
0
2K
Member Avatar for Viasur

Hello all. First I have to let you know that Im a total newbie trying to understand Python using the book 'A byte of Python'. I'm following everything on that book and is been kind of fun until OOP (object orient programing). Im getting an error in most of the …

Member Avatar for Viasur
0
1K
Member Avatar for Aiban

Hi With every piece of code i download to check out, i often find with python 3.1/Windows Vista that the code will start with from Tkinter import * but i need to change it to from tkinter import * as it seems to be case sensative, i tried renameing the …

Member Avatar for jgomo3
0
12K
Member Avatar for pdini

Hi all, I developed a GUI application using PyQt which comport a QGraphicsView. In this QGraphicsView I have a QGraphicsScene with a lot of items (more than 10'000): polygons, rectangles, texts, etc. How can I save it as an image like it appears on the screen (.png for example)? I …

Member Avatar for pdini
0
2K
Member Avatar for dr_zoidberg1

Hi everyone, i’m new to this board, and i’m having a bit of trouble plotting lines inside of a function, perhaps someone knows what i’m doing wrong! I’m trying to plot an X where the points have been clicked, this is all for a wider picture that is going to …

0
97
Member Avatar for bettersaid

hello! i've been trying to create an automated task which it should: 1. open Print 2. choose Printer 3. change Paper Size ( i want to print my doc in all paper size) but i find my code too long and oh i dont know, and i want to simplify …

0
139
Member Avatar for pythonbegin

Hi all How can I create a csv file with header. I have a text file with several number of blocks staring from "//" and ending a block with "//". I have attached a sample file. I want to use first column of this text as a header of csv …

Member Avatar for pythonbegin
0
1K
Member Avatar for Kruptein

I'm fetching a list with all files/folders on a ftp-server, I want to put a [F] before a folder, and leave files like they are, but I can't find a way to check if it's a file or a dir... I already tried: [code=python]from ftplib import FTP import os ftp …

Member Avatar for Sunjay03
0
7K
Member Avatar for PythonNewbie2

Hi guys, I want to add a custom footer to all of my word documents like "This document was written by PythonNewbie". Let's say all of the reports are in a single directory. Here's some code that I have which can do through and find files... Now I need a …

Member Avatar for Beat_Slayer
0
96
Member Avatar for sandhya1202

[QUOTE]Actually i would like to do steaming,stopword removal,word count and punctuation marks removal from my text data i found code for this in DaniWeb[/QUOTE] [CODE]import string def RemovePunc(): line = [] i = 0 text_input = "" total_text_input = "" #This part removes the punctuation and converts input text to …

Member Avatar for Beat_Slayer
0
636
Member Avatar for PythonNewbie2

Let's say I have my own installer for a product that uses a lot of other components. One piece of my product is a python script. However, most of my end-users don't have python installed already. Is there any way I can include the python installer as part of my …

Member Avatar for Beat_Slayer
0
191
Member Avatar for reviloera

Guys I need help am using fedora 13 KDE desktop I want to install Qscintilla and its pyqt4 wrapper when a run [CODE]qmake qscintilla.pro [/CODE] I get an error message.........(bash: qmake command not found) thanxs

Member Avatar for woooee
0
99
Member Avatar for tmd200

Hi, I have a question about the color options in matplotlib. First, some calculations are done, which results in a nested list, which contains for each variable (A,B,C etc.) the values at particular time points. I can plot this like, which gives a nice figure, where every variable has it's …

0
27
Member Avatar for koveras vehcna

Hello everyone, I am currently working on text processing with Python and I want to parse a .txt file into its sentences as a whole. I tried to create some regular expressions but I failed to do so. I only managed to come up with a regex that splits each …

Member Avatar for TrustyTony
0
1K
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
247
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
316
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
399
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
127
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

The End.