15,190 Topics

Member Avatar for
Member Avatar for nimmyliji

Hi, I am new to Python programming... I have a .txt file....... It looks like.. 0,Salary,14000 0,Bonus,5000 0,gift,6000 I want to to replace the first '0' value to '1' in each line. How can I do this? Any one can help me.... With sample code.. Thanks in advance. Nimmyliji

Member Avatar for vegaseat
0
128
Member Avatar for MacUsers

Hi there, I'm having this problem with using translate() - I have a line in my code like: [icode]k.translate(None,':.-')[/icode], being called from a function, which works flawlessly under v2.6.4 but throwing in TypeError when run under v2.5 [code]Traceback (most recent call last): File "./wakeONlan", line 94, in <module> WakeOnLan(k.translate(None,':.-')) TypeError: …

Member Avatar for MacUsers
0
139
Member Avatar for axa121

Hi I am trying to read data from a text file, line by line. However I am having problems with the output of the last line. The text file I have created is: position 50 10 line 50 0 line -50 0 line 0 -50 Here is my code: [code] …

Member Avatar for axa121
0
145
Member Avatar for htrantk

The goal of this project is to use if-else statements, anydbm, and turtle graphics in a Python program to make a database of colors. If the program is called colordb.py, then a session at the command prompt $ happens as follows: $ python colordb.py hit enter to give a color …

0
57
Member Avatar for SOURP0PCORN

[code]#!C:\Python26\python.exe # Three-times-the-square-root-of-your-age.py # # This is a python program that # will input the user's name and age # the output will be 3 times the # square root of the user's name # # author: Min Ku "Peter" Joo # last revision: 02/10/2010 import os import math def …

Member Avatar for vegaseat
0
188
Member Avatar for SgtMe

Hi all. :) I'm having trouble with pygame, images and transparency. Lets say I have an image...a circle to keep it simple (for example only). What I want is to be able to draw the image, but with only the circle showing (ie. not a white box around it). Oh …

Member Avatar for SgtMe
0
334
Member Avatar for sindhujavenkat

How can I split a widget and add some contents on it in PyQt4? Dear Python experts!!! Could you refer me some books for PyQt in which the documentation would be clear(other than Dive into python and Rapid GUI development in python)?

Member Avatar for sindhujavenkat
0
177
Member Avatar for simplySH

Hi! I am trying to make a menu that uses small icons as well as text, but when I open the main menu, the icon in the pull down menu is not correctly displayed until I hoover over it. Could someone please be so kind to tell me what's wrong …

0
46
Member Avatar for explorepython

hi all, In the example below [CODE]from PyQt4 import QtCore, QtGui class Ui_Dialog(QtGui.QDialog): def __init__(self,parent=None): QtGui.QDialog.__init__(self,parent) self.setObjectName("Dialog") self.resize(600, 500) self.model = QtGui.QDirModel() self.tree = QtGui.QTreeView() self.tree.setModel(self.model) print(self.model.flags(self.model.index("c:\Program Files"))) self.model.setFilter(QtCore.QDir.Dirs|QtCore.QDir.NoDotAndDotDot) self.tree.setSortingEnabled(True) self.tree.setRootIndex(self.model.index("c:\Program Files")) #self.tree.hideColumn(1) #self.tree.hideColumn(2) #self.tree.hideColumn(3) self.tree.setWindowTitle("Dir View") self.tree.resize(400, 480) self.tree.setColumnWidth(0,200) self.tree.show() QtCore.QObject.connect(self.tree, QtCore.SIGNAL("clicked(QModelIndex)"), self.test) QtCore.QMetaObject.connectSlotsByName(self) self.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) def …

0
212
Member Avatar for Kruptein

Are their people willing to help testing/contributing to a python project? (if this is not a 'legal' subject, feel free to delete it; I wasn't sure)

Member Avatar for Kruptein
0
77
Member Avatar for sniperx99

I would like to specify a file for manipulation from the command line. I am new to python so I'm not really sure how to begin this. I am guessing that I need some options?

Member Avatar for d5e5
0
467
Member Avatar for rwbarrette

I have a script which looks at multiple values within a large database, and draws coordinates on a floatcanvas. I also have some thresehold variables attached to a slider widget. As the slider changes the thresehold value, the canvas is redrawn...well...sort of. It draws the new objects over the old, …

Member Avatar for vegaseat
0
440
Member Avatar for SgtMe

Hi all. :) I'm having trouble with pygame, images and transparency. Lets say I have an image...a circle to keep it simple (for example only). What I want is to be able to draw the image, but with only the circle showing (ie. not a white box around it). Oh …

0
52
Member Avatar for foren

