Re: How to exit program with custom code and custom message?

2023-03-13 Thread Chris Angelico
; echo $? > > <<< 100 > > > > python -c " import sys; sys.exit(100)" > > echo $? > > <<< 100 > > OTOH, you don't want to get too tricky: > > (on Windows, obviously) > C:\Users\tom>py -c "import sys; sys.exit(type(100)

Re: How to exit program with custom code and custom message?

2023-03-13 Thread Thomas Passin
#x27;t want to get too tricky: (on Windows, obviously) C:\Users\tom>py -c "import sys; sys.exit(type(100) == type('a'))" C:\Users\tom>echo %ERRORLEVEL% 0 Presumably we wouldn't want to get an exit value of 0 for this case! -- https://mail.python.org/mailman/listinfo/python-list

Re: How to exit program with custom code and custom message?

2023-03-13 Thread Thomas Passin
On 3/13/2023 11:50 PM, MRAB wrote: On 2023-03-14 03:29, Thomas Passin wrote: On 3/13/2023 10:34 PM, scruel tao wrote: Lars: I totally understand your reasoning here, but in some way it follows the unix philosophy: Do only one thing, but do that good. I understand, python is not strongly typ

Re: How to exit program with custom code and custom message?

2023-03-13 Thread MRAB
On 2023-03-14 03:29, Thomas Passin wrote: On 3/13/2023 10:34 PM, scruel tao wrote: Lars: I totally understand your reasoning here, but in some way it follows the unix philosophy: Do only one thing, but do that good. I understand, python is not strongly typed, so `sys.exit` will be able to ac

Re: How to exit program with custom code and custom message?

2023-03-13 Thread Thomas Passin
On 3/13/2023 10:34 PM, scruel tao wrote: Lars: I totally understand your reasoning here, but in some way it follows the unix philosophy: Do only one thing, but do that good. I understand, python is not strongly typed, so `sys.exit` will be able to accept any types parameters rather than just

Re: How to exit program with custom code and custom message?

2023-03-13 Thread scruel tao
Lars: > I totally understand your reasoning here, but in some way it follows the unix > philosophy: Do only one thing, but do that good. I understand, python is not strongly typed, so `sys.exit` will be able to accept any types parameters rather than just integer. In order to handle such “other”

Re: 转发: How to exit program with custom code and custom message?

2023-03-13 Thread Cameron Simpson
On 13Mar2023 10:18, scruel tao wrote: Chris: but for anything more complicated, just print and then exit. It's worth noting, by the way, that sys.exit("error message") will print that to STDERR, not to STDOUT, which mean that the equivalent is: Yes, I know, but don’t you thi

Re: 转发: How to exit program with custom code and custom message?

2023-03-13 Thread Lars Liedtke
and to the output you want and not implicitly rely on adfdtitional parameters of exit. Yes, not all functions work this way. But that does not mean they shouln't ;-) Cheers Lars On 13.03.23 11:18, scruel tao wrote: Chris: It doesn't actually take a list of arguments; the squar

转发: How to exit program with custom code and custom message?

2023-03-13 Thread scruel tao
Chris: > It doesn't actually take a list of arguments; the square brackets indicate that arg is optional here. Oh, I see, it seems that I mistunderstood the document. > but for anything more complicated, just print and then exit. > It's worth noting, by the way, that sys.

Re: How to exit program with custom code and custom message?

