Hi, guys. Here is a demo program like this:
aa = 3
bb = 4
cc = 53
dd = 6
print cc
I put a breakpoint at the first line, then debug the program. After 'aa' is set
to '3', I modify '53' in the 3rd line to '34', then save the source file and
run remain codes. As expected, the output is '53'.
Does p
On Thu, May 26, 2011 at 2:36 PM, amt <0101...@gmail.com> wrote:
> First of all, hello! I want to start learning programming. I'm looking
> into becoming more than a hobbyist programmer. I searched a lot on Google on
> what programming language should I learn first and I see a lot of good words
>
On Thu, May 26, 2011 at 5:22 PM, Alan Gauld wrote:
>
> Indeed, I personally dislike Java, I think it encourages some very bad
> programming design habits, especially in the OOP area, but sadly it is the
> de facto standard... (And increasingly, so are the bad habits! :-( )
I despise it root an
"Marc Tompkins" wrote
...Java has come to dominate academia and busness applications.
Which, as Joel Spolsky has famously pointed out, is not universally
a Good
Thing:
Indeed, I personally dislike Java, I think it encourages
some very bad programming design habits, especially
in the OOP a
"Prasad, Ramit" wrote
I would like to have the docstring for function first also
contain the docstring for second because it should
support/pass any argument second contains.
You can explicitly set the docstring by assigning to __doc__:
def f():
... '''here is f's doc string '''
...
"michael scott" wrote
Alan's tutorial (alan is a very active member here)
http://www.freenetpages.co.uk/hp/alan.gauld/
Note the new site in my sig...
It has a lot of buglets fixed for v2 and importantly
has a v3 version too (albeit still under construction,
but complete enough for beginner
On Thu, May 26, 2011 at 4:37 PM, Alan Gauld wrote:
>
> "Prasad, Ramit" wrote
>
> Is C still the standard interviewing basis for the computer science basics
>> (e.g. data structures, algorithms, etc)?
>>
>
> In the UK at least it is almost universally Java nowadays.
>
> C (and C++) are still yuse
"amt" <0101...@gmail.com> wrote
1)What book should I start with? ( I have checked Python for non
programmers but there are a lot of titles there, what should I pick
first?I
was thinking about Invent your own computer games with Python.)
Tutorials are a matter of taste. Take a look at a few,
"James Reynolds" wrote
As far as the null point goes, it shouldn't be null at all once it
gets to
the point Alan pointed out. The pointer is set in (for example)
stat_avg
seq = PySequence_Fast(obj, "Expected a Sequence");
Can the function fail? If so what does it return? That was
my p
"James Reynolds" wrote
I'll look into your suggestion regarding comprehension (i'm not sure
what
that means in a programing sense, but I'm sure I'll find out!)
Its the English meaning of the word.
Studies have shown that the layout of code (indentation,
placement of braces etc) have a big e
"Prasad, Ramit" wrote
Is C still the standard interviewing basis for the computer
science basics (e.g. data structures, algorithms, etc)?
In the UK at least it is almost universally Java nowadays.
C (and C++) are still yused in industrial settings, especially
in embedded systems, but Java
> I suppose it's up to the programmer.
It is, provided the programmer is remembering that the audience
is not him/herself buty the many other programmers who will
have to read and maintain the code over the years to follow.
So if the programmer genuinely believes that one form is clearer
the
On 05/26/2011 02:45 PM, Wolf Halton wrote:
Now I am looking at how to make it have an admin function to set the
valid characters, and have a way to output the password into main()
Simple, just learn to use the 'return' statement:
[code]
def new_pass(p):
pp = int(raw_input("Enter the len
I suppose it's up to the programmer. Personally, I find something like this:
variable += something
a lot easier to read than
temp = something
variable += temp
For me, it's just another variable I have to worry about
allocating/deallocating/seeing if it's used anywhere else/accidentally using
I have a 0.2 version
[code]
def new_pass(p):
valchars = string.ascii_letters + string.digits + string.punctuation
series = list(valchars)
pp = int(raw_input("Enter the length you want your password to be:[%i] "
% (p)) or p)
# length of password chosen or default length
James Reynolds, 26.05.2011 21:34:
On Thu, May 26, 2011 at 3:07 PM, Stefan Behnel wrote:
Stefan Behnel, 26.05.2011 18:10:
James Reynolds, 26.05.2011 17:22:
As an intellectual exercise, I wanted to try my hand at writing some
extensions in C.
This is fine for en exercise, and I hope you had
I am a beginner so I can relate with you, although python is my first
programming language, it sounds as if you are coming from another language.
Either way, here are some sites I'll collected that have tutorials and are free.
Alan's tutorial (alan is a very active member here)
http://www.freene
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/26/2011 03:36 PM, amt wrote:
> First of all, hello! I want to start learning programming. I'm looking into
> becoming more than a hobbyist programmer. I searched a lot on Google on what
> programming language should I learn first and I see a lot
Hello amt,
Please find my responses below -
On Fri, May 27, 2011 at 1:06 AM, amt <0101...@gmail.com> wrote:
> First of all, hello! I want to start learning programming. I'm looking
> into becoming more than a hobbyist programmer. I searched a lot on Google on
> what programming language should
First of all, hello! I want to start learning programming. I'm looking into
becoming more than a hobbyist programmer. I searched a lot on Google on what
programming language should I learn first and I see a lot of good words
about Python so I decided to go for it but have some questions:
1)What b
On Thu, May 26, 2011 at 3:07 PM, Stefan Behnel wrote:
> Stefan Behnel, 26.05.2011 18:10:
>
> James Reynolds, 26.05.2011 17:22:
>>
>>> As an intellectual exercise, I wanted to try my hand at writing some
>>> extensions in C.
>>>
>>
>> This is fine for en exercise, and I hope you had fun doing thi
Module 1:
Def first(arg1,arg2, *args, **kwargs):
# some code that wraps around second(*args, **kwargs)
Module 2:
Def second(...):
# some code here
Function first is basically a wrapper around second. Both are generators but
first is more refined/selective about what it yields. I would l
Someone once told me I was a "kinetic learner" and it seemed to fit with my
learning habbits, I wasn't aware there is an entire branch of education
theory revolving around "learning specialties", which was interesting to
learn about.
On Thu, May 26, 2011 at 1:52 PM, Patty wrote:
>
> - Or
Thank you Rachel and Alan for the feedback.
Oddly enough, I had created an exception between the time I sent this and
your response to catch occasions when the list is empty (I will need to test
a few other things, like what if the list holds items other than strictly
numbers?)
I did utilize some
Stefan Behnel, 26.05.2011 18:10:
James Reynolds, 26.05.2011 17:22:
As an intellectual exercise, I wanted to try my hand at writing some
extensions in C.
This is fine for en exercise, and I hope you had fun doing this.
However, for real code, I suggest you use Cython instead. Your module would
Rachel-Mikel ArceJaeger, 26.05.2011 17:46:
A couple small things that will help improve memory management
Rather than avg = sumall / count; return avg; Just return sumall/count
instead. Then you don't have to waste a register or assignment
operation.
Division is expensive. Avoid it when you can
"Alan Gauld" wrote in message
news:irm3ae$vpl$1...@dough.gmane.org...
"Rachel-Mikel ArceJaeger" wrote
Consider these the ravings of an ex maintenance programmer
who spent far too much of his life deciphering other folks
"clever" C code... It wasn't clever and it wasn't working!
Alan G.
If I were interviewing for a Perl or PHP position, then yes. However, if
I just wanted to see if they knew the algorithm, I'd let them use
whatever language they were most comfortable in, provided those of us
interviewing also knew the language.
I think C++ is more common now for data structur
- Original Message -
From: "Stefan Behnel"
To:
Sent: Thursday, May 26, 2011 9:10 AM
Subject: Re: [Tutor] Python Extensions in C
James Reynolds, 26.05.2011 17:22:
As an intellectual exercise, I wanted to try my hand at writing some
extensions in C.
This is fine for en exercise, a
> When giving an interview, I ask interviewees to write samples of code.
Would you ask your code samples for a python (or XXX language) position do you
have them code it in...C or actually code it in Python (or XXX language)?
> Another favorite of mine was asking a candidate to write a piece of c
"Rachel-Mikel ArceJaeger" wrote
avg = sumall / count;
return avg;
Just return sumall/count instead.
Then you don't have to waste a register or assignment operation.
Readibility counts in C too. And premature optimisation is even
more of an evil since C is harder to read to start with
Thi
"James Reynolds" wrote
I was wondering if you all could look over my code and give some
feedback.
Here is the link for the code: http://pastebin.com/jw3ihfsN
Some style issues, the indentation is inconsistent. Also
the braces positioning is one of the worst for comprehension
(See the book C
James Reynolds, 26.05.2011 17:22:
As an intellectual exercise, I wanted to try my hand at writing some
extensions in C.
This is fine for en exercise, and I hope you had fun doing this.
However, for real code, I suggest you use Cython instead. Your module would
have been substantially simpler
A couple small things that will help improve memory management
Rather than
avg = sumall / count;
return avg;
Just return sumall/count instead. Then you don't have to waste a register or
assignment operation.
Division is expensive. Avoid it when you can.
Here,
for (a=0; a != count; a++) {
Hello All:
As an intellectual exercise, I wanted to try my hand at writing some
extensions in C.
I was wondering if you all could look over my code and give some feedback.
Here is the link for the code: http://pastebin.com/jw3ihfsN
I have zero experience coding in C (and not much more coding in
Yes it does! Thank you.
Rachel
On May 25, 2011, at 8:34 PM, Wayne Werner wrote:
> On Wed, May 25, 2011 at 10:17 PM, Rachel-Mikel ArceJaeger
> wrote:
> You asked for the traceback. All I get is this:
> -
>
> python a2.py
> File "a2.py", line 20
> titles = [title in my
Do import math first I.e type
import math
You could also do
from math import pi
Provided pi is the only function u need in the math module.
from math import *
This imports every function of the math module.
HTH
Sent from my BlackBerry wireless device from MTN
-Original Message-
From: David
"김태윤" wrote
but I can't find any document for "aubio" library
OK, I spoke too soon, I found the doc page.
http://aubio.org/documentation
It has a page on extracting pitch information wioth python.
HTH,
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
"김태윤" wrote
I am new to python
I want to detect pitch in portion of some sound
Since you specifically spell aubio with a 'b' I assume
you are trying to use the aubio library/module.
http://aubio.org/doc/index.html
This list is for helping people learn Python and any
support for third party
hello
I am new to python
I want to detect pitch in portion of some sound
there are pretty good tutorials for ctype
but I can't find any document for "aubio" library
my platform is windows xp sp3
I want to know what function are there
and how to use it
could somebody tell me how?
thanks in advanced!
40 matches
Mail list logo