Re: Problem finding my folder via terminal

2018-06-09 Thread Tamara Berger
Hi Cameron,

Thanks for the help. I was just following the coding in the workbook
when I inserted sudo. What you said about it makes a lot of sense.

Again, thanks for all your help.

Tamara
On Sat, Jun 9, 2018 at 5:49 PM Cameron Simpson  wrote:
>
> On 09Jun2018 10:48, Tamara Berger  wrote:
> >I want to read your last two emails in the evening when I have more time to
> >digest the information, but I have a quick question now. I made the 
> >correction
> >you suggested to mymodule and went on to create a source distribution file.
> >Then I got stuck again when trying to install my module into site-packages. I
> >think I got a permission error. How do I fix this? Here is the coding from 
> >the
> >shell:
> >
> >Last login: Sat Jun  9 13:16:15 on ttys000
> >192:~ TamaraB$ cd Desktop/mymodules/dict
> >-bash: cd: Desktop/mymodules/dict: No such file or directory
>
> I think this should be "dist", not "dict".
>
> >192:~ TamaraB$ cd Desktop/mymodules/dist
>
> Ah, yes. Ok then.
>
> >192:dist TamaraB$ sudo python3 -m pop install vsearch-1.0.tar.gz
> >Password:
> >
> >There is a symbol of a key after the word "Password."
>
> There are a few issue here.
>
> First, it should be "pip", not "pop".
>
> Second, this is using the "sudo" command to run "python3 -m pip install
> vsearch-1.0.tar.gz" as root, the system administrator account. "sudo" is 
> asking
> you for your password before proceeding.
>
> Might I suggest that you don't do this step?
>
> The reason here is that it will install your "vsearch" module into the 
> _system_
> site-packages area. That area is under the control of the OS vendor (Apple in
> this case) and they may legitimately put something else of the same name 
> there,
> or have already done so. In the former case they're land on your module and in
> the latter case you will be destroying the vendor supplied module.
>
> As a rule of thumb it is best to avoid putting stuff in the vendor controlled
> places - it leads to maintenance problems and can lead to unexpected 
> behaviour.
>
> Instead, use pip's "--user" option, thus:
>
>   python3 -m pip install --user vsearch-1.0.tar.gz
>
> Note: there is _no_ "sudo" command there. This command runs as you, not root,
> and installs in your home directory in an area for user supplied packages.
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-09 Thread Tamara Berger
On Sat, Jun 9, 2018 at 5:05 AM Cameron Simpson  wrote:
>
> A third possibility is that you made a mymodules somewhere else (such as in
> your top level home directory), and later decided to put it on your Desktop to
> make it easy to find/access.

I did save it in My Documents first and then moved it to my desktop.
But I did not write code. I just dragged and dropped.

>So you might have decided to "mv" your "mymodules"
> folder into the Desktop like this:
>
>   mv mymodules Desktop/mymodules
>
> which is fine. But mv has some interesting behaviour. If "mymodules" didn't
> exist in Desktop, then youre "mymodules" will get moved into the Desktop.
> However, if mv's final argument is an _existing_ directory, mv puts things
> inside it. So if you went:
>
>   mkdir Desktop/mymodules
>   mv mymodules Desktop/mymodules
>
> then mv would put your top level "mymodules" _inside_ the "Desktop/mymodules"
> folder that already exists, producing the structure you currently have.

I didn't do any of this. Could dragging and dropping have created the
duplicate folder?

Thanks,

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


Re: Problem finding my folder via terminal

2018-06-08 Thread Tamara Berger
Nope. No duplicate folder.
On Fri, Jun 8, 2018 at 5:35 AM Cameron Simpson  wrote:
>
> On 08Jun2018 01:52, Tamara Berger  wrote:
> >In answer to your comments, I am in the correct folder. But the "ls"
> >command did not return any files. Did I enter the command incorrectly?
> >Or are the files not recognized? Here is what I typed into terminal:
> >
> >"Last login: Fri Jun  8 01:40:07 on ttys001
> >192:~ TamaraB$ cd Desktop/mymodules
> >192:mymodules TamaraB$ pwd
> >/Users/TamaraB/Desktop/mymodules
> >192:mymodules TamaraB$ ls
> >mymodules
> >192:mymodules TamaraB$"
>
> It looks like you have a "mymodules" folder _inside_ your "Desktop/mymodules"
> folder. Form the /Users/TamaraB/Desktop/mymodules folder, type these commands.
>
>   ls -la
>   ls -la mymodules
>
> (Feel free to omit any other stuff in your Desktop folder listing for privacy
> reasons.)
>
> Or:
>
>   cd ~/Desktop/mymodules
>   ls -laR
>
> The "R" option will create a recursive listing. Or you could just open the
> folder in the Finder and look around:
>
>   open ~/Desktop/mymodules
>
> I'm thinking you've just made an additional "mymodules" inside your main
> "mymodules" by accident.
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-08 Thread Tamara Berger
Hi Cameron,

