Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #60219 > unrolled thread

Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

Started byBharath Kummar <bathubharath94@gmail.com>
First post2013-11-22 18:22 +0530
Last post2013-11-27 14:00 +0000
Articles 20 on this page of 83 — 31 participants

Back to article view | Back to comp.lang.python


Contents

  Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Bharath Kummar <bathubharath94@gmail.com> - 2013-11-22 18:22 +0530
    Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Roy Smith <roy@panix.com> - 2013-11-22 08:56 -0500
    Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-22 14:12 +0000
      Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Grant Edwards <invalid@invalid.invalid> - 2013-11-22 15:08 +0000
    Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! rusi <rustompmody@gmail.com> - 2013-11-22 06:13 -0800
      Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Ian Kelly <ian.g.kelly@gmail.com> - 2013-11-22 08:10 -0700
      Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Ned Batchelder <ned@nedbatchelder.com> - 2013-11-22 07:18 -0800
    Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-23 01:55 +0000
      Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-23 02:18 +0000
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-22 22:47 -0500
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Ian Kelly <ian.g.kelly@gmail.com> - 2013-11-22 23:42 -0700
          Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-24 12:31 +1300
          Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-24 12:35 +1300
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! William Ray Wing <wrw@mac.com> - 2013-11-23 09:00 -0500
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-23 14:18 +0000
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-23 10:44 -0500
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Tim Chase <python.list@tim.thechases.com> - 2013-11-23 10:35 -0600
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Steve Simmons <square.steve@gmail.com> - 2013-11-23 17:34 +0100
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Chris Angelico <rosuav@gmail.com> - 2013-11-24 03:35 +1100
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Steve Simmons <square.steve@gmail.com> - 2013-11-23 17:43 +0100
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-23 19:40 +0000
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-23 14:00 -0800
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-23 15:06 -0800
          Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Tim Chase <python.list@tim.thechases.com> - 2013-11-23 17:22 -0600
          Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Chris Angelico <rosuav@gmail.com> - 2013-11-24 10:30 +1100
          Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-24 01:38 +0000
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Devin Jeanpierre <jeanpierreda@gmail.com> - 2013-11-23 23:32 -0800
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Chris Angelico <rosuav@gmail.com> - 2013-11-24 18:49 +1100
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! xDog Walker <thudfoo@gmail.com> - 2013-11-24 08:11 -0800
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-25 11:32 -0800
              Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Ned Batchelder <ned@nedbatchelder.com> - 2013-11-25 12:10 -0800
                Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-26 12:12 +1300
                  Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Larry Martell <larry.martell@gmail.com> - 2013-11-25 18:27 -0500
                Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-25 19:33 -0800
                  Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Ned Batchelder <ned@nedbatchelder.com> - 2013-11-26 03:40 -0800
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Grant Edwards <invalid@invalid.invalid> - 2013-11-25 16:23 +0000
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-11-25 20:53 +0100
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Joel Goldstick <joel.goldstick@gmail.com> - 2013-11-25 15:05 -0500
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Ethan Furman <ethan@stoneleaf.us> - 2013-11-25 12:00 -0800
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-11-26 08:32 +0100
        Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-11-26 08:47 +0100
          Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Roy Smith <roy@panix.com> - 2013-11-26 09:37 -0500
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Chris Angelico <rosuav@gmail.com> - 2013-11-27 01:52 +1100
              Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Alister <alister.ware@ntlworld.com> - 2013-11-26 15:31 +0000
                Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Gene Heskett <gheskett@wdtv.com> - 2013-11-26 10:51 -0500
              Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-26 17:26 -0800
                Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Ned Batchelder <ned@nedbatchelder.com> - 2013-11-26 21:11 -0500
                  Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-26 20:24 -0800
                    Still off topic. Deal with it. [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !] Steven D'Aprano <steve@pearwood.info> - 2013-11-27 06:56 +0000
                      Re: Still off topic. Deal with it. [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !] Chris Angelico <rosuav@gmail.com> - 2013-11-27 18:06 +1100
                      Re: Still off topic. Deal with it. [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !] Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-11-27 11:47 +0200
                    Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Ned Batchelder <ned@nedbatchelder.com> - 2013-11-27 05:32 -0500
                Completely and utterly Off Topic [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !] Steven D'Aprano <steve@pearwood.info> - 2013-11-27 06:48 +0000
                  Re: Completely and utterly Off Topic [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !] Chris Angelico <rosuav@gmail.com> - 2013-11-27 18:02 +1100
                  Re: Completely and utterly Off Topic [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !] rusi <rustompmody@gmail.com> - 2013-11-27 01:47 -0800
                    Re: Completely and utterly Off Topic [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !] Chris Angelico <rosuav@gmail.com> - 2013-11-27 20:57 +1100
                  Re: Completely and utterly Off Topic [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-27 10:00 +0000
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-11-26 17:57 +0100
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Tim Delaney <timothy.c.delaney@gmail.com> - 2013-11-27 08:42 +1100
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-11-27 09:16 +0100
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Chris Angelico <rosuav@gmail.com> - 2013-11-27 19:19 +1100
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-11-27 09:31 +0100
              Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Rotwang <sg552@hotmail.co.uk> - 2013-11-27 13:36 +0000
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Chris Angelico <rosuav@gmail.com> - 2013-11-27 19:36 +1100
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-11-27 10:12 +0100
              Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! rusi <rustompmody@gmail.com> - 2013-11-27 01:32 -0800
                Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! rusi <rustompmody@gmail.com> - 2013-11-27 01:36 -0800
                Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Paul Rudin <paul.nospam@rudin.co.uk> - 2013-11-27 10:31 +0000
                  Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Larry Martell <larry.martell@gmail.com> - 2013-11-27 09:09 -0500
                    Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! rusi <rustompmody@gmail.com> - 2013-11-27 06:37 -0800
                    Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-27 14:45 +0000
                Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Gene Heskett <gheskett@wdtv.com> - 2013-11-27 08:18 -0500
                Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Ned Batchelder <ned@nedbatchelder.com> - 2013-11-27 10:25 -0500
                Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Tim Chase <python.list@tim.thechases.com> - 2013-11-27 10:25 -0600
                  Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! rusi <rustompmody@gmail.com> - 2013-11-27 09:15 -0800
              Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! alex23 <wuwei23@gmail.com> - 2013-11-28 10:58 +1000
                Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Roy Smith <roy@panix.com> - 2013-11-27 20:08 -0500
                  Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Tim Chase <python.list@tim.thechases.com> - 2013-11-27 19:24 -0600
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-27 10:06 +0000
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Robert Kern <robert.kern@gmail.com> - 2013-11-27 12:51 +0000
            Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Robert Kern <robert.kern@gmail.com> - 2013-11-27 12:57 +0000
              Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! rusi <rustompmody@gmail.com> - 2013-11-27 05:29 -0800
                Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP ! Robert Kern <robert.kern@gmail.com> - 2013-11-27 14:00 +0000

Page 1 of 5  [1] 2 3 4 5  Next page →


#60219 — Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

FromBharath Kummar <bathubharath94@gmail.com>
Date2013-11-22 18:22 +0530
SubjectGot a Doubt ! Wanting for your Help ! Plz make it ASAP !
Message-ID<mailman.3038.1385125611.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

Hello Sir/Mam,

Could you please help me with my current research ?  Am implementing the
concept in python language.
My doubts are :
1)  Is it possible to Retrieve the address of a variable in python ?
2)  Is it possible to Delete the Address of the Variable and create a new
dynamic address inside the compiler/interpreter itself ?
3)  Is it easy to find the Binary equivalence of a given Alphanumeric
String ?
4)  Is it possible to count the number of 1's in the Binary equivalence ?

