15,181 Topics
| |
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 … | |
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”, … | |
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? | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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) == … | |
#!/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) … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
**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 … | |
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 … | |
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 … | |
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. |
The End.