473,554 Members | 2,971 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.
5
15,190
thread by: Christoph | last post Jul 18 '05 by: Bengt Richter
Hi, I have a script I pass (from Zope) an image file to, to do some PIL image stuff with it. I want a StringIO instance representing the altered image file to be returned. What is the method to get the image data (header and pixel data)? I tried Image.tostring(), but that only returns the pixle data. But to be able to use the returned data...
7
15,189
thread by: Henrik Berg Nielsen | last post Jul 18 '05 by: Bengt Richter
Hi group! I need to extract some text (well numbers actually) from a bunch of similarly looking .png images. After extraction the numbers will be fed to a Python script for further processing. Any good ideas on how to go about with this? I have no idea whatsoever about how to extract the numbers out of the images... Thanks in advance,
6
15,173
thread by: Mr.SpOOn | last post Nov 4 '08 by: Lawrence D'Oliveiro
Hi, I'd like to use regular expressions to parse a string and accept only valid strings. What I mean is the possibility to check if the whole string matches the regex. So if I have: I can match this: 'aaaaaabbb'
11
15,168
thread by: redefined.horizons | last post Feb 4 '07 by: rzed
I'm still pretty new to Python. I'm writing a function that accepts thre integers as arguments. I need to divide the first integer by te second integer, and get a float as a result. I don't want the caller of the function to have to pass floats instead of integers. How do I convert the arguments passed to the function into floats before I do...
6
15,166
thread by: William Manley | last post Apr 4 '07 by: William Manley
According to what I read in the ConfigParser module, this should work, but it doesn't. Can anyone point out what I'm doing wrong? def writeinifile ( self, FILE='P:/INI/test.ini', SECTION='Testsection', OPTION='Item', VALUE='wheeee' ): p = ConfigParser() p.read(FILE) if not p.has_section ( SECTION ): ...
6
15,161
thread by: Tung Wai Yip | last post Jul 18 '05 by: Tung Wai Yip
Can I add empty directory using zipfile? When I try to add a directory it complains that it is not a file. tung
5
15,157
thread by: KB | last post Jul 31 '05 by: Steven D'Aprano
Hi, This may be a rudimentary question: How to convert a string like '777' to an octal integer like 0777, so that it can be used in os.chmod('myfile',0777)? I know the leading zero is important in os.chmod. KB
3
15,133
thread by: justinrob | last post Jan 27 '08 by: bruno.desthuilliers
Can someone tell me the minimum requitements for Python as I can't find it anwhere on the site. I have 3 PC's which are only 256mb RAM, wanted to know if this was sufficenent. Thanks
2
15,132
thread by: Twist Around | last post Jul 18 '05 by: George Kinney
We have to use a zebra printer to print some specialty labels. I was wondering if anyone had used python to output text to these. I know they use the Zebra Printing Language and before we got into that i was wondering if there was already a module that did this. Any info would be greatly appreciated. Thank You Christopher
13
15,093
thread by: Sateesh | last post Jul 19 '05 by: Dan Poirier
Hi, Is it possible to access Lotus notes using Python? Can anyone provide me some pointers? Thanks Sateesh
6
15,090
thread by: aruni | last post Nov 13 '18 by: rodnaz
Hi I am aruni.I have just started to use the python.I tried to import os in my program.but it is giving me an error as "no Module named OS".I thought it as similar to sys.Can anyone tell me an sugesstion.How to use the os in my python program.
8
15,081
thread by: Terry Gray | last post Jul 18 '05 by: baiste
Using Python 2.2 in Debian linuxI am trying to change to a different directory, execute a 'make all' command, and redirect the output of the subshell to a PyQt window... I should be able to execute the os.system('cd newdirectory; make all'), but how do I redirect stdout of the new subshell created by the os.system call? Any help would be...
4
15,079
thread by: sfo | last post Jul 11 '06 by: sfo
how do i create a hash of hash similar to perl using dict in python $x{$y}{z}=$z thanks. --RR
1
15,076
thread by: Ken Favrow | last post Jul 18 '05 by: Ken Favrow
Is there a way I can control the mouse with python? I need to be able to navigate and click in other applications based on vectors sent from my program. Basically a mouse macro type thing. any help?
4
15,069
thread by: fang | last post Jul 24 '08 by: fang
Dear all: The mouse cannot be responded in the windows of python(command line) and cut and paste cannot be done. ctrl c and ctrl v do not work. But they do work in IDLE. please teach me about the python(command line).
2
15,051
thread by: Benjamin Rutt | last post Dec 20 '05 by: Peter Hansen
I often execute a long-running python script which is a "driver" for my application; it may run for several hours on a large input. Under CPython, is it safe for me to modify the Python script and run it under some smaller inputs for test purposes, while the long-running script is still running? It seems safe to do so, but I want to be...
6
15,045
thread by: Prashanth Ellina | last post Jul 19 '05 by: Peter Hansen
Hi, I have used the low-level thread module to write a multi-threaded app. tid = thread.start_new_thread(process, ()) tid is an integer thread ident. the thread takes around 10 seconds to finish processing. Meanwhile the main thread finished execution and exits. This causes an error because the child thread tries to access something in...
1
15,041
thread by: Rich | last post Jun 27 '08 by: Nick Craig-Wood
Hello, I am working on a python library for sending and receiving data from a Subaru's ECU (the fuel injection computer) via the OBD-II port and an OBD to USB cable, with the Subaru Select Monitor protocol. There are a few open source programs that do this already (http://romraider.com/ , http://jdash.sourceforge.net/ ,...
6
15,020
thread by: Alan Isaac | last post Jan 28 '07 by: Gabriel Genellina
I'm fairly new to Python and I've lately been running a script at the interpreter while working on it. Sometimes I only want to run the first quarter or half etc. What is the "good" way to do this? Possible ugly hacks include: - stick an undefined name at the desired stop point - comment out the last half I do not like these and...
3
15,015
thread by: stdazi | last post Sep 23 '06 by: bearophileHUGS
Hello! I'm relatively new to python but I already noticed that many lines of python code can be simplified to a oneliner by some clever coder. As the topics says, I'm trying to split lines like this : 'foo bar- blah/hm.lala' - 'foo////bbbar.. xyz' -
4
15,011
thread by: AjayGohil | last post Mar 22 '23 by: Vanisha
what does private cloud mean?
10
15,006
thread by: Debajit Adhikary | last post Oct 18 '07 by: J. Clifford Dyer
I have two lists: a = b = What I'd like to do is append all of the elements of b at the end of a, so that a looks like: a =
13
15,006
thread by: jinsue | last post Jul 15 '10 by: bvdet
Hi all, For the life of me I cannot work out why this is occuring but whenever I try to .destroy() this widget (or its parent) my program hangs - it doesn't crash, it just stops responding so I have to force kill it. Python 2.6.5, Windows 7 def generate_list(self): """ Clears off current list and runs...
4
15,004
thread by: samic | last post Jan 2 '10 by: samic
Hello I have just started learning Python and I have so many problem in solving my exercise. I know the answer I have written is not correct. Can any body help me? the question is: The body mass index (BMI) is calculated as a person’s weight (in pounds) times 720, divided by the square of the person’s height (in inches). A BMI in the range...
4
14,999
thread by: cosmid | last post Apr 13 '12 by: planruk
Hi, I am new to Python. Just started learning it. I am just trying to follow the book and run the example given in the book. I created a module by saving 2 python statements in notepad and saved the file in .py format just like the book said. the two statements are: print 2**8 print 'test' I saved the file as test.py. The book's 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.