[CODE]import os f = open(r'c:\Fummy_Tasks\Fummy_Forensic\19012010\IMAGES.txt') mkdir_name = 'mkdir c:\\Fummy_Tasks\\Fummy_Forensic\\19012010\\test2_Strings' print mkdir_name os.system(mkdir_name) mkdir_name = 'mkdir c:\\Fummy_Tasks\\Fummy_Forensic\\19012010\\test2_Memdmp' print mkdir_name os.system(mkdir_name) f = open(r'c:\\process_list_test2.img.txt','r') process_id = f.readline() while True: process_info = f.readline() if not process_info: break process_PID = process_info.split() openfilename = 'c:\\python26\\python.exe c:\\volatility-1.3_Beta\\volatility memdmp -f c:\\Fummy_Tasks\\Fummy_Forensic\\19012010\\test2.img -p %s' % (process_PID[1]) print openfilename …

Member Avatar for Gribouillis
0
229
Member Avatar for jpslayug

Hi All, Good day to everyone! I'm new to Python (and relatively new to scripting, at that), and really benefited from looking at examples on this site, you guys are great! I'm trying to do the following, and need help please: 1. Read an input file, each line formatted as …

Member Avatar for jpslayug
0
223
Member Avatar for sindhujavenkat

Could anyone tel me that how can I link two widgets in PyQt4. one more thing I want to know. I have created a tabbed view. How can I add the vcontents in a tabbed view?

Member Avatar for sindhujavenkat
0
140
Member Avatar for vamsicoolman

how to read the output of the html, Actaully I am writing a small text as output whenever I invoke the html file but when I am using urllib.read() or webbrowser.read() I am able to read the source of the html rather than its output. I am a begineer So …

Member Avatar for vamsicoolman
0
13K
Member Avatar for BlackPhoenix

Hi, I'm in the process of creating a program that will allow any client connected to a simple server to voice chat. To start small, I only want the server to play the sound it is receiving from the clients -- the server will not be sending voice to any …

0
74
Member Avatar for polygon

Dear Folks, I am trying to use python-idiom to reverse a list of lists so that, for example, a = [[1, 2], ['apple', 'orange']] becomes b = [['orange', 'apple'], [2, 1]] My code for this at present is: [CODE] import copy a = [[1, 2], ["apple", "orange"]] if type(a) is …

Member Avatar for Gribouillis
0
2K
Member Avatar for persianprez

Hey guys, I recently found out how to make .py an exe using py2exe and I also found another program called "Smart Install Maker." I bought the license and wanted to let you know if you want to send me your .py, I will package it for you for free. …

Member Avatar for snippsat
0
189
Member Avatar for sindhujavenkat

I am new to PyQt... I wanted to know how to add the contents in each tab of the tabbed view. Also, I wanted to know how to link two widgets./

Member Avatar for sindhujavenkat
0
145
Member Avatar for GoBlue

Hello. I'm new here, and a student taking a course in Python. I'm completely lost as to what I should put in the numerator for this part: [CODE] def compactness(self): # TODO: compute the percentage of filler words to total words # lower percentage is more compact # students to …

Member Avatar for slate
0
91
Member Avatar for Stefano Mtangoo

Hi all, I have been poking wx document and also google but i havent prevailed. All I need is to get all drives C, D, E etc just like my computer is. What is the trick? Thanks

Member Avatar for Stefano Mtangoo
0
103
Member Avatar for persianprez

I want to use a proxy in my code. What I'm trying to do is open a list of proxies from a .txt and load them as the proxy. If I just can get the code to use proxy, I'm sure I can figure out the rest. Here is my …

Member Avatar for persianprez
0
85
Member Avatar for nimmyliji

Hi, How can i pass an xml file from python to flex 3..? Any one can help me...... with example code

Member Avatar for JasonHippy
0
482
Member Avatar for lrh9

I was wondering if anyone knows of any resources about building a custom importer. I've found this: [url]http://www.doughellmann.com/PyMOTW/sys/imports.html[/url]. I am also aware of PEP 302 and PEP 369 and imp and importlib. Are there any other resources I might need?

Member Avatar for lrh9
1
457
Member Avatar for sammyboy289

Hi, im a begginer to python, and i've been doing it a small while now, i've been attempting some puzzles of a website, and have met a small problem, and i can't find it. My code is below and i will explain my problem, ask how to sort it, and …

Member Avatar for sammyboy289
0
94
Member Avatar for neostead

Hi, i'm working on simple fullscreen launcher application, to use it with remote on my HTPC media center to launch xbmc, stepmania, nes emulator, etc I'd like to use png icons with transparency, but there is a problem. In alpha channel of loaded icons i can see the back frame's …

Member Avatar for neostead
0
4K
Member Avatar for purgatoryred

Please forgive my ignorance but forever I've been in the habit of building a library of useful subroutines which I call from an application I am building. Recently the language has been python - a distinct departure from my experience. I've been unable to create a reasonable library. Here's the …

Member Avatar for purgatoryred
0
139
Member Avatar for devsprasad

Hi, I am wondering about how to insert an image(.png) file into excel sheet using python.I have also tried converting .png file into .bmp file, but met with no success. I have tried using insert_bitmap() function, it doesn't give any exceptions. But the resulting excel file that is created is …

Member Avatar for devsprasad
0
30

The End.