Re: Python Beginner

2013-11-20 Thread Mark Lawrence
On 20/11/2013 19:33, ngangsia akumbo wrote: On Wednesday, November 20, 2013 8:21:44 PM UTC+1, Mark Lawrence wrote: On 20/11/2013 19:04, ngangsia akumbo wrote: Yes a lot, i come from a third world country. It will be a big opportunity for me and my community to study and being able to c

Re: Python Beginner

2013-11-20 Thread ngangsia akumbo
On Wednesday, November 20, 2013 8:21:44 PM UTC+1, Mark Lawrence wrote: > On 20/11/2013 19:04, ngangsia akumbo wrote: > > > Yes a lot, i come from a third world country. > > > > > > It will be a big opportunity for me and my community to study and being > > able to create programs, web apps etc

Re: Python Beginner

2013-11-20 Thread Mark Lawrence
On 20/11/2013 19:04, ngangsia akumbo wrote: Yes a lot, i come from a third world country. It will be a big opportunity for me and my community to study and being able to create programs, web apps etc which can solve a lot of problems in my country and around. Each day i go out i see at least o

Re: Python Beginner

2013-11-20 Thread Joel Goldstick
o: python-list@python.org > Subject: Re: Python Beginner > > can someone really help to give me a more details answer please. > > what can i do with python? > > > -- > https://mail.python.org/mailman/listinfo/python-list you can cook dinner with python... really.. this

Re: Python Beginner

2013-11-20 Thread ngangsia akumbo
Yes a lot, i come from a third world country. It will be a big opportunity for me and my community to study and being able to create programs, web apps etc which can solve a lot of problems in my country and around. Each day i go out i see at least one problem that technology can solve. -- ht

RE: Python Beginner

2013-11-20 Thread Hector Chapa
you are trying to accomplish by coming into programming? -Original Message- From: ngangsia akumbo [mailto:ngang...@gmail.com] Sent: Wednesday, November 20, 2013 12:35 PM To: python-list@python.org Subject: Re: Python Beginner can someone really help to give me a more details answer

Re: Python Beginner

2013-11-20 Thread ngangsia akumbo
can someone really help to give me a more details answer please. what can i do with python? -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Beginner

2013-11-18 Thread Gregory Ewing
On Monday, November 18, 2013 5:42:22 AM UTC+1, Terry Reedy wrote: On 11/17/2013 11:02 PM, ngangsia akumbo wrote: We don't even have a University that offer a full flesh computer science course The phrase you are looking for is 'full-fledged'. He might have meant "fully fleshed-out", i.e.

Re: Python Beginner

2013-11-18 Thread Mark Lawrence
On 18/11/2013 10:18, ngangsia akumbo wrote: On Saturday, November 16, 2013 11:41:31 PM UTC+1, Chris Angelico wrote: On Sun, Nov 17, 2013 at 9:25 AM, ngangsia akumbo wrote: I am called Richard m from western Africa, Cameroon. It was a pleasure for me to join this group. Hi! Welcome! s

Re: Python Beginner

2013-11-18 Thread ngangsia akumbo
On Saturday, November 16, 2013 11:41:31 PM UTC+1, Chris Angelico wrote: > On Sun, Nov 17, 2013 at 9:25 AM, ngangsia akumbo wrote: > > > I am called Richard m from western Africa, Cameroon. It was a pleasure for > > me to join this group. > > > > Hi! Welcome! > > > > > secondly, i wihs to s

Re: Python Beginner

2013-11-18 Thread ngangsia akumbo
s have to hire from abroad. > > > > > > Talking about problem in IT you can think of the most basic problem. > > > > > > Taxation, databases, accounting, simple apps for businesses , > > > tracking systems, bookkeeping, Mobil apps for city direction, et

Re: Python Beginner

2013-11-17 Thread Terry Reedy
city direction, etc, which i can't identify all being a python beginner. To find (free) business software written in Python, search at https://pypi.python.org/pypi sourceforge.net or you favorite search engine. Perhaps you can learn to use and adapt a few to solve local business problems.

Re: Python Beginner

2013-11-17 Thread ngangsia akumbo
, etc, which i can't identify all being a python beginner. We don't even have a University that offer a full flesh computer science course and most of the guys who even do it, most know it in theory and they don't have the ability to write reasonable code to solve present problem

Re: Python Beginner

2013-11-16 Thread Steven D'Aprano
Hello Richard and welcome! On Sun, 17 Nov 2013 09:41:31 +1100, Chris Angelico wrote: > On Sun, Nov 17, 2013 at 9:25 AM, ngangsia akumbo > wrote: >> I am called Richard m from western Africa, Cameroon. It was a pleasure >> for me to join this group. [...] >> i Need some advise on how, and what p

