15,181 Topics

Member Avatar for
Member Avatar for Suresh_6

Hi i'm new to python, i want to generate results by comparing two files(txt/xls)line by line as Pass or Fail. i was able to achieve this using difflib and htmldiff(). comparison works fine but not able to add third column as results which should return pass/fail for corresponding line. can …

Member Avatar for Suresh_6
0
162
Member Avatar for iuessele

I am a total newbie to programming. I was hoping to learn how to write a program that prints out a string representation of a random card from a deck of playing cards. The programs should use either “A”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “10”, “J”, “Q”, …

Member Avatar for alexander.selin.7
0
13K
Member Avatar for pizzaaaa

Hi I'm new to Python. I can't seem to go back to a submenu. Using continue or break will make it go to the MAIN menu. Will using def help? If so, how is def used in that situation?

Member Avatar for Lucaci Andrew
0
137
Member Avatar for zina_a

Hi, I want to display a Frame2 when I clic the button4 in Frame1,my problem is when I clic in that button the Frame2 is not displayed this is my code: #Boa:Frame:Frame1 import wx import wx.animate def create(parent): return Frame1(parent) [wxID_FRAME1, wxID_FRAME1BUTTON1, wxID_FRAME1BUTTON2, wxID_FRAME1BUTTON3, wxID_FRAME1BUTTON4, wxID_FRAME1BUTTON5, wxID_FRAME1BUTTON6, wxID_FRAME1GIFANIMATIONCTRL1, wxID_FRAME1PANEL1, wxID_FRAME1STATICTEXT1, …

Member Avatar for vegaseat
0
364
Member Avatar for krystosan

when getting file from a web server or ftp server, if we use `u = urllib2.urlopen(url)` Correct me if I am wring, it is not getting downloaded to disk, i think its getting stored in buffer(RAM), is there a way that the buffer split should get saved onto disk directly …

Member Avatar for slate
0
301
Member Avatar for mark103

Hi all, I'm running on python version 2.6 for xbmc media application, but I'm having trouble with setLabel function. When I run the code, it will update the value in the setLabel, but it will not allow me to update the values in the setLabel more than once. Here it …

Member Avatar for vegaseat
0
413
Member Avatar for Tcll

