struct size confusion:

2006-03-22 Thread Michael Yanowitz
Hello: I am relatively new to Python and this is my first post on this mailing list. I am confused as to why I am getting size differences in the following cases: print struct.calcsize(I) 4 print struct.calcsize(H) 2 print struct.calcsize(HI) 8 print struct.calcsize(IH) 6 Why is

RE: struct size confusion:

2006-03-22 Thread Michael Yanowitz
now. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Fredrik Lundh Sent: Wednesday, March 22, 2006 9:28 AM To: python-list@python.org Subject: Re: struct size confusion: Michael Yanowitz wrote: I am relatively new to Python and this is my first post

RE: Remove integer from float number

2006-03-23 Thread Michael Yanowitz
how about this solution: def printDecimal(number): if (number 0): print number - int(number) else: print int(number) - number -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Grant Edwards Sent: Thursday, March 23, 2006 5:11 PM

RE: Remove integer from float number

2006-03-23 Thread Michael Yanowitz
Sorry, got it backwards: def printDecimal(number): if (number = 0): print number - int(number) else: print int(number) - number -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Michael Yanowitz Sent: Thursday, March 23, 2006 5:21

RE: Remove integer from float number

2006-03-24 Thread Michael Yanowitz
Sorry about the Top Posting that I did before. It is just the style I am used to using, and I didn't realize that it was different here. I won't do it again. -- http://mail.python.org/mailman/listinfo/python-list

tuple syntax ',' (ending in comma?)

2006-04-04 Thread Michael Yanowitz
Hello: I am still relatively new to Python. I am confused by the syntax for tuples. I had: thread.start_new_thread(read_data_thread, (strDataFilename)) and got back the following error: File scene.py, line 256, in readData thread.start_new_thread(read_data_thread, (strDataFilename))

RE: The World's Most Maintainable Programming Language

2006-04-06 Thread Michael Yanowitz
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Peter Hansen Sent: Thursday, April 06, 2006 8:47 AM To: python-list@python.org Subject: Re: The World's Most Maintainable Programming Language Mirco Wahab wrote: Hi Ralf So we should rename Python into

RE: Python2CPP ?

2006-04-12 Thread Michael Yanowitz
First of all: why do you want to translate pythont to C++? Anyway, this has a C back-end: http://www.pypy.org Szabi Thanks. I want to translate from Python to C++ for a few reasons: 1) Curiosity. I would like to see how well the translation goes. 2) Efficiency. It is alot quicker to code

Checking if string inside quotes?

2007-05-09 Thread Michael Yanowitz
Hello: If I have a long string (such as a Python file). I search for a sub-string in that string and find it. Is there a way to determine if that found sub-string is inside single-quotes or double-quotes or not inside any quotes? If so how? Thanks in advance: Michael Yanowitz -- http

RE: Checking if string inside quotes?

2007-05-09 Thread Michael Yanowitz
have to check to see if the string was already in quotes and if so remove the quotes. But not sure how to do that? Or is there an easier way? Thanks in advance: Michael Yanowitz -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent

RE: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-14 Thread Michael Yanowitz
Let me guess - the next step will be to restrict the identifiers to be at most 6 characters long. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Stefan Behnel Sent: Monday, May 14, 2007 2:53 PM To: python-list@python.org Subject: Re: PEP 3131: Supporting

Tkinter - changing existing Dialog?

2006-06-01 Thread Michael Yanowitz
to do is to search for it myself. Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

RE: Tkinter - changing existing Dialog?