Could you PLEASE provide me with the codes (codes only for the asked
queries) ?
Your reply counts a lot for me and my research !  I love to explore more in
python.

Awaiting for your Response (Please reply ASAP).

Best,
Bharath
(+91 9025338332)

[toc] | [next] | [standalone]


#60222

FromRoy Smith <roy@panix.com>
Date2013-11-22 08:56 -0500
Message-ID<roy-6DC29A.08562122112013@news.panix.com>
In reply to#60219
In article <mailman.3038.1385125611.18130.python-list@python.org>,
 Bharath Kummar <bathubharath94@gmail.com> wrote:
 
> Could you please help me with my current research ?  Am implementing the
> concept in python language.
> My doubts are :

[Note to readers of American/British English; Indian English uses 
"doubt" the same way we would use "question"]

> 1)  Is it possible to Retrieve the address of a variable in python ?

No.  One of the fundamental concepts of Python is that it completely 
hides the physical memory.  Sure, at some point, when you write

x = 42

it allocates some piece of memory and puts the integer 42 into it, but 
all those details are hidden from you (and are implementation specific).


> 3)  Is it easy to find the Binary equivalence of a given Alphanumeric
> String ?

I think what you're talking about is the ord() function.  Given a single 
character (i.e. a string of length 1), it returns the unicode value for 
that character.  Thus:

>>> ord('X')
88

You could iterate over the characters in a string to find that for each 
one:

>>> [ord(c) for c in "My string"]
[77, 121, 32, 115, 116, 114, 105, 110, 103]


> 4)  Is it possible to count the number of 1's in the Binary equivalence ?

This is starting to sound like a homework problem, or possibly an 
interview question :-)

[toc] | [prev] | [next] | [standalone]


#60223

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-11-22 14:12 +0000
Message-ID<528f6648$0$29992$c3e8da3$5496439d@news.astraweb.com>
In reply to#60219
On Fri, 22 Nov 2013 18:22:29 +0530, Bharath Kummar wrote:

> 1)  Is it possible to Retrieve the address of a variable in python ? 

No. Variables in Python are not at fixed addresses, like in Pascal or C, 
they are names in a namespace.

You can read this post for some more information about the difference 
between C variables and Python variables, and calling conventions across 
different languages:

https://mail.python.org/pipermail/tutor/2010-December/080505.html

It's a long post, but to summarise the part about variables:

In languages like Pascal or C, the compiler keeps a table mapping 
variable names to fixed memory addresses, like this:

Variable  Address
========  =======
x         10234
y         10238
z         10242

The command "x = 42" stores the value 42 into memory address 10234. If 
you ask the compiler for the address of x, it can say 10234. That's how 
variables work in languages like Pascal, C, Fortran, and similar.

With the Pascal or C style variable, the variable address exists even 
before you give it a value.

But languages like Python don't work that way. There is no table of 
variable:address available to the compiler, and variables don't have an 
address. Python's variables are *name bindings*, not fixed memory 
addresses. The Python runtime keeps a global dictionary which maps names 
to their values:

{'x': <integer object 42>,
 'y': <string object 'hello world'>,
 'z': <list object [1,2,3]>,
}

The general name for this is "namespace". In Python you can access the 
global namespace with the globals() function, and a read-only copy of the 
local namespace with the locals() function.

Entries in the namespace cannot be blank. So names don't exist before 
they are bound to a value.


> 2) 
> Is it possible to Delete the Address of the Variable and create a new
> dynamic address inside the compiler/interpreter itself ? 

I don't understand this question.

Since variables don't have addresses, you can't delete what doesn't exist.


> 3)  Is it easy
> to find the Binary equivalence of a given Alphanumeric String ?

Which binary equivalence are you referring to? Again, I don't understand 
your question. I can do this:

py> astring = "1234"
py> int(astring).to_bytes(4, 'big')
b'\x00\x00\x04\xd2'
py> int(astring).to_bytes(4, 'little')
b'\xd2\x04\x00\x00'


Or I can do this:

py> astring = "Alpha1234 δθЖ∞"
py> astring.encode('utf-8')
b'Alpha1234 \xce\xb4\xce\xb8\xd0\x96\xe2\x88\x9e'


Or I can do this:

py> import binascii
py> binascii.hexlify(b'Hello World!')
b'48656c6c6f20576f726c6421'


And many other string -> binary equivalences. Which ones did you have in 
mind?


> 4)  Is it possible to count the number of 1's in the Binary equivalence
> ?

Of course. First decide which binary equivalence you want, then decide 
what you mean by "count the number of 1s" (do you mean the byte with 
value 1, or the ASCII code for 1, or the bit 1?), then count them.


> Could you PLEASE provide me with the codes (codes only for the asked
> queries) ?

If you explain your question in more detail, we can give more detailed 
answers.



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#60232

