15,175 Topics
| |
Hi, I have a large file (11 GB), that I want to extract information from. I decided that the file was to big to work with, so I ended up with splitting it into 20 smaller files. Now I don't know what the smartest thing is to do with these … | |
This is python code and I am new to programming and I can't get just the first word of the sentence to capitalize. [CODE] def main(): input= 'the money is in the bag. however you dont want it.' words = input.split('.') capitalized_words = [] for word in words: word=word.strip() title_case_word … | |
Hey guys, Is it possible to change the color of characters in a list if they do/dont meet certain conditions? So here's my code: [CODE]def checkWord(real, guess, remReal, remGuess, wrongSpot): # Format the letters so user knows whats wrong/right fullWord= real # Create copy list of real word realWord= list(fullWord) … | |
I would like to know how to use [ICODE]system("pause")[/ICODE]from C++ in Python 2.7 to get similar effect. Could you help me? | |
[code] from urllib import urlretrieve import urllib2 import re import gzip urlretrieve('http://www.locationary.com/place/en/US/Virginia/Richmond-page28/?ACTION_TOKEN=NumericAction', 'myfile') page = gzip.open('myfile', 'rb').read() findLoc = re.compile('http://www\.locationary\.com/place/en/US/Virginia/Richmond/.{1,100}\.jsp') findLocL = re.findall(findLoc,page) listIterator = [] listIterator[:] = range (0,25) for i in listIterator: urlretrieve(i, 'myfile2') page2 = gzip.open('myfile2', 'rb').read() findYP = re.compile('http://www\.yellowpages\.com.{1,100}\d{1,100}') findYPL = re.findall(findYP,page2) listIterator2 = [] listIterator2[:] … | |
I am trying to use Beautiful Soup to scrape a website, Locationary.com, and get some information from it. I am a member and even when I'm logged in this doesn't work... OK. This first bit of code just returns the HTML of Locationary.com (the home page) in a "pretty" form. … | |
I'm currently working in another thread to find a better conversion method here's my script: [code] #!BPY """ Name: 'Brawl (.mdl0)...' Blender: 248 Group: 'Import' Tooltip: 'Import a Brawl model file (.mdl0)' """ __author__= ['Tcll'] __url__ = ("") __version__= '0.015' __bpydoc__= '''\ mdl0 Importer ''' # ***** BEGIN GPL LICENSE … | |
Good day everyone, i need to display image from the database but the code returns error page when i tried to print image from the database using [CODE] print fout [/CODE] below is the entire codes [CODE] #! /data/python import MySQLdb import sys print ("Content-type: image/jpeg"); print # End of … | |
Hi, Basically I want to put my responses for each of the outputs of my loop (answers yes or no to different contrast numbers) into an empty list ... so I would have a list for each contrast corresponding to how many yes or no's there were? [CODE]from observerClass import … | |
I need to write a recursive Python function that takes a numeric list as its argument, finds and returns the minimum of its elements. I am not allowed to use min() function of Python. I'll be very grateful if someone can help me. | |
Hello Having trouble reading in some 8-bit data (not text) from serial port using pyserial module. Am storing the data in a string buffer as it comes in, that's working fine. Problem is that I'm printing the buffer out to the terminal screen, after a wee bit of data (30~200 … | |
So, I have a two part question for you... I'm going to be writing several lines of code to a .txt file, but I won't know what each line is, or how many there will be. There could easily be hundreds of lines. I need to add a prefix to … | |
Hi Guys , this questioned has been asked before , but the answers haven helped me . I want to seperate lines when i am appending the text control. But "\n" is simply not working . I am using Python 2.7 , on Windows 7. Please help. I want to … | |
Python does not have a type like struct in C or record in Pascal, but it can be easily implemented with a class. This little code snippet shows you how to do it. | |
I have to create a simulation to repeatedly play the Monty Hall game. I've created a class. This is what I have so far. I have created the buttons, activated them, deactivated the stay and quit buttons. I have a button class that is used to activate and deactivate buttons … | |
I couldn't find a meaningful code sample for the wxPython slider (wx.Slider), so I concocted this one and added a few explanations. It explores two different sliders, one is horizontal, the other vertical. The slider events are then fed to a function that retrieves the position values and displays them … | |
I need to read a file that contains this: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 … | |
So after a lot of work I got functions to compare one word with another one. Now my problem is formatting the output. I have one function that locates letters int he wrong position, one that finds matching letters and one to compare the results in order to format the … | |
I am working on a program that uses a recursive function to print the digits of a number in English (i.e. 456 would display "Four Five Six".) Right now I am beyond confused and I don't have much code to show for the hour and a half of work I've … | |
Hi, I have created a checkbutton within a dialog box. But, I am not able to capture the value of the checkbutton. The value always seems to be 0 whether checked or not. [CODE] class MyDialog: def __init__(self,parent): self.Frame1= Tix.Frame(parent) self.Frame1.pack(side=Tix.LEFT, fill=Tix.BOTH) self.enabled = Tix.IntVar() self.checkbutton = Tix.Checkbutton(self.Frame1,text = "Enable … | |
I am trying to let the user search an external file for 2 things after they tell me one of the things.. There are 3 different products and prices in the txt file in the form of: apple 1.99 orange 9.99 coconut 1.59 however, this only shows the price of … | |
Hi, I have a file containing one column with values: 3.258 1.345 5.769 1.00 etc... I want to sort this data. I tried to use sort() directly on my raw data but I get error message saying 'str' object has no attribute 'sort'. I now it's basic, but I'm a … | |
# I wanted to change the question. I have a list something like this: list1= ['NNW 30', 'SE 15', 'SSW 60', 'NNE 70', 'N 10'] For this list, if the element in the list starts with N, i want '+' to be inserted before the integer. If the element in … | |
I'm pretty new to programming, so this may be really obvious, but I'm having trouble with it. I'm trying to learn python, so I thought I'd make a simple program in python to help me write similar lines of java code faster, (I'm going to easily have hundreds of lines … | |
Hello, I am taking a computer programming class this semester and working on a project. I am trying to read a text file into a 2D list. The text file contains ten rows and ten columns of numbers, either a 0,1,or 2. When i try to read the file it … | |
Hello friends, I'm developing a small application with PyQt4. [img]http://i41.tinypic.com/2vl1f2t.png[/img] I want to add two spacer between Print and the other icons, just like they did on Notepad, do anyone know how to do it? [img]http://i39.tinypic.com/r87cro.png[/img] | |
This should be written in Python. The program will determine all of the magic squares when given an n, display permutations that match the magic squares to the screen AND write it to a file. It will only test when n == 3!!! But code it for n of ANY … | |
Hi Guys, My final project has come and it is to make a GUI for a program that we previously wrote. So I have to use tkinter as my package for python to get this written. Now I can't find anything on tkinter and python 3.2 or any GUI "designers" … | |
I have to ask the user for a filename (that exists in the programs father file) and open that .gif file in order to play with the colors of the image... I am really new as programming and need help! I will be asking for more answers soon as well!! … | |
Hi, I have this data set consisting of some values for which I want to get the distribution for through random sampling. How would could I do that in Python. I'm new to Python and don't know where to start. Is there a python package that could do this, i.e. … |
The End.