473,796 Members | 2,677 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.
2
5,413
thread by: Brian Alexander | last post Jul 18 '05 by: Skip Montanaro
Hello; I am trying to protect some global data, which may, in the future, be accessed by threads. I'm not sure how to implement a locking mechanism in python. Here is the idea I'm trying to express: class resourceManager(object): def __init__(self): self.__resources = 100
1
2,559
thread by: Tim | last post Jul 18 '05 by: Peter Hansen
Does anybody know how to get a return code or any errors from a python script that has been made into a exe using py2exe? Right now when I run my script.exe it always returns 0 even if the script fails.
6
3,753
thread by: python | last post Jul 18 '05 by: John Roth
Hi- I need to make a class for quartlerly dates. I need to be able to compare two quarterly dates and get the number of quarters between them. For example: >>> 2001q1 = qDate(year=2001, quarter=1) >>> 2001q4 = qDate(year=2001, quarter=4) >>> 2001q4 - 2001q1
3
10,524
thread by: Peter L. Buschman | last post Jul 18 '05 by: Peter L. Buschman
I'm trying to think in Python, but am stumped here... What is the equivalent for the following if you are dealing with a tuple of non-strings? >>> import string >>> foo = ( '1', '2', '3' ) >>> string.join( foo, '.' ) '1.2.3'
0
983
thread by: Salvatore | last post Jul 18 '05 by: Salvatore
Hi All, Does anybody get an operationnal version of Grail which turn on windows ? Regards Salvatore
3
11,526
thread by: Leeds, Mark | last post Jul 18 '05 by: David Eppstein
I did more investigation into my previous problem and what happens is that my text file has \r for representing a new line instead of a \n. is there a way to tell the readlines function that the symbol for a newline is \r rather than \n ? right now the readlines function reads the\r as another item in the list and just puts everything into...
2
1,472
thread by: JZ | last post Jul 18 '05 by: Skip Montanaro
How much memory WebKit should normally take??? As I can see, every WebKit daemon takes over 40MB (sic!) of RAM. WebKit lauches 10 daemons during startup, so I need over 400MB for WebKit alone! Is it normal or I have something wrong configured? (used RedHat7 and Webware CVS 2003-09-12) I compared the same with Windows XP Pro workstation. It...
1
2,220
thread by: HHaegele | last post Jul 18 '05 by: Kevin Cazabon
Hello, what does this exception mean. I don´t have any idea where to start searching for the mistake, can you give me some hints , please. Exception in thread Thread-1: Traceback (innermost last): File "E:\dSPACE\ControlDesk\Python\Lib\threading.py", line 376, in __bootstrap self.run() File...
17
3,069
thread by: Tobiah | last post Jul 18 '05 by: Martin Maney
Ok, I miss the idiom that my other languages use, something like: while( foo = getmore()){ process(foo); }
1
628
thread by: Leeds, Mark | last post Jul 18 '05 by: Peter Otten
python : i am a python novice and i am reading in a text file of say 500 lines with the fields in each line elimited by a "|" and there are 90 records in each line. my normal reading of text lines algorithm ( using readlines, and then strip the "|" and then append into a list) seems to be working strangely because it's reading all...
2
2,956
thread by: Harry Pehkonen | last post Jul 18 '05 by: Harry Pehkonen
While setting up some unit tests, I came to the conclusion that a Tkinter Text widget can never be empty, but will always (?) contain a \n. Here is a brief example: >>> import Tkinter >>> t = Tkinter.Text() >>> t.get(0.0, Tkinter.END) '\n' >>> t.delete(0.0, Tkinter.END) >>> t.get(0.0, Tkinter.END)
1
2,173
thread by: Marc Petitmermet | last post Jul 18 '05 by: Fredrik Lundh
The line below looks up the name "öttinger" (with the German umlaut) of an author using the mysql console: mysql> select author from records where author like '%Öttinger%'; This successfully finds all entries in the records database where "öttinger" is the author or the co-author. In a web form, the user enters "öttinger" and wants...
0
1,215
thread by: Fred Pacquier | last post Jul 18 '05 by: Fred Pacquier
Hi, For my education I'd like to take a peek at "CGI Uploader", an old script that can be found on Vaults Of Parnassus ( http://py.vaults.ca/apyllo.py? find=uploader ). Unfortunately that is hosted on Parnassus itself : http://www.vex.net/~x/python_stuff.html I can access the page itself, but no file linked there will actually
1
1,845
thread by: google account | last post Jul 18 '05 by: Lukasz Pankowski
I know that string.letters and string.digits are all the letters and numbers, is there a string.???? that is a subset of all the ascii characters that are available on a US English Keyboard without going to special characters (like ß or ¿) I couldnt see anything that was explaining this stuff on the python.org site. I think what I want...
3
2,115
thread by: srijit | last post Jul 18 '05 by: Richie Hindle
Hello, I am unable to access http://www.scintilla.org/tags2api.py? May I have a copy of the program? Regards, Srijit
7
18,407
thread by: M-a-S | last post Jul 18 '05 by: M-a-S
I'd like to parametrize a module. That is, to set and pass some values into the module, while it is being imported. I tried this: # sub_1.py -- main program extern = "OK" import sub_2 print sub_2.noway # prints 'no extern' :-( # EOF
3
1,562
thread by: jcj | last post Jul 18 '05 by: jcj
hello, is it possible to have something like : script.cgi #!/usr/local/bin/python # -*-python-*- global MY_VARIABLE MY_VARIABLE = "myvalue" import module1 module1.my_function()
0
1,350
thread by: Masiar Farahani | last post Jul 18 '05 by: Masiar Farahani
Hi, Is there a option in PythonWin to write files in unix file mode? Regards Masiar
2
4,866
thread by: Garry Hodgson | last post Jul 18 '05 by: Tim Roberts
how do i use smtplib to send mail to someone with "cc" to someone else? if i just include the "to" addressees in the call to smtplib.sendmail(), and put the others in the "Cc" header fields, only the "To" recipients get the mail, thought the mail headers look right. but if i also add the "Cc" folks to the list of recipients in the call to...
1
1,768
thread by: David Opstad | last post Jul 18 '05 by: Martin v. Löwis
Hi, all! I'm relatively new to Python, but have definitely fallen in love with it. It reminds me of Mesa (old Xerox development language) and LISP a bit. Anyway, on to the question. Now that Unicode 4.0 has been released (just got my copy today), any guesses on how long before the unicodedata module will be updated to include all the new...
14
2,284
thread by: Lupe | last post Jul 18 '05 by: HankC
I'm convinced to try Python! I've read many posts, and although I recently bought a book on C to start learning it, I'd like to give Python a good chance. What IDE would you recommend for someone who needs easiness of use with a background of Pascal and VB for MS Office? I've definitely changed to Linux now and I would like a free IDE...
4
2,297
thread by: Dan Rawson | last post Jul 18 '05 by: Jeff Epler
Is there any way to force getopt to process one option first?? I'd like to be able to pass in the name of a configuration file for my application, then have the remaining command-line parameters over-ride the configuration file if they are present. For the moment, I'm restricted to 2.2 versions. TIA . . . . Dan
4
3,502
thread by: Maxime Biais | last post Jul 18 '05 by: M-a-S
Hello, I know how to print a string without the trailing newline with a coma like : print "hello word", but this example add a white space after the string :( Do you know how to avoid this white space without using write()
2
1,477
thread by: Rob Hunter | last post Jul 18 '05 by: Terry Reedy
So I thought I had come to peace with binding in Python, but then this happened to me: I was trying to do things the Python way (as opposed to the Scheme way) as was suggested to me, and so here's a shortened version of my program: def getGenres(title): #it takes a movie title and returns a list of genres that the movie falls into ...
3
2,258
thread by: Alberto Vera | last post Jul 18 '05 by: News M Claveau /Hamster-P
Hello: Could you tell me How I can solve this problem? Regards import win32com.client ImportError: No module named win32com.clieny

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.