2023-03-13 Thread Chris Angelico
stderr and results in an exit code of 1. > > However, if I want to exit the program with status 0 (or any numbers else > except 1) and print necessary messages before exiting, I have to write: > ```python > print("message") > sys.exit() > ``` > So why `sys.exi

How to exit program with custom code and custom message?

2023-03-13 Thread scruel tao
Currently, I use `sys.exit([arg])` for exiting program and it works fine. As described in the document: > If another type of object is passed, None is equivalent to passing zero, and > any other object is printed to stderr and results in an exit code of 1. However, if I want to exit the p

Re: Getting the exit code of a subprocess

2021-12-15 Thread Jason
On Wed, Dec 15, 2021 at 08:19:16PM -0800, Kushal Kumaran wrote: > On Wed, Dec 15 2021 at 09:38:48 PM, Jason wrote: > > Hello, > > > > How can I find out the exit code of a process when using the > > subprocess module? I am passing an email message to a shell script and

Re: Getting the exit code of a subprocess

2021-12-15 Thread Kushal Kumaran
On Wed, Dec 15 2021 at 09:38:48 PM, Jason wrote: > Hello, > > How can I find out the exit code of a process when using the > subprocess module? I am passing an email message to a shell script and > I need to know whether the shell script threw an error. > > Here is my

Getting the exit code of a subprocess

2021-12-15 Thread Jason
Hello, How can I find out the exit code of a process when using the subprocess module? I am passing an email message to a shell script and I need to know whether the shell script threw an error. Here is my code: p = Popen(cmd, stdout=None, stdin=PIPE, stderr=None) p.communicate(input=msg) I

Re: a clean exit

2021-07-29 Thread Dieter Maurer
jak wrote at 2021-7-29 00:07 +0200: > ... >Thanks to both of you for the replies. I know the rules you described to >me for process synchronization but unfortunately, due to the structure >of the library I am using, I cannot apply them. I can't even use >try/except because the library, when the err

Re: a clean exit

2021-07-28 Thread jak
Il 23/07/2021 10:55, jak ha scritto: Hello everybody, I wrote a bot for telegram which consists of some processes of which the main ones are: - the main process: a list of callback functions - a second process: managed with a message queue - a third process: started by the library I use (python-t

Re: a clean exit

2021-07-24 Thread Dieter Maurer
jak wrote at 2021-7-23 10:55 +0200: > ... >The problem is that sometimes I get an error from the library (python- >telegram-bot) via logging that my bot has no way of intercepting. The >error is "connection reset by pear" after which my program is no longer >called and I need to restart it. Typical

a clean exit

2021-07-23 Thread jak
Hello everybody, I wrote a bot for telegram which consists of some processes of which the main ones are: - the main process: a list of callback functions - a second process: managed with a message queue - a third process: started by the library I use (python-telegram-bot) which is used for the eve

exit() builtin, was Re: imaplib: is this really so unwieldy?

2021-05-26 Thread Peter Otten
might not be ideal. I've never had to use sys. for exit... C:\Users\Wulfraed>python Python ActivePython 3.8.2 (ActiveState Software Inc.) based on on win32 Type "help", "copyright", "credits" or "license" for more information. exi

Re: text displays on screen only when I click to exit the program

2021-04-30 Thread Mirko via Python-list
Am 30.04.2021 um 20:55 schrieb Quentin Bock: > code with comments for context: > > #Create a text based game where the user must find 3 items before > completing a level > #imports and variables for game > import pygame > from pygame import mixer > running = True > #initializes pygame > pygame.ini

text displays on screen only when I click to exit the program

2021-04-30 Thread Quentin Bock
code with comments for context: #Create a text based game where the user must find 3 items before completing a level #imports and variables for game import pygame from pygame import mixer running = True #initializes pygame pygame.init() #creates the pygame window screen = pygame.display.set_mode(

Re: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

2020-10-31 Thread Mats Wichmann
On 10/30/20 1:38 PM, Gian_Xatzak. wrote: >When I tried to download  matplotlib, it show me that message in the end: > >  > >ERROR: Command errored out with exit status 1: python setup.py egg_info >Check the logs for full command output. > >  &g

Re: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

2020-10-30 Thread Chris Angelico
On Sat, Oct 31, 2020 at 6:39 AM Gian_Xatzak. wrote: > >When I tried to download matplotlib, it show me that message in the end: > > > >ERROR: Command errored out with exit status 1: python setup.py egg_info >Check the logs for full command output. > Did

Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

2020-10-30 Thread Gian_Xatzak .
When I tried to download  matplotlib, it show me that message in the end:   ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.   *I have Windows 10, Python3.8.6(64bit)     Sent from [1]Mail for Windows

Re: How to cover connection exception errors, and exit

2020-03-29 Thread Peter Otten
dcwhat...@gmail.com wrote: > Hi, > > I've tried urllib, requests, and some other options. But I haven't found > a way to trap certain urls that aren't possible to connect from, outside > the office. In those cases, I need to just output an error. > > > So, the following code will cover the 40

How to cover connection exception errors, and exit

2020-03-28 Thread dcwhatthe
Hi, I've tried urllib, requests, and some other options. But I haven't found a way to trap certain urls that aren't possible to connect from, outside the office. In those cases, I need to just output an error. So, the following code will cover the 404s and similar errors for most of the pro

Managing concurrent.futures exit-handlers

2020-02-27 Thread Remy NOEL
Hello ! I am currently using concurrent.futures ThreadPoolExecutor, but i am annoyed by its exit_handler preventing program exit if any of the jobs it is running is blocked. Currently i can workaround it by either unregister the exit handler concurrent.futures.thread._python_exit or by

RE: What is the Difference Between quit() and exit() commands in Python?

2019-09-16 Thread wesley
Hi exit (http://docs.python.org/2/library/constants.html#exit"; rel="noreferrer) is an alias for quit (or vice-versa). They exist together simply to make Python more user-friendly. please refer: https://stackoverflow.com/questions/19747371/python-exit-comma

Re: What is the Difference Between quit() and exit() commands in Python?

2019-09-16 Thread Eryk Sun
On 9/16/19, Hongyi Zhao wrote: > > What is the Difference Between quit() and exit() commands in Python? They're different instances of the Quitter class, which is available if site.py is imported (i.e. not with the -S command-line option). They're created by site.setquit():

Re: What is the Difference Between quit() and exit() commands in Python?

2019-09-16 Thread Peter Otten
Hongyi Zhao wrote: > What is the Difference Between quit() and exit() commands in Python? They are instances of the same type >>> import inspect >>> type(quit) is type(exit) True >>> print(inspect.getsource(type(quit))) class Quitter(object): def __init__(self,

What is the Difference Between quit() and exit() commands in Python?

2019-09-16 Thread Hongyi Zhao
What is the Difference Between quit() and exit() commands in Python? -- https://mail.python.org/mailman/listinfo/python-list

Re: exit 2 levels of if/else and execute common code

2019-02-11 Thread Cameron Simpson
On 11Feb2019 08:17, Irv Kalb wrote: On Feb 11, 2019, at 7:25 AM, Neal Becker wrote: I have code with structure: ``` if cond1: [some code] if cond2: #where cond2 depends on the above [some code] [ more code] else: [ do xxyy ] else: [ do the same xxyy as above ] ``` So what's the best

