15,175 Topics
| |
I have a task that sounds simple enough... but I don't code in Python; my background is in network design. So, here we go, I have to write a script that scans text files on a network share to parse for anything in the the text log that begins with … | |
Hi, I've been asked to write a program using Python to count the number of words in a sentance. The exact task is outlined below: Write a Python Program to count: (i) the number of lines (ii) the number of word (iii) the number of character in a text file … | |
I'm using a modulu on a variable that has a hex numeric value, apparently I;m doing something wong: [CODE] import sys import fileinput if len(sys.argv) != 2: print 'Usage: ', sys.argv[0], 'val' sys.exit(1) offset = sys.argv[1] print 'offset=',offset mod = offset%4096 if mod != 0: print "unaligned: ",offset [/CODE] since … | |
Hello, Do you know what is the regular expression for characters that are enclosed in quotes? E.g "python" "12345" Thanks | |
[url]http://ironpython.codeplex.com/releases/view/12482[/url] I'M running Ubuntu 9.10. On the website above, what which download should I use? I don't see a debian so I'M assuming I need to get the bin. If that's the case, I have no idea how to install a bin. Thanks for any and all replies. Wait, it's … | |
Ok first of all I'd like you guys to know this is like my first thread ever so go easy on me if I'm not doing something right :P Right then , so I've been programming in python for some time now and I love pretty much everything about this … | |
Hello there, i created a webservice in php using SOAP. Now i need to invoke that in my python. Here is my php code soapserver.php [CODE] <?php function getSessionData($sid) { mysql_connect('localhost','root',''); mysql_select_db('database'); $query = "SELECT Uname FROM tablename"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); return $row['Uname']; } require('nusoap.php'); $server = … | |
hi, my problem I can't solve: each of my two lists consists of an ID and runID. The output I need are those elements who are not in list2 and the max Value of runID of each ID. e.g. list1 = [('1101', '2'), ('1101', '3'), ('1101', '4'), ('4472', '2'), ('4472', … | |
Hi all, Is there a way to get system memory consumption and CPU consumption in a platform independent way, using python...? Basically my requirement is, get the memory status and CPU status of a particular process. If there is a way to get memory info and CPU info by just … | |
Hi! I would like to make an ordinary dictionary from english to norwegian, but I have a problem. I am using this sentence as an example: "I read the book" The problem isn't the first two words, but the last ones. :-/ The program should replace "the book" to "boka". … | |
how to create a submenu in python? how to use [I]insert_cascade(index,**options)[/I].......... please help me out. | |
HELLO! I am working with wxPython libraries .... I used the library 'Notebook' to create 3 tabs .... How do I put in one of these tabs a toolbar? how can I do?? Help! thanks! | |
Hi folks - I think I'm almost there... I have files with data in this format: ID1 ID2 Dist 1 a 50 2 b 20 3 c 10 2 c 100 4 c 80 4 a 70 1 a 90 2 a 34 3 b 5 2 b 6 1 … | |
I am trying to put a terminal into my tk gui program as a widget. I figured out how to have the output of a command sent to a text widget: [CODE] root = Tkinter.Tk() tfield = Tkinter.Text(root) tfield.pack() for line in os.popen("run_command", 'r'): tfield.insert("end", line) root.mainloop() [/CODE] But how … | |
I have a python assignment that has to do with character occurrence. I have to extract all the characters (letters to be precise) in a poem and count how many of each letters there are. For an example: Bobby goes to school blahhhh blahhh blahhh To: B---6 o---5 y---1 ...etc … | |
Hi, Wonder if anyone here can help with this: I'm trying to split each line of data from a text file into a list or tuple. The lines contain a mixture of ints, floats, and strings (with spaces). I can do it easily enough using split() twice - once by … | |
Hi, I have written a python script that acts as a wrapper around an executable. Here is the code: [CODE] import os import sys import string import csv usage = "usage: Specify the directories for files and the RDOCK cut-off value" if len(sys.argv) < 4: print usage sys.exit() else: first_folder … | |
Hi, we started doing programing at uni and i got interested so am learning some python at home. just started on generators and thought i'd write a function to generate prime numbers, as you do: [CODE] def primes(p=2): while True: for n in range(2,p): if p % n == 0: … | |
hello! I am working with the libraries WX-Python ... I wonder if you can create a button that can be selected and then dragged into a panel?? Can someone help me make this thing or give me some suggestions to do it?? Help! thanks! | |
Hey Guys I've got a Python function that is slowing the efficiency of my program down and was wondering if anyone could give me some pointers on how I could make this function more efficient ? The function is used for converting a integer to a base 16 number. [CODE]def … | |
Evaluation of formula G =((p→q) ^p)→q and the output display the result of true false' conclusion if it is a valid, invalid or inconsistent.. thank you for any response its a big help to my study her's my unfinished code [code] import sys p=(True,True,False,False) q=(True,False,True,False) def p_AND_q(p,q): print p,"\t", q, … | |
Hi, so in essence I have two little scripts: a server side script and a client side script. My client script sends a request to the server, and the server sends a string to the client. Once I get the string back into the client, I set it to the … | |
Does anybody have an example of how to split or double down in a blackjack program? | |
Hi I am new at python, so say I have a text folder with many number records in a single column how would I go about extracting only numbers that begin with zero and is either 10 or 7 digits long creating a new txt file for the 7 digit … | |
Hi, i'm running a server in my basement. ubuntu running xampp. And i was wondering if anyone can point me to some good uses of python to use on my server. i'm a bit low on inspiration. I know there's Django and also mod_python. But it doesn't have to be … | |
I have function in my program calls a class which opens a new window [CODE]class TopLevel3: def __init__(self): self.root2 = Toplevel() self.canvas3 = Canvas(self.root2, width=400, height=200) self.canvas3.pack() self.root2.title("ImageDB") r = 0 for c in range(6): Label(relief=RIDGE, width=55).grid(row=r, column=0) Entry(relief=SUNKEN, width=20).grid(row=r, column=1) Button(text='View Image').grid(row=r, column=2) Button(text='Update Tag').grid(row=r, column=3) r = r+1 … | |
I wish to create a program that informs the user whether a given date is a holiday or not - Here is how it should work: The student should be prompted to enter an integer for the month and then prompted to enter an integer for the day. (For example, … | |
Hi, Is it possible to include php file in python? in my application already header and left menu and footer are existing in php. i want to include those files in my new python script. Plz tell me how to do this? Thanks in advance -Shyami | |
I'm having trouble combining tkinter windows/functions, i have simplified my problem down to this which i think seems to be the problem. Both these functions will work on their own, but not together. (at least the way i want them to!) What I am after is to be able to … | |
Hello, I would like to execute a double for-loop in python. I use the python interface with ArcGIS (hence the gp. prefixes and weird functions). Here is my double-for loop attempt but I can't execute the code due to 'invalid syntax.' If I remove the bottom loop, the code runs … |
The End.