我目前有一个工作脚本,可以解析文本文件中的文本数据
我感兴趣的不是使用文本文件,而是使用Tkinter Scrolled文本来保存数据,而不是使用文本文件。然后我希望有一个Tkinter按钮,它将运行解析函数并解析数据,就像我使用文本文件中的数据运行解析脚本时通常所做的那样
当我试图通过tkinter按钮将工作脚本转换为运行的定义时,我遇到了局部变量和全局变量的问题。作为一个简单的修复,我将工作脚本直接添加到包含tkinter代码的新代码中。然后将工作脚本设置为一个循环,当按下tkinter按钮时,该循环将被激活,该按钮称为一个新的定义,该定义只是更改了布尔值。假定更改后的布尔值使工作脚本运行
我原以为这样行得通,但事实并非如此。如果有人能(1)帮助我理解如何正确运行我的工作脚本作为通过tkinter按钮调用的定义,或者(2)帮助我修复我的“修复”,其中工作脚本没有转换为定义,而是保存在一个循环中,我将非常感激
请参阅下面的脚本“简单修复”版本:(请参阅下面的@Mike-SMT帖子了解当前脚本-我通过了单词限制,试图将旧脚本和newtestable.txt文件添加到此帖子中)
下面是一个可测试的.txt文件。(更新)
asdfasdfasdfasd asdf™
BLAH asdfasdf asdff
asdfasdfsadf & asdfasd
asdf
asd asdf
asdff
asdfaf
asdfasd
asdfasd
asdff asdfasdf / asdfasdf asdfas asdfasdf asdfasdf / asdfa asdf BLAH-2020-02-0001 asdffd
asdf asdf asdff asdf asdf asdfas asdf asdfas asdf asdfast asdfdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfsdfasdfasd asdfasd sdfas df asdfas df ffffffasdfasd asdfasdfasd asdfasdfasdfasdfasdfasdfsdfsdf asdfasdfasdfasdf asdfasdfasdfsdf asdf asdf asdff asdf asdf asdfas asdf asdfas asdf asdfast asdfdfasdfasdfasdf asdf asdf asdff asdf asdf asdfas asdf asdfas asdf asdfast asdfdfasdfasdfasdf Read More ...
asdfasdf sa
as asdff asdff
Adf f asdf
BLAH-2020-02-0001
Submitted: 29-Feb-2020; Last Updated: 03-Mar-2020; 12314 days, 112314 hours in review
Title Title Title Title Title Title
bob, blah (proxy) (contact); bob2, blah2; bob3, blah3; bob4, blah4
Short Report
asdff - asdffasdf asdf sdf asdff asdfas:
dfgsdfg fg (Due 10-Mar-2020)
fg: sdf Agsdfgs
sdfg: sdgfsd sdfg, BLAH
ADM: sdfgg, sdfgsd (proxy)
HTML PDF Supplemental Files Original Files Abstract Cover Letter External Searches
- sdfg sdfgg sdfgsdf
Date Submitted:
29-Feb-2020
Admin:
sdfgg, sdfgsd AU REV VIEW ADM PROD
proxy
Date to Admin:
29-Feb-2020
Admin:
Admin
Date to Admin:
03-Mar-2020
sdfgg-sdf-sdgfsd:
sdfgsdg sdfgg, BLAH AU REV DE EIC ADM VIEW PROD
Date to sdfgg-gsd-sdfg:
03-Mar-2020
- sdfgsd sdfgsdf sdgg
sdfgs dfgsdg dfgsdfgdfg asdf asdf asdff asdf asdf asdfas asdf asdfas asdf asdfast asdfdfasdfasdfasdfasdf asdf asdff asdf asdf asdfas asdf asdfas asdf asdfast asdfdfasdfasdfasdfasdf asdf asdff asdf asdf asdfas asdf asdfas asdf asdfast asdfdfasdfasdfasdfasdf asdf asdff asdf asdf asdfas asdf asdfas asdf asdfast asdfdfasdfasdfasdf
- sdfgsdn sdfgsd
sdfgsdgsd fg
sdfgsdg sdfgsd
sdfgs sdgsdg
sdfgsdg dfgsd & sdgg
sdfgsd
sdgsd
BLAH-2020-02-0001
Title Title Title Title Title sdfg
29-Feb-2020
- asdfasd-asdfasdf asdfa
asdfas - Manuscript type:
Short Report
Title:
Title Title Title Title Title blah
Manuscript ID:
BLAH-2020-02-0001
Funding Information:
sdfgsdfg sdfg sdgsdfgsdfg
Submitting Author:
bob, bob (proxy)
primary affiliation
Dr.
place place place 123
123 place place place
China
Authors & Institutions:
Dr. name name
place place place 123
123 place place place
China
Dr. name name
place place place 123
123 place place place
China
Dr. name name
place place place 123
123 place place place
China
Dr. name name
place place place 123
123 place place place
China
Dr. name name
place place place 123
123 place place place
China
Dr. name name
place place place 123
123 place place place
China
Dr. name name
place place place 123
123 place place place
China
Dr. name name
place place place 123
123 place place place
Australia
Dr. name name
place place place 123
123 place place place
South Korea
Contact Author (populates the ##PROLE_AUTHOR_..## e-mail tags):
Dr. name name
place place place 123
123 place place place
Japan
Running Head:
Title Title Title Title blah blah
Discipline:
Dis Type blah blah
Keywords:
asdf asdf, asdfas, asdf asdfa, Tasdfsdf, asdfasasdf
Additional Keywords:
asdfas
Author Recommended Reviewers:
person 1
person 2
Author Opposed Reviewers:
Author's Cover Letter:
dear person,
blah blah blah
cover letter
blahb blah blah
blah blah blah
sincerely,
person
If you have been invited to submit an article for a supplement, please select the title of the supplement:
Manuscript Details - Metadata (Please use numbers only)
Content Information
Number of words (excluding the title page, abstract, references, acknowledgements, and wording for tables and figures):
1761
Number of manuscript pages:
12
Number of tables (use 0 for none):
2
Illustration Information
Total number of figures (use 0 for none):
2
Number of colour figures (use 0 for none):
0
Publication Charge
zsasdf sdf asdf as dfa sdfasdfasdf asdfas df asdf as df as dfdfasdfasdfasd zsasdf sdf asdf as dfa sdfasdfasdf asdfas df asdf as df as dfdfasdfasdfasdzsasdf sdf asdf as dfa sdfasdfasdf asdfas df asdf as df as dfdfasdfasdfasdzsasdf sdf asdf as dfa sdfasdfasdf asdfas df asdf as df as dfdfasdfasdfasd
zsasdf sdf asdf as dfa sdfasdfasdf asdfas df asdf as df as dfdfasdfasdfasdzsasdf sdf asdf as dfa sdfasdfasdf asdfas df asdf as df as dfdfasdfasdfasdzsasdf sdf asdf as dfa sdfasdfasdf asdfas df asdf as df as dfdfasdfasdfasdzsasdf sdf asdf as dfa sdfasdfasdf asdfas df asdf as df as dfdfasdfasdfasd zsasdf sdf asdf as dfa sdfasdfasdf asdfas df asdf as df as dfdfasdfasdfasd
Supplement articles: please select the option "I believe a third-party will pay..." below, and enter AAA as the code (stands for "BLAH Supplement Sponsor").
If your manuscript is accepted, you will be given the option of paying by credit card or invoice. If you believe that payment for your article is covered by a society, institutional or funding agency arrangement, please let us know using the form below.
Not sure if payment for your article could be covered by your institution or funding agency? Use our Institute/Funder Policy Finder tool to check: http://sdfgsdfgsdgsdgsdg.html
Who Will Pay
I accept responsibility for paying the publication charge on this article.
If your manuscript is accepted, you will be able to pay by credit card, invoice, or pro forma.
(Please see the “Discounts That May Apply” section for a list of institutions and funding agencies that have agreed to cover a portion of the publication fees.)
I believe a third-party will pay the publication charge for this article.
Some institutions and funding agencies have agreed to be invoiced directly and pay the sdfgsd sdfgsdfgsd sdfgsdg article publication charge (sdfgs) for their affiliated researchers. To check your eligibility, go to http://www.sdfgsdfg and find the affiliated institution or funder of the corresponding author, then copy the code and paste it here.
Please enter institution code here:
Please enter your funder and grant / project number if your institution requires this information in order to pay the APC:
I request a waiver of the publication charge for this article.
We offer a complete or partial fee waiver on a case-by-case basis for individual autdfghdfh dfhdfhdfhdfghdfhdfghdfhdfgdfh gfhdfhdfhdf dfghdfh (internal use)
Discounts That May Apply
Please select from the drop-down menus below for all discounts you wish to claim. Please note that the single, highest discount will apply.
Society Membership Discount
If the Corresponding Author is a member of the asdfasdf fasdf asdf asdasdf and wishes to request a discount (as applicable), please select it from the list below.
If the Corresponding Author is not an dsfgs dgfsdgsd sdfgsdgfishes to apply before submitting, the membership application form is available at: www.sdfgsdfgsdfg. To qualify for the discount, please supply your membership number during original submission. The discount will not be applied if you become a member after original submission, or if you suspend your membership before acceptance of your manuscript.
Please enter the society membership ID number of the corresponding author so we can verify your membership. If you don't know your membership ID you can request this from msdfgsdfgsd@sdgsdfgs.org:
For office use only: dfasdf asdffdasasdf asdf
asdfasdfasdf asdfasdf
The institutions or funding agencies listed below have agreed to cover a portion of the article publication charges in sdfgsd gsdgsdgfsdfgsdfgsdg for their affiliated researchers. If you are a corresponding author affiliated with one of the organizations listed, please select it from the list below:
Other Discount
If you have received another type of discount code, such as a promotional discount code via e-mail or brochure, please enter it below:
Eligibility for institutional payment via asdf asfasdfasdfasdfasdfas is based on the date of submission of an article. If your institution ceases to have an active account/partnership arrangement prior to completion of the article submission process, your article will not be eligible for institutional/funder payment.
Submission Information - Confirm the following:
Confirm that the manuscript has been submitted solely to this journal and is not published, in press, or submitted elsewhere.
Conflict of Interest
wer wert wet wet wetwert wet wert we requires that all authors disclose any potential sources of conflict of interest. Any interest or relationship, financial or otherwise, that might be perceived as influencing an author’s objectivity is considered a potential source of conflict of interest. These must be disclosed when directly relevant or indirectly related to the work that the authors describe in their manuscript. Potential sources of conflict of interest include but are not limited to patent or stock ownership, membership of a company board of directors, membership of an advisory board or committee for a company, and consultancy for or receipt of speaker’s fees from a company. The existence of a conflict of interest does not preclude publication in this journal.
If the authors have no conflict of interest to declare, they must also state this at submission. It is the responsibility of the corresponding author to review this policy with all authors and to collectively list in the cover letter (if applicable) to the Editor-in-Chief, in the manuscript (in the footnotes, Conflict of Interest or Acknowledgments section), and in the online submission system ALL pertinent commercial and other relationships.
Do you or any of your co-authors have a conflict of interest to declare?
No
Confirm that you have stated this conflict of interest in the footnotes, Conflict of Interest or Acknowledgments section of your manuscript as required by the Journal (see the Instructions to Authors).
Provide details and include this information below.
Previously Submitted to sdfgsdfgsdfgsdfgsdfgsdfgsdfg
Has this manuscript previously
- been submitted via sdfgsdfgsdfgsdfsdfgsdfgsdfg previous submission site and is now being submitted either for final acceptance or after revision
- been submitted via the sdfgsdfgsdfgsdgfsdf sdgfsdfg website and received a revision decision [revised papers should be submitted as “revisions” and not as “new” papers]
- been submitted to sdfgsdfgsdfgsdgsdfgsdfgsdfcted?
If either of the above is true please answer "Yes".
No
If yes, please state previous sdfg sdfg sdgfsdgsdfgsdfgsdfgsd:
Open Access Agreement
Confirm that all authors of this submission have read and understood the journal's policy concerning the completion of the Open Access Agreement. This form will be requested if your paper is accepted. Further information can be found in the journal's Author Guidelines.
Supporting Information
We allow submission of "Sdfhdfggh dfh". Go to https://dfgsdgf sdgsdfgsdfgdfgsd.html to access the fgh dfhdfh guidelines for the submission of Supporting Information. If you wish to submit Supporting Information, please select the file designation “Supporting Information for review and publication” when uploading your files. Please note that we would encourage you, where possible and appropriate, to include such information in an Appendix in your main document instead of designating it as Supporting Information.
Does your submission include any supporting information files for publication?
Yes
No
Ethics
Please insert your ethical statement below. This should include approval by any ethical boards and your consent or consent waiver procedure. If your article does not require an ethical statement (for example if it is a review), please state this. Your ethical statement should also be included in your methods section.
The case we reported are consent for the study.
Dates of data collection
Please state the dates between which your data was collected. Literature reviews should list when the review was completed and the dates of the literature reviewed. This information should also be included in the methods section of your main article and abstract.
sdfgsdfgsdgsd gsdfgsdgsdfgsdgsdgfsdgfsdgsdgsdfg sdf sdfg sdfgsdfgsd.
- Plagiarism Check iThenticate User Guide
Crossref Similarity Check logo
Overall Similarity Index Percentage: 25%
Report complete. View the Originality Report.
- Forward to Viewing
Viewing
- Forward to Admin
fgjgfj, fgjgh (assign a different person)
- Admin Checklist (Date Completed: 03-Mar-2020 )
Is the submission complete, are all files submitted in an acceptable format and is the manuscript ready for review?
Has the author requested a fee waiver?
Have all co-author names been uploaded by the submitting author?
Is the manuscript within the scope of/suitable for the journal?
Does the manuscript main document include keywords?
If the author has claimed a society membership discount, has membership been verified and society discount code provided (Manuscript Information tab>Author-Supplied Data>Edit This Information)?
Supplement articles only: Has author selected "BLAH Supplement Sponsor" as their funder? Is manuscript on list of expected supplemental articles? If yes, copy Supplement Title into "Comments to Payment Administrator" below. If no, unsubmit paper and ask author to select another payment option.
Comments to Payment Administrator:
- Export History
Export Method
Date Exported
History
Remove
Batch:
Submitted ms export
03-Mar-2020
Exported to file blah-2020-02-0001-20200303110924.zip
Successfully uploaded blah-2020-02-0001-20200303110924.zip via FTP file to sdfgsdfg.com.
Assign to Batch:
Export Now:
- Editor-in-Chief List
Order
Name
Status
History
Remove
Editorial Office, BLAH
(assign a different person)
Assigned (03-Mar-2020)
- EIC Decision
Make a Decision
Accept
Minor Revision
Major Revision
Reject
Reject without Review
Decision comments (internal use only):
Reviews
- Assign to Issue
Not assigned to issue.
Assign to:
- Companion Papers
Manuscript ID
Manuscript Title
Date Submitted
Author
Status
Delete
Type
- Flag This Manuscript
Leave this manuscript unflagged
Accepted Manuscript Plagiarism check needed
.R2
Resubmission
.R1
TDA with Reports TDA without Reports
- Notes
Note Title
Updated By
Updated On
Edit
Delete
This document has no notes.
dfghdfhdfhd fgh dfhdfgh
df hdfhdfghdfhdfhdfghdfhdf
dfhdfghdfghdfghdfgh
dfhdfghdfhdfhdfhd
@dfghdfhdfh | dfghdfh dfhdfhh | dfhdf dfhdfh | dfhdf df dfhdf
Admin: dfghdfhdf dfhdfhh |
这里发生了很多事情,很多事情需要改变
在关闭应用程序之前,
mainloop()
之后的代码不会工作。因此,让我们将解析代码移动到用于更新onWork的函数中可以使用循环生成大多数标签和输入字段。这将有助于减少行数,使内容更易于阅读。通过输入字段列表,您可以使用列表+索引值来获取所需内容
您有很多代码没有执行任何操作或从未被调用。我已经从示例中删除了所有这些内容
oneCountries
可能应该是您导入的单独文件中的列表。如果您遵循PEP8行长度规则,那么最终会在代码中添加一堆行除了一些小事情外,我对您的解析代码没有太大的更改,因为我没有任何数据要测试,所以我无法按原样编写更好的版本。也就是说,我可以看到很多地方会出问题。如果你的情况有问题。例如,运行循环值为
line
的循环,然后运行子循环值为line
的子循环。这将导致在到达下一个if之前覆盖内容。或者,如果if
语句失败,您就没有else条件,因此在没有定义这些变量的情况下,代码的其余部分可能会失败。因此,如果您可以提供一些示例文件数据,我可以更新该部分您有几个未使用的导入项。尽量保持你的文章简洁明了
删除所有未使用的代码并重新编写其他代码后,示例从320行增加到140+。 下面是经过修改的代码。如果您有任何问题,请告诉我:
相关问题 更多 >
编程相关推荐