Re: Python newbie here! No module named settings

2015-04-12 Thread rdavis7408
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/p

Re: python newbie

2014-06-18 Thread Jim Gibson
In article , 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 is to translate t

Re: python newbie

2014-06-18 Thread Maura E Monville
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 > > > dist

Re: python newbie

2014-06-18 Thread Steven D'Aprano
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 ta

Re: Python newbie trying to embed in C++

2013-02-28 Thread Michael Torrie
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

Re: Python newbie trying to embed in C++

2013-02-28 Thread Gisle Vanem
"Marwan Badawi" 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 mirrored to the ML a b

Re: Python newbie trying to embed in C++

2013-02-28 Thread Marwan Badawi
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 do

Re: Python newbie trying to embed in C++

2013-02-28 Thread Marwan Badawi
On 27/02/2013 10:26, Ian Kelly wrote: On Wed, Feb 27, 2013 at 1:51 AM, Marwan 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 na

Re: Python newbie trying to embed in C++

2013-02-27 Thread Terry Reedy
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 ( http

Re: Python newbie trying to embed in C++

2013-02-27 Thread Christian Gollwitzer
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

Re: Python newbie trying to embed in C++

2013-02-27 Thread Ian Kelly
On Wed, Feb 27, 2013 at 1:51 AM, Marwan 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 standard

Re: Python Newbie

2013-02-26 Thread rurpy
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

Re: Python Newbie

2013-02-26 Thread Chris Angelico
On Wed, Feb 27, 2013 at 6:42 AM, Piterrr 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 > hardware could have t

Re: Python Newbie

2013-02-26 Thread Piterrr
"Jean-Michel Pichavant" 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 with NULL string var

Re: Python Newbie

2013-02-26 Thread Ethan Furman
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 n

Re: Python Newbie

2013-02-26 Thread Jean-Michel Pichavant
- 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 under

Re: Python Newbie

2013-02-26 Thread rurpy
On 02/26/2013 01:32 AM, Larry Hudson wrote: > On 02/24/2013 02:43 PM, piterrr.dolin...@gmail.com wrote: > >> ... But for the moment I am trying to imitate familiar ground. > > This is EXACTLY why you're having trouble grasping Python. Python is a > different language and > requires a differen

Re: Python Newbie

2013-02-26 Thread Matej Cepl
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

Re: Python Newbie

2013-02-26 Thread Matej Cepl
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

Re: Python Newbie

2013-02-26 Thread Larry Hudson
On 02/24/2013 02:43 PM, piterrr.dolin...@gmail.com wrote: ... But for the moment I am trying to imitate familiar ground. 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 is NO dif

Re: Python Newbie

2013-02-25 Thread Nick Mellor
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 }

Re: Python Newbie

2013-02-25 Thread Serhiy Storchaka
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 losin

Re: Python Newbie

2013-02-24 Thread Ethan Furman
On 02/24/2013 05:53 PM, Chris Angelico wrote: On Mon, Feb 25, 2013 at 12:44 PM, Oscar Benjamin wrote: On 25 February 2013 01:24, Chris Angelico wrote: Once again, Ethan gets the short end of the citations stick... 'twarn't me wrote that, he did. Not that it's at all contrary to my views, and

Re: Python Newbie

2013-02-24 Thread Joshua Landau
On 25 February 2013 02:08, Dennis Lee Bieber wrote: > On Sun, 24 Feb 2013 21:58:36 +, Joshua Landau > declaimed the following in > gmane.comp.python.general: > > > > > > condition1 = long_condition_expression_1 > > condition2 = long_condition_expression_2 > > condition3 = long_condition_expr

Re: Python Newbie

2013-02-24 Thread J.R.
On 24/02/2013 23:03, Roy Smith wrote: In article , "J.R." wrote: PS.: JavaScript is a trademark, and the actual language name is specified as ECMAScript. The decision whether to call it JavaScript or ECMAScript really comes down to, "Do you want to be correct, or do you want people to know

Re: Python Newbie

