Re: please help

2021-08-16 Thread Dennis Lee Bieber
On Mon, 16 Aug 2021 20:24:17 +0100, MRAB declaimed the following: >On 2021-08-16 02:19, vitalis wrote: >> I keep getting this error while trying to install pyqt5 designer >> >> Fatal error in launcher: Unable to create process using '"c:\program >> files\python39\python.exe" "C:\Pro

Re: please help

2021-08-16 Thread MRAB
On 2021-08-16 02:19, vitalis wrote: I keep getting this error while trying to install pyqt5 designer Fatal error in launcher: Unable to create process using '"c:\program files\python39\python.exe" "C:\Program Files\Python39\Scripts\pip.exe" install PyQt5Designer': The system can

Re: Please help test astral char display in tkinter Text (especially *nix)

2020-11-06 Thread Anssi Saari
Terry Reedy writes: > Perhaps half of the assigned chars in the first plane are printed > instead of being replaced with a narrow box. This includes emoticons > as foreground color outlines on background color. Maybe all of the > second plane of extended CJK chars are printed. The third plane i

Re: Please help test astral char display in tkinter Text (especially *nix)

2020-11-05 Thread Terry Reedy
On 11/4/2020 7:47 AM, Menno Holscher wrote: Op 03-11-2020 om 04:04 schreef Terry Reedy: Perhaps half of the assigned chars in the first plane are printed instead of being replaced with a narrow box. This includes emoticons as foreground color outlines on background color.  Maybe all of the sec

Re: Please help test astral char display in tkinter Text (especially *nix)

2020-11-04 Thread Menno Holscher
Op 03-11-2020 om 04:04 schreef Terry Reedy: Perhaps half of the assigned chars in the first plane are printed instead of being replaced with a narrow box. This includes emoticons as foreground color outlines on background color.  Maybe all of the second plane of extended CJK chars are printed. 

Re: Please Help! Absolute Novice - New Job, have this task.

2020-03-18 Thread bob gailer
Request for future: give us a specific subject e.g. how do I restore a button's text/color ? On 3/18/2020 6:05 PM, mjnash...@gmail.com wrote: Absolute beginner here, have no idea what I am doing wrong. All I want to do here is have the pushButton in PyQt5 to change to "Working..." and Red when

Re: Please help me

2019-08-06 Thread Brian Oney via Python-list
On Mon, 2019-08-05 at 21:10 +0430, arash kohansal wrote: > Hello ive just installed python on my pc and ive already check the > path > choice part but microsoft visual code can not find it and it does not > have > the reload item Check out: https://code.visualstudio.com/docs/languages/python or

Re: Please help me

2019-08-05 Thread MRAB
On 2019-08-05 17:40, arash kohansal wrote: Hello ive just installed python on my pc and ive already check the path choice part but microsoft visual code can not find it and it does not have the reload item 1. Open Visual Studio Code. 2. Press F1, type "Python: Select Interpreter", and then pre

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

2018-01-28 Thread Jason Qian via Python-list
The message type is bytes, this may make different ? print(type(message)) On Sun, Jan 28, 2018 at 8:41 PM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Sun, 28 Jan 2018 20:31:39 -0500, Jason Qian via Python-list wrote: > > > Thanks a lot :) > > > > os.write(1, message)

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

2018-01-28 Thread Dan Stromberg
On Sun, Jan 28, 2018 at 6:04 PM, Steven D'Aprano wrote: > On Sun, 28 Jan 2018 17:49:44 -0800, Dan Stromberg wrote: > So what was the clue that it was bytes that you saw that (nearly) > everyone else missed? Especially me. Can I get away with saying "it was just a good guess"? I've been using byt

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

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 17:49:44 -0800, Dan Stromberg wrote: > On Sun, Jan 28, 2018 at 5:35 PM, Steven D'Aprano > wrote: >> On Sun, 28 Jan 2018 17:04:56 -0800, Dan Stromberg wrote: >>> How about: >> os.write(1, message) >> >> What do you think that will do that print() doesn't do? > message

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

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 19:51:06 -0500, Jason Qian via Python-list wrote: > print(repr(message)) out : > > *does not exist\r\n\tat com.* For the record, I'd just like to say that this is not the output of Jason's call to print(). It has been edited to remove the b' ' delimiters which would have

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

