On Sun, 14 Feb 2010 12:08:40 pm the kids wrote:
> Hi, my name is John Paul.
>
> I was trying to define a class but I can't make it asign particular
> objects particular variables at their creation. Please help.
>
> John Paul
I don't quite follow what you mean, it is best if you can show example
On Sat, Feb 13, 2010 at 8:08 PM, the kids wrote:
> Hi, my name is John Paul.
>
> I was trying to define a class but I can't make it asign particular objects
> particular variables at their creation. Please help.
It would help to see some details of what you are trying to do. It
sounds like you w
On Sat, Feb 13, 2010 at 3:00 PM, Chris Patillo wrote:
> Thanks for your response. i did some research on json.load() and I don't
> understand how you extract the data from it. How do I get just the name and
> number from the file?
The value returned from json.load() is a Python dictionary. The
Hi, my name is John Paul.
I was trying to define a class but I can't make it asign particular objects
particular variables at their creation. Please help.
John Paul___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
On Sat, 13 Feb 2010 02:33:04 am Mac Ryan wrote:
> whenever I get stuck, I begin to write a message to the
> list, and in the process of explaining what is the intended behaviour
> and outcome of my code, I systematically find the bug by myself.
[...]
> Does anybody else experience the same?
Yes!
On Sun, 14 Feb 2010 10:58:10 am Alan Gauld wrote:
> "spir" wrote
>
> > PS: in "l>>24 & 255", the & operation is useless, since all 24
> > higher bits are already thrown away by the shift:
>
> They are not gone however there are still 32 bits in an integer so
> the top bits *should* be set to zero.
On Sat, Feb 13, 2010 at 7:59 AM, Kent Johnson wrote:
> On Fri, Feb 12, 2010 at 11:49 PM, Eduardo Vieira
> wrote:
>> Hello! I was reading the latest version of Mark Pilgrim's "Dive into
>> Python" and am confused with these example about the pluralization
>> rules. See http://diveintopython3.org/e
On Sat, 13 Feb 2010 10:51:38 am Garry Willgoose wrote:
> I want to be able to import multiple instances of a module and call
> each by a unique name and it doesn't appear at first glance that
> either import or __import__ have what I need.
No, such a thing is not officially supported by Python.
"spir" wrote
PS: in "l>>24 & 255", the & operation is useless, since all 24 higher
bits are already thrown away by the shift:
They are not gone however there are still 32 bits in an integer so the top
bits *should* be set to zero. But glitches can occur from time to time...
It is good pract
"David Abbott" wrote
I am attempting to understand this little program that converts a
network byte order 32-bit integer to a dotted quad ip address.
def int2ip(l):
if MAX_IP < l < 0:
raise TypeError, "expected int between 0 and %d inclusive" %
MAX_IP
return '%d.%d.%d.%d' % (l
On Sat, 13 Feb 2010 23:17:27 +0100
spir wrote:
> On Sat, 13 Feb 2010 13:58:34 -0500
> David Abbott wrote:
>
> > I am attempting to understand this little program that converts a
> > network byte order 32-bit integer to a dotted quad ip address.
> >
> > #!/usr/bin/python
> > # Filename : int2ip
On Sat, 13 Feb 2010 13:58:34 -0500
David Abbott wrote:
> I am attempting to understand this little program that converts a
> network byte order 32-bit integer to a dotted quad ip address.
>
> #!/usr/bin/python
> # Filename : int2ip.py
>
> MAX_IP = 0xL
> ip = 2130706433
>
> def int2ip(l
2010/2/13 Shurui Liu (Aaron Liu) :
> Yeah, i know. I don't want somebody tell me all the answers of these
> assignment directly. I just want to know is there any error in the commands
> listed online? My teacher told us there is some, but I cannot find out. He
> said we can run them on putty.exe as
Yeah, i know. I don't want somebody tell me all the answers of these
assignment directly. I just want to know is there any error in the commands
listed online? My teacher told us there is some, but I cannot find out. He
said we can run them on putty.exe as soon as we fix the errors. I have found
so
On Sat, Feb 13, 2010 at 9:56 AM, patrice laporte wrote:
>
> Hi,
>
> Being in an exeption of my own, I want to print the name of the caller, and
> I'm looking for a way to have it.
>
> Could you tell us exactly why you want to do this? It seems sort of
strange. Also couldn't you pass the caller a
On Sat, Feb 13, 2010 at 4:08 PM, 刘书睿 wrote:
> Here are my assignment about Python, I don't know if anything is wrong. Is
> there anybody can help me?
>
> 1. assignment 9a and 9b hyperlink:
>
> http://cset.sp.utoledo.edu/cset1100py/cset1100_assign.html#simplepy
>
> 2. I don't know how to run a prog
Here are my assignment about Python, I don't know if anything is wrong. Is
there anybody can help me?
1. assignment 9a and 9b hyperlink:
http://cset.sp.utoledo.edu/cset1100py/cset1100_assign.html#simplepy
2. I don't know how to run a program in putty.exe, who knows? Cause i don't
know the relati
On Sat, 2010-02-13 at 11:32 -0800, Steve Willoughby wrote:
On Sat, 2010-02-13 at 13:45 -0600, Wayne Werner wrote:
Thanks Steve and Wayne your explanations;
HAL (helps a lot)
--
David Abbott
___
Tutor maillist - Tutor@python.org
To unsubscribe or cha
On Sat, Feb 13, 2010 at 12:58 PM, David Abbott wrote:
>
> I don't understand the l>>24 & 255.
>
> from the docs;
> Right Shift a >> b rshift(a, b)
> Bitwise And a & b and_(a, b)
>
They're binary operations...
If you're not familiar, wikipedia or google can find you many sources.
In a nutshell
2010/2/13 Kent Johnson
>
>
> >Here is a way to do it using the traceback module. Under the hood it
> >is still using implementation details contained in traceback and stack
> >frame objects but the public interface in the traceback module should
> >be stable.
>
> >import sys, traceback
>
> >def w
On Sat, Feb 13, 2010 at 01:58:34PM -0500, David Abbott wrote:
> I don't understand the l>>24 & 255.
The >> and << operators (when applied to integers) shift the
bits left or right a number of positions.
The number 5, for example, is 101 in binary, or if you
want to picture that as a 16-bit value
I am attempting to understand this little program that converts a
network byte order 32-bit integer to a dotted quad ip address.
#!/usr/bin/python
# Filename : int2ip.py
MAX_IP = 0xL
ip = 2130706433
def int2ip(l):
if MAX_IP < l < 0:
raise TypeError, "expected int between 0 an
On Sat, Feb 13, 2010 at 10:56 AM, patrice laporte wrote:
> Being in an exeption of my own, I want to print the name of the caller, and
> I'm looking for a way to have it.
>
> I've found a lot of recipe all of them using what seems to be, according to
> me, a not so good trick : all those recipe m
Thanks. Sounds like good advice. BTW, I just did some advertising on the
AstroPy NG a moment ago for your books. A query for good Py books.
On 2/13/2010 8:19 AM, ALAN GAULD wrote:
Another question on similar matters. If I write a program and "compile" it for
distribution, and a user has 2
Hi,
Being in an exeption of my own, I want to print the name of the caller, and
I'm looking for a way to have it.
I've found a lot of recipe all of them using what seems to be, according to
me, a not so good trick : all those recipe make use of
sys._getframe(1).f_code.co_name, such as in this exe
Thanks, Kent.
As of a day ago, I've moved my Python work to W7. For about the last 4
weeks, I've been using XP. Four weeks ago, I moved my mail and browser
to W7, so trying to copy out from one PC to the other is a tale of
juggling. Next time I have the deprecation and test msgs appear, I'll
> Another question on similar matters. If I write a program and "compile" it
> for
> distribution, and a user has 2.6 going to be able to execute it. I would like
> to
> the the compiled program is free of such restrictions. That is, it's an
> independent program. I would like to think that
Thanks, Alan. Some of what I've derived elsewhere almost sounds like
hearsay or is anecdotal. I'm thinking here about forums and the like.
However, I just grabbed my Core Python book, and noted than Chun
mentions a preferred sequence.
Std Lib, Third Party, App specific modules. He cites scoping
On Sat, Feb 13, 2010 at 3:18 AM, Alan Gauld wrote:
>
> "Randy Raymond" wrote
>
> By the way, Alan Gauld's emails generate an error in my system. His is
>> the only emails I have a problem with so far. At first it tried to open a
>> News service.
>>
>
> Interesting. I am using the gmane news se
On Sat, Feb 13, 2010 at 7:21 AM, Chris Patillo wrote:
> I need to read in a .json file and write out a file with some of the
> information from this file. I can't figure out how to read the .json file
> in. I know there is a module for this, but I don't understand how it works.
>
> The file I am
On Fri, Feb 12, 2010 at 10:55 PM, Wayne Watson
wrote:
> There seems to be something of a general consensus in ordering import
> statements. Something like standard library imports first. When using tools
> like matlablib or tkinter (maybe), must one keep an order among the relevant
> imports?
I d
On Fri, Feb 12, 2010 at 11:49 PM, Eduardo Vieira
wrote:
> Hello! I was reading the latest version of Mark Pilgrim's "Dive into
> Python" and am confused with these example about the pluralization
> rules. See http://diveintopython3.org/examples/plural3.py and
> http://diveintopython3.org/generator
I need to read in a .json file and write out a file with some of the
information from this file. I can't figure out how to read the .json file
in. I know there is a module for this, but I don't understand how it works.
The file I am needing to read is like below (except much much larger)
{
"Wayne Watson" wrote
There seems to be something of a general consensus in ordering import
statements. Something like standard library imports first.
I've never seen anything written down but its true I tend to do that.
But its not been a conscious thing...
tools like matlablib or tkinter
"Eduardo Vieira" wrote
def build_match_and_apply_functions(pattern, search, replace):
def matches_rule(word):
return re.search(pattern, word)
def apply_rule(word):
return re.sub(search, replace, word)
return (matches_rule, apply_rule)
patterns = \
(
('[sxz]$',
"Randy Raymond" wrote
By the way, Alan Gauld's emails generate an error in my system.
His is the only emails I have a problem with so far.
At first it tried to open a News service.
Interesting. I am using the gmane news server but I've not heard
of anyone else having problems. Is there
36 matches
Mail list logo