2013-02-24 Thread Chris Angelico
On Mon, Feb 25, 2013 at 1:03 PM, Roy Smith wrote: > In article , > "J.R." wrote: > >> PS.: JavaScript is a trademark, and the actual language name is >> specified as ECMAScript. > > The decision whether to call it JavaScript or ECMAScript really comes > down to, "Do you want to be correct, or do

Re: Python Newbie

2013-02-24 Thread MRAB
On 2013-02-25 01:53, Chris Angelico wrote: On Mon, Feb 25, 2013 at 12:44 PM, Oscar Benjamin wrote: On 25 February 2013 01:24, Chris Angelico wrote: Once again, Ethan gets the short end of the citations stick... 'twarn't me wrote that, he did. Not that it's at all contrary to my views, and I m

Re: Python Newbie

2013-02-24 Thread Roy Smith
In article , "J.R." wrote: > PS.: JavaScript is a trademark, and the actual language name is > specified as ECMAScript. The decision whether to call it JavaScript or ECMAScript really comes down to, "Do you want to be correct, or do you want people to know what you're talking about?" -- htt

Re: Python Newbie

2013-02-24 Thread J.R.
On 21/02/2013 19:40, piterrr.dolin...@gmail.com wrote: I am nervous about using variables "out of the blue", without having to declare them. For example, when I write "i = 0" it is perfectly OK to Python without 'i' being declared earlier. How do I know that I haven't used this variable earlie

Re: Python Newbie

2013-02-24 Thread Chris Angelico
On Mon, Feb 25, 2013 at 12:44 PM, Oscar Benjamin wrote: > On 25 February 2013 01:24, Chris Angelico wrote: >> Once again, Ethan gets the short end of the citations stick... >> 'twarn't me wrote that, he did. Not that it's at all contrary to my >> views, and I might well have said it if he hadn't,

Re: Python Newbie

2013-02-24 Thread Michael Torrie
On 02/24/2013 03:43 PM, piterrr.dolin...@gmail.com wrote: > I wanted Python to register what type of variable I'm after. So I > init my vars accordingly, int might be 0, float 0.0 and string with > null, err... None. As several people on the list have pointed out, there are no variables in Python.

Re: Python Newbie