Before I reply to the meat of your email, I guess we'd better clear up
your initial issues. You write:

"Replies inline below, which is the style we prefer on this list. (And to reply,
please reply to the specific message, not your original post. This will let you
pick up that branch of the conversation directly and not confuse your readers.)"

1.  I don't know what you mean by "inline," though I do notice all the
single and double carets at the left margin. I don't understand the
underlying rationale for the different patterns. And how do I create
them, manually?

2.  I also don't understand your instruction that I reply to the
specific message and not to my original post. I did not reply to my
own post but to Steven's comments. And then I brought up my main
issue, which had remained unaddressed by his email.

Thanks,

Tamara
On Thu, Jun 7, 2018 at 10:27 PM Cameron Simpson  wrote:
>
> Hi,
>
> Replies inline below, which is the style we prefer on this list. (And to 
> reply,
> please reply to the specific message, not your original post. This will let 
> you
> pick up that branch of the conversation directly and not confuse your 
> readers.)
>
> On 07Jun2018 08:39, T Berger  wrote:
> >On Wednesday, June 6, 2018 at 12:19:35 PM UTC-4, T Berger wrote:
> >> I’m learning Python on my own and have been stuck for two days trying to 
> >> get modules I created into site-packages. As a trial step, we were asked 
> >> to change directly into the folder containing our modules. I typed “cd 
> >> mymodules” per instructions, but got this error message: “-bash: cd: 
> >> mymodules: No such file or directory.” I saved mymodules to my documents. 
> >> What is going wrong here?
> >>
> >> When I tried to create a distribution file, I typed “192:~ TamaraB$ 
> >> mymodules$ python3 setup.py sdist.” I got this error message: “-bash: 
> >> mymodules$: command not found.” What should I do?
> [...snip...]
> > “We'll need some more information about the computer you are using: what OS
> > are you using (Mac, Linux, Windows, something else), what shell are you
> > using, perhaps a file listing of your home directory. “
> >
> >I’m using Terminal in Mac Sierra (10.12.6).
>
> Cool.
>
> >“(I'm not sure what the 192 part means. Does that increase each time you 
> >type a command?) “
> >
> >I'm new to Terminal, but that 192 looked weird to me too. It doesn’t 
> >increase, just stays at 192. There is also a thin gray left bracket in front 
> >of the “192” which didn’t copy into my email. Is there some way to restore 
> >the default prompt in Terminal (and what is the default prompt)?
>
> On a Mac, it tends to be like this: "{hostname}:~ {username}$ " where
> {hostname} is your Mac's name and {username} is your login name; that is 
> called
> the "shell prompt", and "the shell" is the command line interpreter running 
> the
> commands you type. On a Mac, this is usually bash, a UNIX Bourne shell.
>
> There is a secondary prompt like this "> ". That indicates that you're typing 
> a
> compond command, or at least that the shell believes you're typing a compond
> command, which is just a command which extends to more than one line. The
> common way to confuse the shell about this is to forget to close a quote - the
> shell expects that string to continue until it sees a closing quote.
>
> You can leave the secondary prompt by typing Control-C (often denoted "^C").
> That will cancel the incomplete command and get you back to a clean empty
> primary prompt.
>
> Note that if you start some interactive command, such as the interactive 
> Python
> interpreter, you will then be dealing with _its_ prompts until you leave that
> command.
>
> >Back to my problem. Your email helped me get into the mymodules folder, but 
> >I’m still stuck at the next step of the exercise, which is to get the module 
> >I created into site-packages. mymodules contains three files: the module we 
> >created, a setup file (setup.py), and a readme file. The line of text we 
> >were instructed to type into our terminal was: “python3 setup.py sdist.” In 
> >response, I got this error message: 
> >“/Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python:
> > can't open file 'setup.py': [Errno 2] No such file or directory”.
> >
> >Why is this not working for me?
>
> I would expect that your shell is not actually in the "mymodules" directory
> when you typed "python3 setup.py sdist". Usually your shell prompt includes 
> the
> current working directory (the "~" in my example above, which is your home
> directory), which is a useful contextual clue.
>
> You can also find out your current working directory by running the "pwd"
> command (the "print working directory" command).
>
> The "ls" (list) command without arguments will list what is in the current
> directory, so you can now check (a) whether you're where you thought you were,
> and (b) what is in the current directory (in case it doesn't contain what you
> expected).
>

Re: Problem finding my folder via terminal

2018-06-08 Thread Tamara Berger
Hi Cameron,

I'm replying via email because the Post Reply button is missing from
the forum website.

