Re: Doubt in line_profiler documentation

2018-01-27 Thread Alain Ketterlin
Abhiram R writes: [...] > https://github.com/rkern/line_profiler > > The definition for the time column says - > > "Time: The total amount of time spent executing the line in the timer's > units. In the header information before the tables, you will see a line > 'Timer unit:' giving the conversio

error from Popen only when run from cron

2018-01-27 Thread Larry Martell
I have a script that does this: subprocess.Popen(['service', 'some_service', 'status'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) When I run it from the command line it works fine. When I run it from cron I get: subprocess.Popen(['service', 'some_service', 'status'], stdout=subproces

Re: error from Popen only when run from cron

2018-01-27 Thread Chris Angelico
On Sun, Jan 28, 2018 at 2:58 AM, Larry Martell wrote: > I have a script that does this: > > subprocess.Popen(['service', 'some_service', 'status'], > stdout=subprocess.PIPE, stderr=subprocess.STDOUT) > > When I run it from the command line it works fine. When I run it from > cron I get: > > su

Re: error from Popen only when run from cron

2018-01-27 Thread Grant Edwards
On 2018-01-27, Larry Martell wrote: > I have a script that does this: > > subprocess.Popen(['service', 'some_service', 'status'], > stdout=subprocess.PIPE, stderr=subprocess.STDOUT) > > When I run it from the command line it works fine. When I run it from > cron I get: > > subprocess.Popen(['s

Re: error from Popen only when run from cron

2018-01-27 Thread Dan Stromberg
If you have your script set $PATH and $HOME, you can test it with: env - ./my-script The difference between running a script from the command line, and running a script from cron, is often environment variables. env - clears the environment. On Sat, Jan 27, 2018 at 7:58 AM, Larry Martell wrote:

Re: error from Popen only when run from cron

2018-01-27 Thread Larry Martell
On Sat, Jan 27, 2018 at 11:09 AM, Chris Angelico wrote: > On Sun, Jan 28, 2018 at 2:58 AM, Larry Martell > wrote: >> I have a script that does this: >> >> subprocess.Popen(['service', 'some_service', 'status'], >> stdout=subprocess.PIPE, stderr=subprocess.STDOUT) >> >> When I run it from the com

Re: error from Popen only when run from cron

2018-01-27 Thread Wildman via Python-list
On Sat, 27 Jan 2018 10:58:36 -0500, Larry Martell wrote: > I have a script that does this: > > subprocess.Popen(['service', 'some_service', 'status'], > stdout=subprocess.PIPE, stderr=subprocess.STDOUT) > > When I run it from the command line it works fine. When I run it from > cron I get: > >

Data-structure for multiway associativity in Python

2018-01-27 Thread qrious
I need a data structure and a corresponding (hopefully fast) mechanism associated with it to do the following. While I am looking for the concept first, my preference for implementation of this will be in Python. [c1, c2,..., cn] is a list of strings (for my own implementation, but could be a

Fwd: Text Strip() now working constantly.

2018-01-27 Thread George Shen
Hi Python Group, I am not sure if I am doing this correctly however, I believe I found a bug that involves the striping of a text string. I have attached a JPG that clearly illustrate the issue. I am currently using 2.7.13 In short: Given a string. 'cm_text.data' if you try and strip '.data' th

Re:Please Help

2018-01-27 Thread xuanwu348
np.uint8 is unsigned int, range 0~255 >>> np.uint8(256) 0 At 2018-01-27 12:33:22, "" wrote: >import numpy as np >x=np.unit8([250) >print(x) >y=np.unit8([10]) >print(y) >z=x+y >print(z) > > >output > >[250] >[10] >[4] > >My question how is z [4] >-- >https://mail.python.org/mailman/listin

Re: Text Strip() now working constantly.

2018-01-27 Thread Chris Angelico
On Sun, Jan 28, 2018 at 4:25 AM, George Shen wrote: > Hi Python Group, > > I am not sure if I am doing this correctly however, I believe I found a bug > that involves the striping of a text string. If you're implying that it's a bug in Python, no it isn't. If you're trying to understand the bug i

Re: Data-structure for multiway associativity in Python

2018-01-27 Thread Dan Stromberg
It's possible, but not common, to do association lists in Python. They're pretty inefficient in just about any language. I'm not totally clear on what you need, but it might be a good thing to do a list of sets - if you're looking for an in-memory solution. On Sat, Jan 27, 2018 at 10:33 AM, Denni

Re: Text Strip() now working constantly.

2018-01-27 Thread nasirahamed40719
Hi, I'm a begginer in Python, i have a question... can we use replace method to do it. E.g. a='cm_text.data' a.replace('.data', ''), this will return output as 'cm_text'. -- https://mail.python.org/mailman/listinfo/python-list

Re: Data-structure for multiway associativity in Python

2018-01-27 Thread MRAB
On 2018-01-27 18:01, qrious wrote: I need a data structure and a corresponding (hopefully fast) mechanism associated with it to do the following. While I am looking for the concept first, my preference for implementation of this will be in Python. [c1, c2,..., cn] is a list of strings (for m

Re: Text Strip() now working constantly.

2018-01-27 Thread Chris Angelico
On Sun, Jan 28, 2018 at 5:46 AM, wrote: > Hi, I'm a begginer in Python, i have a question... > > can we use replace method to do it. > > E.g. a='cm_text.data' > a.replace('.data', ''), this will return output as 'cm_text'. Yep! That works too. Be aware, though, that it might replace ".data"

Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Jason Qian via Python-list
HI I am a string that contains \r\n\t [Ljava.lang.Object; does not exist*\r\n\t*at com.livecluster.core.tasklet I would like it print as : [Ljava.lang.Object; does not exist tat com.livecluster.core.tasklet -- https://mail.python.org/mailman/listinfo/python-list

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Jason Qian via Python-list
HI I have a string that contains \r\n\t [Ljava.lang.Object; does not exist*\r\n\t*at com.livecluster.core.tasklet I would like to print it as : [Ljava.lang.Object; does not exist tat com.livecluster.core.tasklet How can I do this in python print ? Thanks On Sat, Jan 27, 20

How to embed a native JIT compiler to a django app?

2018-01-27 Thread Etienne Robillard
Hi, I want to compile a Django application into a C source file and embed a JIT compiler into the binary. Is there any way of doing this with llvm/clang? Regards, Etienne -- Etienne Robillard tkad...@yandex.com https://www.isotopesoftware.ca/ -- https://mail.python.org/mailman/listinfo/pyt

Welcome the 3.8 and 3.9 Release Manager - Łukasz Langa!

2018-01-27 Thread Barry Warsaw
As Ned just announced, Python 3.7 is very soon to enter beta 1 and thus feature freeze. I think we can all give Ned a huge round of applause for his amazing work as Release Manager for Python 3.6 and 3.7. Let’s also give him all the support he needs to make 3.7 the best version yet. As is tra

Sentiment analysis using sklearn

2018-01-27 Thread qrious
I am attempting to understand how scikit learn works for sentiment analysis and came across this blog post: https://marcobonzanini.wordpress.com/2015/01/19/sentiment-analysis-with-python-and-scikit-learn The corresponding code is at this location: https://gist.github.com/bonzanini/c9248a239

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Ned Batchelder
On 1/27/18 3:15 PM, Jason Qian via Python-list wrote: HI I am a string that contains \r\n\t [Ljava.lang.Object; does not exist*\r\n\t*at com.livecluster.core.tasklet I would like it print as : [Ljava.lang.Object; does not exist tat com.livecluster.core.tasklet It looks like

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Terry Reedy
On 1/27/2018 3:15 PM, Jason Qian via Python-list wrote: HI I am a string that contains \r\n\t [Ljava.lang.Object; does not exist*\r\n\t*at com.livecluster.core.tasklet I would like it print as : [Ljava.lang.Object; does not exist tat com.livecluster.core.tasklet Your output

Re: Sentiment analysis using sklearn

2018-01-27 Thread Terry Reedy
On 1/27/2018 4:05 PM, qrious wrote: I am attempting to understand how scikit learn works for sentiment analysis and came across this blog post: https://marcobonzanini.wordpress.com/2015/01/19/sentiment-analysis-with-python-and-scikit-learn The corresponding code is at this location: https://g

Re: Sentiment analysis using sklearn

2018-01-27 Thread Dan Stromberg
On Sat, Jan 27, 2018 at 1:05 PM, qrious wrote: > I am attempting to understand how scikit learn works for sentiment analysis > and came across this blog post: > > https://marcobonzanini.wordpress.com/2015/01/19/sentiment-analysis-with-python-and-scikit-learn > > The corresponding code is at this

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Jason Qian via Python-list
Thanks for taking look this. 1. Python pass a function to c side as callback, and print out the message. def handleError(message, code): print('** handleError **') * print('exception ' + str(message))* 2. On c side : send stack trace back to python by calling the callback function Callback::Ca

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Jason Qian via Python-list
Thanks for taking look this. The source of the string is std::string from our c code as callback . On the python side is shows as bytes. Is there way we can reformat the string that replace \r\n with newline, so python can correctly print it ? Thanks On Sat, Jan 27, 2018 at 5:39 PM, Terry Reed

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Jason Qian via Python-list
there are 0D 0A 09 %c %d 116 *%c %d 13%c %d 10%c %d 9* %c %d 97 On Sat, Jan 27, 2018 at 9:05 PM, Dennis Lee Bieber wrote: > On Sat, 27 Jan 2018 20:33:58 -0500, Jason Qian via Python-list > declaimed the following: > > > Ljava.lang.Object; does not exist*\r\n\t*at com > > > >

Sending Email using examples From Tutorials

2018-01-27 Thread Gg Galvez
I am having difficulty getting the python script to send an email to work. Here is the code I use from among a number of other examples which I used. The only changes I made were the email addresses, so I can see the result if it works. If you have any suggestions, please email your reply also t

Re: Sending Email using examples From Tutorials

2018-01-27 Thread Jason Friedman
> > import smtplib > server = smtplib.SMTP('localhost') > server.sendmail('gg77gal...@yahoo.com', > """To: gg.gal...@gmail.com > From: gg77gal...@yahoo.com > > Beware the Ides of March. > """) > server.quit() > > when running this I get the following message. Please help: > > Traceback (most recent

Compression of random binary data

2018-01-27 Thread pendrysammuel
If it is then show him this 387,420,489 = 00110011 00111000 00110111 00101100 00110100 00110010 0011 00101100 00110100 00111000 00111001 9^9 = ⬇️ (^ = to the power of) = 387,420,489 But 9^9 = 00111001 0100 00111001 -- https://mail.python.org/mailman/listinfo/python-list

Re: Compression of random binary data

2018-01-27 Thread Chris Angelico
On Sun, Jan 28, 2018 at 4:26 PM, wrote: > If it is then show him this > > 387,420,489 > = > 00110011 00111000 00110111 00101100 00110100 00110010 0011 00101100 > 00110100 00111000 00111001 > > 9^9 = ⬇️ (^ = to the power of) > = 387,420,489 > > But > > 9^9 > = > 00111001 0100 00111001 I

Re: Compression of random binary data

2018-01-27 Thread pendrysammuel
387,420,489 is a number with only 2 repeating binary sequences In binary 387,420,489 is expressed as 00110011 00111000 00110111 00101100 00110100 00110010 0011 00101100 00110100 00111000 00111001 387,420,489 can be simplified to 9*9 or nine to the power of nine In binary 9*9 is represented

Re: Compression of random binary data (Posting On Python-List Prohibited)

2018-01-27 Thread pendrysammuel
I have it in my head, just need someone to write the program for me, I know nothing about data compression or binary data other than 1s and 0s and that you can not take 2 number without a possible value more or less than them selves and compress them, I have been working for 1 1/2 years on a sol

Re: Compression of random binary data (Posting On Python-List Prohibited)

2018-01-27 Thread pendrysammuel
Lawrence D’Oliveiro In other words yes, I just need to be sober first. -- https://mail.python.org/mailman/listinfo/python-list

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Prahallad Achar
In python 3. X Use. Decode and. Encode On 28 Jan 2018 1:47 am, "Jason Qian via Python-list" wrote: > HI > >I am a string that contains \r\n\t > >[Ljava.lang.Object; does not exist*\r\n\t*at > com.livecluster.core.tasklet > > >I would like it print as : > > [Ljava.lang.Object; does no

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread breamoreboy
On Saturday, January 27, 2018 at 8:16:58 PM UTC, Jason Qian wrote: > HI > >I am a string that contains \r\n\t > >[Ljava.lang.Object; does not exist*\r\n\t*at com.livecluster.core.tasklet > >I would like it print as : > > [Ljava.lang.Object; does not exist > tat com.livecluster.cor

Re: [python-committers] Welcome the 3.8 and 3.9 Release Manager - Łukasz Langa!

2018-01-27 Thread Eric Snow
On Sat, Jan 27, 2018 at 2:02 PM, Barry Warsaw wrote: > please welcome your next release manager… > > Łukasz Langa! Congrats, Łukasz! (or condolences? ) -eric -- https://mail.python.org/mailman/listinfo/python-list

Re: Sentiment analysis using sklearn

2018-01-27 Thread qrious
On Saturday, January 27, 2018 at 2:45:30 PM UTC-8, Terry Reedy wrote: > On 1/27/2018 4:05 PM, qrious wrote: > > I am attempting to understand how scikit learn works for sentiment analysis > > and came across this blog post: > > > > https://marcobonzanini.wordpress.com/2015/01/19/sentiment-analysi

Re: Sentiment analysis using sklearn

2018-01-27 Thread qrious
On Saturday, January 27, 2018 at 5:21:15 PM UTC-8, Dan Stromberg wrote: > On Sat, Jan 27, 2018 at 1:05 PM, qrious wrote: > > I am attempting to understand how scikit learn works for sentiment analysis > > and came across this blog post: > > > > https://marcobonzanini.wordpress.com/2015/01/19/senti