2006-06-02 Thread Michael Yanowitz
Thanks. That is what I was looking for. The configure command (as you and John pointed out), should do what I need. The first response of starting a new thread was not what I was looking for. Michael Yanowitz -Original Message- In article [EMAIL PROTECTED], Michael Yanowitz [EMAIL

.py and running in Windows:

2006-06-13 Thread Michael Yanowitz
when finished rather than exit the shell. How do I do that? Or would it cause a problem (so that Python no longer works) if I change the default .py extension to open in an editor rather than execute it if I open it? Thanks: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

RE: .py and running in Windows:

2006-06-13 Thread Michael Yanowitz
:48 AM To: python-list@python.org Subject: Re: .py and running in Windows: Andrew Gwozdziewycz wrote: You'll have better results posting this to it's own thread. He certainly should have, but since I've read it here anyway: On Jun 13, 2006, at 9:29 AM, Michael Yanowitz wrote: Hello

SWIG problems with gcc and Cygwin?

2006-06-20 Thread Michael Yanowitz
Traceback (most recent call last): File stdin, line 1, in ? File example.py, line 5, in ? import _example ImportError: No module named _example Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

RE: SWIG problems with gcc and Cygwin?

2006-06-26 Thread Michael Yanowitz
++ compiler I have presently is Cygwin gcc. Thanks in advance: Michael Yanowitz -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Michael Yanowitz Sent: Tuesday, June 20, 2006 3:39 PM To: python-list@python.org Subject: SWIG problems with gcc and Cygwin? Hello

RE: SWIG problems with gcc and Cygwin?

2006-06-27 Thread Michael Yanowitz
Thanks. It now works for me in Cygwin. I would never have guessed to write it as a dll. Michael Yanowitz -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Norman Vine Sent: Tuesday, June 27, 2006 4:21 PM To: python-list@python.org Subject: Re: SWIG

RE: Detecting 64bit vs. 32bit Linux

2006-07-10 Thread Michael Yanowitz
The one thing I observed (just an observation) is that: a) on 32-bit machines: sizeof(int) = 32 sizeof(long) = 32 b) on 64-bit machines: sizeof(int) = 32 sizeof(long) = 64 This in C and Python. Thanks in advance: Michael Yanowitz -Original Message- From: [EMAIL

Last used directory?

2006-07-12 Thread Michael Yanowitz
directory, which can be from a previous run or even a previous day. Is that possible? If so how? Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

Breaking up Strings correctly:

2007-04-09 Thread Michael Yanowitz
parentheseis. So that I get the proper '(' and ')' to split this upper correctly? Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

RE: Breaking up Strings correctly:

2007-04-10 Thread Michael Yanowitz
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Adam Atlas Sent: Monday, April 09, 2007 11:28 PM To: python-list@python.org Subject: Re: Breaking up Strings correctly: On Apr 9, 8:19 am, Michael Yanowitz [EMAIL PROTECTED] wrote: Hello: I have been

Functions, Operators, and Overloading?

2006-07-24 Thread Michael Yanowitz
can be overloaded. So can I define a new operator? If so, can I define func1 as an operator? (on the side, I have always wanted to define the ++ operator as +=1. Is that possible?) Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

Splitting a float into bytes:

2006-07-26 Thread Michael Yanowitz
of the float are? Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

RE: Splitting a float into bytes:

2006-07-26 Thread Michael Yanowitz
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Simon Forman Sent: Wednesday, July 26, 2006 2:56 PM To: python-list@python.org Subject: Re: Splitting a float into bytes: Michael Yanowitz wrote: Hello: For some reason I can't figure out how to split

Static Variables in Python?

2006-07-31 Thread Michael Yanowitz
it is called. Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

RE: Static Variables in Python?

2006-08-01 Thread Michael Yanowitz
-Original Message- From: Cliff Wells [mailto:[EMAIL PROTECTED] Sent: Monday, July 31, 2006 4:55 PM To: Michael Yanowitz Cc: python-list@python.org Subject: Re: Static Variables in Python? On Mon, 2006-07-31 at 15:21 -0400, Michael Yanowitz wrote: Is it possible to have a static

Negative division bug?

2006-08-03 Thread Michael Yanowitz
correct for positive numbers, but for negative integers it seems to subtract one from the expected result. Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

Make Object Oriented?

2006-08-10 Thread Michael Yanowitz
but if not, C-to-C++ would be ok? Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

Defining our own types?

2006-08-16 Thread Michael Yanowitz
that if I type in a number followed by a dot followed by number followed by a dot followed by a number followed by a dot and another number, it can call make_ip_address() on the value? Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

255 argument limit?

2006-10-25 Thread Michael Yanowitz
, 5,6,7,8,9,200,1,2,3,4,5,6,7,8,9,210,1,2,3,4,5,6,7,8,9,220,1,2,3,4,5,6,7,8,9, 230, 1,2,3,4,5,6,7,8,9,240,1,2,3,4,5,6,7,8,9,250,1,2,3,4,5,6,7,8,9) SyntaxError: more than 255 arguments Is there a way to increase this limit? (This is just a made up example, I would not normally do this). Thanks in advance: Michael

String Replace only if whole word?

2006-11-17 Thread Michael Yanowitz
determines when a word ends, and I will define a word as containing only 'A'-'Z','a'-'z','0'-'9','_' . As long as the string contains more of the word digits after the match, don't replace? Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

RE: String Replace only if whole word?

2006-11-17 Thread Michael Yanowitz
Michael Yanowitz wrote: Hello: I am hoping someone knows if there is an easier way to do this or someone already implemented something that does this, rather than reinventing the wheel: I have been using the string.replace(from_string, to_string, len(string)) to replace names in a file

RE: String Replace only if whole word?

2006-11-17 Thread Michael Yanowitz
-Original Message- From: Carsten Haese [mailto:[EMAIL PROTECTED] Sent: Friday, November 17, 2006 11:03 AM To: Michael Yanowitz Cc: python-list@python.org Subject: RE: String Replace only if whole word? On Fri, 2006-11-17 at 10:43 -0500, Michael Yanowitz wrote: Your pattern would

RE: proposed Python logo

2006-04-21 Thread Michael Yanowitz
How about having something from Monty Python in the logo rather than something snakelike. Python was named after Monty Python and not the snake. Snakes also don't appear friendly to me. I used to have rats as pets. Snakes are murderers of rats. Which I do find strange that there is a rat on

PyLint results?

2006-04-21 Thread Michael Yanowitz
my naming convention or unused variables which I will ignore at this time. I did find it to be a very useful too any how in cleaning up my code. I raised my code rate from about -8 to about +7. Thanks: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

Python function returns:

2006-05-04 Thread Michael Yanowitz
, nPortNumber) Am I missing something obvious? Is there a better, or more standard way to return values from functions? Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

PYTHONPATH vs PATH?

2006-05-08 Thread Michael Yanowitz
Hello: Someone on my team tried out installing my Python code and found that setting PYTHONPATH does not work, but setting PATH environment variable works the way PYTHONPATH should. Is that how it supposed to be, or is that a bug or feature? -Original Message- (parts deleted)

Shadow Detection?

2006-05-09 Thread Michael Yanowitz
Hello: Many times, people are warning things like Don't use 'str' as a variable name as it will shadow the built in str function. Is there some way to determine if a string is already defined in some higher scope? Maybe something like code if isdefined ('str'): print 'str is already

Tkinter Dialog Management problems:

2006-05-18 Thread Michael Yanowitz
Hello: Below I have included a stripped down version of the GUI I am working on. It contains 2 dialog boxes - one main and one settings. It has the following problems, probably all related, that I am hoping someone knows what I am doing wrong: 1) Pressing the Settings.. Button multiple times,