Re: exit 2 levels of if/else and execute common code

2019-02-11 Thread Neal Becker
Chris Angelico wrote: > On Tue, Feb 12, 2019 at 3:21 AM Neal Becker wrote: >> >> Chris Angelico wrote: >> >> > On Tue, Feb 12, 2019 at 2:27 AM Neal Becker >> > wrote: >> >> >> >> I have code with structure: >> >> ``` >> >> if cond1: >> >> [some code] >> >> if cond2: #where cond2 depends on t

Re: exit 2 levels of if/else and execute common code

2019-02-11 Thread Irv Kalb
> On Feb 11, 2019, at 7:25 AM, Neal Becker wrote: > > I have code with structure: > ``` > if cond1: > [some code] > if cond2: #where cond2 depends on the above [some code] >[ more code] > > else: >[ do xxyy ] > else: > [ do the same xxyy as above ] > ``` > > So what's the best sty

Re: exit 2 levels of if/else and execute common code

2019-02-11 Thread Chris Angelico
On Tue, Feb 12, 2019 at 3:21 AM Neal Becker wrote: > > Chris Angelico wrote: > > > On Tue, Feb 12, 2019 at 2:27 AM Neal Becker wrote: > >> > >> I have code with structure: > >> ``` > >> if cond1: > >> [some code] > >> if cond2: #where cond2 depends on the above [some code] > >> [ more cod

Re: exit 2 levels of if/else and execute common code

2019-02-11 Thread Neal Becker
Chris Angelico wrote: > On Tue, Feb 12, 2019 at 2:27 AM Neal Becker wrote: >> >> I have code with structure: >> ``` >> if cond1: >> [some code] >> if cond2: #where cond2 depends on the above [some code] >> [ more code] >> >> else: >> [ do xxyy ] >> else: >> [ do the same xxyy as a

Re: exit 2 levels of if/else and execute common code

2019-02-11 Thread Dan Sommers
On 2/11/19 9:25 AM, Neal Becker wrote: I have code with structure: ``` if cond1: [some code] if cond2: #where cond2 depends on the above [some code] [ more code] else: [ do xxyy ] else: [ do the same xxyy as above ] ``` So what's the best style to handle this? As coded, i

Re: exit 2 levels of if/else and execute common code

2019-02-11 Thread Chris Angelico
On Tue, Feb 12, 2019 at 2:27 AM Neal Becker wrote: > > I have code with structure: > ``` > if cond1: > [some code] > if cond2: #where cond2 depends on the above [some code] > [ more code] > > else: > [ do xxyy ] > else: > [ do the same xxyy as above ] > ``` > > So what's the best s

Re: exit 2 levels of if/else and execute common code

