15,190 Topics
![]() | |
What method / methods should be be used in order to get the frame to start up in a central position of the screen, and could you also provide the code please. I'm using wxPython. thanks | |
i see how this code prints s which is 'cad' but, then it somehow backtracks to print s again which is 'cat' according to the results after i execute it. can someone walk me through how this works? it would be a great help. [CODE]def eds(k,L,s): """ starting with the … | |
I'm getting "TypeError: unsupported operand type(s) for *: 'instance' and 'int'" It looks as if I am not setting a correctly and it would be great if someone could assist me with my problem. Thanks! [CODE=python] #! /usr/bin/env python from Tkinter import * import tkMessageBox tkMessageBox.showinfo("Text","Hello. Tell me any whole … | |
i dont even know where to start in this one lol ....... write a program to calculate and print the total parking charges for a customer at a long term parking lot. The charges are calculated according to the number of days parked at the lot. The parking charges for … | |
For my Intro CS class I've been asked to write two programs, described as the following. def glyph(image): """Given a grayscale image, returns the corresponding glyph.""" and def text(image, glyphs, threshold): """Given a grayscale image, a list of 26 glyphs corresponding to the 26 uppercase English letters (in order), and … | |
i have a lot of doc files to convert everyday. Any suggestion that help me to automate this conversion. Thanksssss :) | |
Hi all I have just joined the site , as i have posted on other forums and i have had no replies back. I have a file named index.py and in this i have def index() and def show(), when i access localhost/index or localhost/index.py or localhost/index.py/show or localhost/index/show it … | |
Hello! I started to create my own tiny 'framework' mainly built on the socket and the thread module. I haven't been doing too much thread programming before. My problem is that when I try server.waitForConnections(2), at the second connection, it says [code] Unhandled exception in thread started by Error in … | |
I know that this is an easy one but it is hard for me to figure out. I need to make a program that can: * Open the file and read through all of the lines in the file. (got this) * If a line starts with "Subject:", skip the … | |
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 … | |
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 … | |
[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 | |
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? | |
![]() | 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 … ![]() |
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 … | |
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 … |
The End.