FromGrant Edwards <invalid@invalid.invalid>
Date2013-11-22 15:08 +0000
Message-ID<l6ns0k$iuu$1@reader1.panix.com>
In reply to#60223
On 2013-11-22, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote:
> On Fri, 22 Nov 2013 18:22:29 +0530, Bharath Kummar wrote:
>
>> 1)  Is it possible to Retrieve the address of a variable in python ? 
>
> No. Variables in Python are not at fixed addresses, like in Pascal or C, 
> they are names in a namespace.
>
> You can read this post for some more information about the difference 
> between C variables and Python variables, and calling conventions across 
> different languages:
>
> https://mail.python.org/pipermail/tutor/2010-December/080505.html
>
> It's a long post, but to summarise the part about variables:
>
> In languages like Pascal or C, the compiler keeps a table mapping 
> variable names to fixed memory addresses, like this:
>
> Variable  Address
>========  =======
> x         10234
> y         10238
> z         10242

FWIW, that's only true for some sorts of variables.  Other variables
have an address that is relative to a stack or frame pointer.

-- 
Grant Edwards               grant.b.edwards        Yow! PEGGY FLEMMING is
                                  at               stealing BASKET BALLS to
                              gmail.com            feed the babies in VERMONT.

[toc] | [prev] | [next] | [standalone]


#60224

Fromrusi <rustompmody@gmail.com>
Date2013-11-22 06:13 -0800
Message-ID<5b2d036a-bff7-4ff6-9cde-1c7f1efe87ab@googlegroups.com>
In reply to#60219
On Friday, November 22, 2013 6:22:29 PM UTC+5:30, Bharath Kummar wrote:
> Hello Sir/Mam, 
> Could you please help me with my current research ?  Am implementing the concept in python language. 
> My doubts are :
> 1)  Is it possible to Retrieve the address of a variable in python ?
> 2)  Is it possible to Delete the Address of the Variable and create a new dynamic address inside the compiler/interpreter itself ? 
> 3)  Is it easy to find the Binary equivalence of a given Alphanumeric String ?
> 4)  Is it possible to count the number of 1's in the Binary equivalence ? 
> Could you PLEASE provide me with the codes (codes only for the asked queries) ? 
> Your reply counts a lot for me and my research !  I love to explore more in python.

1) id will give you addresses.  Except that
   - not portable ie not guaranteed to be a m/c address
   - its of an object not a variable
   - if you are thinking C, its mostly useless

2) del will delete objects -- like free in C
   Except that like above, thinking in C will cause more problems than it solves

3,4 I cant make out what you mean

[toc] | [prev] | [next] | [standalone]


#60233

FromIan Kelly <ian.g.kelly@gmail.com>
Date2013-11-22 08:10 -0700
Message-ID<mailman.3043.1385133070.18130.python-list@python.org>
In reply to#60224
On Fri, Nov 22, 2013 at 7:13 AM, rusi <rustompmody@gmail.com> wrote:
> 2) del will delete objects -- like free in C
>    Except that like above, thinking in C will cause more problems than it solves

No, del will only delete name bindings.  Whether the bound object is
also deleted depends on whether it is still referenced, and the timing
by which the bound object may be deleted varies between
implementations.

[toc] | [prev] | [next] | [standalone]


#60234

FromNed Batchelder <ned@nedbatchelder.com>
Date2013-11-22 07:18 -0800
Message-ID<997d5b72-6a01-4ba3-97fe-c0235689572e@googlegroups.com>
In reply to#60224
On Friday, November 22, 2013 9:13:50 AM UTC-5, rusi wrote:
> On Friday, November 22, 2013 6:22:29 PM UTC+5:30, Bharath Kummar wrote:
> > Hello Sir/Mam, 
> > Could you please help me with my current research ?  Am implementing the concept in python language. 
> > My doubts are :
> > 1)  Is it possible to Retrieve the address of a variable in python ?
> > 2)  Is it possible to Delete the Address of the Variable and create a new dynamic address inside the compiler/interpreter itself ? 
> > 3)  Is it easy to find the Binary equivalence of a given Alphanumeric String ?
> > 4)  Is it possible to count the number of 1's in the Binary equivalence ? 
> > Could you PLEASE provide me with the codes (codes only for the asked queries) ? 
> > Your reply counts a lot for me and my research !  I love to explore more in python.
> 
> 1) id will give you addresses.  Except that
>    - not portable ie not guaranteed to be a m/c address
>    - its of an object not a variable
>    - if you are thinking C, its mostly useless
> 
> 2) del will delete objects -- like free in C
>    Except that like above, thinking in C will cause more problems than it solves

Not true: del doesn't delete objects. It merely removes references to objects.  Only if the object has no more references is the object deleted.

