it is not working .....how to unstalll it

2019-06-07 Thread nidhi singh

I’m
protected online with Avast Free Antivirus. Get it here — it’s free forever.

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-- 
https://mail.python.org/mailman/listinfo/python-list


No option available for saving files

2019-06-07 Thread Shreya Joshi
Hi ma’am/sir,
I’ve started using python Shell 3.6.8-32 bit executable installer on windows 
OS. But there is no option to save or open a new file. This gives an output 
after every line. But, I want to work on longer codes to execute programs. 

Am I using the right interface? Please help.
Here is a screenshot…

Sent from Mail for Windows 10

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: No option available for saving files

2019-06-07 Thread Calvin Spealman
The python shell is good for experimenting and testing some things out, but
you are right it isn't for writing programs you actually re-use and run
later. You can use any text editor you want, Visual Studio Code and Sublime
Text are both popular, but anything will do at all. There is also a simple
editor with integration for running Python included in the Python Windows
installer, called IDLE. You should be able to find that in your start menu.

On Fri, Jun 7, 2019 at 4:24 AM Shreya Joshi 
wrote:

> Hi ma’am/sir,
> I’ve started using python Shell 3.6.8-32 bit executable installer on
> windows OS. But there is no option to save or open a new file. This gives
> an output after every line. But, I want to work on longer codes to execute
> programs.
>
> Am I using the right interface? Please help.
> Here is a screenshot…
>
> Sent from Mail for Windows 10
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

