15,181 Topics

Member Avatar for
Member Avatar for hinz10

Hi I have a file, let's call it file.xml which contains information on the 1st and 3rd line (xml header and footer). What I would like to do is always write to the 2nd line so that the header and footer remain in the correct place. This is a gps …

Member Avatar for Gribouillis
0
94
Member Avatar for cnuzzo

I am using python 2.6 and am new to using Tkinter. I am trying to create a basic template GUI for a Toplevel Frame with multiple frames inside of it. I ran into an issue where I am not able to clear my frames properly. I think I have an …

Member Avatar for cnuzzo
0
1K
Member Avatar for Lolalola

[code=syntax] <div tal:define="number python: 1"> <tal:block repeat="item s_items"> <div tal:define="number python: number + 1"> <div tal:content="python: number">none</div> </div> </tal:block> </div> [/code] Hi, always show 2. but I would like to show 2 3 4 5 ... How to do? Thanks

Member Avatar for Lolalola
0
137
Member Avatar for madhaka

Vpython claims you can add and substract objects. All good and proper. Using 'frame', you can group or add objects together. Yes, but how do you subtract one object from another? How do you place a slot in a slab, or a round dent in a box?

0
40
Member Avatar for herrschteiner

Good day, I am attempting to write a Python script that has a given hexadecimal value, and a given list of strings. The script randomly samples the list and pulls out 3, 4-string lists. The strings are joined, converted to integers, converted to hexadecimal values, added together and the sum …

Member Avatar for herrschteiner
0
220
Member Avatar for MichelleCrews

ok ... first i had to make a function that tells you if the number you choose is a magic number or not ....(perfect number) ... i figured that out now i have to make a function that prints the magic number ... The second function, called print_magic, has a …

Member Avatar for MichelleCrews
-1
502
Member Avatar for elt6801

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 …

Member Avatar for elt6801
0
163
Member Avatar for morgan505

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 …

Member Avatar for vegaseat
0
115
Member Avatar for dbbd

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 …

Member Avatar for dbbd
0
253
Member Avatar for tziny

Hello, Do you know what is the regular expression for characters that are enclosed in quotes? E.g "python" "12345" Thanks

Member Avatar for The_Kernel
0
103
Member Avatar for lewashby

[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 …

Member Avatar for JasonHippy
0
106
Member Avatar for spiricn

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 …

Member Avatar for spiricn
0
172
Member Avatar for shyami

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 = …

0
56
Member Avatar for sammakko

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', …

Member Avatar for sammakko
0
86
Member Avatar for rpjanaka

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 …

0
56
Member Avatar for heValbo

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". …

Member Avatar for Gribouillis
0
117
Member Avatar for katharnakh

how to create a submenu in python? how to use [I]insert_cascade(index,**options)[/I].......... please help me out.

Member Avatar for skydiverman05
0
4K
Member Avatar for 1988asso

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!

Member Avatar for vegaseat
0
115
Member Avatar for Stubaan

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 …

Member Avatar for Stubaan
0
180
Member Avatar for txwooley

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 …

Member Avatar for txwooley
0
11K
Member Avatar for Tops

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 …

Member Avatar for bvdet
0
104
Member Avatar for gridder

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 …

Member Avatar for gridder
0
121
Member Avatar for chavanak

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 …

0
66
Member Avatar for iloveannaw

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: …

Member Avatar for Gribouillis
0
65
Member Avatar for 1988asso

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!

Member Avatar for 1988asso
0
29
Member Avatar for edy_sze

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 …

Member Avatar for edy_sze
0
135
Member Avatar for firstimer04

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, …

0
42
Member Avatar for SoulMazer

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 …

Member Avatar for SoulMazer
0
2K
Member Avatar for kfancy

Does anybody have an example of how to split or double down in a blackjack program?

0
47
Member Avatar for germ

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 …

Member Avatar for vegaseat
0
153

The End.