Re: How to 'ignore' an error in Python?

2023-04-29 Thread Phu Sam
3 at 04:55:41 PM, Chris Green wrote: > > > > > I'm sure I'm missing something obvious here but I can't see an > elegant > > > > > way to do this. I want to create a directory, but if it exists > it's > > > > > not an e

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Chris Angelico
other operations to fail later (if someone creates a file called "logs" and then you try to create "logs/2023-04-30.txt", you get an error at that point). I have also known situations where this is a deliberate way to suppress something (like a cache or log directory). ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: How to 'ignore' an error in Python?

2023-04-29 Thread jak
Stefan Ram ha scritto: jak writes: Maybe I only say this because it has happened to me too many times but before ignoring the error in the 'except' branch, I would make sure that if the name exists it is a folder and not a file. If the name exists and it is a file's name, this will be dete

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Chris Angelico
us here but I can't see an elegant > > > > way to do this. I want to create a directory, but if it exists it's > > > > not an error and the code should just continue. > > > > > > > > So, I have:- > > > > > > >

Re: How to 'ignore' an error in Python?

2023-04-29 Thread jak
Chris Angelico ha scritto: Using mkdirs when you only want to make one is inviting problems of being subtly wrong, where it creates too many levels of directory. Personally, I would just do: Maybe I only say this because it has happened to me too many times but before ignoring the error in the

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Chris Green
Kushal Kumaran wrote: > On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: > > I'm sure I'm missing something obvious here but I can't see an elegant > > way to do this. I want to create a directory, but if it exists it's > > not an error and the

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Chris Green
ant to create a directory, but if it exists it's > > > not an error and the code should just continue. > > > > > > So, I have:- > > > > > > for dirname in listofdirs: > > > try: > > > os.mkdir(dir

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Greg Ewing via Python-list
On 30/04/23 2:43 am, jak wrote: Maybe I expressed myself badly but I didn't mean to propose alternatives to the EAFP way but just to evaluate the possibility that it is not a folder. If it's not a folder, you'll find out when the next thing you try to do to it fails. You could check for it ear

RE: How to 'ignore' an error in Python?

2023-04-29 Thread avi.e.gross
require a loss of simplicity. -Original Message- From: Python-list On Behalf Of Kushal Kumaran Sent: Saturday, April 29, 2023 12:19 AM To: python-list@python.org Subject: Re: How to 'ignore' an error in Python? On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: >

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Chris Angelico
On Sat, 29 Apr 2023 at 14:27, Kushal Kumaran wrote: > > On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: > > I'm sure I'm missing something obvious here but I can't see an elegant > > way to do this. I want to create a directory, but if it exists it'

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Kushal Kumaran
On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: > I'm sure I'm missing something obvious here but I can't see an elegant > way to do this. I want to create a directory, but if it exists it's > not an error and the code should just continue. > >

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Cameron Simpson
On 28Apr2023 10:39, Mats Wichmann wrote: For this specific case, you can use os.makedirs: os.makedirs(dirname, exist_ok=True) I'm not a great fan of makedirs because it will make all the missing components, not just the final one. So as an example, if you've got a NAS mounted backup area at

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Cameron Simpson
On 28Apr2023 16:55, Chris Green wrote: for dirname in listofdirs: try: os.mkdir(dirname) except FileExistsError: # so what can I do here that says 'carry on regardless' except: # handle any other error, which is reall

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Mats Wichmann
On 4/28/23 11:05, MRAB wrote: On 2023-04-28 16:55, Chris Green wrote: I'm sure I'm missing something obvious here but I can't see an elegant way to do this.  I want to create a directory, but if it exists it's not an error and the code should just continue. So, I have:-

Re: How to 'ignore' an error in Python?

2023-04-28 Thread MRAB
On 2023-04-28 16:55, Chris Green wrote: I'm sure I'm missing something obvious here but I can't see an elegant way to do this. I want to create a directory, but if it exists it's not an error and the code should just continue. So, I have:- for dirname in list

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Mats Wichmann
On 4/28/23 09:55, Chris Green wrote: I'm sure I'm missing something obvious here but I can't see an elegant way to do this. I want to create a directory, but if it exists it's not an error and the code should just continue. So, I have:- for dirname in list

How to 'ignore' an error in Python?