2019-02-11 Thread Neal Becker
Rhodri James wrote: > On 11/02/2019 15:25, Neal Becker wrote: >> I have code with structure: >> ``` >> if cond1: >>[some code] >>if cond2: #where cond2 depends on the above [some code] >> [ more code] >> >>else: >> [ do xxyy ] >> else: >>[ do the same xxyy as above ] >>

Re: exit 2 levels of if/else and execute common code

2019-02-11 Thread Rhodri James
On 11/02/2019 15:25, Neal Becker wrote: I have code with structure: ``` if cond1: [some code] if cond2: #where cond2 depends on the above [some code] [ more code] else: [ do xxyy ] else: [ do the same xxyy as above ] ``` So what's the best style to handle this? As coded,

exit 2 levels of if/else and execute common code

2019-02-11 Thread Neal Becker
I have code with structure: ``` if cond1: [some code] if cond2: #where cond2 depends on the above [some code] [ more code] else: [ do xxyy ] else: [ do the same xxyy as above ] ``` So what's the best style to handle this? As coded, it violates DRY. Try/except could be used with

Re: how to exit from a nested loop in python

2019-02-09 Thread DL Neil
On 8/02/19 7:45 PM, Kaka wrote: for i in range(len(A.hp)): for j in range(len(run_parameters.bits_Mod)): req_slots[j] = math.ceil((A.T[i]) for g in Temp[i]["Available_ranges"][j]: for s in range(g[0], g[-1]): if (s+req_slots[j]-1) <= g[-1]

Re: how to exit from a nested loop in python

2019-02-08 Thread Rurpy via Python-list
On Thursday, February 7, 2019 at 11:45:23 PM UTC-7, Kaka wrote: > for i in range(len(A.hp)): > > for j in range(len(run_parameters.bits_Mod)): > req_slots[j] = math.ceil((A.T[i]) > > for g in Temp[i]["Available_ranges"][j]: > for s in range(g[0], g[-1]): >

Re: how to exit from a nested loop in python

2019-02-08 Thread Peter Otten
Kaka wrote: > for i in range(len(A.hp)): > > for j in range(len(run_parameters.bits_Mod)): > req_slots[j] = math.ceil((A.T[i]) > > for g in Temp[i]["Available_ranges"][j]: > for s in range(g[0], g[-1]): > if (s+req_slots[j]-1) <= g[-1]: >

how to exit from a nested loop in python

2019-02-07 Thread Kaka
for i in range(len(A.hp)): for j in range(len(run_parameters.bits_Mod)): req_slots[j] = math.ceil((A.T[i]) for g in Temp[i]["Available_ranges"][j]: for s in range(g[0], g[-1]): if (s+req_slots[j]-1) <= g[-1]: if (Temp[i]['cost'][

Re: clever exit of nested loops

2018-09-27 Thread Gregory Ewing
Neal Becker wrote: but it does violate the principle "Exceptions should be used for exceptional conditions). Python doesn't really go in for that philosophy. Exceptions are often used for flow control, e.g. StopIteration. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: clever exit of nested loops

2018-09-27 Thread Thomas Jollans
On 2018-09-26 21:06, Mark Lawrence wrote: > > To me the Ned Batchelder presentation > https://www.youtube.com/watch?v=EnSu9hHGq5o "Loop like a Native" is the > definitive way on how to deal with loops in Python. > Hear, hear. Great talk. -- https://mail.python.org/mailman/listinfo/python-list

Re: clever exit of nested loops

2018-09-27 Thread Neal Becker
ssible. > > To the contrary, I do think this solution looks not "convoluted" but > rather clear. Also, in Python some other "exceptions" are used for a > similar purpose - for example "StopIteration" to signal that an iterator > is exhausted. One might co

Re: clever exit of nested loops

2018-09-27 Thread Christian Gollwitzer
Am 26.09.18 um 12:28 schrieb Bart: On 26/09/2018 10:10, Peter Otten wrote: class Break(Exception): pass try: for i in range(10): print(f'i: {i}') for j in range(10): print(f'\tj: {j}') for k in range(10):   

Re: clever exit of nested loops

2018-09-27 Thread John Ladasky
On Wednesday, September 26, 2018 at 12:50:20 AM UTC-7, vito.d...@gmail.com wrote: > I have "abused" the "else" clause of the loops to makes a break "broke" more > loops I did this once upon a time. In recent years, when I start writing tricky nested loops, I frequently find myself reaching fo

Re: clever exit of nested loops

2018-09-26 Thread Mark Lawrence
On 26/09/18 08:50, vito.detul...@gmail.com wrote: Hi Today I've added a couple of lines in my source code, and I'm very ashamed of it. it "runs", and I know what it does (for now), but it's "too clever". I have "abused" the "else" clause of the loops to makes a break "broke" more loops f

Re: clever exit of nested loops

2018-09-26 Thread Peter Otten
vito.detul...@gmail.com wrote: > Hi > Today I've added a couple of lines in my source code, and I'm very ashamed > of it. it "runs", and I know what it does (for now), but it's "too > clever". I have "abused" the "else" clause of the loops to makes a break > "broke" more loops > > > for i in

Re: clever exit of nested loops

2018-09-26 Thread Chris Angelico
On Wed, Sep 26, 2018 at 5:56 PM wrote: > > Hi > Today I've added a couple of lines in my source code, and I'm very ashamed of > it. > it "runs", and I know what it does (for now), but it's "too clever". > I have "abused" the "else" clause of the loops to makes a break "broke" more > loops > > >

clever exit of nested loops

2018-09-26 Thread vito . detullio
Hi Today I've added a couple of lines in my source code, and I'm very ashamed of it. it "runs", and I know what it does (for now), but it's "too clever". I have "abused" the "else" clause of the loops to makes a break "broke" more loops for i in range(10): print(f'i: {i}') f

Re: Debug script under pdb, how to avoid a bunch of errors caused by the exit()?

2018-09-06 Thread Jach Fong
nt Deleted breakpoint 1 at c:\test\buginpdb.py:3 > c:\test\buginpdb.py(3)() -> print('bad password') (Pdb) cont bad password The program exited via sys.exit(). Exit status: None > c:\test\buginpdb.py(1)() -> password = 'bad' (Pdb) q C:\test> O

Re: Debug script under pdb, how to avoid a bunch of errors caused by the exit()?

2018-09-06 Thread Peter via Python-list
leted breakpoint 1 at c:\test\buginpdb.py:3 > c:\test\buginpdb.py(3)() -> print('bad password') (Pdb) cont bad password The program exited via sys.exit(). Exit status: None > c:\test\buginpdb.py(1)() -> password = 'bad' (Pdb) q C:\test> On 6/0

Re: Debug script under pdb, how to avoid a bunch of errors caused by the exit()?

2018-09-06 Thread Oscar Benjamin
On Thu, 6 Sep 2018 at 10:59, Jach Fong wrote: > > Here the script file, test0.py: > -- > password = 'bad' > if password == 'bad': > print('bad password') > exit() > else: >

Debug script under pdb, how to avoid a bunch of errors caused by the exit()?

2018-09-06 Thread Jach Fong
Here the script file, test0.py: -- password = 'bad' if password == 'bad': print('bad password') exit() else: print('good password') print('something else to do') When running it un

Re: I am trying to delete duplicates but the job just finishes with an exit code 0

2017-11-07 Thread Peter Otten
tysondog...@gmail.com wrote: > I am trying to delete duplicates but the job just finishes with an exit > code 0 and does not delete any duplicates. > > The duplicates for the data always exist in Column F and I am desiring to > delete the entire row B-I > > Any ideas? &g

I am trying to delete duplicates but the job just finishes with an exit code 0

2017-11-06 Thread tysondogerz
I am trying to delete duplicates but the job just finishes with an exit code 0 and does not delete any duplicates. The duplicates for the data always exist in Column F and I am desiring to delete the entire row B-I Any ideas? import openpyxl wb1 = openpyxl.load_workbook('C:/dwad/SWWA

Re: Setting the exit status from sys.excepthook

2016-11-21 Thread Peter Otten
d, and the > process exits with status 1. > > How can I change the exit status to another value, but only for exceptions > handled by my_error_handler? Why not just put try: ... except: ... around the main function? That said, it looks like you can exit() from the errorhandle

Setting the exit status from sys.excepthook

2016-11-21 Thread Steven D'Aprano
exit status to another value, but only for exceptions handled by my_error_handler? -- Steven 299792.458 km/s — not just a good idea, it’s the law! -- https://mail.python.org/mailman/listinfo/python-list

Re: exit ThreadPoolExecutor immediately

2016-11-15 Thread woooee
Doug Hellmann has what looks like a similar example using a poison pill (2nd example at) https://pymotw.com/2/multiprocessing/communication.html#multiprocessing-queues Note that join() allows the processes to finish so it you don't care then don't "join()" them. You can also terminate a multi

Re: exit ThreadPoolExecutor immediately

2016-11-15 Thread dieter
Atul Johri writes: > I am looking for a way to stop a ThreadPoolExecutor immediately under the > assumption that I don't care about what's currently running or pending. > > ``` > limit = 2 > executor = ThreadPoolExecutor(10) > posts = itertools.islice(mygen(executor=executor, **kwargs), 0, limit)

exit ThreadPoolExecutor immediately

2016-11-14 Thread Atul Johri
I am looking for a way to stop a ThreadPoolExecutor immediately under the assumption that I don't care about what's currently running or pending. ``` limit = 2 executor = ThreadPoolExecutor(10) posts = itertools.islice(mygen(executor=executor, **kwargs), 0, limit) for post in posts: print(post)

How to fix PyV8 linux setup error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

2016-09-12 Thread p . infante413
s.h: No such file or directory #include "src/natives.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Well, before that, it repeatedly asks for exporting V8 to V8_HOME and building it. I do it repeatedly just to mo

Re: collect2: ld returned 1 exit status when building from source

2016-09-12 Thread BartC
l.o:/home/steve/python/python-dev/cpython/Include/pydtrace.h:25: first defined here [ ... many, many, many more similar errors ... ] collect2: ld returned 1 exit status make: *** [Programs/_freeze_importlib] Error 1 Looks as if some error has slipped in the sources: you should not have multi

Re: collect2: ld returned 1 exit status when building from source

2016-09-12 Thread dieter
o:/home/steve/python/python-dev/cpython/Include/pydtrace.h:25: > first defined here > [ ... many, many, many more similar errors ... ] > > collect2: ld returned 1 exit status > make: *** [Programs/_freeze_importlib] Error 1 Looks as if some error has slipped in the sources: you sh

Re: collect2: ld returned 1 exit status when building from source

2016-09-10 Thread Steve D'Aprano
clude/pydtrace.h:25: first defined here [ ... many, many, many more similar errors ... ] collect2: ld returned 1 exit status make: *** [Programs/_freeze_importlib] Error 1 -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https

Re: collect2: ld returned 1 exit status when building from source

2016-09-10 Thread Steve D'Aprano
On Sun, 11 Sep 2016 03:34 am, Zachary Ware wrote: > On Sep 10, 2016 09:56, "Steve D'Aprano" > wrote: >> >> I'm trying to build from source using: >> >> ./configure --with-pydebug && make -s -j2 [...] >> Any suggestions for fixing this? > > Try make distclean, then configure and build again. S

Re: collect2: ld returned 1 exit status when building from source

2016-09-10 Thread Zachary Ware
race_FUNCTION_ENTRY': > /home/steve/python/python-dev/cpython/Include/pydtrace.h:26: multiple > definition of `PyDTrace_FUNCTION_ENTRY' > Python/ceval.o:/home/steve/python/python-dev/cpython/Include/pydtrace.h:26: > first defined here > > [ ... many, many, m

collect2: ld returned 1 exit status when building from source

2016-09-10 Thread Steve D'Aprano
_ENTRY' Python/ceval.o:/home/steve/python/python-dev/cpython/Include/pydtrace.h:26: first defined here [ ... many, many, many more PyDTrace_* multiple definitions ... ] collect2: ld returned 1 exit status make: *** [Programs/_freeze_importlib] Error 1 Any suggestions for fixing this?

Graceful exit from Python + multiprocessing daemons

2016-05-20 Thread deva . seetharam
Hello, Greetings! I would like to get your advice wrt following situation: I have a Linux daemon written in python (version 2.7) using the python-daemon (https://pypi.python.org/pypi/python-daemon) module. The objective of using python daemon is to run as an init.d script in Linux. This gets i

Re: Skipping test using unittest SkipTest and exit status

2016-05-14 Thread Chris Angelico
quot;Failed scanning ") > raise RuntimeError. > > My overall ,idea is Setup class fails then don't run any of the next > statements and exit the tests. There are three quite different things happening in your three examples. 1) When a test *fails*, it means that the test

Re: Skipping test using unittest SkipTest and exit status

2016-05-14 Thread Ganesh Pal
test are getting skipped but I have two problem . > > > > (1) This script is in turn read by other scripts which considers the > > test have passed based on the scripts return code , but the test have > > actually been skipped , How do include an exit status to indicat

Re: Skipping test using unittest SkipTest and exit status

2016-05-13 Thread Steven D'Aprano
which considers the > test have passed based on the scripts return code , but the test have > actually been skipped , How do include an exit status to indicates that > the test have failed But the test *hasn't* failed. A skipped test is not a failed test. If you want t

Skipping test using unittest SkipTest and exit status

2016-05-13 Thread Ganesh Pal
considers the test have passed based on the scripts return code , but the test have actually been skipped , How do include an exit status to indicates that the test have failed (2) Why is the message in the raise statement i.e raise unittest.SkipTest("Class setup failed skipping test&

Re: exit from Tkinter mainloop Python 2.7

2016-03-09 Thread Rick Johnson
On Friday, March 4, 2016 at 3:50:43 PM UTC-6, kevin...@gmail.com wrote: > Thanks for your attention to this matter. > My code now look like this: [...] All of the help offered in this thread ignores the elephant in the room. What are you trying to achieve here Kevin? To me, this looks like some so

Re: exit from Tkinter mainloop Python 2.7

2016-03-04 Thread Peter Otten
kevind0...@gmail.com wrote: > > > Christian & Others: > > Thanks for your attention to this matter. > My code now look like this: > > from Tkinter import * > > > def butContinue(): > dbUser = entryName.get() Here you set the local variable dbUser (every name you rebind inside a functio

Re: exit from Tkinter mainloop Python 2.7

2016-03-04 Thread kevind0718
Christian & Others: Thanks for your attention to this matter. My code now look like this: from Tkinter import * def butContinue(): dbUser = entryName.get() pWord = entryPWord.get() print dbUser print pWord root1.quit() dbUser = "" pWord = "" root1 = Tk() ##root1.geomet

Re: exit from Tkinter mainloop Python 2.7

2016-02-24 Thread Dave Farrance
ot;, "end-1c" ) >print entryPWord.get("1.0", "end-1c" ) And your root1.destroy() goes here instead. (The root window would normally be destroyed on the script exit, but some IDE debuggers will leave it open.) -- https://mail.python.org/mailman/listinfo/python-list

Re: exit from Tkinter mainloop Python 2.7

2016-02-23 Thread Peter Otten
Christian Gollwitzer wrote: > Am 23.02.16 um 22:39 schrieb kevind0...@gmail.com: >> from Tkinter import * >> >> def butContinue(): >> root1.destroy() >> [...] >> entryName = Entry(root1).grid(row=1, column=1, pady=5) >> [...] >> butGo = Button(root1, text=" Continue " , command=butContin

Re: exit from Tkinter mainloop Python 2.7

2016-02-23 Thread Christian Gollwitzer
Am 23.02.16 um 22:39 schrieb kevind0...@gmail.com: lblTop = Label(root1, text= ' Enter Values Below', font="Helvetica 14").grid(row=0, column=0, columnspan=2 , pady=5) ##lblTop.pack(side = TOP) lblDB = Label(root1,text= 'Weight').grid(row=1, column=0 ) lblPWord = Label(root1, text=

Re: exit from Tkinter mainloop Python 2.7

2016-02-23 Thread Christian Gollwitzer
Am 23.02.16 um 22:39 schrieb kevind0...@gmail.com: from Tkinter import * def butContinue(): root1.destroy() [...] entryName = Entry(root1).grid(row=1, column=1, pady=5) [...] butGo = Button(root1, text=" Continue " , command=butContinue ).grid(row=3, column=1, sticky=W, pady=10) root

exit from Tkinter mainloop Python 2.7

2016-02-23 Thread kevind0718
Hello: Newbie here. Spent the a good part of the day tinkering and reading tutorials, I was able to create a sample that is very close to my requirement. When I execute the code below the Dialog displayed as expected and I can enter data into the textboxes. All good. When I click on butGo I

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-22 Thread Grant Edwards
On 2015-12-22, Ian Kelly wrote: > On Tue, Dec 22, 2015 at 8:17 AM, Grant Edwards > wrote: >> On 2015-12-21, Steven D'Aprano wrote: >> >>> So as far as I am concerned, if changes of subject line breaks threading for >>> you, so sad, too bad. Go without threading or use a better mail client. >> >

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-22 Thread Tim Chase
On 2015-12-21 23:24, Jon Ribbens wrote: > That sounds a bit confused - if the *intention* of changing the > subject line is to create a new thread, then breaking the thread > is not "breaking threading" ;-) I'm pretty sure that the purpose is not to *break* the thread, but to suggest that the sub-

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-22 Thread Ian Kelly
On Tue, Dec 22, 2015 at 8:17 AM, Grant Edwards wrote: > On 2015-12-21, Steven D'Aprano wrote: > >> So as far as I am concerned, if changes of subject line breaks threading for >> you, so sad, too bad. Go without threading or use a better mail client. > > Same here. After getting what is effectiv

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-22 Thread Grant Edwards
On 2015-12-21, Steven D'Aprano wrote: > So as far as I am concerned, if changes of subject line breaks threading for > you, so sad, too bad. Go without threading or use a better mail client. Same here. After getting what is effectively a "F*&# Y*& I'm too lazy to do things right" from multiple

Re: Ignore error with non-zero exit status

2015-12-22 Thread Thomas 'PointedEars' Lahn
Terry Reedy wrote: > On 12/21/2015 9:05 AM, Thomas 'PointedEars' Lahn wrote: >> Chris Angelico wrote: >>> On Tue, Dec 22, 2015 at 12:19 AM, Thomas 'PointedEars' Lahn >>> wrote: Mark Lawrence wrote: > On 21/12/2015 07:51, Thomas 'PointedEars' Lahn wrote: >> Chris Angelico wrote: >

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-21 Thread Cameron Simpson
On 22Dec2015 10:14, Steven D'Aprano wrote: On Tue, 22 Dec 2015 08:44 am, Jon Ribbens wrote about mail clients that use the Subject line to thread messages: Also: Thunderbird, The Bat!, Eudora, Gnus, Outlook, Outlook Express, Pegasus Mail, Pine, Apple Mail, Windows Live Mail, Yahoo Mail, Evolut

Re: Ignore error with non-zero exit status

2015-12-21 Thread Chris Angelico
On Tue, Dec 22, 2015 at 11:17 AM, Ian Kelly wrote: > On Dec 21, 2015 4:55 PM, "Terry Reedy" wrote: >> >> Nothing has changed since except for >> https://www.python.org/dev/peps/pep-0498/ >> already added to 3.6. > > https://xkcd.com/927/ The 927ness of it was discussed at length prior to impleme

Re: Ignore error with non-zero exit status

2015-12-21 Thread Ian Kelly
On Dec 21, 2015 4:55 PM, "Terry Reedy" wrote: > > Nothing has changed since except for > https://www.python.org/dev/peps/pep-0498/ > already added to 3.6. https://xkcd.com/927/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Ignore error with non-zero exit status

2015-12-21 Thread Chris Angelico
On Tue, Dec 22, 2015 at 10:53 AM, Terry Reedy wrote: > Nothing has changed since except for > https://www.python.org/dev/peps/pep-0498/ > already added to 3.6. And the flip side of the argument is https://www.python.org/dev/peps/pep-0461/ in 3.5, expanding on percent formatting. Both are useful,

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-21 Thread Ian Kelly
On Mon, Dec 21, 2015 at 4:24 PM, Jon Ribbens wrote: > On 2015-12-21, Steven D'Aprano wrote: >> The whole purpose of the change of subject is to indicate in a human-visible >> way that the subject of the thread has changed, i.e. that it is a new >> thread derived from the old one. If that breaks t

Re: Ignore error with non-zero exit status

2015-12-21 Thread Terry Reedy
On 12/21/2015 9:05 AM, Thomas 'PointedEars' Lahn wrote: Chris Angelico wrote: On Tue, Dec 22, 2015 at 12:19 AM, Thomas 'PointedEars' Lahn wrote: Mark Lawrence wrote: On 21/12/2015 07:51, Thomas 'PointedEars' Lahn wrote: Chris Angelico wrote: But it's been clearly stated that .format is not

Re: Ignore error with non-zero exit status

2015-12-21 Thread Steven D'Aprano
On Tue, 22 Dec 2015 09:27 am, Thomas 'PointedEars' Lahn wrote: [...] > No, it is not. Your logic is flawed, too, pseudonymous nobody with the > unreadable posting style. If its unreadable, how do you know what it says? "PointedEars", you're doing a marvellous job of acting like a self-righteous

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-21 Thread Jon Ribbens
On 2015-12-21, Steven D'Aprano wrote: > On Tue, 22 Dec 2015 08:44 am, Jon Ribbens wrote about mail clients that use > the Subject line to thread messages: >> Also: Thunderbird, The Bat!, Eudora, Gnus, Outlook, Outlook Express, >> Pegasus Mail, Pine, Apple Mail, Windows Live Mail, Yahoo Mail, >> Ev

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-21 Thread Steven D'Aprano
On Tue, 22 Dec 2015 08:44 am, Jon Ribbens wrote about mail clients that use the Subject line to thread messages: > Also: Thunderbird, The Bat!, Eudora, Gnus, Outlook, Outlook Express, > Pegasus Mail, Pine, Apple Mail, Windows Live Mail, Yahoo Mail, > Evolution, SquirrelMail, KMail, Windows Mail, e

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-21 Thread Jon Ribbens
On 2015-12-21, Ian Kelly wrote: > On Mon, Dec 21, 2015 at 1:58 PM, Ben Finney > wrote: >> Ian Kelly writes: >>> This isn't just a Usenet group; it's also a mailing list, and many >>> MUAs rely on the Subject header for proper threading. >> >> If such MUAs do that, they're misinterpreting the Su

  1   2   3   4   5   >