15,190 Topics

Member Avatar for
Member Avatar for LRNPHP

Hi There, I'm very new to Python. Is there a easy way of looping trhough a file and using the values in a grep command? [code] Value A Value B 2011-12-14 20:54:09, 797410378, 2011-12-14 20:55:52, 734451141, 2011-12-14 20:56:30, 796058907, 2011-12-14 20:59:51, 736280553, 2011-12-14 21:09:42, 729858848, 2011-12-14 21:12:02, 825895818, 2011-12-14 21:13:53, …

Member Avatar for Gribouillis
0
94
Member Avatar for welshly_2010

hey i am trying to find many attacks were logged per day per ip. i am reading from a syslog file. here a line couple lines am reading from [QUOTE]Jan 10 09:32:09 j4-be03 sshd[3876]: Failed password for root from 218.241.173.35 port 47084 ssh2 Jan 10 09:32:19 j4-be03 sshd[3879]: Failed password …

Member Avatar for Gribouillis
0
88
Member Avatar for dmv091

Hello I am new to Dani web but here it goes. I am trying to create a game that called Three button monte i am using graphics from zelle but and i will upload the proper code to go alone with mine. My problem is when it comes to checking …

Member Avatar for woooee
0
464
Member Avatar for ozzyx123

hi everyone i have made a program which extracts information from an email account, it extracts the date, the sender, number of copies written in the body, and it extracts the pdf file from the email and puts it into a directory, it also counts the number of pages in …

Member Avatar for ozzyx123
0
1K
Member Avatar for nosehat

Is there an easy way to modify the contents of a zip file inside the archive, without unpacking everything to a temp directory, making the change, then packing it all up again? I've got a whole bunch of zip files, each one with a bunch of plain text files (html, …

Member Avatar for nosehat
0
1K
Member Avatar for boiishuvo

[CODE]info = '''<table> <tr align = "center"> <h1> Lachlan Osborn </h1> <p> Address: 5 Smith Street, Manly <br> Date of Birth: 26th April 1993 </p> <a href="semester.html"><b>My Semester Units</b></a> <p><b>Check out my <a href="hobbies.html">hobbies.</a></b></p> </tr> </center>''' def remove_html(text, info): import re text = re.sub(r'<.*?>', '', info) return text remove_html(text.strip())[/CODE]

Member Avatar for snippsat
0
285
Member Avatar for boiishuvo

I want this program to read a text file then target and replace anything start with < and end with > for example it finds <html>, replace that into **** but somehow i tested it and it didn't work than i expected. any suggestions? [CODE]def remove_html(text): txtLIST = list(text) i …

Member Avatar for boiishuvo
0
446
Member Avatar for inuasha

Alright so I was not sure exactly how to say this, but here is the idea. I have a graph or table I guess you could call that looks like this. [CODE] print ''' ----------------------------- | | | |x | | | |----------------------------- ''' [/CODE] Then I want to make …

Member Avatar for Gribouillis
0
216
Member Avatar for pakiali007

Create a function that take a full name as a parameter and returns just the middle name regardless of how many words it consists of.

Member Avatar for peter_budo
0
73
Member Avatar for floatingshed

I'm running a command line app from a Python script: [CODE]os.system(myapp)[/CODE] myapp contains the path to the app and the required parameters. It works fine but it runs at, I believe, Normal priority which makes the PC sluggish. How can I start the external process at a lower priority? Thanks.

Member Avatar for floatingshed
0
156
Member Avatar for ozzyx123

hi everyone i am very close to finishing my first program in python, but there are two things in the way. first of all the code highlighted in red reads the number of pages of pdf files in a directory. my problem is that it is in a for loop …

Member Avatar for britanicus
0
194
Member Avatar for AJkiter

Ok some of you might've seen my post from yesterday about the weekend challenge game thing i'm doing with a friend. The link to my post yesterday is [url]http://www.daniweb.com/software-development/python/threads/416633/1777493#post1777493[/url] Anyway, now im trying to make a shop type thing but im having trouble writing a script (or whatever you call …

Member Avatar for TrustyTony
0
108
Member Avatar for ozzyx123

hi everyone i am currently building a program which logs into an email, extracts information like the date, sender, subject, number of copies, and takes any attachments and puts them into a directory, than takes the number of pages of the pdf. i have already built a program which does …

Member Avatar for peter_budo
0
656
Member Avatar for Stanzilus

Hello all, I am new to python and working on a school project to import an SQL query with python and have it print out results then save them to a file location. This is what I have so far and wanted to know what I am missing or if …

0
33
Member Avatar for lfmconsummates

