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
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
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
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
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
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))
-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
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
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
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
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
to do is to
search for it myself.
Thanks in advance:
Michael Yanowitz
--
http://mail.python.org/mailman/listinfo/python-list
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
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
: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
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
++ 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
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
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
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
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
-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
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
of the float are?
Thanks in advance:
Michael Yanowitz
--
http://mail.python.org/mailman/listinfo/python-list
-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
it is called.
Thanks in advance:
Michael Yanowitz
--
http://mail.python.org/mailman/listinfo/python-list
-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
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
but if not, C-to-C++ would
be ok?
Thanks in advance:
Michael Yanowitz
--
http://mail.python.org/mailman/listinfo/python-list
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
,
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
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
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
-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
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
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
,
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
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)
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
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,
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
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
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
:
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
] |
+-+
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
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
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
-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
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
.
-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
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
51 matches
Mail list logo