2013-02-24 Thread Oscar Benjamin
On 25 February 2013 01:24, Chris Angelico wrote: > On Mon, Feb 25, 2013 at 11:45 AM, Oscar Benjamin > wrote: >> On 25 February 2013 00:08, wrote: >> Chris Angelico wrote: For example (I believe it's already been mentioned) "declaring" intX with some integer value does *nothing* to ma

Re: Python Newbie

2013-02-24 Thread Michael Torrie
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 s

Re: Python Newbie

2013-02-24 Thread Michael Torrie
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

Re: Python Newbie

2013-02-24 Thread Chris Angelico
On Mon, Feb 25, 2013 at 12:04 PM, Steven D'Aprano 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 needs to be tested > 50 Test code

Re: Python Newbie

2013-02-24 Thread Chris Angelico
On Mon, Feb 25, 2013 at 11:45 AM, Oscar Benjamin wrote: > On 25 February 2013 00:08, 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 >>>

Re: Python Newbie

2013-02-24 Thread Steven D'Aprano
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

Re: Python Newbie

2013-02-24 Thread Steven D'Aprano
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 >

Re: Python Newbie

2013-02-24 Thread Steven D'Aprano
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

Re: Python Newbie

2013-02-24 Thread Roy Smith
In article , 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 things they do intentionally. They need language feat

Re: Python Newbie

2013-02-24 Thread Oscar Benjamin
On 25 February 2013 00:08, 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 >> > > Y

Re: Python Newbie

2013-02-24 Thread Roy Smith
In article , Ethan Furman 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? > > > > Indeed the assignment is enough to deduce "intX" is

Re: Python Newbie

2013-02-24 Thread Steven D'Aprano
On Sun, 24 Feb 2013 16:08:01 -0500, Roy Smith wrote: > In article , > Chris Angelico 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 ma

Re: Python Newbie

2013-02-24 Thread Ethan Furman
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

Re: Python Newbie

2013-02-24 Thread Mark Lawrence
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

Re: Python Newbie

2013-02-24 Thread Joshua Landau
On 25 February 2013 00:08, 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

Re: Python Newbie

2013-02-24 Thread piterrr . dolinski
> 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

Re: Python Newbie

2013-02-24 Thread Ethan Furman
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 unl

Re: Python Newbie

2013-02-24 Thread Chris Angelico
On Mon, Feb 25, 2013 at 10:38 AM, 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 unlikely i

Re: Python Newbie

2013-02-24 Thread Chris Angelico
On Mon, Feb 25, 2013 at 9:33 AM, Ethan Furman wrote: > On 02/24/2013 12:58 PM, Chris Angelico wrote: >> >> On Mon, Feb 25, 2013 at 7:34 AM, Ethan Furman wrote: >>> >>> >>>- no variable declarations, just use 'em >> >> >> Variable declarations can go either way; Python requires you to name >>

Re: Python Newbie

2013-02-24 Thread piterrr . dolinski
>> 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

Re: Python Newbie

2013-02-24 Thread Albert Hopkins
> 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

Re: Python Newbie

2013-02-24 Thread Joshua Landau
On 24 February 2013 23:18, Oscar Benjamin wrote: > On 24 February 2013 21:35, Joshua Landau > wrote: > > > > determinant = b**2 - 4*a*c > > It's called the discriminant. A determinant is something altogether > different. *cries at own idiocy* Thank you. -- http://mail.python.org/mailman/listi

Re: Python Newbie

2013-02-24 Thread Joshua Landau
On 24 February 2013 22:08, Chris Angelico wrote: > On Mon, Feb 25, 2013 at 8:35 AM, Joshua Landau > 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

Re: Python Newbie

2013-02-24 Thread Joshua Landau
On 24 February 2013 22:43, 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 insult. If you can't ta

Re: Python Newbie

2013-02-24 Thread Joel Goldstick
On Sun, Feb 24, 2013 at 5:43 PM, 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 > pseudo-declare vari

Re: Python Newbie

2013-02-24 Thread Dave Angel
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 wa

Re: Python Newbie

2013-02-24 Thread piterrr . dolinski
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 tr

Re: Python Newbie

2013-02-24 Thread Ethan Furman
On 02/24/2013 12:58 PM, Chris Angelico wrote: On Mon, Feb 25, 2013 at 7:34 AM, Ethan Furman 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 -- example? -- ~Ethan~

Re: Python Newbie

2013-02-24 Thread Mitya Sirenef
On 02/24/2013 04:44 PM, Chris Angelico wrote: On Mon, Feb 25, 2013 at 8:08 AM, Roy Smith wrote: >> In article , >> Chris Angelico wrote: >> no need to remember what's an object and what's not -- everything is an object > > Careful on the citations - Ethan Furman said that, I just

Re: Python Newbie

2013-02-24 Thread Chris Angelico
On Mon, Feb 25, 2013 at 8:35 AM, Joshua Landau 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 results for if the det

Re: Python Newbie

2013-02-24 Thread Joshua Landau
On 24 February 2013 20:48, Roy Smith wrote: > In article , > Chris Angelico wrote: > > > On Mon, Feb 25, 2013 at 7:34 AM, MRAB > wrote: > > > Some languages require parentheses, others don't. > > > > > > C does. C++, Java and C# are descended from, or influenced by, C. > > > > > > Algol didn't

Re: Python Newbie

2013-02-24 Thread Joshua Landau
On 24 February 2013 19:29, 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 background where I found

Re: Python Newbie

2013-02-24 Thread Roy Smith
In article , Chris Angelico 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 body of the "if" statement is not an object. In some languages,

Re: Python Newbie

2013-02-24 Thread Roy Smith
In article , Chris Angelico wrote: > On Mon, Feb 25, 2013 at 7:34 AM, MRAB 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.

Re: Python Newbie

2013-02-24 Thread Chris Angelico
On Mon, Feb 25, 2013 at 7:34 AM, Ethan Furman 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 what's not --

Re: Python Newbie

2013-02-24 Thread Ethan Furman
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 come

Re: Python Newbie

2013-02-24 Thread Mark Lawrence
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#, Jav

Re: Python Newbie

2013-02-24 Thread Chris Angelico
On Mon, Feb 25, 2013 at 7:34 AM, MRAB 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 required, but not us

Re: Python Newbie

2013-02-24 Thread MRAB
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#, Java

Re: Python Newbie

2013-02-24 Thread Michael Ross
On Sun, 24 Feb 2013 20:40:05 +0100, 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#,

Re: Python Newbie

2013-02-24 Thread Chris Angelico
On Mon, Feb 25, 2013 at 5:19 AM, Grant Edwards wrote: > On 2013-02-23, Chris Angelico 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 install

Re: Python Newbie

2013-02-24 Thread Mitya Sirenef
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 >

Re: Python Newbie

2013-02-24 Thread piterrr . dolinski
> > 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 bee

Re: Python Newbie

2013-02-24 Thread piterrr . dolinski
> 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:

Re: Python Newbie

2013-02-24 Thread Grant Edwards
On 2013-02-23, Chris Angelico 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 the package ma

Re: Python Newbie

2013-02-24 Thread Roy Smith
In article , Michael Torrie 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

Re: Python Newbie

2013-02-24 Thread Michael Torrie
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-NOR

Re: Python Newbie

2013-02-24 Thread Steven D'Aprano
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

Re: Python Newbie

2013-02-24 Thread Mark Lawrence
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

Re: Python Newbie

2013-02-24 Thread Roy Smith
In article , Chris Angelico wrote: > The "dunder" methods ("d"ouble "under"score, leading and trailing), > also called "magic methods", are the implementations of various > special features. For instance, indexing foo[1] is implemented using > the __getitem__ method. Here's a list: > > http://d

Re: Python Newbie

2013-02-24 Thread Chris Angelico
On Mon, Feb 25, 2013 at 2:46 AM, 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 > > What are these ug

Re: Python Newbie

2013-02-24 Thread piterrr . dolinski
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? _str__

Re: Python Newbie

2013-02-24 Thread Mark Lawrence
On 24/02/2013 04:20, Larry Hudson wrote: On 02/23/2013 03:46 PM, piterrr.dolin...@gmail.com wrote: Hi all, ... I have discovered today there is no do...while type loop. [Sigh] No biggie. This is easily simulated with: while True: ... if : break Less easily simulated i

Re: Python Newbie

2013-02-24 Thread Vito De Tullio
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 d

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/23/2013 04:46 PM, piterrr.dolin...@gmail.com wrote: > Yes, it's true that I am trying to write C# code in Python. It is not > going to change any time soon, if at all - I have done too much > C#ing, C++ing before that and C-ing earlier still. Unfortunately as long as do, you'll find Python

Re: Python Newbie

2013-02-23 Thread Larry Hudson
On 02/23/2013 03:46 PM, piterrr.dolin...@gmail.com wrote: Hi all, ... I have discovered today there is no do...while type loop. [Sigh] No biggie. This is easily simulated with: while True: ... if : break Less easily simulated is the lack of a switch/case structure. This

Re: Python Newbie

2013-02-23 Thread MRAB
On 2013-02-23 23:18, Chris Angelico wrote: On Sun, Feb 24, 2013 at 9:52 AM, Michael Torrie wrote: On 02/23/2013 02:38 PM, Chris Angelico wrote: On Sun, Feb 24, 2013 at 5:29 AM, Dennis Lee Bieber wrote: Error codes under DEC VAX/VMS used odd integers for "success/information" and even

Re: Python Newbie

2013-02-23 Thread Mark Lawrence
On 23/02/2013 21:48, Chris Angelico wrote: On Sun, Feb 24, 2013 at 7:53 AM, jmfauth wrote: On 23 fév, 20:08, Ethan Furman wrote: On 02/23/2013 10:44 AM, jmfauth wrote: [snip various stupidities] jmf Peter, jmfauth is one of our resident trolls. Feel free to ignore him. -- ~Ethan~ Sor

Re: Python Newbie

2013-02-23 Thread piterrr . dolinski
Hi all, (Ethan, I like your "resident troll" statement. Highly exit-aining!) Thanks for all the input. I did not expect to get so much constructive feedback, the more so that my initial attitude towards Python has been less than positive, diplomatically speaking. Yes, it's true that I am tryin

Re: Python Newbie

2013-02-23 Thread Chris Angelico
On Sun, Feb 24, 2013 at 9:52 AM, Michael Torrie wrote: > On 02/23/2013 02:38 PM, Chris Angelico wrote: >> On Sun, Feb 24, 2013 at 5:29 AM, Dennis Lee Bieber >> wrote: >>> Error codes under DEC VAX/VMS used odd integers for >>> "success/information" and even integers for "warning/error" (b

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/21/2013 03:40 PM, piterrr.dolin...@gmail.com wrote: > Chris, you are (almost) spot on with the if blocks indentation. This > is what I do, and it has served me well for 15 years. Most companies, development teams have unified coding style standards that all programmers must adhere to in the

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/23/2013 02:38 PM, Chris Angelico wrote: > On Sun, Feb 24, 2013 at 5:29 AM, Dennis Lee Bieber > wrote: >> Error codes under DEC VAX/VMS used odd integers for >> "success/information" and even integers for "warning/error" (been too >> many years, I think positive integers were success/

Re: Python Newbie

2013-02-23 Thread Gene Heskett
On Saturday 23 February 2013 17:44:21 Steve Simmons did opine: > On 23/02/2013 18:32, Gene Heskett wrote: > > I am here because I was hoping some knowledge leakage would help me to > > understand python, but at my age I am beginning to have to admit the > > level of abstraction is something I may

Re: Python Newbie

2013-02-23 Thread Chris Angelico
On Sun, Feb 24, 2013 at 7:53 AM, jmfauth wrote: > On 23 fév, 20:08, Ethan Furman wrote: >> On 02/23/2013 10:44 AM, jmfauth wrote: >> >> [snip various stupidities] >> >> > jmf >> >> Peter, jmfauth is one of our resident trolls. Feel free to ignore him. >> >> -- >> ~Ethan~ > > Sorry, what can say?

Re: Python Newbie

2013-02-23 Thread Chris Angelico
On Sun, Feb 24, 2013 at 5:34 AM, Dennis Lee Bieber wrote: > On Sat, 23 Feb 2013 13:18:56 +1100, Chris Angelico > declaimed the following in gmane.comp.python.general: > >> awesome Fred's Awesome Internet Language is, it's not going to be as > > Pardon, but was that deliberate -> FAIL :)

Re: Python Newbie

2013-02-23 Thread Chris Angelico
On Sun, Feb 24, 2013 at 5:29 AM, Dennis Lee Bieber wrote: > Error codes under DEC VAX/VMS used odd integers for > "success/information" and even integers for "warning/error" (been too > many years, I think positive integers were success/warning, negative > integers were information/error;

Re: Python Newbie

2013-02-23 Thread jmfauth
On 23 fév, 20:08, Ethan Furman wrote: > On 02/23/2013 10:44 AM, jmfauth wrote: > > [snip various stupidities] > > > jmf > > Peter, jmfauth is one of our resident trolls.  Feel free to ignore him. > > -- > ~Ethan~ Sorry, what can say? More memory and slow down! If you see a progress, I'm seeing a

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/22/2013 02:37 PM, piterrr.dolin...@gmail.com wrote: > Thanks to everyone for all the posts, some friendly some not. I read > all of them with genuine interest. I just finished reading this entire thread and I don't see any posts that are unfriendly. Perhaps some of them are calling you on y

Re: Python Newbie

2013-02-23 Thread Ethan Furman
On 02/23/2013 10:44 AM, jmfauth wrote: [snip various stupidities] jmf Peter, jmfauth is one of our resident trolls. Feel free to ignore him. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >