Posts
 
Reputation
Joined
Last Seen
Ranked #460
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
95% Quality Score
Upvotes Received
26
Posts with Upvotes
23
Upvoting Members
16
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
13 Commented Posts
2 Endorsements
Ranked #621
Ranked #305
~111.74K People Reached
Favorite Forums
Favorite Tags
Member Avatar for RMartins
Member Avatar for pythonBasic
0
712
Member Avatar for gishi

hi! i want to place the contents of a dictionary into a csv file. Can someone help me with this? i already have the code in reading the csv file [CODE] import csv reader = csv.reader(open("c:\sample.dat")) for row in reader: print row [/CODE] i want the first element of the …

Member Avatar for Gribouillis
0
15K
Member Avatar for lionaneesh

[B][I][U]Introduction [/U][/I][/B] [COLOR="Red"]Hey everybody welcome to a tutorials on classes in PYTHON. The purpose I made this tutorial for is that when I was learning classes in python I dint found any good tutorials on Classes. Maybe I was wrong. But here's my tutorial.[/COLOR] [B][I][U]Layout[/U][/I][/B] In this tutorial i'll be …

Member Avatar for mail2sanjay
1
846
Member Avatar for jcmeyer

I would like to copy a row in a database and change one value. I think that this is close to what I am supposed to do. [CODE] self.cursor.execute("INSERT INTO DatabaseName (C1, C2, C3, C4, C5) SELECT (?, C2, C3, C4, C5) FROM DatabaseName WHERE C1=?", [newC1Value, copiedC1Value]) [/CODE] Although, …

Member Avatar for webstart
0
215
Member Avatar for sys73r

input.csv 1,2,text, date, qwertyuiopasdfghjklñzxcvbnm, yhnujmik,2121212121 [code] import csv reader = csv.reader(open('input.csv', 'rb'), delimiter=',',quoting=csv.QUOTE_NONNUMERIC)) csv_out = csv.writer(open('output.csv', 'w')) for row in reader: content = row[0] + row[4] + row[5] + row[11] + row[12] + row[13] + row[16] + row[17] + row[22] csv_out.writerow( content ) [/code] # I want it to save …

Member Avatar for sys73r
0
183
Member Avatar for david_wislon

Hello, I have been looking at using Beautifulsoup python module to make changes to some static html files a total of 167 files, but being a newb in programming was wondering first how to open, read/process the file, then write it, close it and then open the next file thus …

Member Avatar for paxton91
0
691
Member Avatar for flebber

I want to compare a list of files with extension .rtf in my directory with a list of files at a given url and download the files at the url not found in my directory. This is where I am at but cannot figure how to filter a list based …

Member Avatar for TrustyTony
0
316
Member Avatar for rssk

