Thanks for your reply!
On Saturday, June 11, 2016 at 2:41:39 PM UTC-4, MRAB wrote:
> Drop the next 3 comment lines. They add visual clutter, and no useful info.
> > ###
> > # REFERENCE MODULES
> >
On 2016-06-11 18:59, mad scientist jr wrote:
Thanks to everyone for your replies. I see my script was as horrific as I
feared, but I read all the responses and made a few changes. I'm not 100% sold
on not checking types, but took it out, because it made sense that other
programmers might
Look into docstrings. They will make your code much more readable to a
Python reader.
On Sat, Jun 11, 2016 at 2:16 PM mad scientist jr
wrote:
> For those who don't want to have to wade through comments, here is a
> version without so many comments:
>
> # For Python
For those who don't want to have to wade through comments, here is a version
without so many comments:
# For Python 3.x
# This script creates multiple numbered empty folders
# in the desired location. To change the folder names
# or location, edit function get_default_options.
import datetime
Thanks to everyone for your replies. I see my script was as horrific as I
feared, but I read all the responses and made a few changes. I'm not 100% sold
on not checking types, but took it out, because it made sense that other
programmers might want to use some custom type with my functions
First of all welcome :)
The other suggestions you've received so far are good so I won't repeat
them... (note that in particular I've reused the names you've chosen in
your program where I've given code examples, but that's purely for clarity
and I agree with the others who've said you should use
On 06/10/2016 03:52 PM, mad scientist jr wrote:
Is this group appropriate for that kind of thing?
(If not sorry for posting this here.)
So I wanted to start learning Python, and there is s much information
online, which is a little overwhelming. I really learn best from doing,
especially
On Fri, Jun 10, 2016 at 6:52 PM, mad scientist jr
wrote:
> Is this group appropriate for that kind of thing?
> (If not sorry for posting this here.)
>
> So I wanted to start learning Python, and there is s much information
> online, which is a little overwhelming.
The structure of your program is really not that Pythonic. I'd recommend
you take a look at PEP 8.
https://www.python.org/dev/peps/pep-0008/
It's not perfect, but it's a good start to get a feel for how to structure
your Python work.
Marc
On Fri, Jun 10, 2016 at 7:05 PM, Christopher Reimer <
Sent from my iPhone
> On Jun 10, 2016, at 3:52 PM, mad scientist jr
> wrote:
> .
> Now that it's done, I am wondering what kind of things I could do better.
This is Python, not BASIC. Lay off on the CAP LOCK key and delete all the
comments and separation blocks.
Is this group appropriate for that kind of thing?
(If not sorry for posting this here.)
So I wanted to start learning Python, and there is s much information
online, which is a little overwhelming. I really learn best from doing,
especially if it's something actually useful. I needed to
On Thursday, June 2, 2011 at 10:29:48 AM UTC-5, Neeraj Agarwal wrote:
Hello all,
I'm a newbie to Python and its my 2nd day exploring it.
I was trying to use Python wrapper for Google Charts API and was
tweaking the examples.
https://github.com/gak/pygooglechart/raw/master/examples/pie.py
John Sampson wrote:
I notice that the string method 'lower' seems to convert some strings
(input from a text file) to Unicode but not others.
This messes up sorting if it is used on arguments of 'sorted' since
Unicode strings come before ordinary ones.
Is there a better way of
John Sampson wrote:
I notice that the string method 'lower' seems to convert some strings
(input from a text file) to Unicode but not others.
I don't think so. You're going to have to show an example.
I *think* what you might be running into is an artifact of printing to a
terminal, which may
I notice that the string method 'lower' seems to convert some strings
(input from a text file) to Unicode but not others.
This messes up sorting if it is used on arguments of 'sorted' since
Unicode strings come before ordinary ones.
Is there a better way of case-insensitive sorting of strings
John Sampson wrote:
I notice that the string method 'lower' seems to convert some strings (input
from a text file) to Unicode but not others.
This messes up sorting if it is used on arguments of 'sorted' since Unicode
strings come before ordinary ones.
I doubt that. Can you provide a short
On Sat, Jan 24, 2015 at 4:53 AM, Peter Otten __pete...@web.de wrote:
Now the same with unicode. To read text with a specific encoding use either
codecs.open() or io.open() instead of the built-in (replace utf-8 with your
actual encoding):
import io
for line in io.open(tmp.txt,
On Sat, Jan 24, 2015 at 6:14 AM, Marko Rauhamaa ma...@pacujo.net wrote:
Well, if Python can't, then who can? Probably nobody in the world, not
generically, anyway.
Example:
print(re\u0301sume\u0301)
résumé
print(r\u00e9sum\u00e9)
résumé
print(re\u0301sume\u0301 ==
Peter Otten __pete...@web.de:
The standard recommendation is to convert bytes to unicode as early as
possible and only manipulate unicode.
Unicode doesn't get you off the hook (as you explain later in your
post). Upper/lowercase as well as collation order is ambiguous. Python
even with decent
My supervisor has palmed me off with a python code, written by a collaborator,
which implements an algorithm aimed at denoising the dose distribution (energy
per unit mass) output from a radiation transport Monte Carlo code.
My task is to translate the python code into a MatLab code.
A colleague
On Wed, 18 Jun 2014 05:10:03 -0700, Maura E Monville wrote:
My supervisor has palmed me off with a python code, written by a
collaborator, which implements an algorithm aimed at denoising the dose
distribution (energy per unit mass) output from a radiation transport
Monte Carlo code. My task
On Wednesday, June 18, 2014 1:50:54 PM UTC+1, Steven D'Aprano wrote:
On Wed, 18 Jun 2014 05:10:03 -0700, Maura E Monville wrote:
My supervisor has palmed me off with a python code, written by a
collaborator, which implements an algorithm aimed at denoising the dose
distribution
In article fa433710-0953-4b4a-96f6-2f7d1b9af...@googlegroups.com,
Maura E Monville maura.monvi...@gmail.com wrote:
My supervisor has palmed me off with a python code, written by a
collaborator, which implements an algorithm aimed at denoising the dose
distribution (energy per unit mass) output
I am learning Python and wish to develop GUI applications to run on Windows.
I have installed the Visual Studio integrated shell (Ver. 12.0.21005.1 REL) IDE
and the Python 3.3 interpreter. I have gone through some of the 3.3 tutorial
available at http://docs.python.org/3.3/tutorial/.
The
On Thu, Nov 21, 2013 at 3:03 AM, Ev J shorepoin...@gmail.com wrote:
Before I go too far down this road, I need to know if I can/should use this
environment to develop GUI applications. Is there graphical support for this
- for example I can I just insert/move/set properties of buttons, combo
On Thu, 21 Nov 2013 03:14:44 +1100, Chris Angelico wrote:
On Thu, Nov 21, 2013 at 3:03 AM, Ev J shorepoin...@gmail.com wrote:
Before I go too far down this road, I need to know if I can/should use
this environment to develop GUI applications. Is there graphical
support for this - for example
On 11/20/2013 11:03 AM, Ev J wrote:
I am learning Python and wish to develop GUI applications to run on Windows.
I have installed the Visual Studio integrated shell (Ver. 12.0.21005.1 REL) IDE
and the Python 3.3 interpreter. I have gone through some of the 3.3 tutorial
available at
On 11/20/2013 10:03 AM, Ev J wrote:
I am learning Python and wish to develop GUI applications to run on Windows.
I have installed the Visual Studio integrated shell (Ver. 12.0.21005.1 REL) IDE
and the Python 3.3 interpreter. I have gone through some of the 3.3 tutorial
available at
On 27/02/2013 10:26, Ian Kelly wrote:
On Wed, Feb 27, 2013 at 1:51 AM, Marwan lar...@free.fr wrote:
When I run the generated exe, I get errors about the functions not
existing...
TestPython.exe test Hello
AttributeError: 'module' object has no attribute 'Hello'
Cannot find function Hello
On 27/02/2013 16:17, Christian Gollwitzer wrote:
Am 27.02.13 09:51, schrieb Marwan:
And I'd appreciate it if you could give me pointers to how to easily
call Python from C++.
Maybe you can use boost::python?
http://www.boost.org/doc/libs/1_53_0/libs/python/doc/
Cave: I haven't used it and
Marwan Badawi marwan.bad...@inria.fr wrote:
I just noticed that my reply went to the message sender and not to the
newsgroup, so I'm posting again: thanks, I'll look into that.
Yes, I often do that too; i.e. I'm subscribed to python-list@python.org
and get all messages from comp.lang.python
On 02/28/2013 03:47 AM, Gisle Vanem wrote:
I saw you uses Thunderbird on Windows. I'm not sure how it by default handles
a reply-to when there is no Reply-to field in the header. To the address in
From / Sender or what?
Thunderbird has a handy, reply to list button that works every time no
Hello all,
I'm new to Python and just starting to learn it. For he needs of my
project, I need to call some specific methods in Python scripts from C++.
For now, I just compiled the example in the Python documentation about
Pure Embedding to try it out (
On Wed, Feb 27, 2013 at 1:51 AM, Marwan lar...@free.fr wrote:
When I run the generated exe, I get errors about the functions not
existing...
TestPython.exe test Hello
AttributeError: 'module' object has no attribute 'Hello'
Cannot find function Hello
test is the name of a module in the
Am 27.02.13 09:51, schrieb Marwan:
And I'd appreciate it if you could give me pointers to how to easily
call Python from C++.
Maybe you can use boost::python?
http://www.boost.org/doc/libs/1_53_0/libs/python/doc/
Cave: I haven't used it and don't know if it is up-to-date.
Christian
On 2/27/2013 3:51 AM, Marwan wrote:
Hello all,
I'm new to Python and just starting to learn it. For he needs of my
project, I need to call some specific methods in Python scripts from C++.
For now, I just compiled the example in the Python documentation about
Pure Embedding to try it out (
On 02/24/2013 02:43 PM, piterrr.dolin...@gmail.com wrote:
snip
... But for the moment I am trying to imitate familiar ground.
snip
This is EXACTLY why you're having trouble grasping Python. Python is a different language and
requires a different mind-set and different approach. In this, it
On 2013-02-23, 15:51 GMT, Chris Angelico wrote:
When you learn your first language, you think you're learning to
program, but that's not really accurate. Once you've learned half a
dozen, you begin to understand something of the art of coding as
distinct from any particular language; after
On 2013-02-23, 18:44 GMT, jmfauth wrote:
Very easy to explain: wrong, incorrect, naive unicode
handling.
PLONK!
--
http://mail.python.org/mailman/listinfo/python-list
On 02/26/2013 01:32 AM, Larry Hudson wrote:
On 02/24/2013 02:43 PM, piterrr.dolin...@gmail.com wrote:
snip
... But for the moment I am trying to imitate familiar ground.
snip
This is EXACTLY why you're having trouble grasping Python. Python is a
different language and
requires a
- Original Message -
Hi guys,
Question. Have this code
intX = 32 # decl + init int var
intX_asString = None # decl + init with NULL string var
intX_asString = intX.__str__ ()# convert int to string
What are these ugly underscores
On 02/26/2013 10:23 AM, ru...@yahoo.com wrote:
On 02/26/2013 01:32 AM, Larry Hudson wrote:
Python variables do NOT have any data type.
I have no problem interpreting the OP's statement
as meaning that he wanted to use a Python variable to
consistently reference a particular type and wanted a
Jean-Michel Pichavant jeanmic...@sequans.com wrote in message
news:mailman.2567.1361905815.2939.python-l...@python.org...
- Original Message -
Hi guys,
Question. Have this code
intX = 32 # decl + init int var
intX_asString = None # decl + init
On Wed, Feb 27, 2013 at 6:42 AM, Piterrr piotr...@optonline.net wrote:
This reminds me, when I first started working with databases and saw an
error msg which said that my query had ambiguous columns I laughed for 1/2
hr. I found it incredibly exitaining that a 100% deterministic piece of
On Tuesday, February 26, 2013 11:59:51 AM UTC-7, Ethan Furman wrote:
On 02/26/2013 10:23 AM, ru...@yahoo.com wrote:
On 02/26/2013 01:32 AM, Larry Hudson wrote:
Python variables do NOT have any data type.
I have no problem interpreting the OP's statement
as meaning that he wanted to use a
On 24.02.13 17:52, Chris Angelico wrote:
By the way, when you're asking a completely new question, it usually
helps to do so as a brand new thread (not a reply) and with a new
subject line. Otherwise, you risk people losing the new question among
the discussion of the old.
You risk people
Hi Piterr,
It's interesting how strong our habits are, isn't it? It's most likely you've
just got a bit of culture shock.
I've used C# quite a bit as well as Python. I like them both.
What I like about Python is how it manages to be clear and terse at the same
time.
if (flag==1) {
code
}
piterrr.dolin...@gmail.com wrote:
You see, Javascript, for one, behaves the same way as Python (no variable
declaration) but JS has curly braces and you know the variable you have
just used is limited in scope to the code within the { }. With Python, you
have to search the whole file.
I
On 24/02/2013 04:20, Larry Hudson wrote:
On 02/23/2013 03:46 PM, piterrr.dolin...@gmail.com wrote:
Hi all,
snip
... I have discovered today there is no do...while type loop. [Sigh]
No biggie. This is easily simulated with:
while True:
...
if exit condition:
break
Less
Hi guys,
Question. Have this code
intX = 32 # decl + init int var
intX_asString = None # decl + init with NULL string var
intX_asString = intX.__str__ ()# convert int to string
What are these ugly underscores for?
On Mon, Feb 25, 2013 at 2:46 AM, piterrr.dolin...@gmail.com wrote:
Hi guys,
Question. Have this code
intX = 32 # decl + init int var
intX_asString = None # decl + init with NULL string var
intX_asString = intX.__str__ ()# convert int to string
In article mailman.2410.1361721167.2939.python-l...@python.org,
Chris Angelico ros...@gmail.com wrote:
The dunder methods (double underscore, leading and trailing),
also called magic methods, are the implementations of various
special features. For instance, indexing foo[1] is implemented
On 22/02/2013 21:37, piterrr.dolin...@gmail.com wrote:
if (some statement):# short form
rather than
if (some statement == true):# long form
What all those ugly brackets are for?
Peter
--
Cheers.
Mark Lawrence
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 24 Feb 2013 07:46:07 -0800, piterrr.dolinski wrote:
Hi guys,
Question. Have this code
intX = 32 # decl + init int var
intX_asString = None # decl + init with NULL string var
intX_asString = intX.__str__ ()# convert int to string
On 02/24/2013 10:37 AM, Dennis Lee Bieber wrote:
Decided to look up the VAX/VMS scheme...
If you know the condition code for a message, you can use F$MESSAGE to
translate the code to its associated message. For example:
$ WRITE SYS$OUTPUT F$MESSAGE(%X0001)
%SYSTEM-S-NORMAL,
In article mailman.2420.1361728619.2939.python-l...@python.org,
Michael Torrie torr...@gmail.com wrote:
It's interesting to note that Windows NT sort of descends from VMS.
More than sort of. Dave Cutler was the chief architect of both.
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-02-23, Chris Angelico ros...@gmail.com wrote:
It's worth noting, though, that there are self-perpetuating aspects to
it. I can happily distribute a .py file to a Linux audience, because
many Linux distros come with a Python already installed, or at very
least can grab one easily via
To demonstrate that the person who wrote this code was not a good Python
programmer. I hope it wasn't you :-) This person obviously had a very
basic, and confused, understanding of Python.
And, quite frankly, was probably not a very good programmer of *any*
language:
-
if (some statement):# short form
rather than
if (some statement == true):# long form
What all those ugly brackets are for?
Mark,
Back in the day when C was king, or take many newer long established languages
(C#, Java), the use of () has been widespread
On 02/24/2013 02:40 PM, piterrr.dolin...@gmail.com wrote:
if (some statement): # short form
rather than
if (some statement == true): # long form
What all those ugly brackets are for?
Mark,
Back in the day when C was king, or take many newer long established
languages (C#, Java),
On Mon, Feb 25, 2013 at 5:19 AM, Grant Edwards invalid@invalid.invalid wrote:
On 2013-02-23, Chris Angelico ros...@gmail.com wrote:
It's worth noting, though, that there are self-perpetuating aspects to
it. I can happily distribute a .py file to a Linux audience, because
many Linux distros
On Sun, 24 Feb 2013 20:40:05 +0100, piterrr.dolin...@gmail.com wrote:
if (some statement): # short form
rather than
if (some statement == true): # long form
What all those ugly brackets are for?
Mark,
Back in the day when C was king, or take many newer long
On 2013-02-24 19:40, piterrr.dolin...@gmail.com wrote:
if (some statement):# short form
rather than
if (some statement == true):# long form
What all those ugly brackets are for?
Mark,
Back in the day when C was king, or take many newer long established
languages (C#,
On Mon, Feb 25, 2013 at 7:34 AM, MRAB pyt...@mrabarnett.plus.com wrote:
Some languages require parentheses, others don't.
C does. C++, Java and C# are descended from, or influenced by, C.
Algol didn't (doesn't?). Pascal, Modula-2, Oberon, Ada, and others
don't.
Parentheses are used where
On 24/02/2013 19:40, piterrr.dolin...@gmail.com wrote:
if (some statement):# short form
rather than
if (some statement == true):# long form
What all those ugly brackets are for?
Mark,
Back in the day when C was king, or take many newer long established languages (C#,
On 02/24/2013 11:40 AM, piterrr.dolin...@gmail.com wrote:
Back in the day when C was king, or take many newer long established languages (C#,
Java), the use of () has been widespread and mandated by the compilers. I have never
heard anyone moan about the requirement to use parentheses. Now
On Mon, Feb 25, 2013 at 7:34 AM, Ethan Furman et...@stoneleaf.us wrote:
One of the things I love about Python is its ability to get out of the way
and let me work:
- no variable declarations, just use 'em
- no type declarations, just use 'em
- no need to remember what's an object and
In article mailman.2434.1361738581.2939.python-l...@python.org,
Chris Angelico ros...@gmail.com wrote:
On Mon, Feb 25, 2013 at 7:34 AM, MRAB pyt...@mrabarnett.plus.com wrote:
Some languages require parentheses, others don't.
C does. C++, Java and C# are descended from, or influenced by,
In article mailman.2438.1361739512.2939.python-l...@python.org,
Chris Angelico ros...@gmail.com wrote:
no need to remember what's an object and what's not -- everything is an
object
Well, not quite everything. If I write:
if foo:
do_this()
and_this()
the code block making up the
On 24 February 2013 19:29, piterrr.dolin...@gmail.com wrote:
Hi. Steve, I don't know where you have been over the past couple of days
but it is widely known (if the thread title is any indication) that I am
indeed very new to Python, but not new to programming in general.
To give a bit of
On 24 February 2013 20:48, Roy Smith r...@panix.com wrote:
In article mailman.2434.1361738581.2939.python-l...@python.org,
Chris Angelico ros...@gmail.com wrote:
On Mon, Feb 25, 2013 at 7:34 AM, MRAB pyt...@mrabarnett.plus.com
wrote:
Some languages require parentheses, others don't.
On Mon, Feb 25, 2013 at 8:35 AM, Joshua Landau
joshua.landau...@gmail.com wrote:
def solve_quadratic(a, b, c):
Solve a quadratic equation of the form ax² + bx + c = 0
The result will be a tuple of the two results; the results can be equal if
the determinant is 0.
This supports imaginary
On 02/24/2013 04:44 PM, Chris Angelico wrote:
On Mon, Feb 25, 2013 at 8:08 AM, Roy Smith r...@panix.com wrote:
In article mailman.2438.1361739512.2939.python-l...@python.org,
Chris Angelico ros...@gmail.com wrote:
no need to remember what's an object and what's not -- everything
is an
On 02/24/2013 12:58 PM, Chris Angelico wrote:
On Mon, Feb 25, 2013 at 7:34 AM, Ethan Furman et...@stoneleaf.us wrote:
- no variable declarations, just use 'em
Variable declarations can go either way; Python requires you to name
all globals that you mutate
I'm not sure what you mean --
Josh,
Not thank you for your malicious post.
I think you are missing the point here.
My source code was just a dummy to offer context for the question I wanted to
ask. Further down the line, if I ever feel I don't need to pseudo-declare
variables I will stop doing it. But for the moment I am
On 02/24/2013 10:46 AM, piterrr.dolin...@gmail.com wrote:
Hi guys,
Question. Have this code
intX = 32 # decl + init int var
intX_asString = None # decl + init with NULL string var
None is not a str, and it's not a NULL string var Perhaps what you
On Sun, Feb 24, 2013 at 5:43 PM, piterrr.dolin...@gmail.com wrote:
Josh,
Not thank you for your malicious post.
I think you are missing the point here.
My source code was just a dummy to offer context for the question I wanted
to ask. Further down the line, if I ever feel I don't need to
On 24 February 2013 22:43, piterrr.dolin...@gmail.com wrote:
Josh,
Not thank you for your malicious post.
Be careful, us programmers do *eventually* catch on to who is a troll, and
if you say things like that we may eventually mark you off as just to
hostile.
I *honestly* meant no malice or
On 24 February 2013 22:08, Chris Angelico ros...@gmail.com wrote:
On Mon, Feb 25, 2013 at 8:35 AM, Joshua Landau
joshua.landau...@gmail.com wrote:
def solve_quadratic(a, b, c):
Solve a quadratic equation of the form ax² + bx + c = 0
The result will be a tuple of the two results; the
On 24 February 2013 23:18, Oscar Benjamin oscar.j.benja...@gmail.comwrote:
On 24 February 2013 21:35, Joshua Landau joshua.landau...@gmail.com
wrote:
determinant = b**2 - 4*a*c
It's called the discriminant. A determinant is something altogether
different.
*cries at own idiocy*
Thank
Most of what gets hung in art galleries these days is far less
visually pleasing than well-written code.
+1 QOTW
--
http://mail.python.org/mailman/listinfo/python-list
intX = 32 # decl + init int var
How is it not obvious that intX is an integer *without* the comment?
Indeed the assignment is enough to deduce intX is an int. The comment is
there to let me know it is unlikely intX appears earlier in the code. Please,
let me do
On Mon, Feb 25, 2013 at 9:33 AM, Ethan Furman et...@stoneleaf.us wrote:
On 02/24/2013 12:58 PM, Chris Angelico wrote:
On Mon, Feb 25, 2013 at 7:34 AM, Ethan Furman et...@stoneleaf.us wrote:
- no variable declarations, just use 'em
Variable declarations can go either way; Python
On Mon, Feb 25, 2013 at 10:38 AM, piterrr.dolin...@gmail.com wrote:
intX = 32 # decl + init int var
How is it not obvious that intX is an integer *without* the comment?
Indeed the assignment is enough to deduce intX is an int. The comment is
there to let me know it
On 02/24/2013 03:38 PM, piterrr.dolin...@gmail.com wrote:
intX = 32 # decl + init int var
How is it not obvious that intX is an integer *without* the comment?
Indeed the assignment is enough to deduce intX is an int. The comment is
there to let me know it is
For example (I believe it's already been mentioned) declaring intX with
some integer value does *nothing* to maintain
X as an integer:
-- intX = 32
-- intX = intX / 3.0
-- intX
10.66
Yes I did see that it is possible to redefine the type of a variable. But I
don't
On 25 February 2013 00:08, piterrr.dolin...@gmail.com wrote:
For example (I believe it's already been mentioned) declaring intX
with some integer value does *nothing* to maintain
X as an integer:
-- intX = 32
-- intX = intX / 3.0
-- intX
10.66
Yes I did see that
On 25/02/2013 00:08, piterrr.dolin...@gmail.com wrote:
For example (I believe it's already been mentioned) declaring intX with some
integer value does *nothing* to maintain
X as an integer:
-- intX = 32
-- intX = intX / 3.0
-- intX
10.66
Yes I did see that it is possible to
On 02/24/2013 04:08 PM, piterrr.dolin...@gmail.com wrote:
For example (I believe it's already been mentioned) declaring intX with some
integer value does *nothing* to maintain
X as an integer:
-- intX = 32
-- intX = intX / 3.0
-- intX
10.66
Yes I did see that it is possible to
On Sun, 24 Feb 2013 16:08:01 -0500, Roy Smith wrote:
In article mailman.2438.1361739512.2939.python-l...@python.org,
Chris Angelico ros...@gmail.com wrote:
no need to remember what's an object and what's not -- everything is
an object
Well, not quite everything. If I write:
if
In article mailman.2461.1361749985.2939.python-l...@python.org,
Ethan Furman et...@stoneleaf.us wrote:
On 02/24/2013 03:38 PM, piterrr.dolin...@gmail.com wrote:
intX = 32 # decl + init int var
How is it not obvious that intX is an integer *without* the comment?
On 25 February 2013 00:08, piterrr.dolin...@gmail.com wrote:
Chris Angelico wrote:
For example (I believe it's already been mentioned) declaring intX with
some integer value does *nothing* to maintain
X as an integer:
-- intX = 32
-- intX = intX / 3.0
-- intX
10.66
Yes I
In article da0ec7a1-decd-4cfb-9a0b-5722879f5...@googlegroups.com,
piterrr.dolin...@gmail.com wrote:
Yes I did see that it is possible to redefine the type of a variable. But I
don't think I would ever do this intentionally
One does not need language features to protect themselves against
On Sun, 24 Feb 2013 11:40:05 -0800, piterrr.dolinski wrote:
if (some statement): # short form
rather than
if (some statement == true): # long form
What all those ugly brackets are for?
Mark,
Back in the day when C was king, or take many newer long
On Sun, 24 Feb 2013 16:08:06 -0800, piterrr.dolinski wrote:
For example (I believe it's already been mentioned) declaring intX
with some integer value does *nothing* to maintain
X as an integer:
-- intX = 32
-- intX = intX / 3.0
-- intX
10.66
Yes I did see that it is
On Sun, 24 Feb 2013 17:40:54 -0500, Mitya Sirenef wrote:
But if block doesn't have to be inside a function, right? It needs to be
inside a module, but then again everything is inside a module, but it
wouldn't be very object-oriented if the module was the only object in
Python :-).
Python
On Mon, Feb 25, 2013 at 11:45 AM, Oscar Benjamin
oscar.j.benja...@gmail.com wrote:
On 25 February 2013 00:08, piterrr.dolin...@gmail.com wrote:
Chris Angelico wrote:
For example (I believe it's already been mentioned) declaring intX with
some integer value does *nothing* to maintain
X as
On Mon, Feb 25, 2013 at 12:04 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Not at all. The only difference is whether you get a compiler error or a
runtime error. Instead of:
10 Write code.
20 Compile.
30 If compiler error, GO TO 10.
40 REM code compiles, but it still
On 02/24/2013 03:40 PM, Mitya Sirenef wrote:
But if block doesn't have to be inside a function, right? It needs
to be inside a module, but then again everything is inside a module, but
it wouldn't be very object-oriented if the module was the only object in
Python :-).
A module indeed fits
On 02/24/2013 06:04 PM, Steven D'Aprano wrote:
Variables do not have types in Python.
Reset your thinking. Python is a dynamic language with name bindings and
strongly-typed objects, not a static language with strongly-typed
variables. If you don't understand the difference, ask. But so
1 - 100 of 452 matches
Mail list logo