So this program is supposed to take a letter the user wants to replace, and store that in a dictionary. At the end, it asks the user to enter a message and it's supposed to decode it, cross-referencing the dictionary and replacing any letters within it to the newly assigned …

Member Avatar for lfmconsummates
0
186
Member Avatar for crag0

I need to write a script that will check a file and find out what type of file it is. The files I am downloading none of them have extensions and some are binary others txt and html files. I only want to work with the binary files. If anyone …

Member Avatar for TrustyTony
0
177
Member Avatar for hughesadam_87

Hey guys, I've looked over several Google results for basic explanations on [CODE]is / '=='[/CODE] However, I don't think I quite understand enough to know what is the ideal operator for this. [CODE]mylist=[1,2,3] if type(mylist) == list: print 'yes'[/CODE] or do I use [CODE] if type(mylise) is list: print 'yes'[/CODE] …

Member Avatar for Gribouillis
0
163
Member Avatar for xopenex

Hi guys, still Noob here, so i apologize for not using the correct terminology. I will be as detailed and accurate as possible! I've been using QT Designer, and been trying to figure out how to "combine" the GUI ive created with the python script I wrote before making a …

Member Avatar for HiHe
0
2K
Member Avatar for chall77

Hello, I'm new to python and have a requirement to decompress various NRV2B compressed files. I have the python functions for performing this decompression, however I am unsure how to get it working. I have tried making this a module, importing it and then feeding my compressed files as a …

Member Avatar for britanicus
0
278
Member Avatar for AJkiter

Ok so me and my friend are doing a weekend challenge... Whoever makes the best game wins. Im trying to make a game like farmville but its called mineville and its just a little different. My problem is that theres this part in the code that keeps repeating, and i …

Member Avatar for AJkiter
0
1K
Member Avatar for floatingshed

When I run my python scripts I generally run with the console open just to keep an eye on things. I have a script that calls 3 external command line apps one after the other. On one pc all output from these apps appears in the console window and is …

Member Avatar for floatingshed
0
197
Member Avatar for fafa70

hi. i am trying to use two turtles in separate windows simultaneously in python but nothing found yet. i have tried multithreadding but still the same. can somebody help me please. thanks.

Member Avatar for fafa70
0
4K
Member Avatar for puddlejumper406

I have never taken a programing class before but my instuctor wants me to write a program in python i've been looking in the book and still don't even know where to start please any help would be great here's the program she wants You are helping your friend throw …

Member Avatar for puddlejumper406
0
116
Member Avatar for moroccanplaya
Member Avatar for HiHe
0
90
Member Avatar for moroccanplaya

how would you write this function in non oop [CODE] def highlight(self, seq): if "highlight" in self.textWidget.tag_names(): self.textWidget.tag_delete("highlight") i = len(seq) idx = "1.0" while True: idx = self.textWidget.search(seq, idx, nocase=1, stopindex='end') if idx: idx2 = self.textWidget.index("%s+%dc" % (idx, i)) self.textWidget.tag_add("highlight", idx, idx2) self.textWidget.tag_config("highlight", background="yellow") idx = idx2 else: return …

Member Avatar for hughesadam_87
0
119
Member Avatar for karan_kanna

Hi , i have a dump file . i want to load it into a dictionary. i am using pickle load to load it as shown below: pkl_file = open( r'D:\work\dumpfile.dat', 'rb+') FinalTable = {} FinalTable = pickle.load(pkl_file) The problem is it is loading only one key and value from …

Member Avatar for Gribouillis
0
209
Member Avatar for aj9393

I'm am trying to make just a simple text-based adventure game, inspired greatly by Zork. Basically all it is is an IF statement for many possible input so the player isn't constrained to inputting their text in a certain format. Then each section is it's own module so when the …

Member Avatar for woooee
0
363
Member Avatar for chopper25

So im stuck writing a function and was hoping someone would be nice enough to help. My objective is to look at a list of grades such as: [CODE][23 , 64 ,74 , 53 , 55[/CODE] And return a list with the number of grades in each percentage range I.E. …

Member Avatar for woooee
0
593
Member Avatar for hughesadam_87

Hey guys, In prepping for a job interview, I'm trying to eliminate some bad habits and this trivial problem has me realizing how hard that is :'(. The problem: Print a 12 x 12 multiplication table. This is easy.... [CODE]outstring='' for i in range(1,13): for j in range(1,13): outstring +='\t'+str(i*j) …

Member Avatar for hughesadam_87
0
120
Member Avatar for floatingshed

I have a list: [CODE][a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p][/CODE] I would like 4 lists: [CODE][a, e, i, m] [b, f, j, n] [c, g, k, o] [d, h, l, p][/CODE] How would I go about this? Thanks.

Member Avatar for hughesadam_87
0
154

The End.