2018-01-28 Thread Dan Stromberg
On Sun, Jan 28, 2018 at 5:35 PM, Steven D'Aprano wrote: > On Sun, 28 Jan 2018 17:04:56 -0800, Dan Stromberg wrote: >> How about: > os.write(1, message) > > What do you think that will do that print() doesn't do? >>> message = b'*does not exist\r\n\tat com.*' >>> os.write(1, message) *does not

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

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 20:31:39 -0500, Jason Qian via Python-list wrote: > Thanks a lot :) > > os.write(1, message) works ! I still do not believe that print(message) doesn't work. I can see no reason why you need to use os.write(). -- Steve -- https://mail.python.org/mailman/listinfo/pyth

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

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 17:04:56 -0800, Dan Stromberg wrote: > How about: os.write(1, message) What do you think that will do that print() doesn't do? -- Steve -- https://mail.python.org/mailman/listinfo/python-list

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

2018-01-28 Thread Steven D'Aprano
Jason, your Python output and the C output are not the same. Also, it looks like your email client is adding formatting codes to the email, or something. Please look at your post here: https://mail.python.org/pipermail/python-list/2018-January/730384.html Do you notice the extra asterisks added

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

2018-01-28 Thread Jason Qian via Python-list
Thanks Peter, replace print with os.write fixed the problem. On Sun, Jan 28, 2018 at 3:57 AM, Peter Otten <__pete...@web.de> wrote: > Jason Qian via Python-list wrote: > > > HI > > > >I have a string that contains \r\n\t > > > >[Ljava.lang.Object; does not exist*\r\n\t*at > >[co

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

2018-01-28 Thread Jason Qian via Python-list
Thanks a lot :) os.write(1, message) works ! On Sun, Jan 28, 2018 at 8:04 PM, Dan Stromberg wrote: > How about: > >>> os.write(1, message) > > On Sun, Jan 28, 2018 at 4:51 PM, Jason Qian via Python-list > wrote: > > print(repr(message)) out : > > > > *does not exist\r\n\tat com.* > > > > > >

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

2018-01-28 Thread Dan Stromberg
How about: >>> os.write(1, message) On Sun, Jan 28, 2018 at 4:51 PM, Jason Qian via Python-list wrote: > print(repr(message)) out : > > *does not exist\r\n\tat com.* > > > for ch in message: > printf("%d %c",ch, chr(ch)) > > > %d %c 110 n > %d %c 111 o > %d %c 116 t > %d %c 32 > %d %c 101 e >

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

2018-01-28 Thread Jason Qian via Python-list
print(repr(message)) out : *does not exist\r\n\tat com.* for ch in message: printf("%d %c",ch, chr(ch)) %d %c 110 n %d %c 111 o %d %c 116 t %d %c 32 %d %c 101 e %d %c 120 x %d %c 105 i %d %c 115 s %d %c 116 t *%d %c 13%d %c 10* *%d %c 9* %d %c 97 a %d %c 116 t %d %c 32 %d %c 99 c %d %c 111

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

2018-01-28 Thread Steven D'Aprano
On Sat, 27 Jan 2018 21:23:02 -0500, Jason Qian via Python-list wrote: > there are 0D 0A 09 If your string actually contains CARRIAGE RETURN (OD) NEWLINE (OA), and TAB (09) characters, then you don't need to do anything. Just call print, and they will be printed correctly. If that doesn't work,

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

2018-01-28 Thread Peter Otten
Jason Qian via Python-list wrote: > 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 > >

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: 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 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 > > > >

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
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 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: 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 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

Re: Please Help

2018-01-26 Thread Gary Herron
On 01/26/2018 08:33 PM, mohammedfaraz...@gmail.com 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] Despite all the typos in your post, you appear to be doing 8 bit unsigned arithmetic.  Do you kno