In answer to your comments, I am in the correct folder. But the "ls"
command did not return any files. Did I enter the command incorrectly?
Or are the files not recognized? Here is what I typed into terminal:

"Last login: Fri Jun  8 01:40:07 on ttys001

192:~ TamaraB$ cd Desktop/mymodules

192:mymodules TamaraB$ pwd

/Users/TamaraB/Desktop/mymodules

192:mymodules TamaraB$ ls

mymodules

192:mymodules TamaraB$"

Thanks,

Tamara
On Thu, Jun 7, 2018 at 10:27 PM Cameron Simpson  wrote:
>
> Hi,
>
> Replies inline below, which is the style we prefer on this list. (And to 
> reply,
> please reply to the specific message, not your original post. This will let 
> you
> pick up that branch of the conversation directly and not confuse your 
> readers.)
>
> On 07Jun2018 08:39, T Berger  wrote:
> >On Wednesday, June 6, 2018 at 12:19:35 PM UTC-4, T Berger wrote:
> >> I’m learning Python on my own and have been stuck for two days trying to 
> >> get modules I created into site-packages. As a trial step, we were asked 
> >> to change directly into the folder containing our modules. I typed “cd 
> >> mymodules” per instructions, but got this error message: “-bash: cd: 
> >> mymodules: No such file or directory.” I saved mymodules to my documents. 
> >> What is going wrong here?
> >>
> >> When I tried to create a distribution file, I typed “192:~ TamaraB$ 
> >> mymodules$ python3 setup.py sdist.” I got this error message: “-bash: 
> >> mymodules$: command not found.” What should I do?
> [...snip...]
> > “We'll need some more information about the computer you are using: what OS
> > are you using (Mac, Linux, Windows, something else), what shell are you
> > using, perhaps a file listing of your home directory. “
> >
> >I’m using Terminal in Mac Sierra (10.12.6).
>
> Cool.
>
> >“(I'm not sure what the 192 part means. Does that increase each time you 
> >type a command?) “
> >
> >I'm new to Terminal, but that 192 looked weird to me too. It doesn’t 
> >increase, just stays at 192. There is also a thin gray left bracket in front 
> >of the “192” which didn’t copy into my email. Is there some way to restore 
> >the default prompt in Terminal (and what is the default prompt)?
>
> On a Mac, it tends to be like this: "{hostname}:~ {username}$ " where
> {hostname} is your Mac's name and {username} is your login name; that is 
> called
> the "shell prompt", and "the shell" is the command line interpreter running 
> the
> commands you type. On a Mac, this is usually bash, a UNIX Bourne shell.
>
> There is a secondary prompt like this "> ". That indicates that you're typing 
> a
> compond command, or at least that the shell believes you're typing a compond
> command, which is just a command which extends to more than one line. The
> common way to confuse the shell about this is to forget to close a quote - the
> shell expects that string to continue until it sees a closing quote.
>
> You can leave the secondary prompt by typing Control-C (often denoted "^C").
> That will cancel the incomplete command and get you back to a clean empty
> primary prompt.
>
> Note that if you start some interactive command, such as the interactive 
> Python
> interpreter, you will then be dealing with _its_ prompts until you leave that
> command.
>
> >Back to my problem. Your email helped me get into the mymodules folder, but 
> >I’m still stuck at the next step of the exercise, which is to get the module 
> >I created into site-packages. mymodules contains three files: the module we 
> >created, a setup file (setup.py), and a readme file. The line of text we 
> >were instructed to type into our terminal was: “python3 setup.py sdist.” In 
> >response, I got this error message: 
> >“/Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python:
> > can't open file 'setup.py': [Errno 2] No such file or directory”.
> >
> >Why is this not working for me?
>
> I would expect that your shell is not actually in the "mymodules" directory
> when you typed "python3 setup.py sdist". Usually your shell prompt includes 
> the
> current working directory (the "~" in my example above, which is your home
> directory), which is a useful contextual clue.
>
> You can also find out your current working directory by running the "pwd"
> command (the "print working directory" command).
>
> The "ls" (list) command without arguments will list what is in the current
> directory, so you can now check (a) whether you're where you thought you were,
> and (b) what is in the current directory (in case it doesn't contain what you
> expected).
>
> The "ls -la" command will provide a longer and more detailed listing too.
>
> Let us know what you find out.
>
> Cheers,
> Cameron Simpson 
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Server warning

2018-06-15 Thread Tamara Berger
I created a webapp with flask, but got a warning in terminal when I tested it.

Last login: Sat Jun 16 01:13:28 on ttys000
192:~ TamaraB$ cd Desktop/Webapp
192:Webapp TamaraB$ python3 hello_flask.py
 * Serving Flask app "hello_flask" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

Is this a serious issue, or can I ignore it? I was just following
instructions in a manual I consider trustworthy.

Thanks,

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


Re: pep8 Re: Posting warning message

