Re: [Tutor] Sorting a list in ascending order [RESOLVED]

2016-04-29 Thread meenu ravi
That's actually two single quotes:-) both single and double quotes should work. Thanks, Meena On Apr 29, 2016 5:58 PM, "Ken G." wrote: > > On Fri, Apr 29, 2016 at 3:01 PM, Ken G. wrote: > >> In entering five random number, how can I best sort >> it

Re: [Tutor] Sorting a list in ascending order [RESOLVED]

2016-04-29 Thread Ken G.
On 04/29/2016 07:40 PM, Alan Gauld via Tutor wrote: On 29/04/16 23:58, Ken G. wrote: print ''.join(list1) #making it again as a single string Thanks, Meena, that is great! I changed your last line to: print "".join(list1) and it came out as below: 0511414453 Another quotation

Re: [Tutor] Extracting bits from an array

2016-04-29 Thread Alan Gauld via Tutor
On 29/04/16 20:47, Anish Kumar wrote: >> Is the number of bits fixed to four? If so you can shift the bits to the >> right: >> > y = [v>>2 for v in x] > > Right shifting is well defined in Python? Yes, Python has good support for all the common bitwise operations, including the shift

Re: [Tutor] Sorting a list in ascending order [RESOLVED]

2016-04-29 Thread Alan Gauld via Tutor
On 30/04/16 00:05, Ken G. wrote: > been able to change over to Python3. I am not together sure if Python3 > is now more stable to use and more commonly use. It is definitely stable and most libraries are now converted (although a few remain v2 only). Availability of libraries is now the only

Re: [Tutor] Sorting a list in ascending order [RESOLVED]

2016-04-29 Thread Alan Gauld via Tutor
On 29/04/16 23:58, Ken G. wrote: >> print ''.join(list1) #making it again as a single string >> > > Thanks, Meena, that is great! I changed your last line to: > > print "".join(list1) and it came out as below: > > 0511414453 > > Another quotation mark was needed. No it wasn't.

Re: [Tutor] Sorting a list in ascending order

2016-04-29 Thread isaac tetteh
You can use sorted(line) but you result will be in a list if thats okay. Otherwise you can iterate the list. Sent from my iPhone > On Apr 29, 2016, at 3:03 PM, Ken G. wrote: > > In entering five random number, how can I best sort > it into ascending order, such as

Re: [Tutor] Extracting bits from an array

2016-04-29 Thread Michael Selik
> On Apr 29, 2016, at 1:15 PM, Colin Ross wrote: > > Hello, > > I have an array that takes on the following form: > > x = [1000,1001,1011,] > > The array elements are meant to be binary representation of integers. > > Goal: Access array elements and extract

Re: [Tutor] Extracting bits from an array

2016-04-29 Thread Anish Kumar
> >> Hello, >> >> I have an array that takes on the following form: >> >> x = [1000,1001,1011,] > > But these are actually integers in decimal representation. You could treat > them as binary, but I recommend that you use integers in binary > representation to avoid confusion: > x

Re: [Tutor] Sorting a list in ascending order [RESOLVED]

2016-04-29 Thread Ken G.
On 04/29/2016 05:10 PM, Martin A. Brown wrote: Greetings Ken and welcome to Python, Using Linux 2.7.6 in Ubuntu 14.04.4. Thanks. Thank you for this information. I have one tip for you: While Python 2.x will still be around for a while, if you are learning Python today, I'd suggest Python

Re: [Tutor] Sorting a list in ascending order [RESOLVED]

2016-04-29 Thread Ken G.
On Fri, Apr 29, 2016 at 3:01 PM, Ken G. > wrote: In entering five random number, how can I best sort it into ascending order, such as 0511414453? Using Linux 2.7.6 in Ubuntu 14.04.4. Thanks. number01 = "41" number02 =

Re: [Tutor] Sorting a list in ascending order

2016-04-29 Thread Martin A. Brown
Greetings Ken and welcome to Python, > Using Linux 2.7.6 in Ubuntu 14.04.4. Thanks. Thank you for this information. I have one tip for you: While Python 2.x will still be around for a while, if you are learning Python today, I'd suggest Python 3.x. You can read more about the differences

Re: [Tutor] Sorting a list in ascending order

2016-04-29 Thread meenu ravi
Hi Ken, As the message clearly says, the string object doesn't have an attribute "sort". You are trying to join the inputs as a single string,"line" and then you are trying to sort it. But, as you want the string in the sorted format, you should sort it first and then convert it into string, as

[Tutor] Sorting a list in ascending order