I tried my hand at explaining how names and values work in Python: http://nedbatchelder.com/text/names.html  Some people have found it helpful.

--Ned.

[toc] | [prev] | [next] | [standalone]


#60261

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-11-23 01:55 +0000
Message-ID<l6p1v0$1qr$3@dont-email.me>
In reply to#60219
On Fri, 22 Nov 2013 18:22:29 +0530, Bharath Kummar wrote:

> Could you please help me with my current research ?  Am implementing the
> concept in python language.
> My doubts are :
> 1)  Is it possible to Retrieve the address of a variable in python ?
> 2)  Is it possible to Delete the Address of the Variable and create a
> new dynamic address inside the compiler/interpreter itself ?
> 3)  Is it easy to find the Binary equivalence of a given Alphanumeric
> String ?
> 4)  Is it possible to count the number of 1's in the Binary equivalence
> ?

> Could you PLEASE provide me with the codes (codes only for the asked
> queries) ?

The codes are:

1) 7373a28109a7c4473a475b2137aa92d5
2) f2fae9a4ad5ded75e4d8ac34b90d5c9c
3) 935544894ca6ad7239e0df048b9ec3e5
4) b1bc9942d029a4a67e4b368a1ff8d883

Please contact your local government eavesdropping agency for assistance 
on decoding the codes.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#60266

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-11-23 02:18 +0000
Message-ID<5290105a$0$29993$c3e8da3$5496439d@news.astraweb.com>
In reply to#60261
On Sat, 23 Nov 2013 01:55:44 +0000, Denis McMahon wrote:

> On Fri, 22 Nov 2013 18:22:29 +0530, Bharath Kummar wrote:

>> Could you PLEASE provide me with the codes (codes only for the asked
>> queries) ?
> 
> The codes are:
> 
> 1) 7373a28109a7c4473a475b2137aa92d5
> 2) f2fae9a4ad5ded75e4d8ac34b90d5c9c
> 3) 935544894ca6ad7239e0df048b9ec3e5
> 4) b1bc9942d029a4a67e4b368a1ff8d883
> 
> Please contact your local government eavesdropping agency for assistance
> on decoding the codes.

I'm not an expert on Indian English, but I understand that in that 
dialect it is grammatically correct to say "the codes", just as in UK and 
US English it is grammatically correct to say "the programs".

In other words, in UK/US English, "code" in the sense of programming code 
is an uncountable noun, like "rice" or "air", while in Indian English it 
is a countable noun like cats or programs. We have to say "give me two 
samples of code", or perhaps "two code samples", while an Indian speaker 
might say "give me two codes".

As this is an international forum, it behoves us all to make allowances 
for slight difference in dialect.

Aside: I love the fact that pea, as in green peas or black-eyed peas, is 
a back-formation from an uncountable noun. Originally English had the 
word "pease", as in "pease porridge hot" from the nursery rhyme. Like 
wheat, rice, barley and others, You would have to say something like 
"give me a grain of pease" if you only wanted one. Eventually, people 
began to assume that "pease", or "peas", was the plural and therefore 
"pea" must be the singular. I look forward to the day that "rice" is the 
plural of "ri" :-)


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#60270

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2013-11-22 22:47 -0500
Message-ID<mailman.3066.1385178431.18130.python-list@python.org>
In reply to#60266
On 23 Nov 2013 02:18:03 GMT, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> declaimed the following:

>
>Aside: I love the fact that pea, as in green peas or black-eyed peas, is 
>a back-formation from an uncountable noun. Originally English had the 
>word "pease", as in "pease porridge hot" from the nursery rhyme. Like 
>wheat, rice, barley and others, You would have to say something like 
>"give me a grain of pease" if you only wanted one. Eventually, people 
>began to assume that "pease", or "peas", was the plural and therefore 
>"pea" must be the singular. I look forward to the day that "rice" is the 
>plural of "ri" :-)

	Rice is the plural of rouse
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#60278

FromIan Kelly <ian.g.kelly@gmail.com>
Date2013-11-22 23:42 -0700
Message-ID<mailman.3071.1385189013.18130.python-list@python.org>
In reply to#60266
On Fri, Nov 22, 2013 at 7:18 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> I'm not an expert on Indian English, but I understand that in that
> dialect it is grammatically correct to say "the codes", just as in UK and
> US English it is grammatically correct to say "the programs".

