15,175 Topics

Member Avatar for
Member Avatar for rlogan1

Hi, does any of you have any idea why the self.status variable is not rewritten? When I run the script below, although it connects to the ip and port mentioned, and receives a message, the self.status is still "down" the otuput is : 192.168.0.1 down it should be: 192.168.0.1 'message …

Member Avatar for rlogan1
0
95
Member Avatar for Kruptein

I really don't see what is wrong =(. First I download via curl a file, then I want to compare it to a local file there are 15 lines in dwnext.ded and there are 14 lines in extlib.ded I want to store in append those lines that have a string …

Member Avatar for Kruptein
0
166
Member Avatar for atqamar

Hello, I have an Excel file with 40,000 rows of data. I would like to create a program in which reads the first column of the 40,000 lines and allows me to choose which row to edit. After selecting the row to edit, I'd like a form to come up …

Member Avatar for Stefano Mtangoo
0
156
Member Avatar for Purnima12

[CODE]print ('Why hello there!') print ('\n') print ('It seems I have been given the ability to process more complex commands...') print ('\n') yourname1 = input('Would you mind telling me your name?') print ('\n') print ('\n') print ('Thank you,', yourname1,',' 'who is that friend of yours?') print ('\n') print ('\n') yourname2 …

Member Avatar for Gribouillis
1
2K
Member Avatar for Stefano Mtangoo

Is this possible? Any tutorial if possible? I want to make a program to do mass conversion of my Icons without loosing resolution

Member Avatar for Stefano Mtangoo
0
832
Member Avatar for sindhujavenkat

I have created a mainWindow with menubar and toolbar. When I click a tool in a toolbar, function should return a layout. how can I write a function?

Member Avatar for vegaseat
0
61
Member Avatar for jtbcswiss

I perform the following search using regular expression in Python on about 3000 html documents in .txt format and obtain about 600 cases where the following program returns 1 (finds the chain): [CODE]def risk_committee_search1(str): ## get the re object co = re.compile(r""" (?P<nam>:.{300} RISK\W+ (\w+\W+){0,5}? COMMITTEE .{300} | .{300} COMMITTEE\W+ …

Member Avatar for Gribouillis
0
469
Member Avatar for Hawkeye Python

I'm new at Python coding and in DaniWeb. Really nice forum :icon_cheesygrin: Need some help w/ the following code: the content of saldo.txt is the following [CODE]1000[/CODE] The code I was talkin' about: [CODE] # [...] f = open('C:/saldo.txt') print f saldo = f.readline() f.close() if saldo <= 100: a …

Member Avatar for snippsat
0
118
Member Avatar for donnyv

Hi, I want to read the data from a worksheet in an excel workbook, write it to a new worksheet and save that as a dbf or csv file (one worksheet)...basically extracting worksheets from a workbook and saving them individually, renaming them as the title of the worksheet with the …

Member Avatar for J-M DESMETTRE
0
233
Member Avatar for Hawkeye Python

Incomplete dice game function, dunno why does'nt works... If you're not using windows, change the dir. "C:/" [CODE] def bet(Bet): try: f = open('C:/money.txt') print f money = f.readline() f.close() print ('You have', money, 'Dollars. Wanna play dice(y/n)?') v = raw_input() if v == 'y': # here i'm printing those …

Member Avatar for The_Kernel
0
172
Member Avatar for Stubaan

Hi folks Can anyone explain to me why this is not working please? I am trying to delete the first 52 lines of a text file, then skip deleting the next line, then deleting the next 100 lines, then skipping the next line and repeating the process until the file …

Member Avatar for Stefano Mtangoo
1
116
Member Avatar for Hawkeye Python

Well, I'm a begginer in Python coding, and at DaniWeb. My problem is: I can't open any files! I tried: [CODE] >>> f = open('C:\teste.txt', 'w') Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> f = open('C:\teste.txt', 'w') IOError: [Errno 22] invalid mode ('w') or filename: 'C:\teste.txt'[/CODE] …

Member Avatar for Hawkeye Python
0
4K
Member Avatar for vermont

Please I am having challenges to write a code with notepad and then run it with IDLE 2.6 particularly when importing modules like turtle. Here is an example: here is python code : [code=python] # Programme pour dessiner une série de triangles équilatéraux de différentes couleurs en différent endroit. from …

Member Avatar for vegaseat
0
1K
Member Avatar for persianprez

I'm trying to make the code able to post in here [url]http://spreadsheets.google.com/embeddedform?formkey=dEtSUVAtQVAtUVN1WDFPU3BEbm9yNkE6MA[/url] I've been successful in getting to read from the spreadsheet. With this code if you're wondering: [CODE] import urllib opener = urllib.FancyURLopener({}) f = opener.open("urlhere") print f.read() [/CODE]

Member Avatar for persianprez
0
167
Member Avatar for vamsicoolman

please help me how to check the validity of the json object if suppose the example of the JSON is as ({type:'AAU', msgid:1265033798233, sel:0, gadinfo:[{ adid:316,adprt:40.0,dur:10,ef:'2009/06/03 10:00:00',et:'2012/06/03 12:00:00',imgfurl:'vaccumcleaner_h.jpg' }]}) SO I want a script in python which would give me the validity of the object as the output by taking …

Member Avatar for vegaseat
0
178
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
127
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
144
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
333
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
176
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
433
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
439
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
228
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
222

The End.