Re: Python Beginner

2013-11-16 Thread William Ray Wing
On Nov 16, 2013, at 5:25 PM, ngangsia akumbo wrote: > I am called Richard m from western Africa, Cameroon. It was a pleasure for me > to join this group. > > I have been learning python for about 4 months now and i have already > mastered alot as far as the language is concern. > > I am learn

Re: Python Beginner

2013-11-16 Thread Chris Angelico
On Sun, Nov 17, 2013 at 10:22 AM, ngangsia akumbo wrote: > I am experience in running a business. Please i will like to know how python > can make things easier as you said. Well, anything you can describe in terms of rules and procedures can be automated. But this is the art of programming; it'

Re: Python Beginner

2013-11-16 Thread ngangsia akumbo
On Saturday, November 16, 2013 11:41:31 PM UTC+1, Chris Angelico wrote: > On Sun, Nov 17, 2013 at 9:25 AM, ngangsia akumbo wrote: > > > I am called Richard m from western Africa, Cameroon. It was a pleasure for > > me to join this group. > > > > Hi! Welcome! > > > > > secondly, i wihs to s

Re: Python Beginner

2013-11-16 Thread Chris Angelico
On Sun, Nov 17, 2013 at 9:25 AM, ngangsia akumbo wrote: > I am called Richard m from western Africa, Cameroon. It was a pleasure for me > to join this group. Hi! Welcome! > secondly, i wihs to start a small company after learning how to code > > I am learning python very broadly, meaning i am n

Python Beginner

2013-11-16 Thread ngangsia akumbo
I am called Richard m from western Africa, Cameroon. It was a pleasure for me to join this group. I have been learning python for about 4 months now and i have already mastered alot as far as the language is concern. I am learning how to code, firstly because i love coding and i like to do stu

Re: Questions about "compiled" Python (beginner)

2012-01-29 Thread HoneyMonster
On Sun, 29 Jan 2012 14:01:01 -0500, Terry Reedy wrote: > On 1/29/2012 12:57 PM, HoneyMonster wrote: >> I am new to Python (Python 2.7 on Linux). Research indicates that: >> >> a) "Compiling" Python modules into intermediate bytecode marginally >> improves load time. > > The improvement is larger

Re: Questions about "compiled" Python (beginner)

2012-01-29 Thread Cousin Stanley
This short article provides some basic information about .pyc and .pyo files http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html -- Stanley C. Kitching Human Being Phoenix, Arizona -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about "compiled" Python (beginner)

2012-01-29 Thread Terry Reedy
On 1/29/2012 12:57 PM, HoneyMonster wrote: I am new to Python (Python 2.7 on Linux). Research indicates that: a) "Compiling" Python modules into intermediate bytecode marginally improves load time. The improvement is larger the larger the file. You may notice that .pyc files are only created

Questions about "compiled" Python (beginner)

2012-01-29 Thread HoneyMonster
I am new to Python (Python 2.7 on Linux). Research indicates that: a) "Compiling" Python modules into intermediate bytecode marginally improves load time. b) The Python interpreter will use an already-prepared .pyc file if one exists in the same directory as the .py. That then, is presumably w

Re: Easy questions from a python beginner

2010-08-06 Thread Albert van der Horst
In article <4c495b50$0$28634$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: >On Thu, 22 Jul 2010 21:23:05 -0700, Stephen Hansen wrote: > >> On 7/22/10 7:47 PM, wheres pythonmonks wrote: >[...] >>> The truth is that I don't intend to use these approaches in anything >>> serious. However, I've

Re: Easy questions from a python beginner

2010-07-23 Thread Steven D'Aprano
On Fri, 23 Jul 2010 09:22:16 -0700, Stephen Hansen wrote: > On 7/23/10 2:05 AM, Steven D'Aprano wrote: >> On Thu, 22 Jul 2010 21:23:05 -0700, Stephen Hansen wrote: >> >>> On 7/22/10 7:47 PM, wheres pythonmonks wrote: >> [...] The truth is that I don't intend to use these approaches in anythi

Re: Easy questions from a python beginner

2010-07-23 Thread Terry Reedy
On 7/23/2010 4:10 AM, Steven D'Aprano wrote: Using exec or friends to avoid the overhead of function calls is like pushing your car to work to avoid the overhead of having to get in and out of the car. And, of course, exec *is* a function call (explicitly in 3.x, but somewhere also in the inn

Re: Easy questions from a python beginner