I wouldn't necessarily even consider it an Indian thing, as I've known
Americans to use the same phrase.


On Fri, Nov 22, 2013 at 8:47 PM, Dennis Lee Bieber
<wlfraed@ix.netcom.com> wrote:
> On 23 Nov 2013 02:18:03 GMT, Steven D'Aprano
> <steve+comp.lang.python@pearwood.info> declaimed the following:
>
>>
>>Aside: I love the fact that pea, as in green peas or black-eyed peas, is
>>a back-formation from an uncountable noun. Originally English had the
>>word "pease", as in "pease porridge hot" from the nursery rhyme. Like
>>wheat, rice, barley and others, You would have to say something like
>>"give me a grain of pease" if you only wanted one. Eventually, people
>>began to assume that "pease", or "peas", was the plural and therefore
>>"pea" must be the singular. I look forward to the day that "rice" is the
>>plural of "ri" :-)
>
>         Rice is the plural of rouse

Not according to the dictionary.  But it does seem a more likely
candidate for a hypothetical back formation than "ri", which perhaps
was your point.

[toc] | [prev] | [next] | [standalone]


#60339

FromGregory Ewing <greg.ewing@canterbury.ac.nz>
Date2013-11-24 12:31 +1300
Message-ID<bfcs75Ftvi3U1@mid.individual.net>
In reply to#60278
> On Fri, Nov 22, 2013 at 8:47 PM, Dennis Lee Bieber
> <wlfraed@ix.netcom.com> wrote:
 >
>>        Rice is the plural of rouse

And spice is the plural of spouse. :-)

-- 
Greg

[toc] | [prev] | [next] | [standalone]


#60340

FromGregory Ewing <greg.ewing@canterbury.ac.nz>
Date2013-11-24 12:35 +1300
Message-ID<bfcsdtFu1m8U1@mid.individual.net>
In reply to#60278
Ian Kelly wrote:
> I wouldn't necessarily even consider it an Indian thing, as I've known
> Americans to use the same phrase.

In my experience it seems to be a scientific community
vs. computer science community thing. I often hear Fortran
people talk about "a code" where we would say "a library"
or "a piece of code".

-- 
Greg

[toc] | [prev] | [next] | [standalone]


#60299

FromWilliam Ray Wing <wrw@mac.com>
Date2013-11-23 09:00 -0500
Message-ID<mailman.3083.1385215260.18130.python-list@python.org>
In reply to#60266
On Nov 23, 2013, at 1:42 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote:

> On Fri, Nov 22, 2013 at 7:18 PM, Steven D'Aprano
> <steve+comp.lang.python@pearwood.info> wrote:
>> I'm not an expert on Indian English, but I understand that in that
>> dialect it is grammatically correct to say "the codes", just as in UK and
>> US English it is grammatically correct to say "the programs".
> 
> I wouldn't necessarily even consider it an Indian thing, as I've known
> Americans to use the same phrase.
> 

Yes - when I arrived at a Department of Energy national laboratory in the late 1960s, code, to code, and coding were pretty much the accepted verb forms.  To the best of my knowledge, the word program didn't start to creep in until later.  I'm guessing, but I'd assume it started to arrive with the first computer science graduates.

-Bill

[toc] | [prev] | [next] | [standalone]


#60301

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2013-11-23 14:18 +0000
Message-ID<mailman.3085.1385216343.18130.python-list@python.org>
In reply to#60266
On 23/11/2013 02:18, Steven D'Aprano wrote:
>
> In other words, in UK/US English,

UK English?  Clearly you've never been to Newcastle upon Tyne or Glasgow :)