Re: Please Help

2018-01-26 Thread jladasky
Please copy and paste the exact code you are running. The code you show has several syntax errors, and would not execute at all. Now, I think that I can read through your errors anyway, so let me ask you a question: what is the largest possible value that can be represented with an unsigned 8-

Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

2016-03-26 Thread Joel Goldstick
On Sat, Mar 26, 2016 at 1:31 AM, Juan Dent wrote: > > I am trying to run ‘python cppdep.py’ but get the following: > > > > analyzing dependencies among all components ... > Traceback (most recent call last): > File

Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

2016-03-26 Thread Gary Herron
On 03/25/2016 10:31 PM, Juan Dent wrote: I am trying to run ‘python cppdep.py’ but get the following: I would guess that this code was written some time ago for Python2, but that you have downloaded and run it with Python3. Try installing Python2 instead of Python3. Or try talking whoever

Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

2016-03-26 Thread Ned Batchelder
On Saturday, March 26, 2016 at 5:59:30 AM UTC-4, Juan Dent wrote: > I am trying to run 'python cppdep.py' but get the following: > > > analyzing dependencies among all components ... > Traceback (most recent call last

Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

2016-03-26 Thread Steven D'Aprano
On Sat, 26 Mar 2016 04:31 pm, Juan Dent wrote: > > I am trying to run ‘python cppdep.py’ but get the following: > > > analyzing dependencies among all components ... > Traceback (most recent call last): > File "cp

Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

2016-03-26 Thread Mark Lawrence
On 26/03/2016 05:31, Juan Dent wrote: I am trying to run ‘python cppdep.py’ but get the following: analyzing dependencies among all components ... Traceback (most recent call last): File "cppdep.py", line 675, i

Re: please help

2016-02-04 Thread Oscar Benjamin
On 3 February 2016 at 23:03, Syavosh Malek wrote: > hi i install python 3.5.1 and found run time error > see attach file and help me please I'm afraid your attachment didn't arrive as this is a text-only mailing list. Can you include more information about the error? If it's that you're missing

Re: Please help on this sorted function

2015-06-03 Thread Steven D'Aprano
On Wednesday 03 June 2015 06:42, Joonas Liik wrote: > my_dict = {1: 'D', 2: 'B', 3: 'A', 4: 'E', 5: 'B'} > > # dict.items() returns an iterator that returns pairs of (key, value) > # pairs the key argument to sorted tells sorted what to sort by, > operator.itemgetter is a factory function , itemg

Re: Please help on this sorted function

2015-06-03 Thread Gary Herron
On 06/02/2015 01:20 PM, fl wrote: Hi, I try to learn sorted(). With the tutorial example: ff=sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'}) ff [1, 2, 3, 4, 5] I don't see what sorted does in this dictionary, i.e. the sequence of 1..5 is unchanged. Could you explain it to me? Thanks,

Re: Please help on this sorted function

2015-06-02 Thread Chris Angelico
On Wed, Jun 3, 2015 at 6:25 AM, fl wrote: > I am still new to Python. How to get the sorted dictionary output: > > {1: 'D', 2: 'B', 3: 'A', 4: 'E', 5: 'B'} Since dictionaries don't actually have any sort of order to them, the best thing to do is usually to simply display it in order. And there's

Re: Please help on this sorted function

2015-06-02 Thread Joonas Liik
my_dict = {1: 'D', 2: 'B', 3: 'A', 4: 'E', 5: 'B'} # dict.items() returns an iterator that returns pairs of (key, value) pairs # the key argument to sorted tells sorted what to sort by, operator.itemgetter is a factory function , itemgetter(1)== lambda iterable: iterable[1] sorted_dict = sorted(my

Re: Please help on this sorted function

2015-06-02 Thread Joonas Liik
>>> ff=sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'}) >>> ff [1, 2, 3, 4, 5] sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'}) is equivalent to sorted(iter({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'})) and iter(dict) iterates over the dict keys, so when you do iter({1: 'D', 2: 'B', 3: 'B', 4: 'E',

Re: Please help on this sorted function

2015-06-02 Thread fl
On Tuesday, June 2, 2015 at 1:20:40 PM UTC-7, fl wrote: > Hi, > > I try to learn sorted(). With the tutorial example: > > > > > >>> ff=sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'}) > >>> ff > [1, 2, 3, 4, 5] > > > > I don't see what sorted does in this dictionary, i.e. the sequence of >

Re: Please Help to build an addon for Anki

2015-04-20 Thread Ben Finney
Mahesh Chiramure writes: > I liked the addon "Picture-flasher" written for anki very much > and I was wondering if the same thing could be done with mp3 and/or > flac files. Quite probably. That sounds like a good small project to tackle: you've found a free-software program, it has an existing

Re: Please help.

2015-02-09 Thread Steven D'Aprano
Hello Chimex, and welcome. First, before I answer your question, I have a favour to ask. Please adjust your email program to send Plain Text as well as (or even instead of) so-called "Rich Text". When you send Rich Text, many people here will see your email like this: chime...@gmail.com wrote: >

Re: Please help.

2015-02-09 Thread John Ladasky
On Monday, February 9, 2015 at 10:26:47 AM UTC-8, Dave Angel wrote: > That will help him with the functions. But not with the keywords. The > OP didn't specify Python version, but in 3.x, print() is a function, and > can be rebound. Since he said keyword, he's either mistaken, or he's > runn

Re: Please help.

2015-02-09 Thread Dave Angel
On 02/09/2015 01:08 PM, John Ladasky wrote: On Monday, February 9, 2015 at 9:44:16 AM UTC-8, chim...@gmail.com wrote: Hello. Am trying to change the key words to my tribal language. Eg change English language: print() to igbo language: de(). I have been stuck for months I need a mentor or some

Re: Please help.

2015-02-09 Thread John Ladasky
On Monday, February 9, 2015 at 9:44:16 AM UTC-8, chim...@gmail.com wrote: > Hello. Am trying to change the key words to my tribal language. Eg change > English language: print() to igbo language: de(). I have been stuck for > months I need a mentor or someone that can guide me and answer some of

Re: Please help - Python role in Emeryville, CA - Full-time - $100K+

2014-12-18 Thread me
On Thu, 18 Dec 2014 00:08:18 +, Jared E. Cardon wrote: > Hi, > > I found your Python group on Google+ and I'm searching for someone with > 3+ years of Python development experience for a full-time position in > California. Salary north of $100K and working for an amazing company. > Ideally

Re: Please help - Python role in Emeryville, CA - Full-time - $100K+

2014-12-18 Thread David H. Lipman
It depends on if this a Job Posting, specific to Python, is allowed and not considered spam. -- https://mail.python.org/mailman/listinfo/python-list

Re: Please help with this

2013-11-13 Thread Peter Otten
mkharper wrote: > Hi Saad, > > I've had a play and the following "does something". > (I'm running Python 2.7 so replaced input with raw_input.) > (User can use upper or lower case, just lower it before test.) > (I simplified the questions/answers so I could answer them.) > > I'm out of time but

Re: Please help with this

2013-11-13 Thread mkharper
On Wednesday, November 13, 2013 4:18:58 AM UTC, saad imran wrote: > Could you point out any errors in my code: > > > > #This is a game where you have to escape a dragon. > > # By Saad Imran > > > > import random > > import pygame > > > > > > > > # Define questions and answers. > >

Re: Please help with this

2013-11-13 Thread mkharper
On Wednesday, November 13, 2013 4:18:58 AM UTC, saad imran wrote: > Could you point out any errors in my code: > > > > #This is a game where you have to escape a dragon. > > # By Saad Imran > > > > import random > > import pygame > > > > > > > > # Define questions and answers. > >

Re: Please help with this

2013-11-13 Thread mkharper
On Wednesday, November 13, 2013 4:18:58 AM UTC, saad imran wrote: > Could you point out any errors in my code: > > > > #This is a game where you have to escape a dragon. > > # By Saad Imran > > > > import random > > import pygame > > > > > > > > # Define questions and answers. > >

Re: Please help with this

2013-11-12 Thread Steven D'Aprano
On Tue, 12 Nov 2013 20:18:58 -0800, saad imran wrote: > Could you point out any errors in my code: Hi Saad, and welcome! As others have pointed out, you'll have better results if you tell us what errors you have, what result you actually expected, and what you have tried to do to fix it. If y

Re: Please help with this

2013-11-12 Thread Dave Angel
On Tue, 12 Nov 2013 20:18:58 -0800 (PST), saad imran wrote: Could you point out any errors in my code: que1 = "4481 *2" ans1 = "8962" que2 = "457 * 21" ans2 = "9597" These values should all be in a single named structure, probably a list of tuples. Then all that duplicated code could be cond

Re: Please help with this

2013-11-12 Thread Mark Lawrence
On 13/11/2013 04:34, Gary Herron wrote: On 11/12/2013 08:18 PM, saad imran wrote: Could you point out any errors in my code: Nope. You've got to do *some* of the work if you expect free volunteer help from people around here. Take the time to tell us what you expect this program to do,

Re: Please help with this

2013-11-12 Thread Ben Finney
saad imran writes: > Could you point out any errors in my code: This isn't a code review service; it is a community discussion forum. Do you have specific Python-related questions? What particular problems are you having with this code? -- \ “Pinky, are you pondering what I'm ponderi

Re: Please help with this

2013-11-12 Thread Gary Herron
On 11/12/2013 08:18 PM, saad imran wrote: Could you point out any errors in my code: Nope. You've got to do *some* of the work if you expect free volunteer help from people around here. Take the time to tell us what you expect this program to do, what actually happens when you run it,

Re: Please help with Threading

2013-06-02 Thread Jurgens de Bruin
On Saturday, 18 May 2013 10:58:13 UTC+2, Jurgens de Bruin wrote: > This is my first script where I want to use the python threading module. I > have a large dataset which is a list of dict this can be as much as 200 > dictionaries in the list. The final goal is a histogram for each dict 16 > h

Re: please help

2013-05-21 Thread Mark Lawrence
On 21/05/2013 09:38, iman.memarp...@gmail.com wrote: WAP in python to accept a list of words on STDIN and searches for a line containing all five vowels(a,e,i,o,u) Sorry we don't do your homework for you. But your starter for 10 is to use raw_input on Python 2 or input on Python 3 to fetch

Re: please help

2013-05-21 Thread Chris Angelico
On Tue, May 21, 2013 at 6:38 PM, wrote: > WAP in python to accept a list of words on STDIN and searches for a line > containing all five vowels(a,e,i,o,u) Homework. Have a shot at it yourself, post your code, show that you can put in some effort. Otherwise we won't see much reason to put in ef

Re: Please help with Threading

2013-05-20 Thread Steven D'Aprano
On Tue, 21 May 2013 05:53:46 +0300, Carlos Nepomuceno wrote: > BTW, why I didn't find the source code to the sys module in the 'Lib' > directory? Because sys is a built-in module. It is embedded in the Python interpreter. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

RE: Please help with Threading

2013-05-20 Thread Carlos Nepomuceno
> On Tue, May 21, 2013 at 11:44 AM, 8 Dihedral > wrote: >> OK, if the python interpreter has a global hiden print out >> buffer of ,say, 2to 16 K bytes, and all string print functions >> just construct the output string from the format to this string >> in an efficient low level way, then the

RE: Please help with Threading

2013-05-20 Thread Carlos Nepomuceno
e source code to the sys module in the 'Lib' directory? > Date: Tue, 21 May 2013 11:50:17 +1000 > Subject: Re: Please help with Threading > From: ros...@gmail.com > To: python-list@python.org > > On Tue, May 21, 2013 at 11:44 A

Re: Please help with Threading

2013-05-20 Thread Chris Angelico
On Tue, May 21, 2013 at 11:44 AM, 8 Dihedral wrote: > OK, if the python interpreter has a global hiden print out > buffer of ,say, 2to 16 K bytes, and all string print functions > just construct the output string from the format to this string > in an efficient low level way, then the next qu

Re: Please help with Threading

2013-05-20 Thread 88888 Dihedral
Chris Angelico於 2013年5月20日星期一UTC+8下午5時09分13秒寫道: > On Mon, May 20, 2013 at 6:35 PM, Cameron Simpson wrote: > > > _lock = Lock() > > > > > > def lprint(*a, **kw): > > > global _lock > > > with _lock: > > > print(*a, **kw) > > > > > > and use lprint() everywhere? > > > >

Re: Please help with Threading

2013-05-20 Thread Fábio Santos
I didn't know that. On 20 May 2013 12:10, "Dave Angel" wrote: > Are you making function calls, using system libraries, or creating or deleting any objects? All of these use the GIL because they use common data structures shared among all threads. At the lowest level, creating an object requires

Re: Please help with Threading

2013-05-20 Thread Chris Angelico
=On Mon, May 20, 2013 at 8:46 PM, Ned Batchelder wrote: > On 5/20/2013 6:09 AM, Chris Angelico wrote: >> >> Referencing a function's own name in a default has to have one of >> these interpretations: >> >> 1) It's a self-reference, which can be used to guarantee recursion >> even if the name is re

Re: Please help with Threading

2013-05-20 Thread Dave Angel
On 05/20/2013 03:55 AM, Fábio Santos wrote: My use case was a tight loop processing an image pixel by pixel, or crunching a CSV file. If it only uses local variables (and probably hold a lock before releasing the GIL) it should be safe, no? Are you making function calls, using system libraries

Re: Please help with Threading

2013-05-20 Thread Ned Batchelder
On 5/20/2013 6:09 AM, Chris Angelico wrote: Referencing a function's own name in a default has to have one of these interpretations: 1) It's a self-reference, which can be used to guarantee recursion even if the name is rebound 2) It references whatever previously held that name before this def

Re: Please help with Threading

2013-05-20 Thread Chris Angelico
On Mon, May 20, 2013 at 7:54 PM, Cameron Simpson wrote: > On 20May2013 19:09, Chris Angelico wrote: > | On Mon, May 20, 2013 at 6:35 PM, Cameron Simpson wrote: > | > _lock = Lock() > | > > | > def lprint(*a, **kw): > | > global _lock > | > with _lock: > | > print(*a, **kw) > |

RE: Please help with Threading

2013-05-20 Thread Carlos Nepomuceno
> Date: Mon, 20 May 2013 18:35:20 +1000 > From: c...@zip.com.au > To: carlosnepomuc...@outlook.com > CC: python-list@python.org > Subject: Re: Please help with Threading > > On 20May2013 10:53, Carlos Nepomuceno wrote: > | I just g

Re: Please help with Threading

2013-05-20 Thread Cameron Simpson
On 20May2013 19:09, Chris Angelico wrote: | On Mon, May 20, 2013 at 6:35 PM, Cameron Simpson wrote: | > _lock = Lock() | > | > def lprint(*a, **kw): | > global _lock | > with _lock: | > print(*a, **kw) | > | > and use lprint() everywhere? | | Fun little hack: | | def print(*ar

Re: Please help with Threading

2013-05-20 Thread Fábio Santos
It is pretty cool although it looks like a recursive function at first ;) On 20 May 2013 10:13, "Chris Angelico" wrote: > On Mon, May 20, 2013 at 6:35 PM, Cameron Simpson wrote: > > _lock = Lock() > > > > def lprint(*a, **kw): > > global _lock > > with _lock: > > print(*a, **kw

Re: Please help with Threading

2013-05-20 Thread Chris Angelico
On Mon, May 20, 2013 at 6:35 PM, Cameron Simpson wrote: > _lock = Lock() > > def lprint(*a, **kw): > global _lock > with _lock: > print(*a, **kw) > > and use lprint() everywhere? Fun little hack: def print(*args,print=print,lock=Lock(),**kwargs): with lock: print(*args,**

Re: Please help with Threading

2013-05-20 Thread Cameron Simpson
On 20May2013 10:53, Carlos Nepomuceno wrote: | I just got my hands dirty trying to synchronize Python prints from many threads. | Sometimes they mess up when printing the newlines. | I tried several approaches using threading.Lock and Condition. | None of them worked perfectly and all of them ma

Re: Please help with Threading

2013-05-20 Thread Fábio Santos
My use case was a tight loop processing an image pixel by pixel, or crunching a CSV file. If it only uses local variables (and probably hold a lock before releasing the GIL) it should be safe, no? My idea is that it's a little bad to have to write C or use multiprocessing just to do simultaneous c

RE: Please help with Threading

2013-05-20 Thread Carlos Nepomuceno
> Date: Mon, 20 May 2013 17:45:14 +1000 > From: c...@zip.com.au > To: fabiosantos...@gmail.com > Subject: Re: Please help with Threading > CC: python-list@python.org; wlfr...@ix.netcom.com > > On 20May2013 07:25, Fábio Santos wrote:

RE: Please help with Threading

2013-05-20 Thread Carlos Nepomuceno
> Date: Sun, 19 May 2013 13:10:36 +1000 > From: c...@zip.com.au > To: carlosnepomuc...@outlook.com > CC: python-list@python.org > Subject: Re: Please help with Threading > > On 19May2013 03:02, Carlos Nepomuceno wrote: > | Just be

Re: Please help with Threading

2013-05-20 Thread Cameron Simpson
On 20May2013 07:25, Fábio Santos wrote: | On 18 May 2013 20:33, "Dennis Lee Bieber" wrote: | > Python threads work fine if the threads either rely on intelligent | > DLLs for number crunching (instead of doing nested Python loops to | > process a numeric array you pass it to something lik

Re: Please help with Threading

2013-05-19 Thread Fábio Santos
On 18 May 2013 20:33, "Dennis Lee Bieber" wrote: > Python threads work fine if the threads either rely on intelligent > DLLs for number crunching (instead of doing nested Python loops to > process a numeric array you pass it to something like NumPy which > releases the GIL while crunching

Re: Please help with Threading

2013-05-19 Thread Dave Angel
On 05/19/2013 05:46 PM, Dennis Lee Bieber wrote: On Sun, 19 May 2013 10:38:14 +1000, Chris Angelico declaimed the following in gmane.comp.python.general: On Sun, May 19, 2013 at 10:02 AM, Carlos Nepomuceno wrote: I didn't know Python threads aren't preemptive. Seems to be something really o

Re: Please help with Threading

2013-05-19 Thread Chris Angelico
On Mon, May 20, 2013 at 7:46 AM, Dennis Lee Bieber wrote: > On Sun, 19 May 2013 10:38:14 +1000, Chris Angelico > declaimed the following in gmane.comp.python.general: >> With interpreted code eg in CPython, it's easy to implement preemption >> in the interpreter. I don't know how it's actually do

Re: Please help with Threading

2013-05-18 Thread Cameron Simpson
On 19May2013 03:02, Carlos Nepomuceno wrote: | Just been told that GIL doesn't make things slower, but as I | didn't know that such a thing even existed I went out looking for | more info and found that document: | http://www.dabeaz.com/python/UnderstandingGIL.pdf | | Is it current? I didn't know

Re: Please help with Threading

2013-05-18 Thread Chris Angelico
On Sun, May 19, 2013 at 10:02 AM, Carlos Nepomuceno wrote: > I didn't know Python threads aren't preemptive. Seems to be something really > old considering the state of the art on parallel execution on multi-cores. > > What's the catch on making Python threads preemptive? Are there any ongoing >

RE: Please help with Threading

2013-05-18 Thread Carlos Nepomuceno
> To: python-list@python.org > From: wlfr...@ix.netcom.com > Subject: Re: Please help with Threading > Date: Sat, 18 May 2013 15:28:56 -0400 > > On Sat, 18 May 2013 01:58:13 -0700 (PDT), Jurgens de Bruin > decla

Re: Please help with Threading

2013-05-18 Thread Dave Angel
On 05/18/2013 04:58 AM, Jurgens de Bruin wrote: This is my first script where I want to use the python threading module. I have a large dataset which is a list of dict this can be as much as 200 dictionaries in the list. The final goal is a histogram for each dict 16 histograms on a page ( 4x

Re: Please help with Threading

2013-05-18 Thread Peter Otten
Jurgens de Bruin wrote: > I will post code - the entire scripts is 1000 lines of code - can I post > the threading functions only? Try to condense it to the relevant parts, but make sure that it can be run by us. As a general note, when you add new stuff to an existing longish script it is alw

Re: Please help with Threading

2013-05-18 Thread Jurgens de Bruin
I will post code - the entire scripts is 1000 lines of code - can I post the threading functions only? -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help with Threading

2013-05-18 Thread Peter Otten
Jurgens de Bruin wrote: > This is my first script where I want to use the python threading module. I > have a large dataset which is a list of dict this can be as much as 200 > dictionaries in the list. The final goal is a histogram for each dict 16 > histograms on a page ( 4x4 ) - this already w

Re: Please help if you can!

2012-12-26 Thread alex23
On 27 Dec, 11:00, Chris Angelico wrote: > One of the regulars on the list has posted a run-down of how to post > from Google Groups without annoying everyone, and among other things, > it recommends manually deleting all the blank lines. I'm still posting via Groups and am not seeing my posts com

Re: Please help if you can!

2012-12-26 Thread Mitya Sirenef
On 12/26/2012 08:23 PM, Chris Angelico wrote: On Thu, Dec 27, 2012 at 12:17 PM, Mitya Sirenef wrote: I have to agree - I saw that howto as well and it occurred to me that if we have to delete blank lines manually we might as well use postal pigeons with tiny little papyrus scrolls - at least th

Re: Please help if you can!

2012-12-26 Thread Chris Angelico
On Thu, Dec 27, 2012 at 12:17 PM, Mitya Sirenef wrote: > I have to agree - I saw that howto as well and it occurred to me > that if we have to delete blank lines manually we might > as well use postal pigeons with tiny little papyrus scrolls - > at least those don't insert blank lines automaticall

Re: Please help if you can!

2012-12-26 Thread Dennis
> > My *very first* thought about this code is that it's really badly spaced. > Don't put lines together so much! [https://gist.github.com/4383950] shows > how much nicer things look when they're partitioned more. You may not > agree, but it took about 10 seconds and I prefer it. > > On another st

Re: Please help if you can!

2012-12-26 Thread Mitya Sirenef
On 12/26/2012 08:00 PM, Chris Angelico wrote: On Thu, Dec 27, 2012 at 11:45 AM, Joshua Landau wrote: FINALLY: When you use Google Groups, your quotations look to us like this: This is something I said with lots of extra lines in the middle for no reason. Google Groups sucks, basically. S

Re: Please help if you can!

2012-12-26 Thread Chris Angelico
On Thu, Dec 27, 2012 at 11:45 AM, Joshua Landau wrote: > FINALLY: > When you use Google Groups, your quotations look to us like this: > >> This is something I said >> >> with lots of extra >> >> lines in the middle >> >> for no reason. Google >> >> Groups sucks, basically. > > So please just delet

Re: Please help if you can!

2012-12-26 Thread Mitya Sirenef
On 12/26/2012 07:04 PM, bobflipperdoo...@gmail.com wrote: First, sorry for starting a new post - I didn't want anyone to have to read through the whole first one when the questions were completely different :/ Second, I honestly have no idea how to answer your questions. I am a sophomore in h

Re: Please help if you can!

2012-12-26 Thread Joshua Landau
On 27 December 2012 00:04, wrote: > First, sorry for starting a new post - I didn't want anyone to have to > read through the whole first one when the questions were completely > different :/ > > Second, I honestly have no idea how to answer your questions. I am a > sophomore in high school and

  1   2   3   >