cspea...@redhat.com  M: +1.336.210.5107
[image: https://red.ht/sig] 
TRIED. TESTED. TRUSTED. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Python3-3.7.3: cannot run pdb

2019-06-07 Thread Rich Shepard

Running python3-3.7.3 on Slackware-14.2.

I'm trying to debug a module using pdb but failing with all attempts. For
example, using breakpoint() at the line where I want to stop the running
module and examine each line's execution, the program runs to completion and
shows there's a syntax error:

$ python3 geochem.py
  File "geochem.py", line 35
boxchoices = ttk.Combobox(self, textvariable=med,
 ^
SyntaxError: invalid syntax

Importing pdb and inserting pdb.set_trace() produces the same output.

invoking pdb from the command line produces a full back trace:

$ python3 -m pdb geochem.py 
Traceback (most recent call last):

  File "/usr/lib/python3.7/pdb.py", line 1701, in main
pdb._runscript(mainpyfile)
  File "/usr/lib/python3.7/pdb.py", line 1570, in _runscript
self.run(statement)
  File "/usr/lib/python3.7/bdb.py", line 585, in run
exec(cmd, globals, locals)
  File "", line 1, in 
  File "/home/rshepard/development/openEDMS/views/geochem.py", line 35
boxchoices = ttk.Combobox(self, textvariable=med,
 ^
SyntaxError: invalid syntax

I don't understand the source of the syntax error and I'm not able to allow
pdb to step through the code.

Your advice appreciated,

Rich




--
https://mail.python.org/mailman/listinfo/python-list


Re: Python3-3.7.3: cannot run pdb

2019-06-07 Thread Peter Otten
Rich Shepard wrote:

> Running python3-3.7.3 on Slackware-14.2.
> 
> I'm trying to debug a module using pdb but failing with all attempts. For
> example, using breakpoint() at the line where I want to stop the running
> module and examine each line's execution, the program runs to completion
> and shows there's a syntax error:
> 
> $ python3 geochem.py
>File "geochem.py", line 35
>  boxchoices = ttk.Combobox(self, textvariable=med,
>   ^
> SyntaxError: invalid syntax
> 
> Importing pdb and inserting pdb.set_trace() produces the same output.
> 
> invoking pdb from the command line produces a full back trace:
> 
> $ python3 -m pdb geochem.py
> Traceback (most recent call last):
>File "/usr/lib/python3.7/pdb.py", line 1701, in main
>  pdb._runscript(mainpyfile)
>File "/usr/lib/python3.7/pdb.py", line 1570, in _runscript
>  self.run(statement)
>File "/usr/lib/python3.7/bdb.py", line 585, in run
>  exec(cmd, globals, locals)
>File "", line 1, in 
>File "/home/rshepard/development/openEDMS/views/geochem.py", line 35
>  boxchoices = ttk.Combobox(self, textvariable=med,
>   ^
> SyntaxError: invalid syntax
> 
> I don't understand the source of the syntax error and I'm not able to
> allow pdb to step through the code.

You need to fix all syntax errors before you can run the script, with or 
without pdb.

The syntax error you are seeing is typically caused by unclosed parentheses 
in a line preceding the one shown by the compiler, e. g.

>>> x = 2 * (3 + 4
... foo = 42
  File "", line 2
foo = 42
  ^
SyntaxError: invalid syntax


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python3-3.7.3: cannot run pdb

2019-06-07 Thread MRAB

On 2019-06-07 17:26, Rich Shepard wrote:

Running python3-3.7.3 on Slackware-14.2.

I'm trying to debug a module using pdb but failing with all attempts. For
example, using breakpoint() at the line where I want to stop the running
module and examine each line's execution, the program runs to completion and
shows there's a syntax error:

$ python3 geochem.py
File "geochem.py", line 35
  boxchoices = ttk.Combobox(self, textvariable=med,
   ^
SyntaxError: invalid syntax

Importing pdb and inserting pdb.set_trace() produces the same output.

invoking pdb from the command line produces a full back trace:

$ python3 -m pdb geochem.py
Traceback (most recent call last):
File "/usr/lib/python3.7/pdb.py", line 1701, in main
  pdb._runscript(mainpyfile)
File "/usr/lib/python3.7/pdb.py", line 1570, in _runscript
  self.run(statement)
File "/usr/lib/python3.7/bdb.py", line 585, in run
  exec(cmd, globals, locals)
File "", line 1, in 
File "/home/rshepard/development/openEDMS/views/geochem.py", line 35
  boxchoices = ttk.Combobox(self, textvariable=med,
   ^
SyntaxError: invalid syntax

I don't understand the source of the syntax error and I'm not able to allow
pdb to step through the code.

Your advice appreciated,

It's possible that the error is actually on the previous line and that 
it thinks that what's on line 35 is a continuation of what's on line 34, 
but it isn't.

--
https://mail.python.org/mailman/listinfo/python-list


Re: Python3-3.7.3: cannot run pdb

2019-06-07 Thread Rich Shepard

On Fri, 7 Jun 2019, Peter Otten wrote:


You need to fix all syntax errors before you can run the script, with or
without pdb.


Peter,

I thought the debugger would show me the location of the syntax error.


The syntax error you are seeing is typically caused by unclosed
parentheses in a line preceding the one shown by the compiler, e. g.


Yes, I know that and have looked for it unsuccessfully. Will post preceeding
lines in response to MRAB's response.

Regards,

Rich

--
https://mail.python.org/mailman/listinfo/python-list


Re: Python3-3.7.3: cannot run pdb

2019-06-07 Thread Rich Shepard

On Fri, 7 Jun 2019, MRAB wrote:


It's possible that the error is actually on the previous line and that it
thinks that what's on line 35 is a continuation of what's on line 34, but
it isn't.


MRAB,

If that's the case I'm missing seeing the error. Here are the lines prior to
and including line 36:

def __init__(self, parent, *args, **kwargs):
super().__init__(parent, *args, **kwargs)
# A dict to keep track of input widgets
self.inputs = {}

# line 0
self.inputs['name'] = LabelInput(
self, 'Site Name',
input_var=tk.StringVar(),
)
self.inputs['name'].grid(sticky=tk.W, row=0, column=0)

self.inputs['date'] = LabelInput(
self, 'Sample Date',
input_var=tk.StringVar(),
)
self.inputs['date'].grid(row=0, column=1)

self.inputs['medium'] = LabelInput(
self, 'Medium',
med = tk.StringVar()
boxchoices = ttk.Combobox(self, textvariable=med,
values=['Storm water', 'Surface water',
'Ground water', 'Sediments', 
'Soils'])
)

emacs shows all parentheses are paired. I hope that fresh eyeballs see what
I keep missing.

Regards,

Rich

--
https://mail.python.org/mailman/listinfo/python-list


Re: Python3-3.7.3: cannot run pdb

2019-06-07 Thread Rhodri James

On 07/06/2019 18:28, Rich Shepard wrote:

On Fri, 7 Jun 2019, Peter Otten wrote:


You need to fix all syntax errors before you can run the script, with or
without pdb.


Peter,

I thought the debugger would show me the location of the syntax error.


The syntax error causes Python to halt before it has finished compiling 
your program into byte code.  There is nothing to run pdb on!


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python3-3.7.3: cannot run pdb

2019-06-07 Thread Danilo Coccia
Il 07/06/2019 19:31, Rich Shepard ha scritto:
> On Fri, 7 Jun 2019, MRAB wrote:
> 
>> It's possible that the error is actually on the previous line and that it
>> thinks that what's on line 35 is a continuation of what's on line 34, but
>> it isn't.
> 
> MRAB,
> 
> If that's the case I'm missing seeing the error. Here are the lines
> prior to
> and including line 36:
> 
> def __init__(self, parent, *args, **kwargs):
>     super().__init__(parent, *args, **kwargs)
>     # A dict to keep track of input widgets
>     self.inputs = {}
> 
>     # line 0
>     self.inputs['name'] = LabelInput(
>     self, 'Site Name',
>     input_var=tk.StringVar(),
>     )
>     self.inputs['name'].grid(sticky=tk.W, row=0, column=0)
> 
>     self.inputs['date'] = LabelInput(
>     self, 'Sample Date',
>     input_var=tk.StringVar(),
>     )
>     self.inputs['date'].grid(row=0, column=1)
> 
>     self.inputs['medium'] = LabelInput(
>     self, 'Medium',
>     med = tk.StringVar()
  ^^^
 Missing a comma here!

>     boxchoices = ttk.Combobox(self, textvariable=med,
>     values=['Storm water', 'Surface water',
>     'Ground water', 'Sediments',
> 'Soils'])
>     )
> 
> emacs shows all parentheses are paired. I hope that fresh eyeballs see what
> I keep missing.
> 
> Regards,
> 
> Rich
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python3-3.7.3: cannot run pdb

2019-06-07 Thread Rich Shepard

On Fri, 7 Jun 2019, Rhodri James wrote:


The syntax error causes Python to halt before it has finished compiling
your program into byte code. There is nothing to run pdb on!


Okay. That certainly makes sense. It's been a very long time since I did any
Python coding.

Regards,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python3-3.7.3: cannot run pdb

2019-06-07 Thread MRAB

On 2019-06-07 18:31, Rich Shepard wrote:

On Fri, 7 Jun 2019, MRAB wrote:


It's possible that the error is actually on the previous line and that it
thinks that what's on line 35 is a continuation of what's on line 34, but
it isn't.


MRAB,

If that's the case I'm missing seeing the error. Here are the lines prior to
and including line 36:

def __init__(self, parent, *args, **kwargs):
  super().__init__(parent, *args, **kwargs)
  # A dict to keep track of input widgets
  self.inputs = {}

  # line 0
  self.inputs['name'] = LabelInput(
  self, 'Site Name',
  input_var=tk.StringVar(),
  )
  self.inputs['name'].grid(sticky=tk.W, row=0, column=0)

  self.inputs['date'] = LabelInput(
  self, 'Sample Date',
  input_var=tk.StringVar(),
  )
  self.inputs['date'].grid(row=0, column=1)

  self.inputs['medium'] = LabelInput(


Rememnber that these lines are an argument list.


  self, 'Medium',
  med = tk.StringVar()

^ Missing comma.


  boxchoices = ttk.Combobox(self, textvariable=med,
  values=['Storm water', 'Surface water',
  'Ground water', 'Sediments', 
'Soils'])
  )

emacs shows all parentheses are paired. I hope that fresh eyeballs see what
I keep missing.


--
https://mail.python.org/mailman/listinfo/python-list


Re: Python3-3.7.3: cannot run pdb

2019-06-07 Thread Rich Shepard

On Fri, 7 Jun 2019, Danilo Coccia wrote:


    self.inputs['medium'] = LabelInput(
    self, 'Medium',
    med = tk.StringVar()

 ^^^
Missing a comma here!


Thanks, Danilo! When we write the code we too often see what we expect to
see and not what's actually there.

Fresh eyes to the rescue once again.

Regards,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Rich Shepard

I understand positional and keyword arguments and the syntax for the
ttk.Checkbutton as described on
.

$ python3 geochem.py
  File "geochem.py", line 60
ttk.Checkbutton(text='Censored?', variable=input_var),
^
SyntaxError: positional argument follows keyword argument

I've provided only keyword arguments to the call to the ttk.Checkbutton
widget and am not seeing the positional argument that follows. Please show
me what I miss seeing here:

self.inputs['nondetect'] = LabelInput(
self, 'Censored?',
#input_var = tk.BooleanVar(),
input_var = tk.IntVar,
ttk.Checkbutton(text='Censored?', variable=input_var),
)

It does not matter if the variable holding the checkbutton's state is an
IntVar or a BooleanVar, the same syntax error is generated. Commenting out
all widgets prior to this one makes no difference so the error must be
local. Yes?

Please explain where the positional argument is located.

Regards,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Rhodri James

On 07/06/2019 19:43, Rich Shepard wrote:

I understand positional and keyword arguments and the syntax for the
ttk.Checkbutton as described on
.

$ python3 geochem.py
   File "geochem.py", line 60
     ttk.Checkbutton(text='Censored?', variable=input_var),
     ^
SyntaxError: positional argument follows keyword argument

I've provided only keyword arguments to the call to the ttk.Checkbutton
widget and am not seeing the positional argument that follows. Please show
me what I miss seeing here:


Context is everything!


self.inputs['nondetect'] = LabelInput(
     self, 'Censored?',
     #input_var = tk.BooleanVar(),
     input_var = tk.IntVar,
     ttk.Checkbutton(text='Censored?', variable=input_var),
)


Now we can see that Python isn't complaining about the arguments to 
tth.Checkbutton.  The call to ttk.Checkbutton() is itself a positional 
argument in the call to LabelInput, coming after the keyword argument 
"input_var = tk.IntVar".


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Alexandre Brault
On 2019-06-07 2:43 p.m., Rich Shepard wrote:
> I understand positional and keyword arguments and the syntax for the
> ttk.Checkbutton as described on
> .
>
> $ python3 geochem.py
>   File "geochem.py", line 60
>     ttk.Checkbutton(text='Censored?', variable=input_var),
>     ^
> SyntaxError: positional argument follows keyword argument
>
> I've provided only keyword arguments to the call to the ttk.Checkbutton
> widget and am not seeing the positional argument that follows. Please
> show
> me what I miss seeing here:
>
> self.inputs['nondetect'] = LabelInput(
>     self, 'Censored?',
>     #input_var = tk.BooleanVar(),
>     input_var = tk.IntVar,
>     ttk.Checkbutton(text='Censored?', variable=input_var),
> )
>
> It does not matter if the variable holding the checkbutton's state is an
> IntVar or a BooleanVar, the same syntax error is generated. Commenting
> out
> all widgets prior to this one makes no difference so the error must be
> local. Yes?
>
> Please explain where the positional argument is located.
>
> Regards,
>
> Rich

The positional argument in question is not one you passed to the
ttk.Checkbutton call, but the ttk.Checkbutton itself that you're passing
to LabelInput as a positional argument after the input_var keyword argument

Alex

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Chris Angelico
On Sat, Jun 8, 2019 at 4:45 AM Rich Shepard  wrote:
> I've provided only keyword arguments to the call to the ttk.Checkbutton
> widget and am not seeing the positional argument that follows. Please show
> me what I miss seeing here:
>
> self.inputs['nondetect'] = LabelInput(
>  self, 'Censored?',
>  #input_var = tk.BooleanVar(),
>  input_var = tk.IntVar,
>  ttk.Checkbutton(text='Censored?', variable=input_var),
> )
>

General principle: When you see a syntax error, look *before* that
point (reading top-to-bottom, left-to-right, same as the parser does).
Often, the problem is prior to the point where it was actually
discovered.

Specific point: It looks like perhaps you're trying to assign in the
middle of a function call. That doesn't do what you think it does, but
on sufficiently-recent versions of Python, you can do this with
"input_var := tk.IntVar". That might be the easiest solution.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Rich Shepard

On Fri, 7 Jun 2019, Alexandre Brault wrote:


The positional argument in question is not one you passed to the
ttk.Checkbutton call, but the ttk.Checkbutton itself that you're passing
to LabelInput as a positional argument after the input_var keyword
argument


Alex,

Got it, thanks. Now to figure out the proper way of writing the widget.

Regards,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Rich Shepard

On Fri, 7 Jun 2019, Rhodri James wrote:


Now we can see that Python isn't complaining about the arguments to
tth.Checkbutton. The call to ttk.Checkbutton() is itself a positional
argument in the call to LabelInput, coming after the keyword argument
"input_var = tk.IntVar".


Thank you Rhodri. More reading is now the next thing I do.

Regards,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Rich Shepard

On Sat, 8 Jun 2019, Chris Angelico wrote:


General principle: When you see a syntax error, look *before* that point
(reading top-to-bottom, left-to-right, same as the parser does). Often,
the problem is prior to the point where it was actually discovered.


Chris,

This is why I commented out all widgets prior to the ttk.Checkbutton. If the
error was earlier the error would not have appeared.


Specific point: It looks like perhaps you're trying to assign in the
middle of a function call. That doesn't do what you think it does, but on
sufficiently-recent versions of Python, you can do this with "input_var :=
tk.IntVar". That might be the easiest solution.


Yes, I need to use a diffrent syntax for Checkbuttons and Radiobuttons than
for other widgets. Back to my reference book for more study.

Regards,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Chris Angelico
On Sat, Jun 8, 2019 at 6:01 AM Rich Shepard  wrote:
>
> On Sat, 8 Jun 2019, Chris Angelico wrote:
>
> > General principle: When you see a syntax error, look *before* that point
> > (reading top-to-bottom, left-to-right, same as the parser does). Often,
> > the problem is prior to the point where it was actually discovered.
>
> Chris,
>
> This is why I commented out all widgets prior to the ttk.Checkbutton. If the
> error was earlier the error would not have appeared.

Right, but the problem was actually in the LabelInput call, not the
Checkbutton itself.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: No option available for saving files

2019-06-07 Thread Terry Reedy

On 6/7/2019 10:51 AM, Calvin Spealman wrote:

The python shell is good for experimenting and testing some things out, but
you are right it isn't for writing programs you actually re-use and run
later. You can use any text editor you want, Visual Studio Code and Sublime
Text are both popular, but anything will do at all. There is also a simple
editor with integration for running Python included in the Python Windows
installer, called IDLE. You should be able to find that in your start menu.

On Fri, Jun 7, 2019 at 4:24 AM Shreya Joshi 
wrote:


Hi ma’am/sir,
I’ve started using python Shell 3.6.8-32 bit executable installer on
windows OS. But there is no option to save or open a new file. This gives
an output after every line. But, I want to work on longer codes to execute
programs.

Am I using the right interface? Please help.


An interactive shell is for experimentation a statement at a time.
You need an editor for longer code.  IDLE has both.  You can save its 
Shell session to a file for later review or extraction of code that worked.



Here is a screenshot…


This is a text only mailing list with no attachments allowed, certainly 
no images.



--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


Re: Python3-3.7.3: cannot run pdb

2019-06-07 Thread Terry Reedy

On 6/7/2019 12:26 PM, Rich Shepard wrote:

Running python3-3.7.3 on Slackware-14.2.



$ python3 geochem.py
   File "geochem.py", line 35
     boxchoices = ttk.Combobox(self, textvariable=med,
  ^
SyntaxError: invalid syntax


An addendum to previous comments solving the issue.  In 3.8.0b1, you 
would see the caret at the beginning of the word, rather than at the end.

...
>  boxchoices = ttk.Combobox(self, textvariable=med,
>  ^

This gives a better hint that the error is due to something before the 
'b', or rather that the parser was expecting something other than a 
letter (beginning of name character).  One should therefore imagine that 
there was no preceeding \n and that the initial character, in this case, 
was at the end of the previous line.  The error here is basically the 
same as


>>> b b
  File "", line 1
b b
  ^
SyntaxError: invalid syntax


--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Rich Shepard

On Sat, 8 Jun 2019, Chris Angelico wrote:


Right, but the problem was actually in the LabelInput call, not the
Checkbutton itself.


ChrisA,

That's what I found and fixed. Now working on a slightly different issue
with a ttk.Combobox.

Carpe weekend,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Terry Reedy

On 6/7/2019 2:43 PM, Rich Shepard wrote:

I understand positional and keyword arguments and the syntax for the
ttk.Checkbutton as described on
.

$ python3 geochem.py
   File "geochem.py", line 60
     ttk.Checkbutton(text='Censored?', variable=input_var),
     ^
SyntaxError: positional argument follows keyword argument

I've provided only keyword arguments to the call to the ttk.Checkbutton
widget and am not seeing the positional argument that follows. Please show
me what I miss seeing here:

self.inputs['nondetect'] = LabelInput(
     self, 'Censored?',
     #input_var = tk.BooleanVar(),
     input_var = tk.IntVar,


An additional error is the missing ()s.  This would make input_var refer 
to the class, not an instance thereof.



     ttk.Checkbutton(text='Censored?', variable=input_var),
)


--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Rich Shepard

On Fri, 7 Jun 2019, Terry Reedy wrote:


An additional error is the missing ()s. This would make input_var refer to
the class, not an instance thereof.


Oops! I completely missed that.

Thanks, Terry,

Rich
--
https://mail.python.org/mailman/listinfo/python-list