RE: Tkinter Dialog Management problems:

2006-05-18 Thread Michael Yanowitz
Hello: Below I have included a stripped down version of the GUI I am working on. It contains 2 dialog boxes - one main and one settings. It has the following problems, probably all related, that I am hoping someone knows what I am doing wrong: 1) Pressing the Settings.. Button

Python Version Testing Tool?

2006-05-24 Thread Michael Yanowitz
Hello: Is there a version testing tool available for Python such that I can check to see if my code will still run in versions 2.2, 2.3, 2.4.3, and 1.1 (for example) (or whatever) without having to install all these different versions on my computer? Thanks in advance: Michael Yanowitz

RE: how to change sys.path?

2006-05-25 Thread Michael Yanowitz
Is there something like a .pythoninitrc which can run whenever we start Python that can load a file with many sys.path.append(), etc? If not is there some way to modify the Python shell constructor and destructor? Thanks in advance: Michael yanowitz -Original Message- From: [EMAIL

Best way to split up lines - RE: About the 79 character line recommendation

2006-12-07 Thread Michael Yanowitz
: Michael Yanowitz -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ramon Diaz-Uriarte Sent: Wednesday, December 06, 2006 5:12 PM To: Steve Bergman Cc: python-list@python.org Subject: Re: About the 79 character line recommendation On 5 Dec 2006 13:28:22

Can a Tkinter GUI check for abort script:

2006-12-18 Thread Michael Yanowitz
] | +-+ So, every tenth of a seconds or ??? better time, I would like to 'return' to the GUI and check if the Abort Script button has been pressed. How do I do this? Or is there a better way to implement this? Thanks in advance: Michael Yanowitz -- http://mail.python.org

RE: Can a Tkinter GUI check for abort script:

2006-12-18 Thread Michael Yanowitz
Script button is pressed. Presently what happens is that the script takes over and all the buttons on the GUI disappear as the GUI is not given any cpu time to refresh or check if any activity in the dialog. Thanks in advance: Michael Yanowitz -Original Message- From: [EMAIL PROTECTED

RE: Can a Tkinter GUI check for abort script:

2006-12-19 Thread Michael Yanowitz
make, without knowing any of the GUI objects, I can call from test3.py (or while test3.py is running) which will refresh the GUI and check for activity such as button presses on the GUI itself. For example, if I just call sleep(), will it do this? Thanks in advance: Michael Yanowitz

RE: Can a Tkinter GUI check for abort script:

2006-12-19 Thread Michael Yanowitz
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of hg Sent: Tuesday, December 19, 2006 9:44 AM To: python-list@python.org Subject: Re: Can a Tkinter GUI check for abort script: Michael Yanowitz wrote: Hello: I have successfully implemented a Tkinter

Is there a better way to implement this:

2007-01-22 Thread Michael Yanowitz
at 0x009CEF30 Traceback (most recent call last): File ./testthread.py, line 10, in abort raise thread_finished MAX RUN TIME EXCEEDED! HELLO 30 HELLO 31 HELLO 32 Thanks in advance: Michael Yanowitz -- http://mail.python.org/mailman/listinfo/python-list

RE: Is there a better way to implement this:

2007-01-22 Thread Michael Yanowitz
. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Benjamin Niemann Sent: Monday, January 22, 2007 11:19 AM To: python-list@python.org Subject: Re: Is there a better way to implement this: Michael Yanowitz wrote: Hello: I wrote the code below (much irrelevant

RE: division by 7 efficiently ???

2007-02-01 Thread Michael Yanowitz
I think it is off by 1 in small numbers, off by a little more with large numbers: def div7 (N): ...return (N3) + ((N-7*(N3))3) ... div7 (70) 9 div7 (77) 10 div7 (700) 98 div7 (7) 0 div7 (10) 1 div7 (14) 1 div7 (21) 2 div7 (700) 98 div7 (7000) 984 Michael Yanowitz -Original