15,175 Topics
| |
I wrote the code as below its extracting all tabular data by splitting. Now i want to extract the last column(Values) data by removing Text in the middle of the table. import re f_read = open('filename','r') f_write=open('filename','w') str='CEN/4' for line in f_read: m=re.search(str,line) if m: for line in f_read: # … | |
Dear friends, I need again your help for a new challenge ;) I have a number of files with 5 columns of values (comma separated). I would like to find a way to the values in the first 2 columns and compare them with the first 2 columns of the … | |
Hello, I'm currently working on a homework problem that requires me to create a dictionary from a .txt file that contains some of the worst cars ever made. The file looks something like this: 1958 MGA Twin Cam 1958 Zunndapp Janus 1961 Amphicar 1961 Corvair 1966 Peel Trident 1970 AMC … | |
Can there be a conflict between two different version of python ? I have a program that needs access to Python 2.6, I have a environment variable setup, so the program that needs access to a subfolder of the Python 2.6 installation is suppose to access via this environment variable; … | |
Quick question on stripping, I'm executing a simple program, but whenever I try and run it in Terminal, it strips all wrong. The error it puts out is below. It iterates [+]Trying: admin/admin for the first line, but wont repeat it for the rest of the lines, as well as … | |
Hi - I am working through learn python the hard way and I am trying to practice using nosetests command with the "game" I created. The problem when I run nosetests it works fine until it is time to test a class that has raw_input in it, then it just … | |
Hi Guys, I am trying to modify an xml string on the fly. I will enter a sample XML string and the code should generate modified xml.I have exploied it later. xml = xml = '''<FixedPage xmlns="http://schemas.microsoft.com/xps/2005/06" xmlns:x="http://schemas.microsoft.com/xps/2005/06/resourcedictionary-key" xml:lang="en-us" Width="793.92" Height="1122.24"><FixedPage.Resources><ResourceDictionary><LinearGradientBrush x:Key="b0" StartPoint="0,0" EndPoint="0,1122.24" ColorInterpolationMode="SRgbLinearInterpolation" MappingMode="Absolute" SpreadMethod="Pad"><LinearGradientBrush.GradientStops><GradientStop Color="#FFFFFFFF" Offset="0" /><GradientStop … | |
Did anyone have an idea about block a connection to a specific website.I want to choose www.examle.com page to block and the program to block me to get in this site?I thougth first to detect in what website i visit and i don't have any idea how to make ot … | |
I have a project due for my programming class on Friday and im hopelessly stuck on this problem if anyone could help me please, it would be great >The question is: Write a function that takes 4 arguments (integer, integer, picture, string). This function should be able to be used … | |
Using Ubuntu 12.10 have been using python 2.7 and python 3.2 successfully. 2.7 is my default interpreter. Now, after installing python 3.3 it looks like the python3.3 version of "/usr/include/python3.3" was not installed (as it is for "usr/include/python3.2" . I have already done "sudo apt-get install python-dev" . I discovered … | |
I'm looking for fellow programmers that write in python, and maybe have skills in HTML/CSS to bounce some ideas off of, and generally just form a little python programming group. Let me know! :D | |
So, I have a quick question about a small password cracking program that I wrote. The syntax seems to be fine, but when run at the command terminal (I'm on a mac), the program doesn't really DO anything. I'll click "run in terminal" or I'll already have the terminal window … | |
I am new to python and will like to solve ordinary differential equation in Python. How do I differentitae the following equation(1st order and 2nd order). I wish to differentiate C wrt Q C = (Q**3)-15*(Q**2)+(93*Q)+100 | |
Hi I wonder if somthing wrong with this script? I get this resuly in my linux ./accessdll.py : No such file or directory #!/usr/bin/env python from subprocess import Popen, PIPE from re import split from sys import stdout class Proc(object): ''' Data structure for a processes . The class properties … | |
Hi i have linux mint os i have instaled python..and also wxpython and now i cannot run my application fron anywhere how i can add a path that i can run my python scripts from anywhere in my pc.. | |
Hi, I've just started out with Python and I've been stuck on this problem for a few hours now trying to parse a file into a certain format.. I am trying to create a list in a list out of a list. I currently have this list; ['MPNRRRCKLSTAISTVATLAIASPCAYFLVYEPTASAKPAAKHYEFKQAASIADLPGEVLDAISQGLSQFGINL', 'MQLVDRVRGAVTGMSRRLVVGAVGAALVSGLVGAVGGTATAGAFSRPGLPVEYLQVPSPSMGRSELPGWLQA', 'etc'] … | |
I am using Python 2.6 with ide and i created a list with names `names = 'mark', 'raymond', 'rachel', 'matthew', 'roger', 'judith', 'charlie', 'melissa', 'betty']` and then set `names = nmls` so even if I update names, nmls gets updated... however if I do `names = deque(['raymond', 'rachel', 'matthew', 'roger', … | |
I'm stuck writing some code for an intro programming class. I'm pretty sure the mistake is probably that I mixed integers with strings trying to get a result, but I'm just not sure which code I need to replace after messing with it all day and getting many different traceback … | |
I am currently trying to pull high,low, and closing stock data from Yahoo finance, and graph it using Turtle. I was able to pull the data from the url into a list but I can't figure out how to graph it. I know the dates have to be the x-axis, … | |
import logging ... log1 = logging.getLogger() How can I find out what is the file name + path used for logging?. Like to find that out from anywhere the logging is accomplished. also, for plotting, plot.xticks(), I like to create a range to force beginning tick, the ending tick and … | |
Hi I was doing an exercise in the Real Python book. It gave a task of simulating a coin toss "I keep flipping a fair coin until I've seen it land on both heads and tails at least once each – in other words, after I flip the coin the … | |
Hi, My project requires me to read in multiple ascii files and process them. So I am going to go through the data and using conditional statements store the result in lists. After this, I need to store this data and plot some of it using matlab and display the … | |
in the code from mox example on their page [[http://code.google.com/p/pymox/wiki/MoxDocumentation](http://code.google.com/p/pymox/wiki/MoxDocumentation)] where does PersonDao comes from ? import unittest import mox class DaoUnitTest(unittest.TestCase): def setUp(self): # Create an instance of Mox self.person_mocker = mox.Mox() def testUsingMox(self): # Create a mock PersonDao dao = self.person_mocker.CreateMock(PersonDao) # Return a value when this method … | |
HI i m new in linux and i have on my pc linux mint,now i just installed python 3 in my linux.. how i can use the gui to write some scripts i m learning python..and in the tuto he shows the gui in windows very easy to write how … | |
hi , I have found vegaseats codes and tutorials helpful for biginners , how can I collect them in the pdf format? | |
Hi again all, I have been tussling with this program all day. I can't seem to get pickle.dumps (or f.write..tried that earlier) to save without saving over itself. If I do a deposit(option 1) and then a withdraw(option 2), and then history(option 3), it only shows the last option ran … | |
Hi I would like to write the script that produces at least 6 encrypted password using crypt module and save them in a file called password.txt but I get error? and How can I add more than 6 encrypted password ? import crypt import random, string password = input("Please ender … | |
I wrote this function earlier to set the priority if the items in listwidget, however what I think would be more pythonic is to write get and set priority method... how should i proceed with writing the method in a pythonic way ? def changePriority(self,direction): """ Reorder the items in … | |
I'm trying to extract some metadata from a m4v file. I'm looking for the duration, height, width, etc. I do all my programming on a Raspberry Pi and was looking at gexiv2 but could not get it going. I got exiftool working though. My script looks like this: import exiftool … | |
I am trying to make a simple cryptography program using a simple subsitution method. If any one could help that would be nice. I need to be able to encode it as well as decode it. but im just a little confused on how to go about doing that. here … |
The End.