8000 my-Python-Code/shopping_list.py at master · martdev1963/my-Python-Code · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":"JumpGameOOPVer.py","path":"JumpGameOOPVer.py","contentType":"file"},{"name":"JumpGameProcedural.py","path":"JumpGameProcedural.py","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"age_guess2ndver.py","path":"age_guess2ndver.py","contentType":"file"},{"name":"app.py","path":"app.py","contentType":"file"},{"name":"app_ver4.py","path":"app_ver4.py","contentType":"file"},{"name":"backend.py","path":"backend.py","contentType":"file"},{"name":"books.db","path":"books.db","contentType":"file"},{"name":"download.html","path":"download.html","contentType":"file"},{"name":"frontend.py","path":"frontend.py","contentType":"file"},{"name":"graphs.py","path":"graphs.py","contentType":"file"},{"name":"guess_age.py","path":"guess_age.py","contentType":"file"},{"name":"h22_web_app_01_app.py","path":"h22_web_app_01_app.py","contentType":"file"},{"name":"h22_web_app_01_index.html","path":"h22_web_app_01_index.html","contentType":"file"},{"name":"h22_web_app_01_style.css","path":"h22_web_app_01_style.css","contentType":"file"},{"name":"h22_web_app_page.html","path":"h22_web_app_page.html","contentType":"file"},{"name":"index.html","path":"index.html","contentType":"file"},{"name":"letter_game.py","path":"letter_game.py","contentType":"file"},{"name":"mad-libs.py","path":"mad-libs.py","contentType":"file"},{"name":"main.css","path":"main.css","contentType":"file"},{"name":"main.py","path":"main.py","contentType":"file"},{"name":"manvsOrcGame.py","path":"manvsOrcGame.py","contentType":"file"},{"name":"motion_detector.py","path":"motion_detector.py","contentType":"file"},{"name":"motion_detector001.py","path":"motion_detector001.py","contentType":"file"},{"name":"orcEnemyVer1.006.py","path":"orcEnemyVer1.006.py","contentType":"file"},{"name":"pong.py","path":"pong.py","contentType":"file"},{"name":"running-man-game.py","path":"running-man-game.py","contentType":"file"},{"name":"send_email.py","path":"send_email.py","contentType":"file"},{"name":"shooting-Game.py","path":"shooting-Game.py","contentType":"file"},{"name":"shopping_list.py","path":"shopping_list.py","contentType":"file"},{"name":"stock_analysis.py","path":"stock_analysis.py","contentType":"file"},{"name":"success.html","path":"success.html","contentType":"file"},{"name":"test2_pyGame.py","path":"test2_pyGame.py","contentType":"file"},{"name":"testPyGame.py","path":"testPyGame.py","contentType":"file"},{"name":"walkingManGame.py","path":"walkingManGame.py","contentType":"file"},{"name":"weather_man.py","path":"weather_man.py","contentType":"file"},{"name":"web_crawler.py","path":"web_crawler.py","contentType":"file"},{"name":"web_page_puller.py","path":"web_page_puller.py","contentType":"file"},{"name":"web_scraper.py","path":"web_scraper.py","contentType":"file"},{"name":"website-blocker-1st_draft.py","path":"website-blocker-1st_draft.py","contentType":"file"},{"name":"website-blocker.py","path":"website-blocker.py","contentType":"file"},{"name":"world_map.py","path":"world_map.py","contentType":"file"}],"totalCount":42}},"fileTreeProcessingTime":21.565406,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":91921737,"defaultBranch":"master","name":"my-Python-Code","ownerLogin":"martdev1963","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2017-05-20T23:19:39.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/25094842?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1495322381.0","canEdit":false,"refType":"branch","currentOid":"549746f635a2408f4e333d3af41b0445b7b6bc63"},"path":"shopping_list.py","currentUser":null,"blob":{"rawLines":["import os","import random","","shopping_list = [\"apples\"]","","","def clear():"," if os.name == 'nt':"," os.system('cls')"," else:"," os.system('clear')","","","def show_help():"," clear()"," print(\"What should we pick up at the store? \")"," print(\"\"\"","ENTER 'DONE' to stop adding items.","ENTER 'HELP' for this help.","ENTER 'SHOW' to see your current list.","\"\"\")","","","def add_to_list(item):"," show_list()"," if len(shopping_list):"," position = input(\"Where should I add {}?\\n\""," \"Press ENTER to add to the end of the list\\n\""," \"\u003e \".format(item))"," else:"," position = 0",""," try:"," position = abs(int(position))"," except ValueError:"," position = None"," if position is not None:"," shopping_list.insert(position - 1, item)"," else:"," shopping_list.append(new_item)",""," show_list()","","","def show_list():"," clear()",""," print(\"Here's your list:\")",""," index = 1"," for item in shopping_list:"," print(\"{}. {}\".format(index, item))"," index += 1",""," print(\"-\" * 10)","","","help()","","while True:"," new_item = input(\"\u003e \")",""," if new_item.upper() == 'DONE' or new_item.upper() == 'QUIT':"," break"," elif new_item == 'HELP':"," show_help()"," continue"," elif new_item == 'SHOW':"," show_list()"," continue"," else:"," add_to_list(new_item)","","show_list()"],"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/martdev1963/my-Python-Code/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"shopping_list.py","displayUrl":"https://github.com/martdev1963/my-Python-Code/blob/master/shopping_list.py?raw=true","headerInfo":{"blobSize":"1.35 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"d34c0fd","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fmartdev1963%2Fmy-Python-Code%2Fblob%2Fmaster%2Fshopping_list.py","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"78","truncatedSloc":"55"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Python","languageID":303,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/martdev1963/my-Python-Code/blob/master/shopping_list.py","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/martdev1963/my-Python-Code/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/martdev1963/my-Python-Code/raw/refs/heads/master/shopping_list.py","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":null},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"isMarketplaceEnabled":true,"csrf_tokens":{"/martdev1963/my-Python-Code/branches":{"post":"cCM-5zBrd-5Dc3hlv_S0x2CxKeitspO4EmqGC3ZNbzEIac2JNRFdO3YouRt8ZvBhtztFXIXwRH-QlfCTx4-8bA"},"/repos/preferences":{"post":"IVAHEVbZOkpMlpNrTeb5QrCOf5oxjuW8S-l6U2b0OVJ0QPfb-Rve-pY5ykU7VHkH_RMc2YuQkErFBPqN7HbcVw"}}},"title":"my-Python-Code/shopping_list.py at master · martdev1963/my-Python-Code","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-d30550df4878.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}
0