2023-04-28 Thread Chris Green
I'm sure I'm missing something obvious here but I can't see an elegant way to do this. I want to create a directory, but if it exists it's not an error and the code should just continue. So, I have:- for dirname in listofdirs: try: os.mkdir(dir

Re: Weired behaviour - The slice of empty string not return an error

2022-10-30 Thread dn
On 31/10/2022 03.59, Yassine Nasri wrote: PS: The ''[::] should return an error logically. Le dim. 30 oct. 2022 à 15:57, Yassine Nasri a écrit : Hello, len('') # => 0''[0]# => error''[::] # => ''''[::] # <=>

Re: Weired behaviour - The slice of empty string not return an error

2022-10-30 Thread MRAB
On 2022-10-30 14:57, Yassine Nasri wrote: Hello, len('') # => 0''[0]# => error''[::] # => ''''[::] # <=> ''[0:len(''):1] the syntax of slice: slice(start, end, step) The start in ''[::] eq

Re: Weired behaviour - The slice of empty string not return an error

2022-10-30 Thread Yassine Nasri
PS: The ''[::] should return an error logically. Le dim. 30 oct. 2022 à 15:57, Yassine Nasri a écrit : > Hello, > > len('') # => 0''[0]# => error''[::] # => ''''[::] # <=> > ''[0:len(

Weired behaviour - The slice of empty string not return an error

2022-10-30 Thread Yassine Nasri
Hello, len('') # => 0''[0]# => error''[::] # => ''''[::] # <=> ''[0:len(''):1] the syntax of slice: slice(start, end, step) The start in ''[::] equivalent at index 0 of the '' S

Getting an Error TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'

2022-08-17 Thread Coder
sudo pip install pyro4 Collecting pyro4 Downloading https://files.pythonhosted.org/packages/70/e3/8c4e0d24b46fbf02e6b2dc2da5d18f0c73cfd343a1fb01ae64c788c20e56/Pyro4-4.82-py2.py3-none-any.whl (89kB) 100% || 92kB 7.3MB/s Collecting selectors34; python_versio

Re: NILEARN - WHY THIS CODE THROWS AN ERROR?????

2022-07-08 Thread Chris Angelico
On Sat, 9 Jul 2022 at 10:57, MRAB wrote: > > On 08/07/2022 23:20, Avi Gross via Python-list wrote: > > Nati Stern has asked several questions here, often about relatively > > technical uses of python code that many of us have never used and still is > > not providing more exact info that tends t

Re: NILEARN - WHY THIS CODE THROWS AN ERROR?????

2022-07-08 Thread MRAB
וס -Original Message- From: MRAB To: python-list@python.org Sent: Fri, Jul 8, 2022 4:47 pm Subject: Re: NILEARN - WHY THIS CODE THROWS AN ERROR? On 08/07/2022 14:06, נתי שטרן wrote: fullcode: import nilearn.plotting as plot import os,gzip,io import nibabel as nib path="C

Re: NILEARN - WHY THIS CODE THROWS AN ERROR?????

2022-07-08 Thread Avi Gross via Python-list
4:47 pm Subject: Re: NILEARN - WHY THIS CODE THROWS AN ERROR? On 08/07/2022 14:06, נתי שטרן wrote: > fullcode: > > > > import nilearn.plotting as plot > import os,gzip,io > import nibabel as nib > path="C:/users/administrator/desktop/nii" > path2="

Re: NILEARN - WHY THIS CODE THROWS AN ERROR?????

2022-07-08 Thread MRAB
On 08/07/2022 14:06, נתי שטרן wrote: fullcode: import nilearn.plotting as plot import os,gzip,io import nibabel as nib path="C:/users/administrator/desktop/nii" path2="C:/users/administrator/desktop/nii/out/" for i in os.listdir(path): if(".nii.gz" in i): pass else:

NILEARN - WHY THIS CODE THROWS AN ERROR?????

2022-07-08 Thread נתי שטרן
fullcode: import nilearn.plotting as plot import os,gzip,io import nibabel as nib path="C:/users/administrator/desktop/nii" path2="C:/users/administrator/desktop/nii/out/" for i in os.listdir(path): if(".nii.gz" in i): pass else: if(".nii" in i): img = nib.lo

Re: why function throws an error?

2022-06-28 Thread Dennis Lee Bieber
e) >self.router.add(route.rule, route.method, route, name=route.name >) >#if DEBUG: route.prepare() From your subject "why function throws an error?". How would we know? You never show us the error traceback, you never provide a mini

