[issue24872] Add /NODEFAULTLIB:MSVCRT to _msvccompiler
Christoph Gohlke added the comment: FWIW, I rebuilt static libraries for zlib, jbig, jpeg, openjpeg, tiff, webp, lcms, and freetype with /MT flag (a tedious task) and was able to build matplotlib and Pillow using Python 3.5.0rc1. As expected there is no dependency on the vcruntime DLL. Even if everything is built with /MT and using UCRT, some extensions will still depend on version specific Visual C runtime DLLs, e.g. OpenMP, requiring users or distributors to install/bundle the VC runtime package. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24874] Improve pickling efficiency of itertools.cycle
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file40190/cycle_reduce_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24874] Improve pickling efficiency of itertools.cycle
Serhiy Storchaka added the comment: Original Raymonds reason in msg248662 is not valid. Pickling a cycle object that fully consumed its input iterable is already space-inefficient. import itertools, pickle, pickletools c = itertools.cycle(iter('abcde')) [next(c) for i in range(8)] ['a', 'b', 'c', 'd', 'e', 'a', 'b', 'c'] pickle.dumps(c) b'\x80\x03citertools\ncycle\nq\x00cbuiltins\niter\nq\x01]q\x02(X\x01\x00\x00\x00aq\x03X\x01\x00\x00\x00bq\x04X\x01\x00\x00\x00cq\x05X\x01\x00\x00\x00dq\x06X\x01\x00\x00\x00eq\x07e\x85q\x08Rq\tK\x03b\x85q\nRq\x0bh\x02K\x01\x86q\x0cb.' pickletools.dis(pickle.dumps(c)) 0: \x80 PROTO 3 2: cGLOBAL 'itertools cycle' 19: qBINPUT 0 21: cGLOBAL 'builtins iter' 36: qBINPUT 1 38: ]EMPTY_LIST 39: qBINPUT 2 41: (MARK 42: XBINUNICODE 'a' 48: qBINPUT 3 50: XBINUNICODE 'b' 56: qBINPUT 4 58: XBINUNICODE 'c' 64: qBINPUT 5 66: XBINUNICODE 'd' 72: qBINPUT 6 74: XBINUNICODE 'e' 80: qBINPUT 7 82: eAPPENDS(MARK at 41) 83: \x85 TUPLE1 84: qBINPUT 8 86: RREDUCE 87: qBINPUT 9 89: KBININT13 91: bBUILD 92: \x85 TUPLE1 93: qBINPUT 10 95: RREDUCE 96: qBINPUT 11 98: hBINGET 2 100: KBININT11 102: \x86 TUPLE2 103: qBINPUT 12 105: bBUILD 106: .STOP highest protocol among opcodes = 2 An internal iterator is not pickled as iter(de), but as an iterator of the list [a, b, c, d, e] with 3 items consumed. This list also saved as a part of a cycle object state, but not as a copy, but as a reference. There are two alternative patches. Both keep Raymonds optimization of cycle iterating, but have advantages. cycle_reduce_2.patch makes __reduce__ faster and more memory efficient than Raymonds variant. cycle_reduce_3.patch makes unpickled cycle object so optimized as original. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24874] Improve pickling efficiency of itertools.cycle
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file40189/cycle_reduce_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Encrypted web mail
Hi Dennis, On Sat, Aug 15, 2015 at 7:35 PM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Sat, 15 Aug 2015 12:47:17 +0300, Uri Even-Chen u...@speedy.net declaimed the following: To Python, Django and Speedy Mail Software developers, Is it possible to make Speedy Mail encrypted? I want mail to be encrypted on the server, and only the user will be able to read his/her mail. The user's password will be encrypted on the server and nobody will be able to Most systems I know of don't store the password on the server in the first place. They store a one-way hash generated from the password (possibly using a randomly generated salt that is also saved with the hash -- that is, rather than just hash password into hashstring, they hash saltpassword into otherhash and prepend the salt - saltotherhash. When user comes to connect later, they match the user name in the password database, extract the salt from saltotherhash, attach it to the password given by the user, generate the hash, and see if it matches the rest of the saved hash). The hash value is only used for matching purposes, not for any subsequent processing -- it is not a cryptography key, nor is any cryptography key used to produce it. Thanks for the feedback. Actually the passwords on my webmail in 2000 to 2005 were not encrypted, but I agree with you that passwords should be always encrypted. read the user's mail except the user himself. Is it possible? When I had How do you intend to handle new inbound email? After all, the sender of the email sure won't know about any user encryption key -- that means you have to have the encryption key stored on your server associated with the recipient username, so that you can encrypt inbound email before putting it into the user's mailbox... Do you also intend to encrypt the header information or just the body of the message? A public key system MIGHT support that, in that the public key -- used to send to the recipient is only used to encrypt the data, and can be stored on your server (in the same username/password account file). The private (decryption) key would have to be stored on the user's computer and never provided to your server machine -- and you'd need some way to send individual encrypted messages to the user where they are decrypted on their computer, NOT ON the server. You'd also need to be able to identify which messages are new, read, deleted -- if the mailbox is encrypted, this likely means each message is a file within the mailbox, since you can't do things like mark and compress an MBOX (all mail is in one file with a special header marking the start of a message) file without corrupting the encryption stream. If, at anytime, the decryption key is on the server, you have lost the security you claim to be striving for -- as any court ordered system could just patch in a packet sniffer and wait for your user to connect, capture the password, and capture the decryption key if it is sent to the server to retrieve mail (though they don't even need it at that point -- they could just capture the decrypted contents being sent to the user... TLS/SSL sessions may alleviate that problem, but it does mean having certificates to initiate the TLS session keys). If the packets are TLS encrypted, they can require one to patch into the server at the point where the contents are converted back to plain text and capture the traffic. Of course, this now means the user has to carry around a keyring that can be accessed by any computer used to read the email (since the decryption key can not be on the server, if they read email from an android tablet they need to have the key installed on the tablet; they also need it on their desktop if they use it to access the server; on their phone if it has a browser, etc.). A Javascript client is probably going to be rather slow at decrypting the emails -- but you may not be able to install a compiled Java encryption package on all the clients out there (you'd have to have something for iOS, something for Android, for Linux, Macintosh, and Windows -- though the latter three might be able to use the same core Java code). We've taken care of inbound email. What were your plans for outgoing email? You can't encrypt that as it is going to other systems and other users who are not part of your server and don't expect to see encrypted stuff. You could perhaps store the already sent messages using the same public key, but you can't do that with in-work drafts stored on the server prior to being sent (at least, not without requiring them to pass from the server to the client for decryption and then back to the server in plain-text for delivery -- deleting the draft copy and saving an encrypted sent copy) I think ProtonMail https://protonmail.ch/ is doing something similar to what I want, so maybe I'll check what they are doing. I
[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)
Laura Creighton added the comment: Things work with python3.5 so this is an issue with what debian sid calls python3 (i.e. CPython 3.4.3+ (default, Jul 28 2015, 13:17:50) [GCC 4.9.3]) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24858 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24872] Add /NODEFAULTLIB:MSVCRT to _msvccompiler
Steve Dower added the comment: I expect that, but most extensions don't seem to be in that category so this will help remove the administrator barrier. Thanks for going through that tedious process. I'll put up a patch later today and submit for 3.5.0. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24855] fail to mock the urlopen function
sih4sing5hong5 added the comment: I moved the import urlopen inside the patch. The mock worked. Thank you for explanations. I understand now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24855 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)
Laura Creighton added the comment: (as expected) Fails when invoked as python3.4 as well. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24858 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24876] distutils.errors not wildcard-import-safe
New submission from Jakub Wilk: Docstring of the distutils.errors module reads: This module is safe to use in from ... import * mode; it only exports symbols whose names start with Distutils and end with Error. But in reality, the module exports also names that don't start with Distutils: ns = {} exec('from distutils.errors import *', {}, ns) [k for k in ns.keys() if not k.startswith('Distutils')] ['LibError', 'UnknownFileError', 'LinkError', 'CompileError', 'CCompilerError', 'PreprocessError'] -- components: Distutils messages: 248680 nosy: dstufft, eric.araujo, jwilk priority: normal severity: normal status: open title: distutils.errors not wildcard-import-safe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24876 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24842] Mention SimpleNamespace in namedtuple docs
Akira Li added the comment: People do have problems that SimpleNamespace can solve: - Why Python does not support record type i.e. mutable namedtuple [1] - Does Python have anonymous classes? [2] - How to create inline objects with properties in Python? [3] - python create object and add attributes to it [4] [1] http://stackoverflow.com/questions/5227839/why-python-does-not-support-record-type-i-e-mutable-namedtuple [2] http://stackoverflow.com/questions/1123000/does-python-have-anonymous-classes [3] http://stackoverflow.com/questions/1528932/how-to-create-inline-objects-with-properties-in-python [4] http://stackoverflow.com/questions/2827623/python-create-object-and-add-attributes-to-it -- nosy: +akira ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24842 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
-2146826246 in win32com.client for empty #N/A cell in Excel
Anyone know how to handle #N/A in Excel from win32com.client. I'm extracting data from an Excel file using win32com.client. Everything works fine except for when the value #N/A is entered in excel. An empty cell. I assumed I do something as if ws.Cells(r, c).Value is None: ... But that doesn't seem to work. When I debug the piece of code while handling #N/A in a cell the type of the cell according to win32com.client is int and the value in the cell is -2146826246. Chances are small just this number will appear in Excel, but it looks dirty to depend on that value to decide if a cell is empty. Looked around the net for a solution, but nothing came up so far. Anyone knows how to handle a #N/A cell in Excel in the proper way? Regards, Sven -- https://mail.python.org/mailman/listinfo/python-list
Re: Old DbaseV DOS Programmer wants to step over to new/actual modern program software
Hi, On Sun, Aug 16, 2015 at 12:40 PM, AGOSTINHO TEIXEIRA agostinhoteixeir...@gmail.com wrote: I'm a 25year DBASE-5 DOS programmer and want/have to step over to new program/platform software, because there is no future anymore for DOS after W-XP, I've been looking around for alternatives and cannot figure out where to start, I already have been learning the SQL with SSMS database system/script this is very important because I work mostly with large databases invoicing/stock/statements etc. I always manage my users with design-programs,windows-input,files-views, using custom made windows/input. I did all this in *.prg files with hard-coding. I have some ideas in mind like Java with (ECLIPS) because it is very popular, it is the most widely used and can get tutorials and videos all over the internet. I've read a lot of good things about Python, that it is much easier but too complicate to define what to choose, at the first place witch version 2.x or 3.x, a lot of IDE's to choose from, beside of that witch IDE with what pluggin. I'll need something suitable to manage/manipulat e M-SQL. I have a lot of programs to rewrite and not much time, that's why it is very important to me to start with something appropriate with the best software combination that I can learn completely from the internet, cannot go back to the classroom, too old for that. I appreciate very much that any of you can help me to figure out to choose the right software combination for my new project. Thanks! It really doesn't matter which language you choose for you implementation. You will still need to learn it somehow and understand how to operate with it and how to write a nice maintainable code with it. I'd suggest to go to some local college and get some knowledge about your language of the choice. Perl/python might be better. because with them you will be able to test you changes right away on the spot. Also make sure that you DBMS does have a ODBC driver so you can connect to the DB... Thank you. -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: Old DbaseV DOS Programmer wants to step over to new/actual modern program software
On Sunday, August 16, 2015 at 10:10:18 PM UTC+5:30, AGOSTINHO TEIXEIRA wrote: I'm a 25year DBASE-5 DOS programmer and want/have to step over to new program/platform software, because there is no future anymore for DOS after W-XP, I've been looking around for alternatives and cannot figure out where to start, I already have been learning the SQL with SSMS database system/script this is very important because I work mostly with large databases invoicing/stock/statements etc. I always manage my users with design-programs,windows-input,files-views, using custom made windows/input. I did all this in *.prg files with hard-coding. I have some ideas in mind like Java with (ECLIPS) because it is very popular, it is the most widely used and can get tutorials and videos all over the internet. I've read a lot of good things about Python, that it is much easier but too complicate to define what to choose, at the first place witch version 2.x or 3.x, a lot of IDE's to choose from, beside of that witch IDE with what pluggin. I'll need something suitable to manage/manipulat e M-SQL. I have a lot of programs to rewrite and not much time, that's why it is very important to me to start with something appropriate with the best software combination that I can learn completely from the internet, cannot go back to the classroom, too old for that. I appreciate very much that any of you can help me to figure out to choose the right software combination for my new project. Thanks! Questions 1. Are you talking MSQL, MS-SQL? Quite different and also different from MySQL 2. How bound are you to your DBMS? If you are going to anyway port DBase-V to a modern DBMS, you can as well choose a more python-friendly one -- one of postgres, MySql, Sqlite. Anyways... Assuming you are committed to MsSql, I'd suggest in sequence: 1. Forget about DBMS and study the python tutorial for a few days 2. Forget get about *your* DBMS and play around with Sqlite that runs out of the box. This will familiarize you with python's DBMS model without the headaches of installing many pieces of softwares 3. Pick a python MsSql library and port your stuff to that -- https://mail.python.org/mailman/listinfo/python-list
RE: -2146826246 in win32com.client for empty #N/A cell in Excel
Date: Sun, 16 Aug 2015 09:53:32 -0700 Subject: -2146826246 in win32com.client for empty #N/A cell in Excel From: sven.bo...@gmail.com To: python-list@python.org Anyone know how to handle #N/A in Excel from win32com.client. I'm extracting data from an Excel file using win32com.client. Everything works fine except for when the value #N/A is entered in excel. An empty cell. I assumed I do something as if ws.Cells(r, c).Value is None: ... But that doesn't seem to work. When I debug the piece of code while handling #N/A in a cell the type of the cell according to win32com.client is int and the value in the cell is -2146826246. Chances are small just this number will appear in Excel, but it looks dirty to depend on that value to decide if a cell is empty. Looked around the net for a solution, but nothing came up so far. Anyone knows how to handle a #N/A cell in Excel in the proper way? Regards, Sven -- https://mail.python.org/mailman/listinfo/python-list Hello, Does that number happen to be -1 * sys.maxint? Regards,Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list
[issue24874] Improve pickling efficiency of itertools.cycle
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- priority: normal - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Old DbaseV DOS Programmer wants to step over to new/actual modern program software
I'm a 25year DBASE-5 DOS programmer and want/have to step over to new program/platform software, because there is no future anymore for DOS after W-XP, I've been looking around for alternatives and cannot figure out where to start, I already have been learning the SQL with SSMS database system/script this is very important because I work mostly with large databases invoicing/stock/statements etc. I always manage my users with design-programs,windows-input,files-views, using custom made windows/input. I did all this in *.prg files with hard-coding. I have some ideas in mind like Java with (ECLIPS) because it is very popular, it is the most widely used and can get tutorials and videos all over the internet. I've read a lot of good things about Python, that it is much easier but too complicate to define what to choose, at the first place witch version 2.x or 3.x, a lot of IDE's to choose from, beside of that witch IDE with what pluggin. I'll need something suitable to manage/manipulate M-SQL. I have a lot of programs to rewrite and not much time, that's why it is very important to me to start with something appropriate with the best software combination that I can learn completely from the internet, cannot go back to the classroom, too old for that. I appreciate very much that any of you can help me to figure out to choose the right software combination for my new project. Thanks! -- https://mail.python.org/mailman/listinfo/python-list
Re: Old DbaseV DOS Programmer wants to step over to new/actual modern program software
On 08/16/2015 10:40 AM, AGOSTINHO TEIXEIRA wrote: I'm a 25year DBASE-5 DOS programmer and want/have to step over to new program/platform software, because there is no future anymore for DOS after W-XP, I've been looking around for alternatives and cannot figure out where to start, I already have been learning the SQL with SSMS database system/script this is very important because I work mostly with large databases invoicing/stock/statements etc. I always manage my users with design-programs,windows-input,files-views, using custom made windows/input. I did all this in *.prg files with hard-coding. I have some ideas in mind like Java with (ECLIPS) because it is very popular, it is the most widely used and can get tutorials and videos all over the internet. I've read a lot of good things about Python, that it is much easier but too complicate to define what to choose, at the first place witch version 2.x or 3.x, a lot of IDE's to choose from, beside of that witch IDE with what pluggin. I'll need something suitable to manage/manipulate M-SQL. I have a lot of programs to rewrite and not much time, that's why it is very important to me to start with something appropriate with the best software combination that I can learn completely from the internet, cannot go back to the classroom, too old for that. I appreciate very much that any of you can help me to figure out to choose the right software combination for my new project. Thanks! Here're a couple of interesting projects that I found on a google search that might relate to what you're trying to do: http://www.python-camelot.com/ http://kivy.org/ But like the other poster said, take some time to learn a new language, such as Python. Things can get complicated in a hurry, but if you have a solid understanding of the language, it's doable. Also it is helpful if you have a good working knowledge of SQL. SQL is useful when interacting with a variety of database engines such as MS SQL, or a freely available one like PostgreSQL. Then there are dozens of different database access libraries and abstractions you can choose from such as SQLAlchemy. And for creating a GUI there are several different toolkits. As for the future of DOS, existing DOS programs including your DBASE-5 apps should continue running indefinitely with the wonderful DOSBox program: http://www.dosbox.com/. While it's aimed at running games, it runs business apps quite well. -- https://mail.python.org/mailman/listinfo/python-list
[issue23572] functools.singledispatch fails when not BaseClass is True
Adam Bartoš added the comment: I was also bitten by this via Enum. Is there any chance this will be fixed in Python 3.5? -- nosy: +Drekin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23572 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24842] Mention SimpleNamespace in namedtuple docs
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24842 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24842] Mention SimpleNamespace in namedtuple docs
Roundup Robot added the comment: New changeset 678d93c273de by Raymond Hettinger in branch 'default': Issue #24842: Cross-reference types.SimpleNamespace from the namedtuple docs https://hg.python.org/cpython/rev/678d93c273de -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24842 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24872] Add /NODEFAULTLIB:MSVCRT to _msvccompiler
Steve Dower added the comment: Actually, on rereading this (during daylight hours, previous response was before 6am my time) the patch wouldn't help. I need to write some porting notes for rebuilding static libraries with suitable settings. I'll base it on my initial post and find somewhere appropriate in the docs (and maybe blog about it too for SEO purposes). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13691] pydoc help (or help('help')) should show the doc for help
Jairo Trad added the comment: I just tested this issue in Python 3.6.0a0 and got this behavior: help('help') brings Help on _Helper in module _sitebuiltins object: help(help) brings: Help on _Helper in module _sitebuiltins object: help() invokes the help command line. So this was fixes on the way to python3.6, I can make the test for 3.4 but is 3.4 closed for bug fixing? Can someone check this in 3.5? -- nosy: +jairotrad ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13691 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24872] Add /NODEFAULTLIB:MSVCRT to _msvccompiler
Changes by Steve Dower steve.do...@python.org: -- components: +Documentation, Extension Modules priority: release blocker - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15809] 2.7 IDLE console uses incorrect encoding.
Changes by Benjamin Peng (烈之斩) human.p...@gmail.com: -- nosy: +Benjamin Peng (烈之斩) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15809 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13691] pydoc help (or help('help')) should show the doc for help
Terry J. Reedy added the comment: 3.5 is the same as 3.6 in that now both help(help) and help('help') show the not terribly helpful Help on _Helper in module site object: Buried in the text is | Calling help() at the Python prompt starts an interactive help session. | Calling help(thing) prints help for the python object 'thing'. As before, I think the _Helpter stuff should be eliminated and explanation added for help('topic') and a description of what 'topic's are specially recognized. There has been this improvement help('jslfjslfdjlskfj') # 3.4 no Python documentation found for 'jslfjslfdjlskfj' help('jsflksjflkjsl') # 3.5 No Python documentation found for 'jsflksjflkjsl'. Use help() to get the interactive help utility. Use help(str) for help on the str class. but the latter omits decription of what 'topic' will give special output. By experiment, keywords (help('if')), builtins, and unimported modules (help('itertools')) works. Yes, 3.4 can be patched. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13691 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
return types from library api wrappers
What's the accepted practice for return types from a c based API Python wrapper? I have many methods which return generators which yield potentially many fields per iteration. In lower level languages we would yield a struct with readonly fields. The existing implementation returns a dict which I am not fond of. I'd rather return an object with properties, however all the guys who use this api use IDE's and want the type hinting. So, options I can think of are to create a load of classes and returning instances of them, return named tuples or even terser would be to return something like: def api_method(foo, bar): produces two return values, x and y. ... return type('MyResult', (), {'__slots__': [], 'some_field': x, 'another_field': y})() The last option humorously returns readonly fields. However, the latter two don't help much for type hinting unless someone knows something I don't about doc strings? As a Python user, what is preferred? Thanks, jlc -- https://mail.python.org/mailman/listinfo/python-list
[issue24877] Bad Password for file using zipfile module
New submission from shiva prasanth: i created a zip file with password as getlost using Archive Manager which comes with ubuntu. and when i try to extract the same file using zipfile module which comes with python2.7 with same password it is showing error as Bad Password for file which is absurd. it should either give response of cant decrypt zipfile or some other. when i try to do it with terminal command $zip --encrypt file.zip file and upon entering the password it is working my main point is it should not show Bad Password for file and and it should extractall -- components: Extension Modules files: raj messages: 248698 nosy: shiva prasanth priority: normal severity: normal status: open title: Bad Password for file using zipfile module versions: Python 2.7 Added file: http://bugs.python.org/file40192/raj ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24877] Bad Password for file using zipfile module
shiva prasanth added the comment: Python 2.7.9 (default, Apr 2 2015, 15:33:21) [GCC 4.9.2] on linux2 Type help, copyright, credits or license for more information. import zipfile s=zipfile.ZipFile('random.zip') s.extractall(pwd='getlost') Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.7/zipfile.py, line 1040, in extractall self.extract(zipinfo, path, pwd) File /usr/lib/python2.7/zipfile.py, line 1028, in extract return self._extract_member(member, path, pwd) File /usr/lib/python2.7/zipfile.py, line 1082, in _extract_member with self.open(member, pwd=pwd) as source, \ File /usr/lib/python2.7/zipfile.py, line 1007, in open raise RuntimeError(Bad password for file, name) RuntimeError: ('Bad password for file', zipfile.ZipInfo object at 0x7faf1d1921e0) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23672] IDLE can crash if file name contains non-BMP Unicode characters
Terry J. Reedy added the comment: From msg248192 (Serhiy - which ... File /home/serhiy/py/cpython/Lib/idlelib/EditorWindow.py, line 899, in update_recent_files_list if '\0' in path or not os.path.exists(path[0:-1]): File /home/serhiy/py/cpython/Lib/genericpath.py, line 19, in exists os.stat(path) UnicodeEncodeError: 'latin-1' codec can't encode character '\U0001d53c' in position 22: ordinal not in range(256) On Windows, os.stat(astralpath) raises FileNotFoundError: [WinError 2] The system cannot find the file specified: 'as\U0001.py' and os.path.exists(astralpath) catches the exception and returns False. It is a linux issue, and perhaps a bug, that os.path.exists does not catch the exception. To me, as I read the docstring, it should always return True or False, with the latter the default, for any input string. The EditorWindow line is testing for 'badfiles' to be excluded from the recent files list. We can work around the linux behavior with try-except. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23672 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24746] doctest 'fancy diff' formats incorrectly strip trailing whitespace
Jairo Trad added the comment: I have patched this as explained by David. Also the tests are working. Another test broke because a missing trailing space. I fixed that too. This is my first patch :D -- nosy: +jairotrad Added file: http://bugs.python.org/file40191/issue24746.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24746 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24774] inconsistency in http.server.test
Roundup Robot added the comment: New changeset d9e0c82d8653 by Robert Collins in branch '3.4': Issue #24774: Fix docstring in http.server.test. https://hg.python.org/cpython/rev/d9e0c82d8653 New changeset 845c79097c21 by Robert Collins in branch '3.5': Issue #24774: Fix docstring in http.server.test. https://hg.python.org/cpython/rev/845c79097c21 New changeset a8de693ebe66 by Robert Collins in branch 'default': Issue #24774: Fix docstring in http.server.test. https://hg.python.org/cpython/rev/a8de693ebe66 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24774 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24774] inconsistency in http.server.test
Robert Collins added the comment: Thanks for the patch. Applied to 3.4 and up. -- nosy: +rbcollins resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24774 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: no module named kivy import error in ubuntu 14.04
On Mon, Aug 17, 2015 at 5:16 AM, shiva upreti katewinslet...@gmail.com wrote: I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute python setup.py inside the kivy folder. As Laura said, the preferred way to install under Ubuntu would be to use apt-get. But if you want to install directly from PyPI, the best way is to use pip. Those are two package managers, which remove from you the hassle of hunting down all the different dependencies, like Cython. Try apt-get first, and if that doesn't do what you're looking for, use pip (maybe inside a virtualenv). It'll chug for a while and then give you what you need. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue23672] IDLE can crash if file name contains non-BMP Unicode characters
Roundup Robot added the comment: New changeset d54aa163e4ec by Terry Jan Reedy in branch '2.7': Issue #23672: ACKS https://hg.python.org/cpython/rev/d54aa163e4ec New changeset c1031eb12aa1 by Terry Jan Reedy in branch '3.4': Issue #23672: ACKS https://hg.python.org/cpython/rev/c1031eb12aa1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23672 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24746] doctest 'fancy diff' formats incorrectly strip trailing whitespace
R. David Murray added the comment: Unfortunately I was reminded a few days ago that there is a commit hook that prevents patches containing trailing whitespace from being committed to the repository. So using doctest to test this isn't going to work. The alternatives are to write a unit test, or to figure out how to write the doctest such there is no trailing whitespace...which would mean capturing the output of doctest.DoctTestRunner instead of letting it go the console, and then comparing it to an explicitly embedded string. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24746 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23672] IDLE can crash if file name contains non-BMP Unicode characters
Terry J. Reedy added the comment: It appears that the failures in msg248192 and msg248365 are issues with non-latin1 chars in general, not with astral chars in particular. Anyone who wants filenames with astral chars should be using a utf-8 locale. This issue is about Idle working around the tk BMP limit where it can so as to not prevent editing and running files with system-legal names. According to msg248188, the patch works. So I am closing the issue as fixed. -- assignee: - terry.reedy resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23672 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24379] operator.subscript
Josh Rosenberg added the comment: So this has sign off on Python ideas, and it's not fundamentally changing the language (it's implemented in pure Python after all), it's passed a dozen code reviews. Can someone with commit privileges just finish this off please? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24379] operator.subscript
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Old DbaseV DOS Programmer wants to step over to new/actual modern program software
On Sun, Aug 16, 2015 at 1:11 PM, Rustom Mody rustompm...@gmail.com wrote: I have some ideas in mind like Java with (ECLIPS) because it is very popular, it is the most widely used and can get tutorials and videos all over the internet. I've read a lot of good things about Python, that it is much easier but too complicate to define what to choose, at the first place witch version 2.x or 3.x, a lot of IDE's to choose from, beside of that witch IDE with what pluggin. Hi, I am using python for years but still curious about best IDE to suggest newbies. IMHO - too many choices with no clear winner and each with its own flaws. For me two crucial features are: good autocompletion and ability to step over code in debugger. I'd try Eclipse+PyDev first and then additionally check PyCharm ($$$) for comparison (to see how best free compares to good commercial) Vladimir https://itunes.apple.com/us/app/python-code-samples/id1025613117 -- https://mail.python.org/mailman/listinfo/python-list
[issue24379] operator.subscript
Joe Jevnik added the comment: Sorry about the ideas thread. Thank you for merging this! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: no module named kivy import error in ubuntu 14.04
On Monday, August 17, 2015 at 7:30:14 AM UTC+5:30, Chris Angelico wrote: On Mon, Aug 17, 2015 at 5:16 AM, shiva upreti wrote: I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute python setup.py inside the kivy folder. As Laura said, the preferred way to install under Ubuntu would be to use apt-get. But if you want to install directly from PyPI, the best way is to use pip. Those are two package managers, which remove from you the hassle of hunting down all the different dependencies, like Cython. Try apt-get first, and if that doesn't do what you're looking for, use pip (maybe inside a virtualenv). It'll chug for a while and then give you what you need. Its not vanilla apt-get but ppa-apt-get (as Laura's link indicates) -- https://mail.python.org/mailman/listinfo/python-list
Re: no module named kivy import error in ubuntu 14.04
In a message of Sun, 16 Aug 2015 20:19:49 -0700, rurpy--- via Python-list write s: On Sunday, August 16, 2015 at 8:00:14 PM UTC-6, Chris Angelico wrote: On Mon, Aug 17, 2015 at 5:16 AM, shiva upreti katewinslet...@gmail.com wrote: I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute python setup.py inside the kivy folder. [...] use pip (maybe inside a virtualenv). It'll chug for a while and then give you what you need. Umm, actually no... | ~# pip3 install kivy | Downloading/unpacking kivy | Downloading Kivy-1.9.0.tar.gz (16.2MB): 16.2MB downloaded | Running setup.py (path:/tmp/pip-build-m40337r5/kivy/setup.py) egg_info for package kivy | Traceback (most recent call last): | File string, line 17, in module | File /tmp/pip-build-m40337r5/kivy/setup.py, line 173, in module | from Cython.Distutils import build_ext |ImportError: No module named 'Cython' | Cython is missing, its required for compiling kivy ! (on Fedora-21 where no kivy repo package is available) -- https://mail.python.org/mailman/listinfo/python-list If you scroll down http://kivy.org/docs/installation/installation-linux.html there are instructions for Fedora as well. Laura -- https://mail.python.org/mailman/listinfo/python-list
[issue24878] Add docstrings to selected named tuples
Raymond Hettinger added the comment: For example: import sched help(sched.Event) class Event(Event) | Event(time, priority, action, argument, kwargs) | ... | -- | Data descriptors inherited from Event: | | action | Executing the event means executing | action(*argument, **kwargs) | | argument | argument is a sequence holding the positional | arguments for the action. | | kwargs | kwargs is a dictionary holding the keyword | arguments for the action. | | priority | Events scheduled for the same time will be executed | in the order of their priority. | | time | Numeric type compatible with the return value of the | timefunc function passed to the constructor. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24878 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24734] Dereferencing a null returning value
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24734 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24379] operator.subscript
R. David Murray added the comment: For future reference can you post a link to the python-ideas thread in which the signoff occurred? -- nosy: +r.david.murray stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24782] Merge 'configure extensions' into main IDLE config dialog
Terry J. Reedy added the comment: Do you consider the second patch ready as is (as a step toward doing the merge)? Is so, I will do a commit review. -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24782 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24379] operator.subscript
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24878] Add docstrings to selected named tuples
New submission from Raymond Hettinger: Add docstrings to some named tuples that could benefit from it (there was more documentation or useful information other than just the field name). This makes the help() on those named tuples much more informative. -- assignee: docs@python components: Documentation files: ntdoc.diff keywords: patch messages: 248712 nosy: docs@python, rhettinger priority: low severity: normal stage: patch review status: open title: Add docstrings to selected named tuples versions: Python 3.6 Added file: http://bugs.python.org/file40193/ntdoc.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24878 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: no module named kivy import error in ubuntu 14.04
shiva upreti katewinslet...@gmail.com wrote: Hi I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 Just to make clear what others have said -- replacing Ubuntu 14.04's system Python 2.7.6 is a bad idea and will break stuff, so if you really must have the latest version of Python2, then you install it separately, leaving the system Python in place. That in turn means that you can no longer use Ubuntu's normal method of installing libraries via its own software management. Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz I suggest that you DON'T install from tarfiles unless your understanding of Python is of near python-developer level. You really need to know what you're doing regarding dependencies and the search path for modules. If you do want to install a separate instance of the latest version of Python, then the PIP package management is best, and use it to install the libraries separately, NOT in the /usr/ directory -- see the other posts. -- https://mail.python.org/mailman/listinfo/python-list
[issue24735] Invalid access in combinations_with_replacement()
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24735 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24879] Pydoc to list data descriptors in _fields order if it exists
New submission from Raymond Hettinger: Currently, help() lists out data descriptors in alphabetical order. This is fine in the general case, however if the fields are parts of a named tuple, it is more sensible to list them in the order found in the tuple. The presence of a named tuple can be detected by the presence of a _fields attribute that is a list of strings. That strings can be used as a primary sort key before an alphabetical sort of anything not listed in _fields. Person = namedtuple('Person', ['nickname', 'firstname', 'age']) help(Person) Help on class Person in module __main__: class Person(builtins.tuple) | Person(nickname, firstname, age) | ... | | -- | Static methods defined here: | | __new__(_cls, nickname, firstname, age) | Create new instance of Person(nickname, firstname, age) | | -- | Data descriptors defined here: | | __dict__ | A new OrderedDict mapping field names to their values | | age | Alias for field number 2 | | firstname | Alias for field number 1 | | nickname | Alias for field number 0 | | -- | Data and other attributes defined here: | | _fields = ('nickname', 'firstname', 'age') | ... The data descriptors should list nickname, then firstname, then age to match the tuple order in _fields. -- components: Library (Lib) messages: 248714 nosy: rhettinger priority: normal severity: normal status: open title: Pydoc to list data descriptors in _fields order if it exists type: enhancement versions: Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24879 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: no module named kivy import error in ubuntu 14.04
On 2015-08-16 20:16, shiva upreti wrote: Hi I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute python setup.py inside the kivy folder. But it showed the error no module named cython. Then I tried installing cython, it installed successfully but the command python setup.py still gave the error no module named cython. Finally I installed kivy using instructions on this video: https://www.youtube.com/watch?v=mypVFCIIZtw. Now when i try to run the following commands: $ cd path to kivy-examples (I used the actual path, i.e., /usr/share/kivy-examples) $ cd demo/touchtracer $ python main.py I am still getting the error:ImportError: No module named kivy. Any help will be highly appreciated. Thanks. Do you know which Python they were installed into? Was it the system Python (you should probably leave that one alone) or the one that you installed? And which one is it trying to run? -- https://mail.python.org/mailman/listinfo/python-list
Re: Keypress Input
Thanks again to everyone who tried to help. Michael, I especially appreciate your encouragement and chiming in to point out that telling newbies to learn everything there is before posting question was not helpful in getting more people using Python. Have the Pi wired up directly to the buttons, read up on the GPIO library and I just posted for help regarding the error messages I am getting from my Python buttons script. Thanks. -- https://mail.python.org/mailman/listinfo/python-list
Re: -2146826246 in win32com.client for empty #N/A cell in Excel
For what it's worth, I use xlrd for this. http://www.python-excel.org/ Laura -- https://mail.python.org/mailman/listinfo/python-list
[issue24872] Add /NODEFAULTLIB:MSVCRT to _msvccompiler
Christoph Gohlke added the comment: Matplotlib and my own extensions are using C++ sources but do not depend on msvcp140.dll, just the ucrt. Am I missing something? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24874] Improve pickling efficiency of itertools.cycle
Raymond Hettinger added the comment: Applied the cycle2 patch but kept the signature the same as the original reduce (using a number instead of a boolean). -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: -2146826246 in win32com.client for empty #N/A cell in Excel
On Mon, Aug 17, 2015 at 3:27 AM, Albert-Jan Roskam sjeik_ap...@hotmail.com wrote: Does that number happen to be -1 * sys.maxint? No, it's -1 * 0x7ff5f806. As a signed 32-bit integer, it's 0x800a07fa. Does either of those numbers mean anything? Sven, you might do better to ask on a dedicated Python + Win32 mailing list; I haven't used Python on Windows much for a while. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue24872] Add /NODEFAULTLIB:MSVCRT to _msvccompiler
Christoph Gohlke added the comment: Thanks for going through that tedious process ~140 libraries to go. I hit the wall last night trying to build Boost DLLs. Boost's build tool b2 does not allow `link=shared runtime-link=static`, hence the `/MT /LTCG /NODEFAULTLIB:libucrt.lib ucrt.lib` magic does not work. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
RPI.GPIO Help
Hello, all. I am hoping some people here are familiar with the RPi.GPIO python module for the Raspberry Pi. Very new to Python and electronics. Not to computing in general though. I posted for help about accepting key presses and then discovered that wiring up buttons directly to the Pi was 1/50th as difficult as I thought it would be so I am going a different route than keyboard emulation and needing GUI toolkits, etc. However, I am getting error messages with RPi.GPIO. I have three buttons, Red, Yellow and Blue in colour, attached to the Pi. The eventual goal is to have pressing one button result in changing the colour of an LED lightstrip to that colour and the Pi record how long the strip spent as each colour. For development purposes I have the controls near me and my desktop computer, and the Pi networked to this computer. For now I have each button press result in a print statement. When I get this working I will replace the print statements with the code to change colours on the LED strip using the Blinkstick module. This is the basic test code. import atexit import time from blinkstick import blinkstick import RPi.GPIO as GPIO led = blinkstick.find_first() colour = 0 timered = 0 timeyellow = 0 timeblue = 0 timestamp = time.strftime(%H:%M:%S) GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) def red_button(channel): colour = 1 print Red Button Pressed while colour == 1: timered += 1 def yellow_button(channel): colour = 2 print Yellow Button Pressed while colour == 2: timeyellow += 1 def blue_button(channel): colour = 3 print Blue Button Pressed while colour == 3: timeblue += 1 while True: GPIO.add_event_detect(22, GPIO.RISING, callback=red_button, bouncetime=200) GPIO.add_event_detect(23, GPIO.RISING, callback=yellow_button, bouncetime=200) GPIO.add_event_detect(24, GPIO.RISING, callback=blue_button, bouncetime=200) def exit_handler(): print '\033[0;41;37mRed Team:\033[0m ', timered print '\033[0;43;30mYellow Time:\033[0m ', timeyellow print '\033[0;44;37mBlue Time:\033[0m ', timeblue flog = open('flag1log.text', 'a') flog.write(timestamp + '\n' + 'Red Team: ' + str(timered) + '\n' + 'Yellow Team: ' + str(timeyellow) + '\n' + 'Blue Team: ' + str(timeblue) + '\n') flog.close() atexit.register(exit_handler) GPIO.cleanup() This results in the error message RuntimeError: Conflicting edge detection already enabled for this GPIO channel. Running GPIO.cleanup() in the interpreter results in a message stating the GPIO pins are not assigned and there is nothing to cleanup. Removing line 40, the while True: line, removes the error, but the program does not sit and wait waiting for a button press, it just runs and ends a second later. There are other things this script will need, but this is the core function that I need to get working -pressing a button does what I want and the script keeps running so I can press another button if I want. If are familiar with the RPi.GPIO or see a more general Python mistake that could be affecting everything know I would appreciate your help. Thanks. -- https://mail.python.org/mailman/listinfo/python-list
Re: -2146826246 in win32com.client for empty #N/A cell in Excel
On Sun, Aug 16, 2015, at 14:41, Chris Angelico wrote: On Mon, Aug 17, 2015 at 3:27 AM, Albert-Jan Roskam sjeik_ap...@hotmail.com wrote: Does that number happen to be -1 * sys.maxint? No, it's -1 * 0x7ff5f806. As a signed 32-bit integer, it's 0x800a07fa. Does either of those numbers mean anything? That's a COM error code, for Excel error 2042, which (unsurprisingly) means N/A. http://stackoverflow.com/questions/7526640/any-ideas-why-excel-interop-reads-many-decimals-as-2146826246 Here's some information from someone having the same problem in .NET, which may or may not be helpful https://xldennis.wordpress.com/2006/11/22/dealing-with-cverr-values-in-net-%E2%80%93-part-i-the-problem/ It looks like the values are actually returned as a VT_ERROR variant, which .NET (and apparently python) reads as an integer. -- https://mail.python.org/mailman/listinfo/python-list
Re: -2146826246 in win32com.client for empty #N/A cell in Excel
On Sun, 16 Aug 2015 09:53:32 -0700, Sven Boden wrote: Anyone knows how to handle a #N/A cell in Excel in the proper way? 0x800A07FA is how xlErrNA (error 2042) is marshalled. This isn't specific to Python; you'll get the same value using e.g C# or VB.NET. There's a fairly thorough article on this topic at: https://xldennis.wordpress.com/2006/11/22/ https://xldennis.wordpress.com/2006/11/29/ -- https://mail.python.org/mailman/listinfo/python-list
no module named kivy import error in ubuntu 14.04
Hi I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute python setup.py inside the kivy folder. But it showed the error no module named cython. Then I tried installing cython, it installed successfully but the command python setup.py still gave the error no module named cython. Finally I installed kivy using instructions on this video: https://www.youtube.com/watch?v=mypVFCIIZtw. Now when i try to run the following commands: $ cd path to kivy-examples (I used the actual path, i.e., /usr/share/kivy-examples) $ cd demo/touchtracer $ python main.py I am still getting the error:ImportError: No module named kivy. Any help will be highly appreciated. Thanks. -- https://mail.python.org/mailman/listinfo/python-list
Re: no module named kivy import error in ubuntu 14.04
In a message of Sun, 16 Aug 2015 12:16:53 -0700, shiva upreti writes: I am still getting the error:ImportError: No module named kivy. Any help will be highly appreciated. Thanks. The preferred way to install kivy with ubuntu is to follow the instructions here: http://kivy.org/docs/installation/installation-linux.html i.e. $ sudo apt-get install python3-kivy $ sudo apt-get install kivy-examples This assumes you want to use Python 3. See if this works, write back if it doesn't. Laura -- https://mail.python.org/mailman/listinfo/python-list
[issue24872] Add /NODEFAULTLIB:MSVCRT to _msvccompiler
Steve Dower added the comment: Boost requires C++ anyway doesn't it? So the full redist will be required. These options are only useful for pure C sources. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
distutils error ?
I tried building the spammodule.c example described in the documentation section Extending Python with C or C++. As shown the code compiles OK but generates a link error: LINK : error LNK2001: unresolved external symbol init_spam build\temp.win32-2.7\Release\_spam.lib : fatal error LNK1120: 1 unresolved externals I tried changing the name of the initialization function spam_system to init_spam and removed the static declaration. This compiled and linked without errors but generated a system error when _spam was imported. The same error occurs with Python 2.6 and the current compiler. The code and the setup.py file are shown below. setup.py: - from setuptools import setup, Extension setup(name='spam', version='0.1', description='test module', ext_modules=[Extension('_spam', ['spammodule.c'], include_dirs=[C:\Documents and Settings\Owner\Miniconda\include], )], ) sammodule.c -- #include python.h static PyObject *SpamError; static PyObject * spam_system(PyObject *self, PyObject *args) { const char *command; int sts; if (!PyArg_ParseTuple(args, s, command)) return NULL; sts = system(command); if (sts 0) { PyErr_SetString(SpamError, System command failed); return NULL; } return PyLong_FromLong(sts); } static PyMethodDef SpamMethods[] = { {system, spam_system, METH_VARARGS, Execute a shell command.}, {NULL, NULL, 0, NULL}/* Sentinel */ }; PyMODINIT_FUNC initspam(void) { PyObject *m; m = Py_InitModule(spam, SpamMethods); if (m == NULL) return; SpamError = PyErr_NewException(spam.error, NULL, NULL); Py_INCREF(SpamError); PyModule_AddObject(m, error, SpamError); } -- https://mail.python.org/mailman/listinfo/python-list
Re: RPI.GPIO Help
On 2015-08-16 20:40, John McKenzie wrote: Hello, all. I am hoping some people here are familiar with the RPi.GPIO python module for the Raspberry Pi. Very new to Python and electronics. Not to computing in general though. I posted for help about accepting key presses and then discovered that wiring up buttons directly to the Pi was 1/50th as difficult as I thought it would be so I am going a different route than keyboard emulation and needing GUI toolkits, etc. However, I am getting error messages with RPi.GPIO. I have three buttons, Red, Yellow and Blue in colour, attached to the Pi. The eventual goal is to have pressing one button result in changing the colour of an LED lightstrip to that colour and the Pi record how long the strip spent as each colour. For development purposes I have the controls near me and my desktop computer, and the Pi networked to this computer. For now I have each button press result in a print statement. When I get this working I will replace the print statements with the code to change colours on the LED strip using the Blinkstick module. This is the basic test code. import atexit import time from blinkstick import blinkstick import RPi.GPIO as GPIO led = blinkstick.find_first() colour = 0 timered = 0 timeyellow = 0 timeblue = 0 timestamp = time.strftime(%H:%M:%S) GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) def red_button(channel): colour = 1 print Red Button Pressed while colour == 1: timered += 1 def yellow_button(channel): colour = 2 print Yellow Button Pressed while colour == 2: timeyellow += 1 def blue_button(channel): colour = 3 print Blue Button Pressed while colour == 3: timeblue += 1 while True: GPIO.add_event_detect(22, GPIO.RISING, callback=red_button, bouncetime=200) GPIO.add_event_detect(23, GPIO.RISING, callback=yellow_button, bouncetime=200) GPIO.add_event_detect(24, GPIO.RISING, callback=blue_button, bouncetime=200) def exit_handler(): print '\033[0;41;37mRed Team:\033[0m ', timered print '\033[0;43;30mYellow Time:\033[0m ', timeyellow print '\033[0;44;37mBlue Time:\033[0m ', timeblue flog = open('flag1log.text', 'a') flog.write(timestamp + '\n' + 'Red Team: ' + str(timered) + '\n' + 'Yellow Team: ' + str(timeyellow) + '\n' + 'Blue Team: ' + str(timeblue) + '\n') flog.close() atexit.register(exit_handler) GPIO.cleanup() This results in the error message RuntimeError: Conflicting edge detection already enabled for this GPIO channel. Running GPIO.cleanup() in the interpreter results in a message stating the GPIO pins are not assigned and there is nothing to cleanup. Removing line 40, the while True: line, removes the error, but the program does not sit and wait waiting for a button press, it just runs and ends a second later. There are other things this script will need, but this is the core function that I need to get working -pressing a button does what I want and the script keeps running so I can press another button if I want. If are familiar with the RPi.GPIO or see a more general Python mistake that could be affecting everything know I would appreciate your help. Thanks. I'm looking at this: http://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/ As far as I can tell, the 'add_event_detect' method adds a callback. However, you have it in a loop, so you're trying to add more than one callback (actually, the same one more than once!), which it doesn't like. You should add the callbacks only once and then have some kind of sleep or do-nothing loop, perhaps waiting for the signal to quit (I don't have a Raspberry Pi, so I don't know what the usual practice is). -- https://mail.python.org/mailman/listinfo/python-list
[issue24872] Add /NODEFAULTLIB:MSVCRT to _msvccompiler
Steve Dower added the comment: Probably I'm missing something. Maybe there's a subset of C++ that doesn't rely on it - a decent amount of the standard template library is generated at compile time. If the dependency isn't there, it'll be fine. Do you think it'll be worth having a check box in the installer to get the full runtime? Bearing in mind that most won't need it and many won't be able to install it? I'm not sure it is, but you've got a better idea of which packages are popular and which ones need it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24874] Improve pickling efficiency of itertools.cycle
Roundup Robot added the comment: New changeset 17b5c8ba6875 by Raymond Hettinger in branch 'default': Issue #24874: Speed-up itertools and make it pickles more compact. https://hg.python.org/cpython/rev/17b5c8ba6875 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: return types from library api wrappers
On 8/16/2015 7:31 PM, Joseph L. Casale wrote: What's the accepted practice for return types from a c based API Python wrapper? I have many methods which return generators which yield potentially many fields per iteration. In lower level languages we would yield a struct with readonly fields. Current practice is a NamedTuple for python code or the C equivalent. I forget the C name, but I believe it is used by os.stat os.stat('C:/programs') os.stat_result(st_mode=16895, st_ino=1970324837036820, st_dev=1816146727, st_nlink=1, st_uid=0, st_gid=0, st_size=4096, st_atime=1437490766, st_mtime=1437490766, st_ctime=1313612988) s = os.stat('C:/programs') s.st_atime 1437490766.6669185 s.st_atime = 3 Traceback (most recent call last): File pyshell#11, line 1, in module s.st_atime = 3 AttributeError: readonly attribute The existing implementation returns a dict which I am not fond of. I'd rather return an object with properties, however all the guys who use this api use IDE's and want the type hinting. I believe the above gives you both: custom class for type hinting and properties. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
[issue24379] operator.subscript
Raymond Hettinger added the comment: The old python ideas discussion stops way short of a sign-off but I'll go ahead an apply the patch. If someone really hates it, they have a year and half to persuade someone to rip it out ;-) https://mail.python.org/pipermail/python-ideas/2015-June/034086.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24379] operator.subscript
Roundup Robot added the comment: New changeset dccc4e63aef5 by Raymond Hettinger in branch 'default': Issue #24379: Add operator.subscript() as a convenience for building slices. https://hg.python.org/cpython/rev/dccc4e63aef5 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24776] Improve Fonts/Tabs UX for IDLE
Terry J. Reedy added the comment: The side-by-side part I obviously like, but I think we need to keep 'Base Editor Font' since this and only this is affected by the selection. I think there should be an option to increase the 'other' font used for everything else. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24776 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: no module named kivy import error in ubuntu 14.04
On Mon, Aug 17, 2015 at 12:51 PM, Rustom Mody rustompm...@gmail.com wrote: On Monday, August 17, 2015 at 7:30:14 AM UTC+5:30, Chris Angelico wrote: On Mon, Aug 17, 2015 at 5:16 AM, shiva upreti wrote: I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute python setup.py inside the kivy folder. As Laura said, the preferred way to install under Ubuntu would be to use apt-get. But if you want to install directly from PyPI, the best way is to use pip. Those are two package managers, which remove from you the hassle of hunting down all the different dependencies, like Cython. Try apt-get first, and if that doesn't do what you're looking for, use pip (maybe inside a virtualenv). It'll chug for a while and then give you what you need. Its not vanilla apt-get but ppa-apt-get (as Laura's link indicates) I didn't actually click the link. But it's still apt-get, just with an additional repository. In any case, it's way better to use a package manager (either system-provided or Python-provided) than to do everything manually. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue24781] Improve UX of IDLE Highlighting configuration tab
Terry J. Reedy added the comment: As I think I said elsewhere, I want myself and others to be able to select among the style themes provided with ttk, as well as any other themes (a dark theme?) that we or users devise. A custom theme would be a good project for a UI design class. I do not understand the background color question. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24781 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: no module named kivy import error in ubuntu 14.04
On Sunday, August 16, 2015 at 8:00:14 PM UTC-6, Chris Angelico wrote: On Mon, Aug 17, 2015 at 5:16 AM, shiva upreti katewinslet...@gmail.com wrote: I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute python setup.py inside the kivy folder. [...] use pip (maybe inside a virtualenv). It'll chug for a while and then give you what you need. Umm, actually no... | ~# pip3 install kivy | Downloading/unpacking kivy | Downloading Kivy-1.9.0.tar.gz (16.2MB): 16.2MB downloaded | Running setup.py (path:/tmp/pip-build-m40337r5/kivy/setup.py) egg_info for package kivy | Traceback (most recent call last): | File string, line 17, in module | File /tmp/pip-build-m40337r5/kivy/setup.py, line 173, in module | from Cython.Distutils import build_ext |ImportError: No module named 'Cython' | Cython is missing, its required for compiling kivy ! (on Fedora-21 where no kivy repo package is available) -- https://mail.python.org/mailman/listinfo/python-list
[issue24683] Type confusion in json encoding
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24683 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24613] array.fromstring Use After Free
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24613 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: no module named kivy import error in ubuntu 14.04
On Sunday, August 16, 2015 at 10:14:29 PM UTC-6, Laura Creighton wrote: In a message of Sun, 16 Aug 2015 20:19:49 -0700, rurpy--- via Python-list writes: On Sunday, August 16, 2015 at 8:00:14 PM UTC-6, Chris Angelico wrote: [...] use pip (maybe inside a virtualenv). It'll chug for a while and then give you what you need. Umm, actually no... | ~# pip3 install kivy | Downloading/unpacking kivy | Downloading Kivy-1.9.0.tar.gz (16.2MB): 16.2MB downloaded | Running setup.py (path:/tmp/pip-build-m40337r5/kivy/setup.py) egg_info for package kivy | Traceback (most recent call last): | File string, line 17, in module | File /tmp/pip-build-m40337r5/kivy/setup.py, line 173, in module | from Cython.Distutils import build_ext |ImportError: No module named 'Cython' | Cython is missing, its required for compiling kivy ! (on Fedora-21 where no kivy repo package is available) -- https://mail.python.org/mailman/listinfo/python-list If you scroll down http://kivy.org/docs/installation/installation-linux.html there are instructions for Fedora as well. Thanks. But I note that those are all for very old, EoL'd versions of Fedora. I manually installed cython with pip, but then the kivy install failed with some C errors. At the top of it's multi-thousand line log output was a warning that it requires cython-0.21.2. Pip had installed cython-0.23. I installed cython-0.21.2 (since I do not use cython for anything else and noting that pip did not bother to inform me it was overwriting an existing install) and then pip installed kivy without error. However there were a number of warning message about missing somethings (libs or python packages, was not clear to me). So I eventually found the kivy docs on their website where they list prerequisite packages for installing kivy on ubuntu. I'll translate those to hopefully the equivalent fedora package names, install them, reinstall kivy, and get a working kivy install. The point here that all the above is a LONG way from what was was posted here: just type 'pip install kivy' and pip will take care of everything. I hope someday Python gets a decent packaging/distribution story. -- https://mail.python.org/mailman/listinfo/python-list