hi all i hav a list like list = ['0', '344', '1', '345', '2', '346', '3', '347', '4', '348', '5', '349', '6', '350', '7', '351', '8', '352', '9', '353', '10', '354', '11', '355', '12', '356', '13', '357', '14', '358', '15', '359', '16', '360', '17', '361', '18', '512', '19', '513', '20', …

Member Avatar for woooee
0
99
Member Avatar for blacknred

I have a share -//192.168.0.11/myshare which has many files in it. Which is the best way to delete all the files in this directory using python? I tried: [CODE]import os folder = '\\192.168.0.12\myshare1' for the_file in os.listdir(folder): file_path = os.path.join(folder, the_file) try: if os.path.isfile(file_path): os.unlink(file_path) except Exception, e: print e[/CODE] …

Member Avatar for jice
0
126
Member Avatar for ThePythonNoob

I have stated to make a program called virtual Tv, I have been having troubles with variabels and I need the variable: state to be able to be change and accessed outside the class and inside, but I think that state is a local variable at the moment. [CODE]import random …

Member Avatar for lrh9
0
206
Member Avatar for D_rOiD

I need to know how to copy some folders not all from a source tmp/folder. I'm new to python and I want to better understand python. I can't use copytree because I don't wish to copy all folders. I want to be able to pick the folders I want to …

Member Avatar for jice
0
4K
Member Avatar for tony75

Hi I have a folder and its contain 5 text files. My question is How can I navigate to folder and read two first line of the txt files in folder with python scripts? I will be very greatful for your help. Reagards Tony

Member Avatar for TrustyTony
0
267
Member Avatar for animanga

I'm attempting to create a one line Caesar cipher decryption program in python and i'm afraid i've come to the end of my knowledge and well past it. this is the closest working code i've got: [code]def test3(): print("The decrypted text is: "+"".join(map(lambda x: chr(ord(x)+y),x)))[/code] as you can see it …

Member Avatar for animanga
0
749
Member Avatar for Zaffron

Alright, so I'm trying to make a text rpg for proof of concept purposes, and I've hit a wall. My problem, which may be deeper than I hope, lies within class instance referencing. I have a chest class where it fills the chest with a random amount of items. This …

Member Avatar for woooee
0
444
Member Avatar for xxhellothere

Hello everyone, i currently trying to write a program that will locate a hyphen in a date in the format YYYY-MM-DD this is what i have so far [ICODE]date = str(raw_input("Enter a date in YYYY-MM-DD format: ")) i = 0 while i < len(date): if date[i] != "-": i = …

Member Avatar for jice
0
148
Member Avatar for dustbunny000

I have this code: [CODE]protein="GWEIQPYVWDECYRVFYEQLNEEHKKIFKGIFDCIRDNSAPNLATLVRVTTNHFTHEQAMMDAVKFSEVLPHKKMHRDFLEKLGGLSAPVDNHIKGTDFKYKGKAKNVDYCKEWLVL" pp="LLCCCCCCCCCCCCCCCCCCHHHHHHHHHHHHHHHHHCHHHHHHHHHHHHHHCCCCHHHHHHHCLLLCCCCCHHHHHHHHHHHHHHHHHHHCCCCCCCCCCCHHHHHHHHHHHHCCL" gor="cccccccccccchhhhhhhhhhhhhhhhhhhhhhhccccccccceeeeecccccchhhhhhhhhhhcccchhhhhhhhhhhhhccccccccccccccccccccccceeceeccceec" aber="CCCCCCCCCCCCHHHHHHHCCHHHCHHHHHHHHHHCCCCHHHHHHHHHHHCCCCCCHHHHHHHCCCCCCCHCCHHHHHHHHHHCCCCCCCCCCCCCCCCCCCCCCCCCHHHHHHHCC" for i in range(len(protein)): print i+1,protein[i], pp[i], gor[i], aber[i] [/CODE] I'm trying to compare these strings. However, the output is in a vertical format. How can I print it so that the format is vertical? This would make it much easier to …

Member Avatar for jice
0
217
Member Avatar for jice

Hello there, I'm trying to generate a open office text document with tables generated from a database with the lpod library. I'd like to set the width of the tables columns but i can't manage it. Here is my test code so far : [code] import lpod.document import lpod.table doc …

Member Avatar for jice
0
158
Member Avatar for jice

hi, I try to write a app to automatically re-organize my mails (thunderbird). The first thing I try is to re-create my folders tree, once for each year. So i need to read mbox files and rewrite them [CODE=python] import mailbox mbx=mailbox.mbox("./in_mbox") mbx.lock() of=open("out_mbox", "w") for k, m in mbx.iteritems(): …

Member Avatar for jice
0
182
Member Avatar for novice20

hi.... I am doing an snmpwalk on MIB variables and dumping the output to a text file. I dont need all the info and need to read only a part of it. How can this be done efficiently in python?

Member Avatar for ptmcg
0
208
Member Avatar for novice20

hi... is there any MIB parsing tool which generates an excel file or like that can be queried?

Member Avatar for jice
0
46
Member Avatar for acrocephalus

Hello! I have created a database named Ornithobase, which contains a Users table with Name, FamilyName, eMail and Username columns. I have already connected to the database with MySQLdb module. How can I print this table in the console from the Python script? Furthermore, how can I perform a search …

Member Avatar for acrocephalus
0
119
Member Avatar for lstensland

I am new to programming and have been reading a few books on Pyhton but can't seem to grasp what I believe is probably a simple process. I need someone to show me briefly a sample script that would allow me to open a CSV file and edit it line …

Member Avatar for lstensland
0
437
Member Avatar for albertkao

I want to walk a directory and ignore all the files or directories which names begin in '.' (e.g. '.svn'). Then I will process all the files. My test program walknodot.py does not do the job yet. Please help. [CODE]#!c:/Python31/python.exe -u import os path = "C:\\test\\com.comp.hw.prod.proj.war\\bin" for dirpath, dirs, files …

Member Avatar for jice
0
3K
Member Avatar for macca21

How can I tabulate the data strings I have saved in another file... the data sored is in the form of names and scores. The table should look like: Name Score 1 Score 2 Score 3 ==== ======= ======= ======= John 23 21 34 etc... I've started with this and …

Member Avatar for TrustyTony
0
187
Member Avatar for jpl1993

class tennis: def __init__ (self, name, rank, tournamentsPlayed, country, racquetBrand): self.name = name self.rank = rank self.tournamentsPlayed = tournamentsPlayed self.country = country self.racquetBrand = racquetBrand #defines each thing^ def __str__(self):#creates a string return self.name + ":" + self.rank + "\n" + self.tournamentsPlayed + "\n" + self.country + "\n" + self.racquetBrand …

Member Avatar for TrustyTony
0
126
Member Avatar for jpl1993

so i'm almost done with my project. however, i'm still getting some errors when i run. you can find my code below. if you see any problems and know how to fix them, please, please, please let me know! class tennis: def __init__ (self, name, rank, tournamentsPlayed, country, racquetBrand): self.name …

Member Avatar for woooee
0
145
Member Avatar for dbphydb

Hi, Please check the below code. [CODE] URL = "http://11.12.13.27:8080/cruisecontrol" from urllib2 import urlopen from HTMLParser import HTMLParser import re # Fetching links using HTMLParser def get_links(url): parser = MyHTMLParser() parser.feed(urlopen(url).read()) parser.close() return parser.links # Build url for Deploy page def get_deploy_url(): url = URL + "/buildresults/xxx_%s_nightly_build" % branch print …

Member Avatar for dbphydb
0
112
Member Avatar for notuserfriendly

Hello, i am currently writing an assembler for the theoretical SIC/xe machine and i decided to do it in python. Very new to python but i thought it would be fund to do it in and willing to learn. So far i know what to do and have the diea …

Member Avatar for woooee
0
495
Member Avatar for pankajpriyam

Hi, I am using Python 2.3.4 in Linux environment. I have some sql files, I execute sql files in a loop. I want to generate seprate log files for every sql files in loop. How can I do this. regards pankaj

Member Avatar for jice
0
97
Member Avatar for Dan08

Hey, I have a really big file on my computer, this file only got words in it. And because the file is really big, I sure there are repeted words in there. Is there a way of deleting every single repeated word, leaving at least one? Every single word is …

Member Avatar for TrustyTony
0
4K