2018-06-12 Thread Tamara Berger
Hi Cameron,

Thanks for the in-depth answer. I'm going to have to read it
carefully, with the help of a Python glossary. Some of the terms you
use are new to me.

>or am I supposed to root around for my module and make the edits one by one?

I was trying to be amusing and didn't get my point across.

>Finally, no you don't normally root around and change an installed module.
>Instead, modify your original copy and reinstall the newer version!

What I meant was, do I have to open the file, search for, e.g., colons
and insert space after them? These were the sorts of picayune errors
picked up by PEP8 on my program. I deliberately omit such spaces when
I code because I like to do as little unnecessary work as possible.
There is enough repetitive coding as it is. I know some IDEs have word
completion suggestion for variables, etc, that the user creates. But
I'm practicing in barebones IDLE and that means a lot of extra work.

Thanks,

Tamara

On Tue, Jun 12, 2018 at 8:17 PM Cameron Simpson  wrote:
>
> On 12Jun2018 07:51, Tamara Berger  wrote:
> [... snip ...]
> >One more thing about PEP8. My workbook is a bit skimpy on details. Is there a
> >quick way to make the edits
>
> PEP8 is a style recommendation for Python code:
>
>   https://www.python.org/dev/peps/pep-0008/
>
> It is followed pretty rigorously in the Python standard library, and most
> Python code follows a lot of it as a matter of good practice, in that (a) it 
> is
> a fairly good style, producing easy to read code and (b) when everyone uses 
> the
> same or similar styes, we all find other people's code easier to read.
>
> But it is not enforced.
>
> There are several "lint" tools around which will look at your code and 
> complain
> about violations of PEP8 and various other constraints generally held to be
> good to obey, particularly some kinds of initialisation errors and other
> practices that while syntacticly legal may indicate bugs or lead to header to
> debug or maintain code.
>
> Also, some text editors have facilities for autostyling code, sometimes as you
> type it and sometimes as a final step when you save the modified file.
>
> For example, there are tools like autopep8 
> (https://pypi.org/project/autopep8/)
> which will modify python code directly to apply the PEP8 style.
>
> Personally, I run a few lint commands against my Python code by hand, and hand
> repair. Typical workflow goes:
>
> - modify code for whatever reason (add feature, fix bugs, etc) and test
>
> - when happy, _then_ run a lint tool and tidy up most of what it reports
>
> - _then_ instal the code where other things may use it (eg pip install)
>
> My personal kit has a "lint" shell script:
>
>   https://bitbucket.org/cameron_simpson/css/src/tip/bin-cs/lint
>
> which runs my preferred linters against code files, and for Python it runs:
>
> - pyflakes: https://pypi.org/project/pyflakes/
>
> - pep8: https://pypi.org/project/pep8/
>
> - pylint: https://pypi.org/project/pylint/,
>   https://pylint.readthedocs.io/en/latest/
>
> These can all be installed using pip:
>
>   pip install --user pyflakes pep8 pylint
>
> As you can see from my lint script I run them with various options that
> oveeride their default checks to better match my preffered code style.
>
> >or am I supposed to root around for my module and make the edits one by one?
>
> Finally, no you don't normally root around and change an installed module.
> Instead, modify your original copy and reinstall the newer version!
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Posting warning message

2018-06-12 Thread Tamara Berger
On Tue, Jun 12, 2018 at 7:57 PM Cameron Simpson  wrote:
>
> On 12Jun2018 07:14, Tamara Berger  wrote:

> >Just one more thing, Cameron. I was looking at an Apple support page, and it 
> >says "When you're logged in to your Mac using an administrator account, you 
> >can use the sudo command in the Terminal app to execute commands as a 
> >different user, such as the root user." 
> >(https://support.apple.com/en-us/HT202035). I am logged in as administrator. 
> >So why isn't sudo working for me?
>
> >P.S. How would I make the link I provided live?
>
> What link? This is why we trim quoted text and reply below the relevant bit 
> directly: I don't know what link you provided or even whether it is there, 
> just buried in the huge quoted text. Just cite it again, eg:
>
>   How would I make this link (link here) live?

The link is above, in the first paragraph, beginning with the words
"Just one more thing, Cameron."

> And then, of course, tell us what "live" means :-)

Live means live. It is not a word I created. It means that the link
has been activated, so clicking on it will take you to the associated
page. Here is a definition from www.yourdictionary.com/live-link.
"Live Link - Computer Definition: An active text or graphic link on a
Web page. Clicking the link redirects the user to another Web page or
a document or image." The link to the definition I just copied into
this paragraph is not live because clicking on it will not do
anything.

This question became moot when I posted my message, because that
action activated the link. That is why I asked in my next post how one
can edit one's own messages, because  at that point I would have
deleted this post.

Thanks,

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


Re: Posting warning message

2018-06-12 Thread Tamara Berger
On Tue, Jun 12, 2018 at 7:50 PM Cameron Simpson  wrote:
>
> On 12Jun2018 07:48, Tamara Berger  wrote:
> >
> >> On Wed, Jun 13, 2018 at 12:17 AM, T Berger  wrote:
> >> > Sorry, to bother you again. But is there some way to edit a message once
> >> > its posted? Or do I have to delete it and rewrite it?
> >>
> >> Nope. And you can't delete it either.
> >
> >I deleted them a number of time, then got a bar across the page indicating
> >that a post had been deleted.
>
> As has been mentioned, any "delete" you do on Google Groups is pretty limited,
> possibly only to Google's copy. The message has already gone planetwide.
>
> Google's delete _may_ propagate to the rest of usenet, and _may_ be obeyed in
> some of those places. But it certainly doesn't propagate to the mailing list,
> and even if it did, those of use who pull the list down to our personal mail
> folders would ignore such a thing.
>
> >It's nuts that you can't edit your own post.
>
> No, it is actually good:
>
> - there's not one copy of your post that google can modify: it gets copied
>   planet wide, to thousands or millions of independent places
>
> - how do people discover that you've modified a post, to review your change?
>   how do their replies before your modification make any kind of sense if the
>   preceeding message is no longer what they replied to?

I  just meant edit within the moment or two after you've posted a
message. I think a good feature in this forum would allow posters to
edit their messages in just that way. I have such a feature enabled in
gmail. I can "undo" my action for 30 seconds after I've clicked on
"send."

> The correct way to correct a post is to follow up to it (reply to it) with a
> correction or clarification. That way everyone sees the change/fix as a new
> messge. And it works even though the messages get copied everywhere, because
> all that has to happen is to copy your own new message.

Got it.

Thanks,

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


Re: Posting warning message

2018-06-15 Thread Tamara Berger
Cameron,

I DON'T HAVE the options "skip the inbox" and "apply the label." Not
within the option "filter messages like this," which is where I
understood you to say they were, or outside that option. Does Gmail
have these options?

Tamara
On Fri, Jun 15, 2018 at 4:17 AM Cameron Simpson  wrote:
>
> On 14Jun2018 21:09, Tamara Berger  wrote:
> >On Monday, June 11, 2018 at 4:32:56 AM UTC-4, Cameron Simpson wrote:
> >> This is one reason to prefer the mailing list. You can subscribe here:
> >>   https://mail.python.org/mailman/listinfo/python-list
> [...]
> >> Wait for the first message or so and for that message choose GMail's 
> >> "filter
> >> messages like this" action. I like to choose "Apply the label Python" and 
> >> "Skip
> >> the inbox" for such things. Then you'll get a nice little "Python" mail 
> >> folder
> >> in your collection where the list will accumulate. And less spam than the
> >> Group.
> >
> >Sounds great, Cameron. But Gmail doesn't give me the options "Apply the label
> >Python" and "Skip the inbox" under "Filter messages like this." I just get 
> >the
> >generic To, From, Has the words, Doesn't have.
>
> The first panel with to/from etc is just the message selection panel. It
> probably has the "includes the words" field already filled in with something
> that will match a python-list message. When you click "Create filter with this
> search" you get another panel with what to do with matching messages.
>
> I usually:
>
> - skip the Inbox
> - apply the label: click the "Choose label" dropdown and create a new label
>   "python" or whatever suits you
> - also apply filter to matching conversations, which will gather up all the
>   list messages that have already arrived and filter them, too
>
> Also note that you don't need a label per list. I file a few mailing lists in
> the same "python" folder.
>
> Alternatively, you might make a label per list; note that you can put a slash
> in a label eg "python/python-list" and GMail will treat that as a hierarchy,
> making a "python" category on the left with "python-list" underneath it. Might
> be handy of you join several lists and want to group them.
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Posting warning message

2018-06-15 Thread Tamara Berger
Hi Cameron,

Please ignore my last email. I found those two options AFTER I created
the filter. I expected them to be on the "filter messages like this"
panel.

Tamara  > On 14Jun2018 21:09, Tamara Berger  wrote:
> >On Monday, June 11, 2018 at 4:32:56 AM UTC-4, Cameron Simpson wrote:
> >> This is one reason to prefer the mailing list. You can subscribe here:
> >>   https://mail.python.org/mailman/listinfo/python-list
> [...]
> >> Wait for the first message or so and for that message choose GMail's 
> >> "filter
> >> messages like this" action. I like to choose "Apply the label Python" and 
> >> "Skip
> >> the inbox" for such things. Then you'll get a nice little "Python" mail 
> >> folder
> >> in your collection where the list will accumulate. And less spam than the
> >> Group.
> >
> >Sounds great, Cameron. But Gmail doesn't give me the options "Apply the label
> >Python" and "Skip the inbox" under "Filter messages like this." I just get 
> >the
> >generic To, From, Has the words, Doesn't have.
>
> The first panel with to/from etc is just the message selection panel. It
> probably has the "includes the words" field already filled in with something
> that will match a python-list message. When you click "Create filter with this
> search" you get another panel with what to do with matching messages.
>
> I usually:
>
> - skip the Inbox
> - apply the label: click the "Choose label" dropdown and create a new label
>   "python" or whatever suits you
> - also apply filter to matching conversations, which will gather up all the
>   list messages that have already arrived and filter them, too
>
> Also note that you don't need a label per list. I file a few mailing lists in
> the same "python" folder.
>
> Alternatively, you might make a label per list; note that you can put a slash
> in a label eg "python/python-list" and GMail will treat that as a hierarchy,
> making a "python" category on the left with "python-list" underneath it. Might
> be handy of you join several lists and want to group them.
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Flask not responding after installation

2018-06-14 Thread Tamara Berger
It seems I can’t progress a single step without encountering a wall.
I’m trying to build a webapp with flask. I installed flask. I followed
the workbook-provided prompts, which should have resulted in a flask
confirmation. Nothing happened. Any ideas what’s gone wrong:

Last login: Thu Jun 14 13:31:25 on ttys000
Tamaras-iMac:~ TamaraB$ cd Desktop/Web
-bash: cd: Desktop/Web: No such file or directory
Tamaras-iMac:~ TamaraB$ cd Desktop/Webapp
Tamaras-iMac:Webapp TamaraB$ python3 hello_flask.py
Tamaras-iMac:Webapp TamaraB$

Thanks,

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


Re: Problem finding my folder via terminal

2018-06-08 Thread Tamara Berger
Hi Cameron,

I have to answer you via email because I haven't gotten the hang of
the inline style yet. Here is the result of your suggestion:

Last login: Fri Jun  8 22:43:58 on ttys001
192:~ TamaraB$ cd Desktop/mymodules/
192:mymodules TamaraB$ ls -laR /Users/TamaraB/Desktop/mymodules
total 16
drwxr-xr-x   4 TamaraB  staff   136 Jun  7 01:32 .
drwx--+ 37 TamaraB  staff  1258 Jun  8 22:30 ..
-rw-r--r--@  1 TamaraB  staff  6148 Jun  7 10:54 .DS_Store
drwxr-xr-x   5 TamaraB  staff   170 Jun  7 01:32 mymodules

/Users/TamaraB/Desktop/mymodules/mymodules:
total 16
drwxr-xr-x  5 TamaraB  staff  170 Jun  7 01:32 .
drwxr-xr-x  4 TamaraB  staff  136 Jun  7 01:32 ..
-rw-r--r--@ 1 TamaraB  staff0 Jun  5 09:47 README.py
-rw-r--r--@ 1 TamaraB  staff  253 Jun  7 10:55 setup.py
-rw-r--r--@ 1 TamaraB  staff  166 Jun  5 10:01 vsearch.py
192:mymodules TamaraB$

(When I copied the coding into the email, I got a line of space
between each line of coding, and had to delete the extra lines one by
one? Any way to do this job nonmanually or to transfer the coding into
an email without the extra lines of space?)

Thanks for all your help.

Tamara




On Fri, Jun 8, 2018 at 6:03 PM Cameron Simpson  wrote:
>
> On 08Jun2018 10:23, Tamara Berger  wrote:
> >On Fri, Jun 8, 2018 at 5:35 AM Cameron Simpson  wrote:
> >> On 08Jun2018 01:52, Tamara Berger  wrote:
> >> >192:~ TamaraB$ cd Desktop/mymodules
> >> >192:mymodules TamaraB$ pwd
> >> >/Users/TamaraB/Desktop/mymodules
> >> >192:mymodules TamaraB$ ls
> >> >mymodules
> >>
> >> It looks like you have a "mymodules" folder _inside_ your 
> >> "Desktop/mymodules"
> >> folder. Form the /Users/TamaraB/Desktop/mymodules folder, type these 
> >> commands.
> >>
> >>   ls -la
> >>   ls -la mymodules
> >
> >Nope. No duplicate folder.
>
> Your Terminal transcript above says otherwise, because (a) you're standing in
> "/Users/TamaraB/Desktop/mymodules" and (b) the "ls" command shows:
>
>   mymodules
>
> Therefore, _inside_ the "/Users/TamaraB/Desktop/mymodules" folder there is
> something called "mymodules", unless the transcript above is not complete.
>
> Please pos the result of:
>
>   ls -laR /Users/TamaraB/Desktop/mymodules
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-08 Thread Tamara Berger
Hi Cameron,

Re inline style: When I hit reply, this is the window I get. I don't
get my previous email with the carets appended to the beginning of the
line.

Before I look at the rest of your email, I'd like for you to explain
how there is a mymodule folder nested within another mymodule folder.
I don't see this second folder in Finder, and I definitely didn't
create it.

Thanks,

Tamara
On Sat, Jun 9, 2018 at 1:15 AM Cameron Simpson  wrote:
>
> On 08Jun2018 22:55, Tamara Berger  wrote:
> >I have to answer you via email because I haven't gotten the hang of
> >the inline style yet.
>
> I'm using email :-) We use the inline style for that, too. Just walk down the
> quoted previous message and insert your responses below the relevant parts 
> with
> blank lines separating the quoted material from your text. Anyway...
>
> >Here is the result of your suggestion:
> >
> >Last login: Fri Jun  8 22:43:58 on ttys001
> >192:~ TamaraB$ cd Desktop/mymodules/
> >192:mymodules TamaraB$ ls -laR /Users/TamaraB/Desktop/mymodules
> >total 16
> >drwxr-xr-x   4 TamaraB  staff   136 Jun  7 01:32 .
> >drwx--+ 37 TamaraB  staff  1258 Jun  8 22:30 ..
> >-rw-r--r--@  1 TamaraB  staff  6148 Jun  7 10:54 .DS_Store
> >drwxr-xr-x   5 TamaraB  staff   170 Jun  7 01:32 mymodules
>
> Ok, so here we see that there _is_ a "mymodules" folder inside your
> "/Users/TamaraB/Desktop/mymodules" folder.
>
> >/Users/TamaraB/Desktop/mymodules/mymodules:
> >total 16
> >drwxr-xr-x  5 TamaraB  staff  170 Jun  7 01:32 .
> >drwxr-xr-x  4 TamaraB  staff  136 Jun  7 01:32 ..
> >-rw-r--r--@ 1 TamaraB  staff0 Jun  5 09:47 README.py
> >-rw-r--r--@ 1 TamaraB  staff  253 Jun  7 10:55 setup.py
> >-rw-r--r--@ 1 TamaraB  staff  166 Jun  5 10:01 vsearch.py
> >192:mymodules TamaraB$
>
> And inside that second "mymodules" folder is your vsearch module and its
> accompanying files. This kind of mistake is easy to make (the doubled
> directory).
>
> You can do 2 things at this point.
>
> 1: Just:
>
>cd /Users/TamaraB/Desktop/mymodules/mymodules
>
> and run the setup.py from in there.
>
> Or:
>
> 2: Repair the mistake:
>
>cd /Users/TamaraB/Desktop/mymodules
>mv mymodules/* .
>rmdir mymodules
>
> which will move all the files from the lower directory up to where they should
> be. Then run the setup.py.
>
> BTW, the README is normally a text file named README.txt or maybe a markdown
> file named README.md.
>
> >(When I copied the coding into the email, I got a line of space
> >between each line of coding, and had to delete the extra lines one by
> >one? Any way to do this job nonmanually or to transfer the coding into
> >an email without the extra lines of space?)
>
> That is odd. My guess would be that your cut/paste is sending the end of line
> as a CR (carriage return) and a NL (newline), and both of those are being
> "typed" at the paste end, resulting in double spaced text. Annoying.
>
> Are you using mail.google.com to read your GMail? I just tried cut/paste some
> text from both iTerm and Terminal on my Mac into a scratch message there and
> didn't get doubled lines. Can you describe _exactly_ what you did to copy the
> text into your email? Presumably you're doing something different from what 
> I'm
> doing: select text in the terminal, type Cmd-C to copy it, click in my new
> message window and type Cmd-V to paste the copied text.
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Posting warning message

2018-06-11 Thread Tamara Berger
I did subscribe to the mailing list, but it opened the floodgates to a
torrent of irrelevant emails. I didn't know how to turn the flood off,
so I unsubscribed. How do I set the appropriate option?

I was just going to post another message to google groups. If you
don't mind, I'll ask you now.

I got an error message when trying to install pytest. Following the
workbook, I typed these 2 lines in the terminal:

Last login: Mon Jun 11 11:07:46 on ttys000
192:~ TamaraB$ sudo python3
Password:
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> python3 -m pip install pytest
  File "", line 1
python3 -m pip install pytest
 ^
SyntaxError: invalid syntax
>>>

I know you warned against using the sudo command, but Apple supports using it.
What does the "-m" stand for in the line of code?

Thanks,

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


Re: Posting warning message

2018-06-11 Thread Tamara Berger
Apropos my earlier message:

Before I post a question, I search online for an answer. Though I try
all combinations of search terms, I get irrelevant results. Do you
have a suggestion on how to frame searches?

Tamara
On Mon, Jun 11, 2018 at 4:32 AM Cameron Simpson  wrote:
>
> On 10Jun2018 23:38, Tamara Berger  wrote:
> >Thanks, everyone, for your suggestions. I didn't respond to your posts 
> >earlier because I wasn't notified by email updates. I don't understand why 
> >they've stopped coming. I didn't change any settings.
>
> Maybe we haven't been CCing you directly, just posting straight back to the
> list. Did you tick "Automatically subscribe me to email updates when I post to
> a topic" in the group settings?
>
> This is one reason to prefer the mailing list. You can subscribe here:
>
>   https://mail.python.org/mailman/listinfo/python-list
>
> Many of us prefer that to Google Groups. You have the advantage that email
> messages arrive to your GMail directly, instead of to the group. You can 
> easily
> file messages from the list into its own folder (in GMail, this is called
> "apply a label").
>
> Wait for the first message or so and for that message choose GMail's "filter
> messages like this" action. I like to choose "Apply the label Python" and 
> "Skip
> the inbox" for such things. Then you'll get a nice little "Python" mail folder
> in your collection where the list will accumulate. And less spam than the
> Group.
>
> Cheers,
> Cameron Simpson  (formerly c...@zip.com.au)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pep8 Re: Posting warning message

2018-06-13 Thread Tamara Berger
Is it possible to do the "linting" after you've written your code but
before you install it for the first time?

Tamara
On Wed, Jun 13, 2018 at 12:30 AM Cameron Simpson  wrote:
>
> On 13Jun2018 00:05, Tamara Berger  wrote:
> >Thanks for the in-depth answer. I'm going to have to read it
> >carefully, with the help of a Python glossary. Some of the terms you
> >use are new to me.
>
> No worries. Just ask if you don't find definitions.
>
> BTW, a "lint" program, or "linter" is a program for reporting on style trivia,
> trivial logic errors like variable used before defined (or never defined, 
> which
> is often a typing error misspelling a variable or function name), and things
> that look like they might be bugs (a common mistake of mine is constructing
> exceptions like logging calls, and one of my linters has found dozens of these
> for me.)
>
> >>or am I supposed to root around for my module and make the edits one by one?
> >
> >I was trying to be amusing and didn't get my point across.
>
> Ah, ok then. Easy for stuff like that to fall flat in email.
>
> >>Finally, no you don't normally root around and change an installed module.
> >>Instead, modify your original copy and reinstall the newer version!
> >
> >What I meant was, do I have to open the file, search for, e.g., colons
> >and insert space after them? These were the sorts of picayune errors
> >picked up by PEP8 on my program. I deliberately omit such spaces when
> >I code because I like to do as little unnecessary work as possible.
> >There is enough repetitive coding as it is. I know some IDEs have word
> >completion suggestion for variables, etc, that the user creates. But
> >I'm practicing in barebones IDLE and that means a lot of extra work.
>
> Regrettably, yes, unless you're using an editor that has autoformatting
> support. Learn typing habits which minimise stuff like that, it saves going
> back later.
>
> I don't use IDEs on the whole, and I don't use an autoformatter for Python. My
> environment tends to be an editor window and a shell to run things from (thus:
> 2 terminals, one running vim and one running a shell).
>
> Training your fingers to do the trivia reflexively helps. And leaving the
> linting until _after_ you've got your code working correctly helps, because 
> you
> aren't changing tasks midstream and you are linting code you've deleted or
> changed :-)
>
> An editor with syntax support can help. I use vi or vim, and its syntax 
> support
> is fairly crude. Two things its does have which I use a lot is autoindent (as
> simple as starting the next line at the same indent as the one I just
> completed) and syntax highlighting, which colours keywords and identifiers and
> strings differently. When you make trivial mistakes like not closing a quote 
> or
> misspelling a keyword or leaving off a colon there is often a visual cue.
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pep8 Re: Posting warning message

2018-06-14 Thread Tamara Berger
On Thu, Jun 14, 2018 at 1:49 AM Cameron Simpson  wrote:

> Just as you can run your code before you install it, you can lint your code
> beforehand also. In fact, you should be doing both: run and test the code
> _before_ installing it, and also lint it (when you care) and test again
> (because if you made lint changes you want to check they haven't done 
> something
> unwanted).

Great. So I'm using three interfaces: in my case, the text editor, the
Python shell, and the UNIX terminal. Is that right?

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


[no subject]

2019-04-19 Thread Tamara Berger
Hi Python-List,

What code can I use to break out of a program completely, and not just out
of a loop? I wrote code with 3 conditions for saving for a downpayment. The
first addresses cases that don't meet the minimum condition; i.e., enough
money to save for a downpayment within the allotted time. It has its own
print line, but also executes the irrelevant print lines for the other two
conditions.

Thanks,
Tamara
-- 
https://mail.python.org/mailman/listinfo/python-list