ok, so I'm kindof a complete noob when it comes to stuff dealing with windows specifically... I know it's possible to have an interactive OpenGL desktop BG in XP as [this article](http://engineering.imvu.com/2010/11/24/how-to-write-an-interactive-60-hz-desktop-application/) proves it works in C++. but I want to get it working in python and have no idea …

0
66
Member Avatar for mark103

Hi all, I need your help, I'm having a trouble with writing the database at the same time when I'm using the time.sleep function. I can be able to create the database table without have any problem, but when I use the time.sleep function, it will stop writing the data …

Member Avatar for Hiroshe
0
312
Member Avatar for krystosan

I am on OSx and I am trying to exit the program by pressing CTRL+C. but it seems like even if I have a signal handler registered in main thread it doesn't exit while the thread is executing on pressing CTRL+C. Here is a piece of cake where I am …

Member Avatar for TrustyTony
0
2K
Member Avatar for tubs1

Hi All, Im new to programming and am trawling through Python as we speak. API & web services type stuff is of real interest to me but not sure how to structure my learning. I know google is my friend but any ideas on how best to structure my learning …

Member Avatar for ~s.o.s~
0
264
Member Avatar for loulou.skr

I have a large gff file 15,6 GB.. I wanna retrieve features from each record.. and for each subjectOrganism in the qualifier feature I will compare it with sorted list of species and get the index of this organism in sorted list. It work with a small data from the …

Member Avatar for ~s.o.s~
0
215
Member Avatar for abaddon2031

So i have a python code that searches for a folder in a directory and gets the size of the folder. I am wanting to search inside the folder and get the file size of what is in the folder. The items in the folder will have different extentions so …

Member Avatar for ~s.o.s~
0
398
Member Avatar for abaddon2031

I am trying to learn element tree so that i cna work with xml files a little more indepth. I have researched it and everythign i have read says that my version of python should have ElementTree already installed on it. But every time i try to run my sample …

Member Avatar for snippsat
0
2K
Member Avatar for sys73r

I'm working with a LIST that am getting from a soup which after the clean up gives me: lists of variable length ['7.0', '7.5', '6.8', '6.9'] or ['7.0', '7.5'] so my problem is when I try formating the output: code snippet: if grades: print '\r\n["' + str(student[0]), if len(grades) == …

Member Avatar for David W
0
393
Member Avatar for lewashby

#!/usr/bin/env python3 import sys import re file = sys.argv[1] f = open(file, 'rb') seek_positoin = 0 artist_string = b'artist=' line = b'' f.seek(seek_positoin) while artist_string.upper() or artist_string.lower() not in line: line = f.readline() if artist_string.upper() or artist_string.lower() in line: seek_positoin = line.find(artist_string) f.seek(seek_positoin, 1) word = f.read(10) #line = str(line) …

Member Avatar for TrustyTony
0
394
Member Avatar for abaddon2031

I have a small program that searches through two folders and gets the size of the files in them. As of right now for every file that is over the specified size limit sends a email. What i am wanting to do it have it compile a lsit of the …

Member Avatar for TrustyTony
0
279
Member Avatar for Castellar

I have following code: # -*- coding: utf-8 -*- forbiddenWords=['for', 'and', 'nor', 'but', 'or', 'yet', 'so', 'not', 'a', 'the', 'an', 'of', 'in', 'to', 'for', 'with', 'on', 'at', 'from', 'by', 'about', 'as'] def clear_screen(): button2.destroy() button3.destroy() text.destroy() label.destroy() def main_page(): var = StringVar() global label label = Label( root, textvariable=var) var.set("Fill …

0
173
Member Avatar for Jolie Tia

Hello, I am trying to create a function that will search a fixed line of text for a word or phrase. Once that is completed, I am to try and pass the line of text and the word as parameters. Can someone help lead me in the right direction. I …

Member Avatar for Jolie Tia
0
383
Member Avatar for Ravi_exact

Friends, I'm completely new to python, i have question with setting width of PySide.QtGui.QDockWidget in python. I have MainWindow class in python which inherits QtGui.QMainWindow ( PySide ) and have added one left dock widget with simple plot and one right dock widget with simple plot and embedded simple plot …

Member Avatar for britanicus
0
589
Member Avatar for keegansch

Hello! So, I'm taking some classes and learning how to write sample programs in Python, and I've stalled out pretty hard on one of the sample programs. The current exercise wants me to do the following: 1. Create an empty list home_prices 2. While loop asks for a home price …

Member Avatar for David W
0
366
Member Avatar for keegansch

Hello, all! My name's Keegan, and I'm a college student finishing up my B.S. in Journalism, and learning Python is one of the final steps toward earning my degree. I hope to use what I learn about Python and apply it to digital journalism in the form of app development, …

Member Avatar for JorgeM
0
157
Member Avatar for tubs1

Hi All, Im new to Python and doing a few basic exercises around modules and calling same. Can someone explain what par is in relation to this example? -------------- # Defining a module called support.py def print_func( par ): print "Hello : ", par return -------------- # Importing support.py module …

Member Avatar for Gribouillis
0
561
Member Avatar for frankie198

I am new here and it's my first post, so I'm sorry if this is in the wrong place or is formatted wrong. I made my first Python code, which is extremely simple, but I have a few questions I need clarified: This program asks the user to enter 3 …

Member Avatar for David W
0
450
Member Avatar for Ravi_exact

Hi, I would like to add some descriptions to functions on top of every function ex : [Name = 'Test menu', Default=True, etc..] def test(): pass My actual scenario is , I create Menus dynamically by reading all methods from a module at run time. So i don't want to …

Member Avatar for slate
0
482
Member Avatar for abaddon2031

I have a block of code that i am wanting to turn into a function and i am very ocnfused on how to do it properly. If anyone could give me a lead on how to do this it would be a great help. The for statement is where i …

Member Avatar for abaddon2031
0
223
Member Avatar for Tcll

so I have this example, which I've slightly modded to get the simplicities out of the way: from PyQt4 import QtGui, QtCore HORIZONTAL_HEADERS = ("Surname", "Given Name") class person_class(object): ''' a trivial custom data object ''' def __init__(self, sname, fname, isMale): self.sname = sname self.fname = fname self.isMale = isMale …

Member Avatar for Tcll
0
4K
Member Avatar for Will_5

**I genuinely hope this is the right place to post this question.** Anyways, I play video games alot and I really like them (I know playing video games won't help me make them ) But as I play them I keep on getting the urge to create my own video …

Member Avatar for jwenting
0
536
Member Avatar for ddanbe

This is my first try with turtle graphics in Python. It is in fact a sort of "translation" from some old LOGO code. When you run it, this should be the result: ![dbf0a4f76975c5cc4dee5df30139f144](/attachments/small/1/dbf0a4f76975c5cc4dee5df30139f144.png "align-left") Insiders can perhaps play the "Dark side of the moon" record by Pink Floyd :) Any …

Member Avatar for ddanbe
3
2K
Member Avatar for Vishwadeep1

Hello. I am working in QGIS software in which backend python programming is used. I want to interesect a polygon with different lines passing through it, and find the width of that polygon in QGIS 1.8. The polygon is a shapefile ie .shp file. So please help me to complete …

0
121
Member Avatar for TrustyTony

Here some old fashioned line input routine, better idea nowadays would be to use GUI input box with real editing. Anyway, it is quite simple with Python to do this basic routine for terminal based program.

Member Avatar for fonzali
4
510

The End.