15,190 Topics
![]() | |
Hi, I am having trouble installing python 2.5/2.6 correctly on my linux box. I am trying to install in my home directory as I do not have root access. The poor python documentation in this regard makes it impossible to get this right. I want to install python in $HOME/local/lib … | |
Starting on basic functions for python, and this is a assignment that I have to do... but I keep getting a Error.. but I tried, and still don't understand what is wrong. here is what it's suppose to output:[url]http://i39.tinypic.com/r1mv69.jpg[/url] This is what I've done: [code=syntax]def function1(french): print "Bonjour, comment allez-vous … | |
Is possible play waw, wma, mp3 with wxPython without oppening any window? Program will be based on Tk, only playing sounds on wx. | |
I would like to be able to display or print a count of the number of names that were inputted and display this when the user gets out of the loop by pressing any key other than "y". For example: Number of patients processed : 4 How could I create … | |
How do I put in default values in my def textbox code attached - | |
Hello everyone,i really need help with this big problem(to me its big).The project am writing requires a panel to display its current status information on.I figured that i will need to make that panel scrollable because it will contain multiple lines of the text.My problem is i do not know … | |
Is there an easy way of doing this? for example my list is: [code=python] nlat=10 mylist = [] for x in range(0,nlat): for y in range(0,nlat): disk=sphere(pos=(x*s,y*s), radius = r, color=(0,1,9)) mylist.append(disk) [/code] or is it impossible to place objects, such as a sphere from vpython into a numpy array?, … | |
Hello all, I have a very rookie question to ask. I am using Pyraf, Python, Sextractor, & a sextractor wrapper to do some automatic photometry on celestial images. The following code I have written is used to extract info from a sextractor catalog such as image positions, image magnitudes, etc: … | |
Hello, I was assigned the task of coding this program in python for homework and I recently ran into a problem. Basically the assignment asks that a program prompt the user for a series of numbers and will then output the smallest number, the largest (their respective locations) and finally … | |
![]() | i have this code: [ICODE]import webbrowser, random import os import os.path running = 1 DIR="C:/Documents and Settings/Owner/My Documents/georges poopy/main music/" music = filter(lambda x: x.lower().endswith("mp3"),os.listdir(DIR)) music = list(music) choice = int(raw_input("Press 1 to play a new song")) while running == 1: if choice == 1: song = random.choice(music) webbrowser.open(os.path.join(DIR,song)) choice … |
Hi, I'm in first year computer science and could use some help on a program where I have to calculate the standard deviation from data on a txt file. Using some online help I've gotten somewhere but to be honest don't really know what's going on myself. The program is … | |
We have a Visual Basic script that communicates with an application through com. We like to translate it to Python and use win32com.client instead. We have everything working, except for the use of "Nothing" in the VB script for a couple of its function calls. What is the replacement of … | |
I am looking for a good example of the tarfile module, writing to and reading from an archive. Particularly the highly compressed filename.tar.bz2 format. | |
So this should be a really easy one, but i've spent a few hours searching and can't find anything that explicitly states how to do this. All i want to do is see the column names for a particular table. I created the tables like: [CODE=python] con = sqlite3.connect( ":memory:" … | |
Python 2.6.1: How would I write a user input validation statement scores < 0 or scores > 100 print error message and ask for input again? Where would I place it, in the below code? [CODE] num_test = raw_input("How many test would you like to average? ") scores = [] … | |
Hi, I m trying to open a file in read mode , my program is below ... #!/usr/bin/python print "------" file = open("C:\Lakhan\Pytonpro\file.txt", "r") print file file.close() but it shows following error ------ Traceback (innermost last): File "C:\Program Files\Python\Pythonwin\pywin\framework\scriptutils.py", line 165, in RunScript exec f in __main__.__dict__ File "C:\Documents and … | |
Hey all, I'm curious to know if there's a tkFileDialog that allows a person to browse for a folder, and in the pop-up "Browse for Folder" window, also have the option to "Make a new folder". I need to have this functionality, but when I use askdirectory() there is only … ![]() | |
I am new to Python, I have been asked to write a script to display the time difference. I get these times using shell scripts and are stored in some variables H1 and H2. I was wondering if i could use datetime.datetime in Python to calculate the difference the below … | |
When I run my program, I get the word None as output for a line. I don't have a print statement that contains that word. When I debug no errors found. Any ideas what it can be? | |
Hi, I have a nested dictionary like the following how do I loop through such dictionary ,Basically I am looking to get the value of key "name" from the following dictionary Any help is appreciated, [{'resource': ['{"metadata": {"type": "directory", "size": "8"}, "name": "default", "links": {"link": ["{\\"href\\": \\"https://my.server.comdefault\\", \\"rel\\": \\"self\\"}", "{\\"href\\": … | |
![]() | Hello everybody, I am after a little help using python to read in data from a binary file. This is what i got so far: [CODE] import struct infile = "friday.bin" FH = open(infile, 'rb') line = FH.read(32) data= struct.unpack("<H", line[0:2]) print data [/CODE] Which produces an output: 38288 I … |
I would really appreciate a help to this problem: Let's say x = Class() x.name = 'the_name' x.value = 10 if you were only give the 'the_name' how do you get the instance ref, x to get x.value | |
hi, i am trying to develop a database application. i am using python as front end and mysql as back end. But now i am getting some problem as "INTERNAL SERVER ERROR" while i am running my application on MAC OS x. #!/usr/bin/python import os import cgi from cgi import … | |
hi i need help figuring out how to get my program to calculate standard deviation. this is what i've done so far: [QUOTE]import math import sys lines = sys.stdin.readlines() sample_number = 0 time_seconds = 0 time_list = [] for line in lines: time = line.split('\t') f2 = time[1].strip('\n') if time[0]!= … | |
Can you tell me where this unassigned global is...I looked everywhere but cannot find it. [code=python] global gold gold = 0 global a_gold_a a_gold_a = 15 global a_gold_b a_gold_b = 15 global a_gold_c a_gold_c = 20 global room1_done room1_done = 0 def prompt_main(): global a_gold_a, a_gold_b, a_gold_c, room1_done x = … | |
I want to read a file and convert the columns to rows. A 1 2 3 4 5 6 7 8 9 10 B 11 12 13 14 15 16 17 18 19 20 C 21 22 23 24 25 26 27 28 29 30 want them to be like … | |
Hello everybody, I’m experimenting with PyQt, trying to learn it, and I’m a bit stuck with Signals and Slots. I don’t usually like just to repeat the examples you find in tutorials and guides because I think it’s more useful for learning to experiment concepts by yourself. Tutorials usually teach … | |
Hi, I'm doing python studies to write test automation scripts. As a part of that I want a script which should identify the NAT type of my network.. Please help me out in this regard... Thx. | |
I'm not really sure if this is the right place or not for my questions, since i'm a complete noob when it comes to python and all. But its a real simple question, and help would be appreciated. I've been reading "Python for Software Design: How to Think Like a … | |
Hi all! I have made my GUI in Glade 3 with a couple of windows. When I click a button a window should show: [CODE]my_window.show()[/CODE] That works fine. If I close my window with: [CODE]my_window.hide()[/CODE] The next time I show the window it works fine, but if I close my … |
The End.