2010-07-23 Thread Thomas Jollans
On 07/23/2010 07:13 PM, Thomas Jollans wrote: > On 07/23/2010 12:34 AM, wheres pythonmonks wrote: >> 2. Is there a better way to loopup by id? I'm not very familiar with >> sys.exc_info, but creating the id->name hash each time seems like >> overkill. > > I just had the most horrendous idea. Rea

Re: Easy questions from a python beginner

2010-07-23 Thread Thomas Jollans
On 07/23/2010 12:34 AM, wheres pythonmonks wrote: > 2. Is there a better way to loopup by id? I'm not very familiar with > sys.exc_info, but creating the id->name hash each time seems like > overkill. I just had the most horrendous idea. Really, looking up objects by ID, or even swapping two obj

Re: Easy questions from a python beginner

2010-07-23 Thread Stephen Hansen
On 7/23/10 2:05 AM, Steven D'Aprano wrote: > On Thu, 22 Jul 2010 21:23:05 -0700, Stephen Hansen wrote: > >> On 7/22/10 7:47 PM, wheres pythonmonks wrote: > [...] >>> The truth is that I don't intend to use these approaches in anything >>> serious. However, I've been known to do some metaprogrammi

Re: Easy questions from a python beginner

2010-07-23 Thread Dave Angel
wheres pythonmonks wrote: Funny... just spent some time with timeit: I wonder why I am passing in strings if the callback overhead is so light... More funny: it looks like inline (not passed in) lambdas can cause python to be more efficient! import random d = (['A','B'][random.randint(0,1)

Re: Easy questions from a python beginner

2010-07-23 Thread Dave Angel
Duncan Booth wrote: Consider languages where you can easily write a swap function (or any other function that updates its arguments). e.g. consider C or C#. For C your function must take pointers to the variables, so when you call swap you have to make this explicit by taking the address of

Re: Easy questions from a python beginner

2010-07-23 Thread Peter Otten
wheres pythonmonks wrote: > Funny... just spent some time with timeit: > > I wonder why I am passing in strings if the callback overhead is so > light... > > More funny: it looks like inline (not passed in) lambdas can cause > python to be more efficient! import random d = [ (['A','B'

Re: Easy questions from a python beginner

2010-07-23 Thread Duncan Booth
Steven D'Aprano wrote: > On Thu, 22 Jul 2010 22:47:11 -0400, wheres pythonmonks wrote: > >> Thanks for pointing out that swap (and my swap2) don't work everywhere >> -- is there a way to get it to work inside functions? Consider languages where you can easily write a swap function (or any other

Re: Easy questions from a python beginner

2010-07-23 Thread wheres pythonmonks
Funny... just spent some time with timeit: I wonder why I am passing in strings if the callback overhead is so light... More funny: it looks like inline (not passed in) lambdas can cause python to be more efficient! >>> import random >>> d = [ (['A','B'][random.randint(0,1)],x,random.gauss(0,1))

Re: Easy questions from a python beginner

2010-07-23 Thread Steven D'Aprano
On Thu, 22 Jul 2010 21:23:05 -0700, Stephen Hansen wrote: > On 7/22/10 7:47 PM, wheres pythonmonks wrote: [...] >> The truth is that I don't intend to use these approaches in anything >> serious. However, I've been known to do some metaprogramming from time >> to time. > > Depending on how you d

Re: Easy questions from a python beginner

2010-07-23 Thread Steven D'Aprano
On Thu, 22 Jul 2010 22:47:11 -0400, wheres pythonmonks wrote: > Thanks for pointing out that swap (and my swap2) don't work everywhere > -- is there a way to get it to work inside functions? Not in CPython. In IronPython or Jython, maybe, I don't know enough about them. But even if you got it to

Re: Easy questions from a python beginner

2010-07-22 Thread Carl Banks
On Jul 22, 7:47 pm, wheres pythonmonks wrote: > Thanks for pointing out that swap (and my swap2) don't work everywhere > -- is there a way to get it to work inside functions? Impossible without hacking the interpreter. > "No offense, but you seem like you're still tying to be a hacker.  If > th

Re: Easy questions from a python beginner

2010-07-22 Thread Stephen Hansen
On 7/22/10 7:47 PM, wheres pythonmonks wrote: > Thanks for pointing out that swap (and my swap2) don't work everywhere > -- is there a way to get it to work inside functions? > > "No offense, but you seem like you're still tying to be a hacker. If > that's what you want, fine, but generally speak

Re: Easy questions from a python beginner

2010-07-22 Thread Steven D'Aprano
On Thu, 22 Jul 2010 18:34:11 -0400, wheres pythonmonks wrote: > Okay -- so I promised that I would try the namespace mangling approach, > and here's what I have come up with: > > Approach #1: Pass in the variables to be swapped as strings. (boring) Boring and slow and stupid. It makes an inter

Re: Easy questions from a python beginner

2010-07-22 Thread wheres pythonmonks
Thanks for pointing out that swap (and my swap2) don't work everywhere -- is there a way to get it to work inside functions? "No offense, but you seem like you're still tying to be a hacker. If that's what you want, fine, but generally speaking (and particularly for Python), you are going to have

Re: Easy questions from a python beginner

2010-07-22 Thread Carl Banks
On Jul 22, 3:34 pm, wheres pythonmonks wrote: > Okay -- so I promised that I would try the namespace mangling > approach, and here's what I have come up with: > > Approach #1:  Pass in the variables to be swapped as strings.  (boring) > > >>> import sys > >>> def swap(n1,n2): > > ...  try: > ...  

Re: Easy questions from a python beginner

2010-07-22 Thread Stephen Hansen
On 7/22/10 3:34 PM, wheres pythonmonks wrote: > Now, I want to make the above codes more "Pythonic" -- is there a way to: > > 1. Get the function's arguments from the perspective of the caller? > > def f(x): > print "caller's view of x = %s" % callersview(x) > > Then, f(1+2+3) would yield: >

Re: Easy questions from a python beginner

2010-07-22 Thread wheres pythonmonks
Okay -- so I promised that I would try the namespace mangling approach, and here's what I have come up with: Approach #1: Pass in the variables to be swapped as strings. (boring) >>> import sys >>> def swap(n1,n2): ... try: ... raise RuntimeException() ... except: ... e,b,t = sys.exc_info

Re: Easy questions from a python beginner

2010-07-14 Thread r
On Jul 14, 1:24 pm, Grant Edwards wrote: > As of a few minutes ago, this thread had 48 postings on my news > server. > > To paraphrase somebody famous: > >     There are no such things as easy questions.  There are, however, >     easy answers.  And they're wrong.         Ha! This is the very re

Re: Easy questions from a python beginner

2010-07-14 Thread Grant Edwards
On 2010-07-11, wheres pythonmonks wrote: > I have some easy issues (Python 2.6) As of a few minutes ago, this thread had 48 postings on my news server. To paraphrase somebody famous: There are no such things as easy questions. There are, however, easy answers. And they're wrong. --

Re: Easy questions from a python beginner

2010-07-14 Thread John Posner
On 7/14/2010 12:06 PM, Ethan Furman wrote: ... Have you tried this? --> def foo(): ... print locals() ... blah = 'interesting' ... print locals() ... --> foo() {} {'blah': 'interesting'} As can be clearly seen, blah does not exist before the assignment -- the *name* blah has not been *bound* t

Re: Easy questions from a python beginner

2010-07-14 Thread Steven D'Aprano
On Wed, 14 Jul 2010 09:06:34 -0700, Ethan Furman wrote: > Alf P. Steinbach /Usenet wrote: [...] >> Clearly when the exception is raised, referring to the variable, the >> variable exists. > > You are the only one spouting nonsense. Have you tried this? > > --> def foo(): > ... print locals()

Re: Easy questions from a python beginner

2010-07-14 Thread Ethan Furman
Alf P. Steinbach /Usenet wrote: * MRAB, on 12.07.2010 00:37: Alf P. Steinbach /Usenet wrote: Of course there are variables, that's why the docs call them variables. In Java a variable is declared and exists even before the first assignment to it. In Python a 'variable' isn't declared and won

Re: Easy questions from a python beginner

2010-07-12 Thread Rami Chowdhury
On Jul 12, 2010, at 15:55 , Alf P. Steinbach /Usenet wrote: > * Rami Chowdhury, on 13.07.2010 00:14: >> Perhaps I'm misunderstanding, but ... >> >> On Jul 12, 2010, at 13:57 , Alf P. Steinbach /Usenet wrote: >>> >>> Existence of a variable means, among other things, that >>> >>> * You can use

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Steven D'Aprano, on 13.07.2010 01:34: On Mon, 12 Jul 2010 20:28:49 +0200, Alf P. Steinbach /Usenet wrote: As I see it it doesn't matter whether the implementation is CPython call frame slots or that mechanism called something else or a different mechanism called the same or a different mechan

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Steven D'Aprano, on 13.07.2010 01:50: On Mon, 12 Jul 2010 22:57:10 +0200, Alf P. Steinbach /Usenet wrote: Existence of a variable means, among other things, that * You can use the value, with guaranteed effect (either unassigned exception or you get a proper value): in particul

Re: Easy questions from a python beginner

2010-07-12 Thread Steven D'Aprano
On Mon, 12 Jul 2010 22:57:10 +0200, Alf P. Steinbach /Usenet wrote: > Existence of a variable means, among other things, that > >* You can use the value, with guaranteed effect (either unassigned >exception > or you get a proper value): in particular, you won't be accessing a >

Re: Easy questions from a python beginner

2010-07-12 Thread Steven D'Aprano
On Mon, 12 Jul 2010 20:28:49 +0200, Alf P. Steinbach /Usenet wrote: > As I see it it doesn't matter whether the implementation is CPython call > frame slots or that mechanism called something else or a different > mechanism called the same or a different mechanism called something > different; wha

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Rami Chowdhury, on 13.07.2010 00:14: Perhaps I'm misunderstanding, but ... On Jul 12, 2010, at 13:57 , Alf P. Steinbach /Usenet wrote: Existence of a variable means, among other things, that * You can use the value, with guaranteed effect (either unassigned exception or you get a prop

Re: Easy questions from a python beginner

2010-07-12 Thread Rami Chowdhury
Perhaps I'm misunderstanding, but ... On Jul 12, 2010, at 13:57 , Alf P. Steinbach /Usenet wrote: > > Existence of a variable means, among other things, that > > * You can use the value, with guaranteed effect (either unassigned exception >or you get a proper value) Surely by that definiti

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Rhodri James, on 12.07.2010 22:19: On Mon, 12 Jul 2010 13:56:38 +0100, bart.c wrote: "Steven D'Aprano" wrote in message news:4c3aedd5$0$28647$c3e8...@news.astraweb.com... On Mon, 12 Jul 2010 09:48:04 +0100, bart.c wrote: That's interesting. So in Python, you can't tell what local variabl

Re: Easy questions from a python beginner

2010-07-12 Thread Terry Reedy
On 7/12/2010 4:48 AM, bart.c wrote: >>> def foo(): print("Before:", locals()) x = 0 print("After:", locals()) >>> foo() Before: {} After: {'x': 0} That's interesting. So in Python, you can't tell what local variables a function has just by looking at it's code: You are being fooled by the

Re: Easy questions from a python beginner

2010-07-12 Thread Alister Ware
On Sun, 11 Jul 2010 18:17:49 +, Duncan Booth wrote: > wheres pythonmonks wrote: > >> I'm an old Perl-hacker, and am trying to Dive in Python. I have some >> easy issues (Python 2.6) >> which probably can be answered in two seconds: without going into details on how to do these things in py

Re: Easy questions from a python beginner

2010-07-12 Thread Rhodri James
On Mon, 12 Jul 2010 13:56:38 +0100, bart.c wrote: "Steven D'Aprano" wrote in message news:4c3aedd5$0$28647$c3e8...@news.astraweb.com... On Mon, 12 Jul 2010 09:48:04 +0100, bart.c wrote: That's interesting. So in Python, you can't tell what local variables a function has just by looking at

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* Steven D'Aprano, on 12.07.2010 04:39: On Mon, 12 Jul 2010 03:12:10 +0200, Alf P. Steinbach /Usenet wrote: * MRAB, on 12.07.2010 00:37: [...] In Java a variable is declared and exists even before the first assignment to it. In Python a 'variable' isn't declared and won't exist until the firs

Re: Easy questions from a python beginner

2010-07-12 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 12.07.2010 16:59: On 12 Jul, 07:51, "Alf P. Steinbach /Usenet" wrote: We're talking about defining a 'swap' routine that works on variables. I did not miss the point. One cannot make a swap function that rebinds its arguments in the calling stack frame. But a swap function

Re: Easy questions from a python beginner

2010-07-12 Thread sturlamolden
On 12 Jul, 07:51, "Alf P. Steinbach /Usenet" wrote: > We're talking about defining a 'swap' routine that works on variables. I did not miss the point. One cannot make a swap function that rebinds its arguments in the calling stack frame. But a swap function can swap values, given that the type i

Re: Easy questions from a python beginner

2010-07-12 Thread Grant Edwards
On 2010-07-11, Thomas Jollans wrote: > On 07/11/2010 08:45 PM, wheres pythonmonks wrote: >> On #3: Sorry this is confusing, but I was browsing some struct array >> code from numpy, in which one of the columns contained strings, but >> the type information, supplied in numpy.array's dtype argument

Re: Easy questions from a python beginner

2010-07-12 Thread bart.c
"Steven D'Aprano" wrote in message news:4c3aedd5$0$28647$c3e8...@news.astraweb.com... On Mon, 12 Jul 2010 09:48:04 +0100, bart.c wrote: That's interesting. So in Python, you can't tell what local variables a function has just by looking at it's code: def foo(day): if day=="Tuesday": x=0

Re: Easy questions from a python beginner

2010-07-12 Thread Steven D'Aprano
On Mon, 12 Jul 2010 09:48:04 +0100, bart.c wrote: > That's interesting. So in Python, you can't tell what local variables a > function has just by looking at it's code: In the presence of "exec", you can't really tell *anything*. >>> def f(s): ... exec s ... print locals() ... >>> f("x =

Re: Easy questions from a python beginner

2010-07-12 Thread Duncan Booth
"Alf P. Steinbach /Usenet" wrote: > * sturlamolden, on 12.07.2010 06:52: >> On 11 Jul, 21:37, "Alf P. Steinbach /Usenet"> +use...@gmail.com> wrote: >> >>> Oh, I wouldn't give that advice. It's meaningless mumbo-jumbo. >>> Python works like Java in this respect, that's all; neither Java nor >>> P

Re: Easy questions from a python beginner

2010-07-12 Thread bart.c
"MRAB" wrote in message news:mailman.591.1278900548.1673.python-l...@python.org... Alf P. Steinbach /Usenet wrote: def foo(): print( blah ) blah = "this is both an assignment and a declaration causing it to exist" foo() Clearly when the exception is raised, referring to the

Re: Easy questions from a python beginner

2010-07-11 Thread Terry Reedy
On 7/11/2010 1:48 PM, wheres pythonmonks wrote: 2. How can I write a function, "def swap(x,y):..." so that "x = 3; y = 7; swap(x,y);" given x=7,y=3?? (I want to use Perl's Ref "\" operator, or C's&). (And if I cannot do this [other than creating an Int class], is this behavior limited to string

Re: Easy questions from a python beginner

2010-07-11 Thread Steven D'Aprano
On Sun, 11 Jul 2010 21:52:17 -0700, sturlamolden wrote: > On 11 Jul, 21:37, "Alf P. Steinbach /Usenet" +use...@gmail.com> wrote: > >> Oh, I wouldn't give that advice. It's meaningless mumbo-jumbo. Python >> works like Java in this respect, that's all; neither Java nor Python >> support 'swap'. >

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 12.07.2010 06:52: On 11 Jul, 21:37, "Alf P. Steinbach /Usenet" wrote: Oh, I wouldn't give that advice. It's meaningless mumbo-jumbo. Python works like Java in this respect, that's all; neither Java nor Python support 'swap'. x,y = y,x We're talking about defining a 'swa

Re: Easy questions from a python beginner

2010-07-11 Thread Stephen Hansen
On 7/11/10 7:25 PM, Alf P. Steinbach /Usenet wrote: > The alleged facts etc. you're referring are just that, alleged, by you. Two people come together and have a debate. Both present arguments. Both present cases. In the end, they are still in disagreement. You declare us, "religious", and theref

Re: Easy questions from a python beginner

2010-07-11 Thread sturlamolden
On 11 Jul, 21:37, "Alf P. Steinbach /Usenet" wrote: > Oh, I wouldn't give that advice. It's meaningless mumbo-jumbo. Python works > like > Java in this respect, that's all; neither Java nor Python support 'swap'. x,y = y,x -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy questions from a python beginner

2010-07-11 Thread geremy condra
On Sun, Jul 11, 2010 at 10:39 PM, Steven D'Aprano wrote: > On Mon, 12 Jul 2010 03:12:10 +0200, Alf P. Steinbach /Usenet wrote: > >> * MRAB, on 12.07.2010 00:37: > [...] >>> In Java a variable is declared and exists even before the first >>> assignment to it. In Python a 'variable' isn't declared a

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* MRAB, on 12.07.2010 04:09: Alf P. Steinbach /Usenet wrote: * MRAB, on 12.07.2010 00:37: Alf P. Steinbach /Usenet wrote: * Stephen Hansen, on 11.07.2010 21:00: On 7/11/10 11:45 AM, wheres pythonmonks wrote: Follow-up: Is there a way to define compile-time constants in python and have the by

Re: Easy questions from a python beginner

2010-07-11 Thread Steven D'Aprano
On Mon, 12 Jul 2010 03:12:10 +0200, Alf P. Steinbach /Usenet wrote: > * MRAB, on 12.07.2010 00:37: [...] >> In Java a variable is declared and exists even before the first >> assignment to it. In Python a 'variable' isn't declared and won't exist >> until the first 'assignment' to it. > > That is

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* Stephen Hansen, on 12.07.2010 04:02: On 7/11/10 6:12 PM, Alf P. Steinbach /Usenet wrote: However, as stated up-thread, I do not expect facts, logic or general reasoning to have any effect whatsoever on such hard-core religious beliefs. Grow up, and/or get a grip, and/or get over yourself. E

Re: Easy questions from a python beginner

2010-07-11 Thread MRAB
Alf P. Steinbach /Usenet wrote: * MRAB, on 12.07.2010 00:37: Alf P. Steinbach /Usenet wrote: * Stephen Hansen, on 11.07.2010 21:00: On 7/11/10 11:45 AM, wheres pythonmonks wrote: Follow-up: Is there a way to define compile-time constants in python and have the bytecode compiler optimize away

Re: Easy questions from a python beginner

2010-07-11 Thread Stephen Hansen
On 7/11/10 6:12 PM, Alf P. Steinbach /Usenet wrote: > However, as stated up-thread, I do not expect facts, logic or general > reasoning to have any effect whatsoever on such hard-core religious > beliefs. Grow up, and/or get a grip, and/or get over yourself. Everyone who disagreed with you, disa

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* MRAB, on 12.07.2010 00:37: Alf P. Steinbach /Usenet wrote: * Stephen Hansen, on 11.07.2010 21:00: On 7/11/10 11:45 AM, wheres pythonmonks wrote: Follow-up: Is there a way to define compile-time constants in python and have the bytecode compiler optimize away expressions like: if is_my_extra

Re: Easy questions from a python beginner

2010-07-11 Thread MRAB
Alf P. Steinbach /Usenet wrote: * Stephen Hansen, on 11.07.2010 21:00: On 7/11/10 11:45 AM, wheres pythonmonks wrote: Follow-up: Is there a way to define compile-time constants in python and have the bytecode compiler optimize away expressions like: if is_my_extra_debugging_on: print ... when

Re: Easy questions from a python beginner

2010-07-11 Thread News123
Chris Rebert wrote: > On Sun, Jul 11, 2010 at 2:08 PM, News123 wrote: >> Carl Banks wrote: >>> On Jul 11, 10:48 am, wheres pythonmonks >>> wrote: I'm an old Perl-hacker, and am trying to Dive in Python. >>> Welcome to the light. >>> >>> I have some easy issues (Python 2.6) wh

Re: Easy questions from a python beginner

2010-07-11 Thread Chris Rebert
On Sun, Jul 11, 2010 at 2:08 PM, News123 wrote: > Carl Banks wrote: >> On Jul 11, 10:48 am, wheres pythonmonks >> wrote: >>> I'm an old Perl-hacker, and am trying to Dive in Python. >> >> Welcome to the light. >> >> >>>  I have some >>> easy issues (Python 2.6) >>> which probably can be answered

Re: Easy questions from a python beginner

2010-07-11 Thread News123
Carl Banks wrote: > On Jul 11, 10:48 am, wheres pythonmonks > wrote: >> I'm an old Perl-hacker, and am trying to Dive in Python. > > Welcome to the light. > > >> I have some >> easy issues (Python 2.6) >> which probably can be answered in two seconds: >> >> 1. Why is it that I cannot use prin

Re: Easy questions from a python beginner

2010-07-11 Thread Carl Banks
On Jul 11, 11:45 am, wheres pythonmonks wrote: > On #4:  So there are some hacks, but not something as easy as "import > unimportable" or an @noexport decorator.  The underscore works, so > does "del". Careful. If you have a module that looks like this: def foo(): bar() def bar(): pri

Re: Easy questions from a python beginner

2010-07-11 Thread Carl Banks
On Jul 11, 10:48 am, wheres pythonmonks wrote: > I'm an old Perl-hacker, and am trying to Dive in Python. Welcome to the light. > I have some > easy issues (Python 2.6) > which probably can be answered in two seconds: > > 1.  Why is it that I cannot use print in booleans??  e.g.: > > >>> True a

Re: Easy questions from a python beginner

2010-07-11 Thread Alf P. Steinbach /Usenet
* Stephen Hansen, on 11.07.2010 21:00: On 7/11/10 11:45 AM, wheres pythonmonks wrote: Follow-up: Is there a way to define compile-time constants in python and have the bytecode compiler optimize away expressions like: if is_my_extra_debugging_on: print ... when "is_my_extra_debugging" is set t

Re: Easy questions from a python beginner

2010-07-11 Thread Thomas Jollans
On 07/11/2010 08:45 PM, wheres pythonmonks wrote: > Thanks for your answers -- it is much appreciated. > > On #1: I had very often used chained logic with both logging and > functional purposes in Perl, and wanted to duplicate this in Python. > "It reads like english" Using the print_ print wrap

Re: Easy questions from a python beginner

2010-07-11 Thread Stephen Hansen
On 7/11/10 11:45 AM, wheres pythonmonks wrote: > Follow-up: > Is there a way to define compile-time constants in python and have the > bytecode compiler optimize away expressions like: > > if is_my_extra_debugging_on: print ... > > when "is_my_extra_debugging" is set to false? I'd like to pay no

Re: Easy questions from a python beginner

2010-07-11 Thread wheres pythonmonks
Thanks for your answers -- it is much appreciated. On #1: I had very often used chained logic with both logging and functional purposes in Perl, and wanted to duplicate this in Python. "It reads like english" Using the print_ print wrapper works for me. Follow-up: Is there a way to define compi

Re: Easy questions from a python beginner

2010-07-11 Thread Stephen Hansen
On 7/11/10 10:48 AM, wheres pythonmonks wrote: > I'm an old Perl-hacker, and am trying to Dive in Python. I have some > easy issues (Python 2.6) > which probably can be answered in two seconds: > > 1. Why is it that I cannot use print in booleans?? e.g.: True and print "It is true!" Becau

Re: Easy questions from a python beginner

2010-07-11 Thread Duncan Booth
wheres pythonmonks wrote: > I'm an old Perl-hacker, and am trying to Dive in Python. I have some > easy issues (Python 2.6) > which probably can be answered in two seconds: > > 1.  Why is it that I cannot use print in booleans??  e.g.: True and print "It is true!" > > I found a nice work-

Re: Easy questions from a python beginner

2010-07-11 Thread Michael Torrie
On 07/11/2010 11:48 AM, wheres pythonmonks wrote: > I'm an old Perl-hacker, and am trying to Dive in Python. I have some > easy issues (Python 2.6) > which probably can be answered in two seconds: > > 1. Why is it that I cannot use print in booleans?? e.g.: True and print "It is true!" Th

Re: Easy questions from a python beginner

2010-07-11 Thread Thomas Jollans
On 07/11/2010 07:48 PM, wheres pythonmonks wrote: > I'm an old Perl-hacker, and am trying to Dive in Python. I have some > easy issues (Python 2.6) > which probably can be answered in two seconds: > > 1. Why is it that I cannot use print in booleans?? e.g.: True and print "It is true!" pr

Easy questions from a python beginner

2010-07-11 Thread wheres pythonmonks
I'm an old Perl-hacker, and am trying to Dive in Python. I have some easy issues (Python 2.6) which probably can be answered in two seconds: 1.  Why is it that I cannot use print in booleans??  e.g.: >>> True and print "It is true!" I found a nice work-around using eval(compile(.,"","exec"))

Re: Python beginner, unicode encode/decode Q

2008-07-14 Thread MRAB
On Jul 14, 1:51 pm, anonymous <[EMAIL PROTECTED]> wrote: > 1 Objective to write little programs to help me learn German.  See code > after numbered comments. //Thanks in advance for any direction or > suggestions. > > tk > > 2  Want keyboard answer input, for example:   > > answer_str  = raw_input(

Python beginner, unicode encode/decode Q

2008-07-14 Thread anonymous
1 Objective to write little programs to help me learn German. See code after numbered comments. //Thanks in advance for any direction or suggestions. tk 2 Want keyboard answer input, for example: answer_str = raw_input(' Enter answer > ') Herr Üü [ I keyboard in the following characters

Re: python beginner

2008-07-07 Thread Ken Starks
cna wrote: Hi all and one, how may i learn python. is there any other website except python.org For several video series, follow the link from python.org to the ShowMeDo site. http://www.python.org/doc/av/5minutes/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python beginner

2008-07-07 Thread A.T.Hofkamp
On 2008-07-07, cna <[EMAIL PROTECTED]> wrote: > Hi all and one, > how may i learn python. is there any other website except python.org Yes, there are several millions web-sites, all across the world. They cover every possible topic you may and may not imagine. If you mean a website that tries to

python beginner

2008-07-07 Thread cna
Hi all and one, how may i learn python. is there any other website except python.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Beginner needs help with for loop

2008-02-10 Thread John Machin
On Feb 10, 8:26 pm, Chris <[EMAIL PROTECTED]> wrote: > On Feb 10, 8:06 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > > > Hi, I'm trying to write a for loop in place of the string > > method .replace() to replace a character within a string if it's > > found. > > > So far, I've got > >

  1   2   >