Re: [Tutor] How to run a python script

2016-02-21 Thread Chad Perry
What version of Python are you using? Have you tried an apt-get -y update yum -y update Sincerely, Chad Perry cperry...@hotmail.com 512.961.0291 From: Alan Gauld Sent: Saturday, February 20, 2016 6:32 PM To: tutor@python.org Su

Re: [Tutor] How to run a python script

2016-02-21 Thread Alan Gauld
On 21/02/16 00:36, Chad Perry wrote: > What version of Python are you using? Have you tried an > apt-get -y update > yum -y update Since the OP appears to be running Windows I doubt if that will help. In fact, I doubt it would help with a syntax error on Linux either. -- Alan G Author of the L

Re: [Tutor] How to run a python script

2016-02-21 Thread Chris Warrick
Forwarding to mailing list, please use Reply All in the future. On 21 February 2016 at 09:48, Erol Gericke wrote: > Hi Chris, > > Thanks for your prompt reply, the problem has been solved! > I was using the 'python' terminal not the 'DOS' terminal. > > I have created a new directory to hold the

Re: [Tutor] How to run a python script

2016-02-21 Thread Erol Gericke
Thanks again Erol On 2016/02/21 11:10 AM, Chris Warrick wrote: Forwarding to mailing list, please use Reply All in the future. On 21 February 2016 at 09:48, Erol Gericke wrote: Hi Chris, Thanks for your prompt reply, the problem has been solved! I was using the 'python' terminal not the 'DOS

[Tutor] Finding line number by offset value.

2016-02-21 Thread Cody West
Hi, I'm using yara-python for some file scanning and I'm trying to take the offset in the 'strings' field and turn it into a line number. http://yara.readthedocs.org/en/latest/yarapython.html Below is what I'm working with. (48L, '$execution', 'eval(base64_decode') I'm trying to take 48L, whic

Re: [Tutor] How to run a python script

2016-02-21 Thread Chad Perry
This is the shabang for Python http://stackoverflow.com/questions/6908143/should-i-put-shebang-in-python-scripts-and-what-form-should-it-take Sincerely, Chad Perry cperry...@hotmail.com 512.961.0291 > On Feb 21, 2016, at 3:11 AM, Chris Warrick wrote: > > Forwarding to mailing list, please use

Re: [Tutor] How to run a python script

2016-02-21 Thread Chad Perry
Can you share the knowledge on what you did. I love Python it's easy...to use most of the time Sincerely, Chad Perry cperry...@hotmail.com 512.961.0291 > On Feb 21, 2016, at 3:11 AM, Chris Warrick wrote: > > Forwarding to mailing list, please use Reply All in the future. > >> On 21 February

[Tutor] library terminology and importing

2016-02-21 Thread street . sweeper
Hello all, I often use now() and strftime() from datetime, but it seems like I can't import just those functions. The os module allows me to import like this: from os.path import join,expanduser but I get an error if I try from datetime.datetime import now, strftime But if I import all of os

Re: [Tutor] Finding line number by offset value.

2016-02-21 Thread Alan Gauld
On 21/02/16 19:32, Cody West wrote: > I'm using yara-python for some file scanning and I'm trying to take the > offset in the 'strings' field and turn it into a line number. I know nothing about yara except that its some kind of pattern matching engine. However... > (48L, '$execution', 'eval(base

Re: [Tutor] library terminology and importing

2016-02-21 Thread Ben Finney
street.swee...@mailworks.org writes: > I get an error if I try > > from datetime.datetime import now, strftime ‘datetime.datetime’ is not a module, so you can not import objects from it. > But if I import all of os and datetime, I can use those functions by > writing the full 'path' 3 levels dee

Re: [Tutor] Finding line number by offset value.

2016-02-21 Thread Steven D'Aprano
On Mon, Feb 22, 2016 at 01:41:42AM +, Alan Gauld wrote: > On 21/02/16 19:32, Cody West wrote: > > I'm trying to take 48L, which I believe is the character number, and get > > the line number from that. > > I'm not totally clear what you mean but, if it is that 48L > is the character count fro

Re: [Tutor] library terminology and importing

2016-02-21 Thread Martin A. Brown
Good morning, I'm inverting the order of your questions, because I think the order of the answers may help. >But if I import all of os and datetime, I can use those functions by >writing the full 'path' 3 levels deep: > >os.path.expanduser('~') >datetime.datetime.now() [... hold onto your hat,