473,554 Members | 3,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Forum

Python programming language - Ask questions about python interpreter, control flow, data structures, modules errors, classes, standard library, gui, databases, unit testing, object oriented, structured programming and more.
13
17,818
thread by: dan roberts | last post Jul 18 '05 by: wes weston
Folks, This is my first Python project so please bear with me. I need to download data from Yahoo Finance in CSV format. The symbols are provided in a text file, and the project details are included below. Does anyone have some sample code that I could adapt? Many thanks in advance, dan
1
17,796
thread by: flaerpen | last post Jul 17 '07 by: ilikepython
Hi, I'm trying to use the function paste() to paste a image into another image but I can't get it work! Is it the right function to use or is there any other function that's better? Here's my very simple code: from PIL import Image import ImageDraw im = Image.new("RGB", (500,500), "white") draw = ImageDraw.Draw(im)
4
17,777
thread by: Juliano Freitas | last post Jul 18 '05 by: Andrew Clover
How can i get the text between the <teste> tags?? >>> xml = """<root><teste> texto </teste></root>""" >>> from xml.dom import minidom >>> document = minidom.parseString(xml) >>> document <xml.dom.minidom.Document instance at 0x4181df0c> >>> minidom.getElementsByTagName('teste') >>> element = document.getElementsByTagName('teste')
3
17,765
thread by: Svennglenn | last post Jul 18 '05 by: Harlin Seritt
Hi I'm creating a program in Tkinter and I would need help to create a "close button" for dialog windows. One of my typical dialog windows look like this: def show_window(self): top = Toplevel()
12
17,750
thread by: Steve Bergman | last post Apr 12 '06 by: Azolex
Hi, I am trying to come up with a clean and simple way to sort a list of objects (in this case SQLObject instances) by multiple attributes. e.g. a Person object may have an age, a lastName, and a firstName. I'd like to be able to arbitrarily sort by any combination of those in any order.
15
17,723
GTXY20
thread by: GTXY20 | last post Oct 1 '07 by: bartonc
Hi, I have the following in a text file: 1,a 1,b 1,b 2,a 2,c 2,a
6
17,681
thread by: googlinggoogler | last post Nov 8 '05 by: googlinggoogler
Hiya, I've got a PIC microcontroller reading me humidity data via rs232, this is in ASCII format. I can view this data easily using hyperterminal or pyserial and convert it to its value (relative humidty with ord(input)) But what im trying to do is plot the data in real time, ideally with pylab - as it looks simple to use and simple is...
4
17,656
thread by: Fuzzyman | last post Jul 18 '05 by: Fuzzyman
In a nutshell - the question I'm asking is, how do I make a socket conenction go via a proxy server ? All our internet traffic has to go through a proxy-server at location 'dav-serv:8080' and I need to make a socket connection through it. The reason (with code example) is as follows : I am hacking "Tiny HTTP Proxy" by SUZUKI Hisao to make...
2
17,641
thread by: x-herbert | last post Jul 18 '05 by: x-herbert
Hi, I have a small test to "compile" al litle script as a WMI-Tester. The script include a wmi-wrapper and "insert" the Win32-modeles. here the code: my "WMI-Tester.py" ----- import wmi
2
17,624
thread by: anx | last post Nov 22 '05 by: jepler
I've got a grid-managed frame, containing a column of Labels, and a corresponding column of Entry widgets. I'd like to be able to display dozens, or even hundreds of rows, and use a vertical scrollbar to scroll through them in the frame. So far i can get a scrollbar to display, but it won't scroll anything. So that's definately wrong. And the...
6
17,623
thread by: Kkaa | last post Aug 5 '06 by: John Savage
I'm using the os.system command in a python script on Windows to run a batch file like this: os.system('x.exe') The third-party program x.exe outputs some text to the console that I want to prevent from being displayed. Is there a way to prevent the output of x.exe from python?
7
17,621
thread by: Bruce Dickey | last post Jul 18 '05 by: Bruce Dickey
Hi, I have some PHP scripts I'm moving from my web server to the local PC. They just do file manipulation. Anybody know of a tool for translating PHP to Python? A partial translation would be hwlpful. Also, any tips or pritfalls to look out for?
11
17,621
thread by: eddiefisher41 | last post Jun 27 '07 by: bartonc
Hey Guys. I'm looking for some info on how to read binary image data. Basicly RAW image files are strings of bits with say 2 bytes per pixel. What i need to do is read the value of each pixel in turn and store then in another variable, px1, pix2 etc. I'm running an iterative algorithm on 2 pixels at a time then moving to the next two pixels. I...
3
17,600
thread by: Michael Weir | last post Jul 18 '05 by: Francis Avila
I'm sure this is a very simple thing to do, once you know how to do it, but I am having no fun at all trying to write utf-8 strings to a unicode file. Does anyone have a couple of lines of code that - opens a file appropriately for output - writes to this file Thanks very much. Michael Weir
1
17,589
thread by: Alex | last post Feb 17 '08 by: John Machin
Can I get reference to module object of current module (from which the code is currently executed)? I know __import__('filename') should probably do that, but the call contains redundant information (filename, which needs to be updated), and it'll perform unnecessary search in loaded modules list. It shouldn't be a real problem (filename...
7
17,583
thread by: Robert Dailey | last post Jul 14 '07 by: Gabriel Genellina
Hi, Is there a way to force a specific parameter in a function to be a specific type? For example, say the first parameter in a function of mine is required to be a string. If the user passes in an integer, I want to notify them that they should pass in a string, not an integer.
3
17,535
thread by: abeesh ks | last post Dec 2 '11 by: SurekhaP
if(re.match("(^|^{0,1}{1,2})\.(|{0,1}{1,2})\.(|{0,1}{1,2})\.(|{0,1}{1,2})$",ip_addr) != None): print "Verified as passed" else: print "Verified as failed"
12
17,527
thread by: Elaine Jackson | last post Jul 18 '05 by: Dennis Lee Bieber
Is there a function that takes a number with binary numeral a1...an to the number with binary numeral b1...bn, where each bi is 1 if ai is 0, and vice versa? (For example, the function's value at 18 would be 13 .) I thought this was what the tilde operator (~) did, but when I went to try it I found out that wasn't the case. I discovered by...
6
17,527
thread by: gregpinero | last post Sep 25 '07 by: Karthik Gurusamy
Let's say I have this Python file called loop.py: import sys print 'hi' sys.stdout.flush() while 1: pass And I want to call it from another Python process and read the value 'hi'. How would I do it?
15
17,521
thread by: Thomas Dybdahl Ahle | last post Jun 7 '07 by: Thomas Dybdahl Ahle
Hi, When I do a small program like from subprocess import Popen popen = Popen() from time import sleep sleep(100) start it and kill it, the ping process lives on. Is there a way to ensure that the ping process is always killed when the python process is?
10
17,504
thread by: Jochen Hub | last post Jul 18 '05 by: Cliff Wells
Hi, I am a real beginner in Python and I was wondering if there is a way to convert a string (which contains a list) to a "real" list. I need this since I would like to give a list as an argument to my Python script from the bash: #!/usr/bin/python import sys
19
17,494
thread by: Riko Wichmann | last post Jan 6 '06 by: Xavier Morel
hi everyone, I'm googeling since some time, but can't find an answer - maybe because the answer is 'No!'. Can I call a function in python inline, so that the python byte compiler does actually call the function, but sort of inserts it where the inline call is made? Therefore avoiding the function all overhead. Thanks and cheers,
12
17,480
thread by: David Keeney | last post Jul 18 '05 by: Thorsten Kampe
I see this set (or similar) of variables in various modules I read. They are found near the top of each module file, outside of any class or function definitions. " __author__ = "Software Authors Name" __copyright__ = "Copyright (C) 2004 Author Name" __license__ = "Public Domain" __version__ = "1.0" "
303
17,477
thread by: mike420 | last post Jul 18 '05 by: Andrew Dalke
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b. Yahoo store was originally written in Lisp. c. Emacs The issues with these will probably come up, so I might as well mention them myself (which...
4
17,456
thread by: 7stud | last post Sep 21 '07 by: 7stud
Hi, What is the difference between: 1) getting the returncode directly from the subprocess object 2) calling poll() on the subprocess object? Here is an example:

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.