2016-04-29 Thread Ken G.
In entering five random number, how can I best sort it into ascending order, such as 0511414453? Using Linux 2.7.6 in Ubuntu 14.04.4. Thanks. number01 = "41" number02 = "11" number03 = "05" number04 = "53" number05 = "44" line = number01 + number02 + number03 + number04 + number05 print print

Re: [Tutor] pytsk

2016-04-29 Thread Zachary Ware
Hi Peter, On Fri, Apr 29, 2016 at 8:15 AM, Tees, Peter (EthosEnergy) wrote: > Hi folks > > I'm pretty new to Python and programming, I've done the first four modules of > the Python course at Coursera.org to get started > > Now I want to put what I've learned to

Re: [Tutor] pytsk

2016-04-29 Thread SM
I often refer to the same blog (hacking exposed), and find many of the links broken, even though there is a lot of very useful information there. I use pytsk on Linux and always build it from source from here: https://github.com/py4n6/pytsk/releases/download/<>/pytsk-<>.tgz e.g:

Re: [Tutor] pytsk

2016-04-29 Thread Alan Gauld via Tutor
On 29/04/16 14:15, Tees, Peter (EthosEnergy) wrote: > Now I want to put what I've learned to good use, based on the > articles by David Cowen at the Hacking Exposed blog > and in particular his series "Automating DFIR - How to series > on programming libtsk with Python" > Can anyone point me to

Re: [Tutor] Extracting bits from an array

2016-04-29 Thread Peter Otten
Colin Ross wrote: > Hello, > > I have an array that takes on the following form: > > x = [1000,1001,1011,] But these are actually integers in decimal representation. You could treat them as binary, but I recommend that you use integers in binary representation to avoid confusion: >>> x

Re: [Tutor] Extracting bits from an array

2016-04-29 Thread Colin Ross
Thank you Michael, this is exactly what I was looking for! Clears things up on multiple fronts : ) On Fri, Apr 29, 2016 at 2:29 PM, Michael Selik wrote: > > > > On Apr 29, 2016, at 1:15 PM, Colin Ross > wrote: > > > > Hello, > > > > I have an

[Tutor] Extracting bits from an array

2016-04-29 Thread Colin Ross
Hello, I have an array that takes on the following form: x = [1000,1001,1011,] The array elements are meant to be binary representation of integers. Goal: Access array elements and extract the first two bits. e.g. Final result would look something like this: x_new = [10,10,10,11] What I

Re: [Tutor] (no subject)

2016-04-29 Thread Alan Gauld via Tutor
On 29/04/16 14:10, Павел Лопатин wrote: > Hello, > I downloaded Python 3.4.3 from python.org, installed it, > but when I tried to run it on my notebook a message appeared The error is about IDLE rather than about Python so its probably worth checking whether python itself runs first. Open a CMD

[Tutor] pytsk

2016-04-29 Thread Tees, Peter (EthosEnergy)
Hi folks I'm pretty new to Python and programming, I've done the first four modules of the Python course at Coursera.org to get started Now I want to put what I've learned to good use, based on the articles by David Cowen at the Hacking Exposed blog and in particular his series "Automating

[Tutor] (no subject)

2016-04-29 Thread Павел Лопатин
Hello, I downloaded Python 3.4.3 from python.org, installed it, but when I tried to run it on my notebook a message appeared IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection. There was a button OK. I clicked

Re: [Tutor] vpython help

2016-04-29 Thread Steven D'Aprano
Hi Daniel, and welcome, On Thu, Apr 28, 2016 at 11:27:43PM +, Craig, Daniel Joseph wrote: > To whom it may concern, > > > I am writing a program where I have a ball with a position and > velocity reach a wall in 3D space. I am able to drag the ball around > after it is done moving but I

Re: [Tutor] vpython help

2016-04-29 Thread Alan Gauld via Tutor
On 29/04/16 00:27, Craig, Daniel Joseph wrote: > I am writing a program where I have a ball with a position and velocity > reach a wall in 3D space. Well done, but vpython is a bit off topic for this list which deals with the core python language and libraries. I notice there is a vpython user

Re: [Tutor] Is there a library which has this object?

2016-04-29 Thread isaac tetteh
Im sure its not working because array is not in function. paste the error message here im sure someone will give u a better answer Sent from my iPhone > On Apr 28, 2016, at 4:07 PM, Yeh wrote: > > Thank you! > >> You probably want to look at the itertools module. >> >> There

[Tutor] vpython help

2016-04-29 Thread Craig, Daniel Joseph
To whom it may concern, I am writing a program where I have a ball with a position and velocity reach a wall in 3D space. I am able to drag the ball around after it is done moving but I would like to be able to move the ball prior to it moving towards the wall. Is there a way to do this,