Re: why function throws an error?

2022-06-28 Thread Lars Liedtke
Hey, Which error does it throw? Could you please send the stacktrace as well? Cheers Lars -- Lars Liedtke Software Entwickler Phone: Fax:+49 721 98993- E-mail: l...@solute.de solute GmbH Zeppelinstraße 15 76185 Karlsruhe Germany

Re: why function throws an error?

2022-06-28 Thread Mirko via Python-list
Am 28.06.22 um 09:57 schrieb נתי שטרן: def add_route(self, route): #""" Add a route object, but do not change the :data:`Route.app` #attribute.""" self.routes.append(route) self.router.add(route.rule, route.method, route, name=route

why function throws an error?

2022-06-28 Thread נתי שטרן
def add_route(self, route): #""" Add a route object, but do not change the :data:`Route.app` #attribute.""" self.routes.append(route) self.router.add(route.rule, route.method, route, name=route.name ) #if DEBUG: route.prepare()

Re: Facing an error while install python

2019-06-17 Thread Igor Korot
Hi, On Mon, Jun 17, 2019 at 4:59 AM Hassan Hamayun wrote: > > When i Install python i face an error i attach the screenshot with it. Sorry attachments not supported - some blind people are reading the list and provide support. Can you describe what happened and/or copy'n'

Facing an error while install python

2019-06-17 Thread Hassan Hamayun
When i Install python i face an error i attach the screenshot with it. [image: Untitled.png] Thanks & Best Regaed *Hassan Hamayun* -- https://mail.python.org/mailman/listinfo/python-list

Re: Facing an Error after migrating from python 3.4.1 to python 3.6.6 ( Failed to import the site module )

2018-12-30 Thread sandeep . bayi6
On Friday, December 28, 2018 at 5:41:52 PM UTC+5:30, Piet van Oostrum wrote: > sandeep.ba...@gmail.com writes: > > > ``` > > Error code: > > -- > > > >

Re: Facing an Error after migrating from python 3.4.1 to python 3.6.6 ( Failed to import the site module )

2018-12-28 Thread Piet van Oostrum
sandeep.ba...@gmail.com writes: > ``` > Error code: > -- > > > Traceback (most recent call last): > File > "C:\Users\sandeep\AppData\Local\Programs

Facing an Error after migrating from python 3.4.1 to python 3.6.6 ( Failed to import the site module )