-- 
Python is the second best programming language in the world.
But the best has yet to be invented.  Christian Tismer

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#60308

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2013-11-23 10:44 -0500
Message-ID<mailman.3090.1385221454.18130.python-list@python.org>
In reply to#60266
On Fri, 22 Nov 2013 23:42:44 -0700, Ian Kelly <ian.g.kelly@gmail.com>
declaimed the following:
>
>On Fri, Nov 22, 2013 at 8:47 PM, Dennis Lee Bieber
><wlfraed@ix.netcom.com> wrote:
>>
>>         Rice is the plural of rouse
>
>Not according to the dictionary.  But it does seem a more likely
>candidate for a hypothetical back formation than "ri", which perhaps
>was your point.

	Mice/Mouse <> Rice/*Rouse


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#60312

FromTim Chase <python.list@tim.thechases.com>
Date2013-11-23 10:35 -0600
Message-ID<mailman.3093.1385224446.18130.python-list@python.org>
In reply to#60266
On 2013-11-23 10:44, Dennis Lee Bieber wrote:
> On Fri, 22 Nov 2013 23:42:44 -0700, Ian Kelly
> <ian.g.kelly@gmail.com> declaimed the following:
> >
> >On Fri, Nov 22, 2013 at 8:47 PM, Dennis Lee Bieber
> ><wlfraed@ix.netcom.com> wrote:  
> >>
> >>         Rice is the plural of rouse  
> >
> >Not according to the dictionary.  But it does seem a more likely
> >candidate for a hypothetical back formation than "ri", which
> >perhaps was your point.  
> 
> 	Mice/Mouse <> Rice/*Rouse

Wordplay is one of my worst vouse. ;-)

-tkc

[toc] | [prev] | [next] | [standalone]


#60313

FromSteve Simmons <square.steve@gmail.com>
Date2013-11-23 17:34 +0100
Message-ID<mailman.3094.1385224499.18130.python-list@python.org>
In reply to#60266
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font size="-1"><font face="Bitstream Vera Sans">By the same logic
        the plural of spouse is spice and most men that have had more
        than one wife will tell you that, whilst it may be the
        expectation, it ain't necessarily so&nbsp; ;-)<br>
        &nbsp;</font></font><br>
    <div class="moz-cite-prefix">On 23/11/2013 16:44, Dennis Lee Bieber
      wrote:<br>
    </div>
    <blockquote cite="mid:a6j199d8f8edmg0em60om28eoqdr7tidf9@4ax.com"
      type="cite">
      <pre wrap="">On Fri, 22 Nov 2013 23:42:44 -0700, Ian Kelly <a class="moz-txt-link-rfc2396E" href="mailto:ian.g.kelly@gmail.com">&lt;ian.g.kelly@gmail.com&gt;</a>
declaimed the following:
</pre>
      <blockquote type="cite">
        <pre wrap="">
On Fri, Nov 22, 2013 at 8:47 PM, Dennis Lee Bieber
<a class="moz-txt-link-rfc2396E" href="mailto:wlfraed@ix.netcom.com">&lt;wlfraed@ix.netcom.com&gt;</a> wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">
        Rice is the plural of rouse
</pre>
        </blockquote>
        <pre wrap="">
Not according to the dictionary.  But it does seem a more likely
candidate for a hypothetical back formation than "ri", which perhaps
was your point.
</pre>
      </blockquote>
      <pre wrap="">
	Mice/Mouse &lt;&gt; Rice/*Rouse


</pre>
    </blockquote>
    <br>
  </body>
</html>

[toc] | [prev] | [next] | [standalone]


#60314

FromChris Angelico <rosuav@gmail.com>
Date2013-11-24 03:35 +1100
Message-ID<mailman.3095.1385224567.18130.python-list@python.org>
In reply to#60266
On Sun, Nov 24, 2013 at 3:35 AM, Tim Chase
<python.list@tim.thechases.com> wrote:
>>       Mice/Mouse <> Rice/*Rouse
>
> Wordplay is one of my worst vouse. ;-)

Yeah, some people can come up with bad puns in a trouse.

ChrisA

[toc] | [prev] | [next] | [standalone]


#60315

FromSteve Simmons <square.steve@gmail.com>
Date2013-11-23 17:43 +0100
Message-ID<mailman.3096.1385225007.18130.python-list@python.org>
In reply to#60266
On 23/11/2013 17:35, Chris Angelico wrote:
> On Sun, Nov 24, 2013 at 3:35 AM, Tim Chase
> <python.list@tim.thechases.com> wrote:
>>>        Mice/Mouse <> Rice/*Rouse
>> Wordplay is one of my worst vouse. ;-)
> Yeah, some people can come up with bad puns in a trouse.
>
> ChrisA
Well!  That wasn't very nouse!

[toc] | [prev] | [next] | [standalone]


Page 1 of 5  [1] 2 3 4 5  Next page →

Back to top | Article view | comp.lang.python


csiph-web