- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
requests
库可以完美地从 google 文档(来自 How do you save a Google Sheets file as CSV from Python 3 (or 2)?)检索 csv 或 txt 文件
但是当我尝试对 google doc 中的 pdf 文件执行相同操作时,我只能设法获取 HTML 文件,有什么方法可以让我从 google doc 下载 pdf 文件吗?例如https://docs.google.com/file/d/0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj/edit
我试过使用 requester
,我得到了这个:
>>> import requests # https://pypi.python.org/pypi/requests
>>> gdoc = 'https://docs.google.com/file/d/0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj/edit'
>>> print requests.get(gdoc).text
输出:
<!DOCTYPE html><html><head><meta name="google" content="notranslate"><meta http-equiv="X-UA-Compatible" content="IE=edge;"><meta name="fragment" content="!"><title>The Starfish Story (Translation in Navajo).pdf - Google Drive</title><style type="text/css">#gbar,#guser{font-size:13px;padding-right:8px;padding-top:4px !important;}#gbar{padding-left:8px;height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important}a.gb1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27 !important}.gbf .gb4{color:#900 !important}</style><script>_docs_flag_initialData={"jobset":"prod","docs-aiiws":"docs_warm_sdf","info_params":{},"uls":"","icso":false,"docs_eoal":true,"docs_oogt":"NONE","docosEmbedApiJs":"\/\/docs.google.com\/comments\/d\/AAHRpnXu2c4T_cvcH9MyrCUHPNj25CBhn1z7azmidPK7l5vEFT86M59YW7kmm6hTnmTuic9OmYbD43mFsbHo7FXIzRxICAm6TFMaL7q9d34z6-gL59HUNgpG3DAaoty1Q1eA5v7R_WCJU\/api\/js?hl=de","docosUnreadCommentsEnabled":false,"docs-egc":true,"docs-chat_base_url":"talkgadget.google.com\/talkgadget\/","docs-chat_domain_rotation":true,"docs-ce":true,"docs-ut":2,"promo_url":"","promo_title":"","promo_title_prefix":"","promo_content_html":"","promo_element_id":"","promo_orientation":1,"promo_show_on_click":false,"promo_show_on_load":false,"show_promo":false,"docs-encp":false,"buildLabel":"texmex_2013-49-Thu_RC1","buildClNumber":"57718063","debugTask":"ve_32","docs-show_debug_info":false,"dcau":"https:\/\/chrome.google.com\/webstore\/detail\/apdfllckaahabafndbhieahigkjlhalf","ondlburl":"\/\/docs.google.com","drive_url":"\/\/drive.google.com","docs-sup":"\/file","docs-uptc":["lsrp","usp","urp","utm_source","utm_medium","utm_campaign","utm_term","utm_content"],"docs-cwsd":"","docs-al":[0,0,0,1,0]
,"docs-ndt":"Untitled Texmex","docs-eit":false,"docs-spfe":true,"docs-mriim":1800000,"docs-ecc":false,"docs-mnumea":false,"docs-ess":false,"ecbsl":true,"ecid":true,"eod":true,"docs-eilb":false,"docs-pedd":true,"docs-evr":true,"docs-eir":false,"docs-enmr":false,"docs-esrd":false,"share_ui":"jfk","server_time_ms":1387227430022,"gaia_session_id":"","enable_iframed_embed_api":true,"cup":"\/folder\/d\/{folderId}\/edit","docs-fut":"\/\/docs.google.com\/#folders\/{folderId}","esid":true,"esubid":false,"docs-etbs":true,"enable_kennedy":true,"onePickImportDocumentUrl":"","opbu":"https:\/\/docs.google.com\/picker","opru":"https:\/\/docs.google.com\/relay.html","opdu":false,"ophi":"texmex","opuci":"","docs-se":false,"docs-ebcrsct":false,"docs-iror":false,"xdbcmUri":"https:\/\/docs.google.com\/file\/xdbcm.html","xdbcfAllowXpc":true,"docs-corsbc":false,"xdbcfAllowHostNamePrefix":true,"docs-spdy":false,"enable_client_docos":true,"enable_anchored_docos":true,"enable_docos_tickle":true,"gv_int_native":true,"enable_a11y":true,"tpc":true,"enable_pinned_revisions":false,"enable_edit_blob_revisions":false,"upload_url":"https:\/\/docs.google.com\/upload\/resumableupload","enable_toolbar":true,"enable_feedback_button":false,"enable_microscope":true,"enable_manage_timed_text":true,"video_embed_type":"PREFER_FLASH","enable_maps_embed":true,"maps_api_uri":"https:\/\/maps.googleapis.com\/maps\/api\/js?key=AIzaSyBCjpnguVjzi6vS67NdBtyYuvCYz3yBxCY&sensor=false","maps_display_uri":"https:\/\/maps.google.com\/maps","docs_abuse_link":"https:\/\/docs.google.com\/abuse?id=0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj","enable_csi":true,"csi_service_name":"texmex","third_party_default_icon_urls":{"icon16":"\/\/ssl.gstatic.com\/docs\/doclist\/images\/generic_app_icon_16.png","icon32":"\/\/ssl.gstatic.com\/docs\/doclist\/images\/generic_app_icon_32.png","icon64":"\/\/ssl.gstatic.com\/docs\/doclist\/images\/generic_app_icon_64.png","icon128":"\/\/ssl.gstatic.com\/docs\/doclist\/images\/generic_app_icon_128.png"},"enable_chrome_webstore_link":true};</script><script type="text/javascript">(function(){(function(){function e(a){this.t={};this.tick=function(a,c,b){var d=void 0!=b?b:(new Date).getTime();this.t[a]=[d,c];if(void 0==b)try{window.console.timeStamp("CSI/"+a)}catch(e){}};this.tick("start",null,a)}var a;window.performance&&(a=window.performance.timing);var f=a?new e(a.responseStart):new e;window.jstiming={Timer:e,load:f};if(a){var c=a.navigationStart,d=a.responseStart;0<c&&d>=c&&(window.jstiming.srt=d-c)}if(a){var b=window.jstiming.load;0<c&&d>=c&&(b.tick("_wtsrt",void 0,c),b.tick("wtsrt_",
"_wtsrt",d),b.tick("tbsd_","wtsrt_"))}try{a=null,window.chrome&&window.chrome.csi&&(a=Math.floor(window.chrome.csi().pageT),b&&0<c&&(b.tick("_tbnd",void 0,window.chrome.csi().startE),b.tick("tbnd_","_tbnd",c))),null==a&&window.gtbExternal&&(a=window.gtbExternal.pageT()),null==a&&window.external&&(a=window.external.pageT,b&&0<c&&(b.tick("_tbnd",void 0,window.external.startE),b.tick("tbnd_","_tbnd",c))),a&&(window.jstiming.pt=a)}catch(g){}})();})();
</script><link rel="stylesheet" href="/static/file/client/css/1508097430-edit_css_ltr.css">
<link rel="shortcut icon" href="https://ssl.gstatic.com/docs/doclist/images/icon_11_pdf_favicon.ico"><link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/apdfllckaahabafndbhieahigkjlhalf"></head><body dir="ltr" role="application" onload='_onload()'itemscope itemtype="http://schema.org/CreativeWork/DocumentObject"><noscript><div class="docs-butterbar-container"><div class="docs-butterbar-wrap"><div class="jfk-butterBar jfk-butterBar-shown jfk-butterBar-warning">Die Datei kann in Ihrem Browser nicht geöffnet werden, da JavaScript nicht aktiviert ist. Aktivieren Sie JavaScript und laden Sie die Seite noch einmal.</div></div><br></div></noscript><meta itemprop="name" content="The Starfish Story (Translation in Navajo).pdf"><meta itemprop="faviconUrl" content="https://ssl.gstatic.com/docs/doclist/images/icon_11_pdf_favicon.ico"><meta itemprop="url" content="https://docs.google.com/file/d/0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj/edit"><meta itemprop="embedURL" content="https://docs.google.com/file/d/0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj/preview"><div id="docs-chrome" class="docs-vis-ref-chrome" tabindex="0"><div><div id="docs-header"><div id="docs-branding-container"class="docs-branding-default"><a title="Google Drive öffnen" href="//drive.google.com" target="_blank"><div id="docs-drive-logo"></div><div id="docs-branding-logo"></div></a></div><div id=gbar><nobr><a target=_blank class=gb1 href="https://www.google.com/webhp?tab=ow">Suche</a> <a target=_blank class=gb1 href="http://www.google.com/imghp?hl=de&tab=oi">Bilder</a> <a target=_blank class=gb1 href="https://maps.google.com/maps?hl=de&tab=ol">Maps</a> <a target=_blank class=gb1 href="https://play.google.com/?hl=de&tab=o8">Play</a> <a target=_blank class=gb1 href="https://www.youtube.com/?tab=o1">YouTube</a> <a target=_blank class=gb1 href="https://news.google.com/nwshp?hl=de&tab=on">News</a> <a target=_blank class=gb1 href="https://mail.google.com/mail/?tab=om">Gmail</a> <b class=gb1>Drive</b> <a target=_blank class=gb1 style="text-decoration:none" href="http://www.google.com/intl/de/options/"><u>Mehr</u> »</a></nobr></div><div id=guser width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf></span><span id=gbe><a target='_blank' href="https://docs.google.com/abuse?id=0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj" class=gb4>Missbrauch melden</a> | </span><a target='_blank' href="https://docs.google.com/settings" class=gb4>Einstellungen</a> | <a target=_top id=gb_70 href="https://www.google.com/accounts/ServiceLogin?service=wise&passive=1209600&continue=https://docs.google.com/file/d/0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj/edit&followup=https://docs.google.com/file/d/0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj/edit" class=gb4>Anmelden</a></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div><div style="clear:both"></div><div id="docs-titlebar-container"><div id="docs-titlebar"><div class="docs-title-outer"><div class="docs-title-widget goog-inline-block" id="docs-title-widget"><span class="docs-title" id="docs-title" role="button"><div class="docs-title-inner" id="docs-title-inner">The Starfish Story (Translation in Navajo).pdf</div></span></div><div class="docs-star-container goog-inline-block"><div id="docs-star" class="goog-inline-block" style="display:none"></div></div><div class="docs-activity-indicator-container goog-inline-block"></div></div></div><div class="docs-titlebar-buttons"><div id="docs-presence-container" class="goog-inline-block docs-titlebar-button"><div id="docs-presence" class="goog-inline-block"></div><div role="button" id="docs-chat" class="goog-inline-block jfk-button jfk-button-standard jfk-button-narrow docs-chat jfk-button-disabled" aria-disabled="true" style="display: none"><div class="docs-icon goog-inline-block "><div class="docs-icon-img-container docs-icon-img docs-icon-chat"> </div></div></div></div><div class="goog-inline-block"><div role="button" id="docs-docos-commentsbutton" class="goog-inline-block jfk-button jfk-button-standard docs-titlebar-button jfk-button-disabled" aria-disabled="true">Kommentare</div><div id="docs-docos-caret" style="display: none"><div class="docs-docos-caret-outer"></div><div class="docs-docos-caret-inner"></div></div></div><span vsjson="{"role":20,"summary":"Jeder, der über den Link verfügt","visibilityState":"unlisted","restrictedToDomain":false,"visibilityEntries":[{"role":20,"summary":"Jeder, der über den Link verfügt","visibilityState":"unlisted","restrictedToDomain":false,"details":"Alle Nutzer, die über den Link verfügen, sind zum Zugriff berechtigt. Es ist keine Anmeldung erforderlich."}],"restrictedToSingleUserScope":false}" id="docs-titlebar-share-client-button" class="goog-inline-block"><div role="button" class="goog-inline-block jfk-button jfk-button-action docs-titlebar-button jfk-button-disabled" aria-disabled="true"><span class="goog-inline-block apps-share-sprite scb-button-icon scb-unlisted-icon-white"> </span>Freigeben</div></span></div></div></div><div class="docs-butterbar-container"><div class="docs-butterbar-wrap"><div class="jfk-butterBar jfk-butterBar-shown jfk-butterBar-info">Der von Ihnen verwendete Browser wird nicht mehr unterstützt. Einige Funktionen sind daher möglicherweise nicht wie gewünscht verfügbar. Führen Sie ein Upgrade auf einen <a href="http://whatbrowser.org" target="_blank" class="docs-butterbar-link-no-pad">modernen Browser</a> wie <a href="https://www.google.com/chrome/?&brand=CHVN&utm_campaign=en&utm_source=en-et-na-us-docs-ug&utm_medium=et" target="_blank" class="docs-butterbar-link-no-pad">Google Chrome</a> aus.<a href="#" onclick="this.parentNode.parentNode.removeChild(this.parentNode);return false;" class="docs-butterbar-link">Schließen</a></div></div><br></div></div><div id="docs-bars"><div id="docs-menubars"><div id="docs-menubar" role="menubar" class="docs-menubar goog-container goog-container-horizontal" tabIndex="0"><div id="docs-file-menu" role="menuitem" class="menu-button goog-control goog-control-disabled goog-inline-block">Datei</div><div id="docs-edit-menu" role="menuitem" class="menu-button goog-control goog-control-disabled goog-inline-block">Bearbeiten</div><div id="docs-view-menu" role="menuitem" class="menu-button goog-control goog-control-disabled goog-inline-block">Ansicht</div><div id="docs-help-menu" role="menuitem" class="menu-button goog-control goog-control-disabled goog-inline-block">Hilfe</div></div><div id="docs-chat-message-a11y" aria-live="polite" class="docs-offscreen" style="height: 0; width: 0; overflow: hidden"></div><div id="docs-presence-menubar"></div></div></div><div id="docs-help-anchor-wrapper"><div id="docs-help-anchor"></div><div id="docs-help-anchor-right"></div></div><div id="docs-additional-bars"></div></div><div id="docs-editor-container" class="docs-vis-ref-editor-container"><div id="docs-editor" tabindex="1" ><iframe id="gview-embed-content"class="gview-embed-iframe"src="https://docs.google.com/viewer?srcid=0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj&pid=explorer&efh=false&a=v"></iframe></div></div><script type="text/javascript" src="/static/file/client/js/612129255-edit_core__de.js"></script>
<script>DOCS_initializeModules({"core":[],"app":["core"]},{"core":["\/static\/file\/client\/js\/612129255-edit_core__de.js"],"app":["\/static\/file\/client\/js\/4052761810-edit_app__de.js"]}, 'core');</script><script type="text/javascript">_main('\/file\/d\/0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj', {'sid': '48231c7ba8cb2d29','id': '0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj', 'email': '', 'title': 'The Starfish Story (Translation in Navajo).pdf', 'description': '', 'mimetype': 'application\/pdf', 'fileExtension': 'pdf', 'mediaType': 'pdf', 'revisions': [{"tags":[],"creatorDisplayName":"Terry Teller","pinned":true,"filename":"The Starfish Story (Translation in Navajo).pdf","downloadUrl":"https:\/\/docs.google.com\/uc?id=0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj&export=download&revid=0BxcsLDhZbUBBQmJUS0dhMVV4YWZmZStPa05xWlgxd3ZzaVJrPQ","sizeInBytes":33421,"docId":"0BxcsLDhZbUBBQmJUS0dhMVV4YWZmZStPa05xWlgxd3ZzaVJrPQ","creationDateString":"09.01.12","creator":{"isMe":false,"nickname":"Terry Teller","iconUrl":"images\/doclist\/contact_nopicture.png","editProfileUrl":"editProfile"}}],'obfuscatedUserId': 'ANONYMOUS_17612595759507348808','userDomain': '', 'embedPreviewUri': 'https:\/\/docs.google.com\/file\/d\/0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj\/preview','syncUpdates': [],'contentRenderer': 'gviewembed'},{"description":{"raw":"","formatted":""},"download":{"isMissingBlobRef":false,"filename":"The Starfish Story (Translation in Navajo).pdf","url":"https:\/\/docs.google.com\/uc?id=0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj&export=download"},"revision":{"swfUrl":"\/static\/doclist\/client\/css\/1531528182-uploaderapi.swf","busyIconImageUrl":"https:\/\/ssl.gstatic.com\/docs\/doclist\/images\/loading_small.gif"},"sharing":{"is_private":false,"visibility_is_restricted_to_domain":false,"visibility_domain_display_name":""},"basicdetails":{"mimeType":"application\/pdf","lastModifiedDateString":"28.06.12","creationDateString":"09.01.12","fileSize":"33421"},"thumbnail":{"thumbnail_128":"https:\/\/lh5.googleusercontent.com\/lpPbLs1Ej7u889Xoa2e15WTjJJ1nQZMZYEfYlE5tIq-kyhOLFz-33NfIxbrTFLcVA4YyPU6cpVkdhUaXG30aCt3u0nKvWVZw3xdt4A=s128","thumbnail_full":"https:\/\/lh5.googleusercontent.com\/lpPbLs1Ej7u889Xoa2e15WTjJJ1nQZMZYEfYlE5tIq-kyhOLFz-33NfIxbrTFLcVA4YyPU6cpVkdhUaXG30aCt3u0nKvWVZw3xdt4A=s1600"},"gviewembed":{"url":"https:\/\/docs.google.com\/viewer?srcid=0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj&pid=explorer&efh=false&a=v","embeduri":"https:\/\/docs.google.com\/viewer?srcid=0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj&pid=explorer&efh=false&a=v&chrome=false&embedded=true","nonredirectedgviewurl":"https:\/\/docs.google.com\/viewer?srcid=0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj&pid=explorer&efh=false&a=v&chrome=true&redirect=false","isNativeGView":false},"webstoreui":{"mimeType":"application\/pdf","fileExtension":"pdf","moreDriveAppsUrl":"https:\/\/chrome.google.com\/webstore\/category\/collection\/drive_apps"}});</script></body></html>
我试过使用 urllib
并且我得到了:
>>> import urllib, codecs
>>> urllib.urlretrieve('https://docs.google.com/file/d/0BxcsLDhZbUBBMWY1MzRkZGQtMjQxNC00NzQ3LWFmNzEtNzNmMzYzYmU2MDRj/edit')
('/tmp/tmpQ5tDwR', <httplib.HTTPMessage instance at 0x16fbbd8>)
>>> codecs.open('/tmp/tmpQ5tDwR','r').read()
我得到了这个输出:http://pastebin.com/D2FM1VMU
最佳答案
这里的正确答案是使用 Google Drive API访问您的文档,而不是像普通的面向用户的网络浏览器那样尝试编写与 Google 文档对话的脚本。
按照您的操作方式,Google 认为您想要查看该页面。而且,由于您看起来不像是可以 native 查看 PDF 的浏览器,因此它对您很好,并创建了一个 HTML 查看器页面来让您阅读 PDF。该查看器页面确实具有“下载”功能,您可以尝试解析 HTML 和 JavaScript 并触发下载,但这需要大量工作。
此外,我敢打赌 Google 云端硬盘的服务条款明确禁止编写脚本和抓取网络界面。
API 确实需要您创建一个 API key ,您可能还需要 OAuth 来处理以正确用户身份登录。但是一旦你这样做了,它就会像你想做的那样容易使用——而且它确实有效。你做了一个Files: get
请求从其 ID(您现有尝试中的一长串垃圾)获取有关该文件的信息,其中包括 downloadUrl
字段,您只需获取该 URL。像这样的东西,在纯 stdlib 中:
url = 'https://www.googleapis.com/drive/v2/files/' + fileid
r = urllib2.urlopen(url)
filesinfo = json.load(r)
downloadurl = filesinfo['downloadUrl']
r2 = urllib2.urlopen(downloadurl)
data = r2.read()
requests
会让您在开始添加 API key 和可能的 OAuth 时变得更轻松——例如,您可以只传递 {'key': API_KEY}
而不是调用 urllib.urlencode
在字典上将其添加为查询字符串。
Google API Client Library for Python将使事情变得更加简单——您可以在文档页面上看到示例代码。
关于python - 如何通过 python 保存 Google pdf 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20620786/
我尝试根据表单元素的更改禁用/启用保存按钮。但是,当通过弹出按钮选择更改隐藏输入字段值时,保存按钮不受影响。 下面是我的代码。我正在尝试序列化旧的表单值并与更改后的表单值进行比较。但我猜隐藏的字段值无
我正在尝试保存模型的实例,但我得到了 Invalid EmbeddedDocumentField item (1) 其中 1 是项目的 ID(我认为)。 模型定义为 class Graph(Docum
我有一个非常奇怪的问题......在我的 iPhone 应用程序中,用户可以打开相机胶卷中的图像,在我的示例中 1920 x 1080 像素 (72 dpi) 的壁纸。 现在,想要将图像的宽度调整为例
目前,我正在使用具有排序/过滤功能的数据表成功地从我的数据库中显示图像元数据。在我的数据表下方,我使用第三方图像覆盖流( http://www.jacksasylum.eu/ContentFlow/
我的脚本有问题。我想按此顺序执行以下步骤: 1. 保存输入字段中的文本。 2. 删除输入字段中的所有文本。 3. 在输入字段中重新加载之前删除的相同文本。 我的脚本的问题是 ug()- 函数在我的文本
任何人都可以帮助我如何保存多对多关系吗?我有任务,用户可以有很多任务,任务可以有很多用户(多对多),我想要实现的是,在更新表单中,管理员可以将多个用户分配给特定任务。这是通过 html 多选输入来完成
我在 Tensorflow 中训练了一个具有批归一化的模型。我想保存模型并恢复它以供进一步使用。批量归一化是通过 完成的 def batch_norm(input, phase): retur
我遇到了 grails 的问题。我有一个看起来像这样的域: class Book { static belongsTo = Author String toString() { tit
所以我正在开发一个应用程序,一旦用户连接(通过 soundcloud),就会出现以下对象: {userid: userid, username: username, genre: genre, fol
我正在开发一个具有多选项卡布局的 Angular 7 应用程序。每个选项卡都包含一个组件,该组件可以引用其他嵌套组件。 当用户选择一个新的/另一个选项卡时,当前选项卡上显示的组件将被销毁(我不仅仅是隐
我尝试使用 JEditorPane 进行一些简单的文本格式化,但随着知识的增长,我发现 JTextPane 更容易实现并且更强大。 我的问题是如何将 JTextPane 中的格式化文本保存到文件?它应
使用 Docker 相当新。 我为 Oracle 11g Full 提取了一个图像。创建了一个数据库并将应用程序安装到容器中。 正确配置后,我提交了生成 15GB 镜像的容器。 测试了该图像的新容器,
我是使用 Xcode 和 swift 的新手,仍在学习中。我在将核心数据从实体传递到文本字段/标签时遇到问题,然后用户可以选择编辑和保存记录。我的目标是,当用户从 friendslistViewCon
我正在用 Java 编写 Android 游戏,我需要一种可靠的方法来快速保存和加载应用程序状态。这个问题似乎适用于大多数 OO 语言。 了解我需要保存的内容:我正在使用策略模式来控制我的游戏实体。我
我想知道使用 fstream 加载/保存某种结构类型的数组是否是个好主意。注意,我说的是加载/保存到二进制文件。我应该加载/保存独立变量,例如 int、float、boolean 而不是结构吗?我这么
我希望能够将 QNetworkReply 保存到 QString/QByteArray。在我看到的示例中,它们总是将流保存到另一个文件。 目前我的代码看起来像这样,我从主机那里得到一个字符串,我想做的
我正在创建一个绘图应用程序。我有一个带有 Canvas 的自定义 View ,它根据用户输入绘制线条: class Line { float startX, startY, stopX, stop
我有 3 个 Activity 第一个 Activity 调用第二个 Activity ,第二个 Activity 调用第三个 Activity 。 第二个 Activity 使用第一个 Activi
我想知道如何在 Xcode 中保存 cookie。我想使用从一个网页获取的 cookie 并使用它访问另一个网页。我使用下面的代码登录该网站,我想保存从该连接获得的 cookie,以便在我建立另一个连
我有一个 SQLite 数据库存储我的所有日历事件,建模如下: TimerEvent *Attributes -date -dateForMark -reminder *Relat
我是一名优秀的程序员,十分优秀!