2018-12-27 Thread sandeep . bayi6
``` Error code: -- Traceback (most recent call last): File "C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\site.py", line 73,

Re: python 3.5 raiaing an error when import the class Manager in this module sayning name Manager is not define

2017-07-13 Thread Rhodri James
On 12/07/17 16:19, WoFy The 95s wrote: On Wednesday, 12 July 2017 18:57:11 UTC+5:30, Peter Otten wrote: WoFy The 95s wrote: i tried from idle interpreter from person import Manager from person import Manager Traceback (most recent call last): File "", line 1, in from person import Mana

Re: python 3.5 raiaing an error when import the class Manager in this module sayning name Manager is not define

2017-07-12 Thread WoFy The 95s
On Wednesday, 12 July 2017 18:01:35 UTC+5:30, WoFy The 95s wrote: > class Person: > def __init__(self, name, job=None, pay=0): > self.name = name > self.job = job > self.pay = pay > def lastName(self): > return self.name.split()[-1] > def giveRaise(self,

Re: python 3.5 raiaing an error when import the class Manager in this module sayning name Manager is not define

2017-07-12 Thread Peter Otten
WoFy The 95s wrote: > On Wednesday, 12 July 2017 18:57:11 UTC+5:30, Peter Otten wrote: >> WoFy The 95s wrote: >> >> > i tried from idle interpreter >> > >> > from person import Manager >> > >> > >> > >> from person import Manager >> > Traceback (most recent call last): >> > File "", lin

Re: python 3.5 raiaing an error when import the class Manager in this module sayning name Manager is not define

2017-07-12 Thread WoFy The 95s
On Wednesday, 12 July 2017 18:57:11 UTC+5:30, Peter Otten wrote: > WoFy The 95s wrote: > > > i tried from idle interpreter > > > > from person import Manager > > > > > > > from person import Manager > > Traceback (most recent call last): > > File "", line 1, in > > from person import Ma

Re: python 3.5 raiaing an error when import the class Manager in this module sayning name Manager is not define

2017-07-12 Thread Peter Otten
WoFy The 95s wrote: > i tried from idle interpreter > > from person import Manager > > > from person import Manager > Traceback (most recent call last): > File "", line 1, in > from person import Manager > ImportError: cannot import name 'Manager' Enter import person person.__file__

Re: python 3.5 raiaing an error when import the class Manager in this module sayning name Manager is not define

2017-07-12 Thread WoFy The 95s
On Wednesday, 12 July 2017 18:20:32 UTC+5:30, Steve D'Aprano wrote: > Please COPY AND PASTE the FULL error, starting with the line "Traceback". > > The code you show below looks fine, and you don't need an import, so I don't > know what error you are getting. > > > On Wed, 12 Jul 2017 10:31 pm,

Re: python 3.5 raiaing an error when import the class Manager in this module sayning name Manager is not define

2017-07-12 Thread WoFy The 95s
On Wednesday, 12 July 2017 18:20:32 UTC+5:30, Steve D'Aprano wrote: > Please COPY AND PASTE the FULL error, starting with the line "Traceback". > > The code you show below looks fine, and you don't need an import, so I don't > know what error you are getting. > > > On Wed, 12 Jul 2017 10:31 pm,

Re: python 3.5 raiaing an error when import the class Manager in this module sayning name Manager is not define

2017-07-12 Thread Steve D'Aprano
Please COPY AND PASTE the FULL error, starting with the line "Traceback". The code you show below looks fine, and you don't need an import, so I don't know what error you are getting. On Wed, 12 Jul 2017 10:31 pm, lunkamba...@gmail.com wrote: > class Person: > def __init__(self, name, job=N

python 3.5 raiaing an error when import the class Manager in this module sayning name Manager is not define

2017-07-12 Thread lunkambamuk
class Person: def __init__(self, name, job=None, pay=0): self.name = name self.job = job self.pay = pay def lastName(self): return self.name.split()[-1] def giveRaise(self, percent): self.pay = int(self.pay * (1 + percent)) def __repr__(self):

Re: help with an error msg please

2017-05-14 Thread Charles T. Smith
On Sun, 14 May 2017 15:30:52 +0200, Pavol Lisy wrote: > On 5/14/17, Charles T. Smith wrote: >> I'm stumped by this: ... > Did you create getopt.py in your working directory? If so then try to > rename it. > > PL. That was it! Not in my working directory, but in the directory where the test p

Re: help with an error msg please

2017-05-14 Thread Pavol Lisy
On 5/14/17, Pavol Lisy wrote: > On 5/14/17, Charles T. Smith wrote: >> I'm stumped by this: > >> $ PYTHONPATH= python except >> Traceback (most recent call last): >> File "except", line 7, in >> except getopt.error, msg: >> AttributeError: 'module' object has no attribute 'error' >> >> >>

Re: help with an error msg please

2017-05-14 Thread Pavol Lisy
On 5/14/17, Charles T. Smith wrote: > I'm stumped by this: > $ PYTHONPATH= python except > Traceback (most recent call last): > File "except", line 7, in > except getopt.error, msg: > AttributeError: 'module' object has no attribute 'error' > > > The program is: > > $ cat except > #!/usr

Re: help with an error msg please

2017-05-14 Thread Lutz Horn
> $ PYTHONPATH= python except > Traceback (most recent call last): > File "except", line 7, in > except getopt.error, msg: > AttributeError: 'module' object has no attribute 'error' > > > The program is: > > $ cat except > #!/usr/bin/env python > > import getopt > > try: > opts, a

help with an error msg please

2017-05-14 Thread Charles T. Smith
I'm stumped by this: $ PYTHONPATH= python except Traceback (most recent call last): File "except", line 7, in except getopt.error, msg: AttributeError: 'module' object has no attribute 'error' The program is: $ cat except #!/usr/bin/env python import getopt try: opts, args = get

Re: Python 3 raising an error where Python 2 did not

2016-08-26 Thread Terry Reedy
On 8/26/2016 4:50 AM, d...@forestfield.co.uk wrote: In a program I'm converting to Python 3 I'm examining a list of divisor values, some of which can be None, to find the first with a value greater than 1. Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32 Type

Re: Python 3 raising an error where Python 2 did not

2016-08-26 Thread d...@forestfield.co.uk
Thanks for the replies. My example seems to be from the fairly harmless end of a wedge of behaviours that are being handled much more sensibly in Python 3. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 raising an error where Python 2 did not

2016-08-26 Thread Peter Otten
ot;, "copyright", "credits" or "license" for > more information. >>>> None > 1 > Traceback (most recent call last): > File "", line 1, in > TypeError: unorderable types: NoneType() > int() > > I can live with that but I&#x

Re: Python 3 raising an error where Python 2 did not

2016-08-26 Thread Chris Angelico
MD64)] on win32 > Type "help", "copyright", "credits" or "license" for more information. >>>> None > 1 > Traceback (most recent call last): > File "", line 1, in > TypeError: unorderable types: NoneType() > int() >

Python 3 raising an error where Python 2 did not

2016-08-26 Thread d...@forestfield.co.uk
n. >>> None > 1 Traceback (most recent call last): File "", line 1, in TypeError: unorderable types: NoneType() > int() I can live with that but I'm curious why it was decided that this should now raise an error. David Hughes Forestfield Software -- https://mail.python.org/mailman/listinfo/python-list

Re: an error

2016-07-19 Thread Laurent Pointal
when i delete this it tells me that there is an error at the > clockfps.tick(fps) thing what the heck is going on :p Someone else shows you the error. When you have a syntax error in a specific line (see printed traceback), it is common to have to look at previous lines to identify some op

Re: an error

2016-07-19 Thread Terry Reedy
On 7/19/2016 2:07 AM, WePlayGames WeEnjoyIt wrote: pygame1.blit(image3,(143,146) If you type this line (including \n) into IDLE's Python-aware editor, it will notice that there is an open parenthesis for a function call and indent the next line to the space under the 'i' of image. This i

Re: an error

2016-07-18 Thread Chris Angelico
On Tue, Jul 19, 2016 at 4:37 PM, WePlayGames WeEnjoyIt wrote: > Τη Τρίτη, 19 Ιουλίου 2016 - 9:32:34 π.μ. UTC+3, ο χρήστης Chris Angelico > έγραψε: >> On Tue, Jul 19, 2016 at 4:26 PM, WePlayGames WeEnjoyIt >> wrote: >> > thanks chris for responding, it doesnt say anything else just syntax error >

Re: an error

2016-07-18 Thread WePlayGames WeEnjoyIt
Τη Τρίτη, 19 Ιουλίου 2016 - 9:32:34 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Tue, Jul 19, 2016 at 4:26 PM, WePlayGames WeEnjoyIt > wrote: > > thanks chris for responding, it doesnt say anything else just syntax error > > it have seen this error again when im using the for loop and it seem

Re: an error

2016-07-18 Thread Chris Angelico
On Tue, Jul 19, 2016 at 4:26 PM, WePlayGames WeEnjoyIt wrote: > thanks chris for responding, it doesnt say anything else just syntax error > it have seen this error again when im using the for loop and it seems like > when i delete everything after total+=1 i get a different error called > UNEXP

Re: an error

2016-07-18 Thread WePlayGames WeEnjoyIt
Τη Τρίτη, 19 Ιουλίου 2016 - 9:20:20 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Tue, Jul 19, 2016 at 4:07 PM, WePlayGames WeEnjoyIt > wrote: > > the problem with this is that i get an syntax error at the very end at the > > TOTAL+=1 when i delete this it tells me that th

Re: an error

2016-07-18 Thread Ian Kelly
On Tue, Jul 19, 2016 at 12:07 AM, WePlayGames WeEnjoyIt wrote: >pygame1.blit(image3,(143,146) This line is missing a closing parenthesis. -- https://mail.python.org/mailman/listinfo/python-list

Re: an error

2016-07-18 Thread Chris Angelico
On Tue, Jul 19, 2016 at 4:07 PM, WePlayGames WeEnjoyIt wrote: > the problem with this is that i get an syntax error at the very end at the > TOTAL+=1 when i delete this it tells me that there is an error at the > clockfps.tick(fps) thing what the heck is going on :p > When you

an error

2016-07-18 Thread WePlayGames WeEnjoyIt
kfps.tick(fps) pygame.display.update() the problem with this is that i get an syntax error at the very end at the TOTAL+=1 when i delete this it tells me that there is an error at the clockfps.tick(fps) thing what the heck is going on :p -- https://mail.python.org/mailman/listinfo/python-list

Re: A strange one: a commented line throws an error

2016-05-16 Thread sohcahtoa82
On Monday, May 16, 2016 at 10:25:54 AM UTC-7, DFS wrote: > print "test" > # stz source pytz.timezone() instance (for naïve local datetimes) > > $ python temp.py >File "temp.py", line 2 > SyntaxError: Non-ASCII character '\xc3' in file temp.py on line 2, but > no encoding declared; see http://

Re: Is this an error in python-babel or am I missing something?

2016-03-20 Thread cl
c...@isbd.net wrote: > I am getting the following error when running some code that uses > python-sqlkit. This uses python-babel to handle dates for different > locales. > > Traceback (most recent call last): > File > "/usr/local/lib/python2.7/dist-packages/sqlkit-0.9.6.1-py2.7.egg/sqlkit/wi

Is this an error in python-babel or am I missing something?

2016-03-19 Thread cl
I am getting the following error when running some code that uses python-sqlkit. This uses python-babel to handle dates for different locales. Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/sqlkit-0.9.6.1-py2.7.egg/sqlkit/widgets/table/columns.py", lin

Re: Is this an error in python-babel or am I missing something?

2016-03-19 Thread Rick Johnson
On Thursday, March 17, 2016 at 5:48:12 PM UTC-5, c...@isbd.net wrote: > So, my mistake, but python-babel should have caught it. Yeah, errors like that are a real pisser, and the further away from the source that they break, the more headache they become to resolve. They send you on a wild goose

Re: Is this an error in python-babel or am I missing something?

2016-03-19 Thread cl
Rick Johnson wrote: > On Thursday, March 17, 2016 at 5:48:12 PM UTC-5, c...@isbd.net wrote: > > So, my mistake, but python-babel should have caught it. > > Yeah, errors like that are a real pisser, and the further away from the > source that they break, the more headache they become to resolve.

Re: Location of an Error Message

2015-09-02 Thread Ian Kelly
On Wed, Sep 2, 2015 at 1:30 PM, wrote: > Where are the error messages stored? E. g., in which (source code) file is > the message "NameError: name 'sdfe' is not defined" stored (except for > variable arguments like "sdfe")? I do know that I can throw exceptions for > myself, but this question

Location of an Error Message

2015-09-02 Thread stehlampen
Where are the error messages stored? E. g., in which (source code) file is the message "NameError: name 'sdfe' is not defined" stored (except for variable arguments like "sdfe")? I do know that I can throw exceptions for myself, but this question came to my mind in thinking about translating the

Re: Switching from nose to unittest2 - how to continue after an error?

2014-08-26 Thread Skip Montanaro
On Tue, Aug 26, 2014 at 11:58 AM, Terry Reedy wrote: > If you want to be understood, give a snippet of code, what happens now, and > what you want to happen. Thanks, but not really necessary. I have retreated into nose-land. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Switching from nose to unittest2 - how to continue after an error?

2014-08-26 Thread Terry Reedy
obviously did not understand your question "How to continue after an error?" and still don't. If you want to be understood, give a snippet of code, what happens now, and what you want to happen. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Switching from nose to unittest2 - how to continue after an error?

2014-08-26 Thread Skip Montanaro
On Mon, Aug 25, 2014 at 4:47 PM, Terry Reedy wrote: > I know of two ways to collect multiple failures within a test function: Thanks, but I mean multiple test failures. I fully expect a specific test to exit when it hits an assertion failure. I suspect my problem is due to lack of support for th

Re: Switching from nose to unittest2 - how to continue after an error?

2014-08-25 Thread alex23
On 26/08/2014 6:12 AM, Mark Lawrence wrote: Whatever happened to "There should be one-- and preferably only one --obvious way to do it."? :) Ignoring for a moment that "one obvious way" only applies to Python-the-language, when it comes to libraries, there's a few factors (IMO) that affect th

Re: Switching from nose to unittest2 - how to continue after an error?

2014-08-25 Thread Terry Reedy
On 8/25/2014 2:13 PM, Skip Montanaro wrote: It appears that unittest in Python 2.7 should be capable enough that I can abandon nose in favor of python -m unittest. How do I get it to continue past the first failure? Unittest normally stops with the first failure in a test_function. If the asse

Re: Switching from nose to unittest2 - how to continue after an error?

2014-08-25 Thread Mark Lawrence
On 25/08/2014 20:54, Skip Montanaro wrote: On Mon, Aug 25, 2014 at 1:59 PM, Mark Lawrence wrote: If you wish to write tests using something that can be compiled out please don't let me stop you. Having said that if nose or even nose2 works for you why not stick with it? There's also testfixtu

Re: Switching from nose to unittest2 - how to continue after an error?

2014-08-25 Thread Skip Montanaro
On Mon, Aug 25, 2014 at 1:59 PM, Mark Lawrence wrote: > If you wish to write tests using something that can be compiled out please > don't let me stop you. Having said that if nose or even nose2 works for you > why not stick with it? There's also testfixtures, pytest, doctest and > presumably ot

Re: Switching from nose to unittest2 - how to continue after an error?

2014-08-25 Thread Mark Lawrence
On 25/08/2014 19:36, Skip Montanaro wrote: It appears that unittest in Python 2.7 should be capable enough that I can abandon nose in favor of python -m unittest. How do I get it to continue past the first failure? The --help output indicates that a -f flag causes it to "fail fast", however, that

Re: Switching from nose to unittest2 - how to continue after an error?

2014-08-25 Thread Skip Montanaro
> It appears that unittest in Python 2.7 should be capable enough that I > can abandon nose in favor of python -m unittest. How do I get it to > continue past the first failure? The --help output indicates that a -f > flag causes it to "fail fast", however, that appears to be the > default. How do

Switching from nose to unittest2 - how to continue after an error?

2014-08-25 Thread Skip Montanaro
It appears that unittest in Python 2.7 should be capable enough that I can abandon nose in favor of python -m unittest. How do I get it to continue past the first failure? The --help output indicates that a -f flag causes it to "fail fast", however, that appears to be the default. How do I get it t

Re: ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S SIZE 11.5 NEW IN BOX', '$49.99')'

2014-02-25 Thread MRAB
On 2014-02-25 17:37, nowebdevmy...@gmail.com wrote: HI, I'm also getting this kind of error. This will show when I do the edit function http://screencast.com/t/hGSbe1vt and this when performing the delete "Error: You have an error in your SQL syntax; check the manual that correspond

Re: ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S SIZE 11.5 NEW IN BOX', '$49.99')'

2014-02-25 Thread nowebdevmyrrh
HI, I'm also getting this kind of error. This will show when I do the edit function http://screencast.com/t/hGSbe1vt and this when performing the delete "Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax t

Re: ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S SIZE 11.5 NEW IN BOX', '$49.99')'

2013-12-10 Thread Chris Angelico
On Wed, Dec 11, 2013 at 3:23 AM, Dan Stromberg wrote: > > On Mon, Dec 9, 2013 at 12:41 AM, Jai wrote: >> >> >> sql = """insert into `category` (url, catagory,price) VAlUES >> ('%s', '%s', '%s')"""%(link1,x,y) > > > Is that VALUES or VAlUES or VAIUES? It probably should be VALUES. SQL's

Re: ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S SIZE 11.5 NEW IN BOX', '$49.99')'

2013-12-10 Thread Dan Stromberg
On Mon, Dec 9, 2013 at 12:41 AM, Jai wrote: > > sql = """insert into `category` (url, catagory,price) VAlUES > ('%s', '%s', '%s')"""%(link1,x,y) > Is that VALUES or VAlUES or VAIUES? It probably should be VALUES. -- https://mail.python.org/mailman/listinfo/python-list

Re: ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S SIZE 11.5 NEW IN BOX', '$49.99')'

2013-12-09 Thread MRAB
= unicodedata.normalize('NFKD', sql).encode('ascii','ignore') cursor.execute(sql) ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S SIZE 11.5 NEW IN BOX',

Re: ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S SIZE 11.5 NEW IN BOX', '$49.99')'

2013-12-09 Thread Chris Angelico
On Mon, Dec 9, 2013 at 7:41 PM, Jai wrote: > for x , y in zip(lst_content, lst_price): > sql = """insert into `category` (url, catagory,price) VAlUES ('%s', > '%s', '%s')"""%(link1,x,y) > #print sql > sql = unicodedata.normalize('NFKD', sql).encode('ascii','ignore') >

Re: ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S SIZE 11.5 NEW IN BOX', '$49.99')'

2013-12-09 Thread Daniel Watkins
de('ascii','ignore') > cursor.execute(sql) > > ProgrammingError: (1064, "You have an error in your SQL syntax; check the > manual that corresponds to your MySQL server version for the right syntax to > use near 'S SIZE 11.5 NEW IN BOX', &#x

ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S SIZE 11.5 NEW IN BOX', '$49.99')' at

2013-12-09 Thread Jai
ip(lst_content, lst_price): sql = """insert into `category` (url, catagory,price) VAlUES ('%s', '%s', '%s')"""%(link1,x,y) #print sql sql = unicodedata.normalize('NFKD', sql).encode('ascii',&#

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-06 Thread Armando Montes De Oca
Yes Steven a C book I am reading has a quote "Every programmer is fluent in swearing" After my blow ups and confusion I am happy with my program anyway. I will get better at it eventually. I did change things to "raw_input" and works fine. -- http://mail.python.org/mailman/listinfo/python-list

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Steven D'Aprano
On Wed, 05 Jun 2013 07:40:52 -0700, Armando Montes De Oca wrote: > Traceback (most recent call last): > File "Guessing_Game.py", line 32, in > input (enter) > File "", line 0 > ^ > SyntaxError: unexpected EOF while parsing Your problem is that you should not be using input(), but ra

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Mark Lawrence
On 05/06/2013 23:51, Armando Montes De Oca wrote: Well I am sure this will end up a simple solution which is not solved by the geniuses with no sense of humor. Programmers are known for being odd nerds and I just got two of them. Goldstick Jesus what a couple of lazy minded nonsense. Your an a

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Armando Montes De Oca
Well I am sure this will end up a simple solution which is not solved by the geniuses with no sense of humor. Programmers are known for being odd nerds and I just got two of them. Goldstick Jesus what a couple of lazy minded nonsense. Your an ass hole. -- http://mail.python.org/mailman/listinf

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Armando Montes De Oca
Not to make excuses as to my forum etiquette I apologize. I am half Cuban and simple. I meant no disrespect I like Mr. Goldstick's name. Maybe I can find the answer somewhere else true. However a simple code to close the program like in Visual Basic "Me.close" seems like something that should c

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Joel Goldstick
On Wed, Jun 5, 2013 at 4:18 PM, Thomas Murphy wrote: > Goldstick which seems Jewish to me. I would think as a Gentile Heathen > Jesus save us this would project a need for a good sex life > > *WAT* > * > * > I second the WAT. You are a strange person. I think you were being offensive. I can't

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 5:59 AM, Armando Montes De Oca wrote: > Well I am replying to To whom it may concern at this point I am a bit lost. I > posted all my code. I am not taking classes on this nor do I have a book I > followed a guy on You Tube. I am a student but I heard Python is a good > l

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Thomas Murphy
Goldstick which seems Jewish to me. I would think as a Gentile Heathen Jesus save us this would project a need for a good sex life *WAT* * * * * Armando, are you understanding that input and raw_input make Python do very different things, and this is dependent of the version of Python you're using

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Armando Montes De Oca
Well I am replying to To whom it may concern at this point I am a bit lost. I posted all my code. I am not taking classes on this nor do I have a book I followed a guy on You Tube. I am a student but I heard Python is a good language to learn in conjunction with C++ and Perl for example. I have

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Joel Goldstick
gt; As for how to change that line, it depends on how you're running the > script. > -- > http://mail.python.org/mailman/listinfo/python-list > The program exited with code: 0 is being provided by geany after your program has run. If instead you open up a terminal and type: python your_progr

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Zachary Ware
On Wed, Jun 5, 2013 at 10:35 AM, Armando Montes De Oca wrote: > Thank You now the program exits with: > (program exited with code: 0) > Press return to continue > > > Is there a way to get the line (program exited with code: 0) to say something > > like: "The game will end now" > > Press return to

  1   2   3   >