PEPs will move to peps.python.org

2022-03-09 Thread Adam Turner
With the acceptance of PEP 676, the canonical home of the Python Enhancement Proposal series will shortly move to peps.python.org. All existing links will redirect when the change is made, this announcement is to promote awareness of the new domain as canonical. Thanks, Adam Turner PEP Editor

Pip standard error warning about dependency resolver

2021-02-23 Thread adam....@gmail.com
I started seeing this sometimes from pip: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts. Yeah, sure, that's something to consider. We seem fine with the new resolver. Is there a w

Python 3 Feature Request: `pathlib` Use Trailing Slash Flag

2020-08-09 Thread Adam Hendry
`pathlib` trims trailing slashes by default, but certain packages require trailing slashes. In particular, `cx_Freeze.bdist_msi` option "directories" is used to build the package directory structure of a program and requires trailing slashes. Does anyone think it would be a good idea to add a f

Re: Bulletproof json.dump?

2020-07-09 Thread Adam Funk
On 2020-07-07, Stephen Rosen wrote: > On Mon, Jul 6, 2020 at 6:37 AM Adam Funk wrote: > >> Is there a "bulletproof" version of json.dump somewhere that will >> convert bytes to str, any other iterables to list, etc., so you can >> just get your data into a file

Re: Bulletproof json.dump?

2020-07-07 Thread Adam Funk
On 2020-07-06, Adam Funk wrote: > On 2020-07-06, Chris Angelico wrote: >> On Mon, Jul 6, 2020 at 10:11 PM Jon Ribbens via Python-list >> wrote: >>> While I agree entirely with your point, there is however perhaps room >>> for a bit more helpfulness from the

Re: Bulletproof json.dump?

2020-07-06 Thread Adam Funk
On 2020-07-06, Chris Angelico wrote: > On Mon, Jul 6, 2020 at 10:11 PM Jon Ribbens via Python-list > wrote: >> >> On 2020-07-06, Chris Angelico wrote: >> > On Mon, Jul 6, 2020 at 8:36 PM Adam Funk wrote: >> >> Is there a "bulletproof" version of

Re: Bulletproof json.dump?

2020-07-06 Thread Adam Funk
On 2020-07-06, Frank Millman wrote: > On 2020-07-06 2:06 PM, Jon Ribbens via Python-list wrote: >> On 2020-07-06, Chris Angelico wrote: >>> On Mon, Jul 6, 2020 at 8:36 PM Adam Funk wrote: >>>> Is there a "bulletproof" version of json.dump somewhere that w

Re: Bulletproof json.dump?

2020-07-06 Thread Adam Funk
On 2020-07-06, Chris Angelico wrote: > On Mon, Jul 6, 2020 at 8:36 PM Adam Funk wrote: >> >> Hi, >> >> I have a program that does a lot of work with URLs and requests, >> collecting data over about an hour, & then writing the collated data >> to

Bulletproof json.dump?

2020-07-06 Thread Adam Funk
Hi, I have a program that does a lot of work with URLs and requests, collecting data over about an hour, & then writing the collated data to a JSON file. The first time I ran it, the json.dump failed because there was a bytes value instead of a str, so I had to figure out where that was coming fr

Is CONTINUE_LOOP still a thing?

2020-06-09 Thread Adam Preble
I got to the point of trying to implement continue in my own interpreter project and was surprised when my for-loop just used some jumps to manage its control flow. Actually, I hoped for something else; I don't have logic in my code generation to track jump positions. I kind of hoped there was s

Re: Is there some reason that recent Windows 3.6 releases don't included executable nor msi installers?

2020-05-29 Thread Adam Preble
On Friday, May 29, 2020 at 7:30:32 AM UTC-5, Eryk Sun wrote: > On 5/28/20, Adam Preble wrote: > Sometimes a user will open a script via "open with" and browse to > python.exe or py.exe. This associates .py files with a new progid that > doesn't pass the %* comma

Re: Is there some reason that recent Windows 3.6 releases don't included executable nor msi installers?

2020-05-28 Thread Adam Preble
> mostly obscure fixes added between 3.6.8 and 3.6.10*. If a rare user > such as Adam also chooses to not compile the latter, that is his choice. I was going to just stay mute about why I was even looking at 3.6.10, but I felt I should weigh in after some of the other responses. I think some

Is there some reason that recent Windows 3.6 releases don't included executable nor msi installers?

2020-05-22 Thread Adam Preble
I wanted to update from 3.6.8 on Windows without necessarily moving on to 3.7+ (yet), so I thought I'd try 3.6.9 or 3.6.10. All I see for both are source archives: https://www.python.org/downloads/release/python-369/ https://www.python.org/downloads/release/python-3610/ So, uh, I theoretically

Import machinery for extracting non-modules from modules (not using import-from)

2020-05-03 Thread Adam Preble
The (rightful) obsession with modules in PEP-451 and the import machinery hit me with a gotcha when I was trying to implement importing .NET stuff that mimicked IronPython and Python.NET in my interpreter project. The meat of the question: Is it important that the spec loader actually return a m

How does the import machinery handle relative imports?

2020-04-22 Thread Adam Preble
I'm fussing over some details of relative imports while trying to mimic Python module loading in my personal project. This is getting more into corner cases, but I can spare time to talk about it while working on more normal stuff. I first found this place: https://manikos.github.io/how-pythons-

Re: Why generate POP_TOP after an "import from?"

2020-04-18 Thread Adam Preble
On Saturday, April 18, 2020 at 1:15:35 PM UTC-5, Alexandre Brault wrote: > >>> def f(): > ... â â from sys import path, argv ... So I figured it out and all but I wanted to ask about the special characters in that output. I've seen that a few times and never figured out what's going on and if

Re: Why generate POP_TOP after an "import from?"

2020-04-18 Thread Adam Preble
On Friday, April 17, 2020 at 1:37:18 PM UTC-5, Chris Angelico wrote: > The level is used for package-relative imports, and will basically be > the number of leading dots (eg "from ...spam import x" will have a > level of 3). You're absolutely right with your analysis, with one > small clarification

Re: Why generate POP_TOP after an "import from?"

2020-04-17 Thread Adam Preble
On Friday, April 17, 2020 at 1:22:18 PM UTC-5, Adam Preble wrote: > At this point, my conceptual stack is empty. If I POP_TOP then I have nothing > to pop and the world would end. Yet, it doesn't. What am I missing? Check out this guy replying to himself 10 minutes later. I guess

Why generate POP_TOP after an "import from?"

2020-04-17 Thread Adam Preble
Given this in Python 3.6.8: from dis import dis def import_from_test(): from sys import path >>> dis(import_from_test) 2 0 LOAD_CONST 1 (0) 2 LOAD_CONST 2 (('path',)) 4 IMPORT_NAME 0 (sys) 6 IMPORT_

Re: How does the super type present itself and do lookups?

2020-03-22 Thread Adam Preble
On Thursday, March 19, 2020 at 5:02:46 PM UTC-5, Greg Ewing wrote: > On 11/03/20 7:02 am, Adam Preble wrote: > > Is this foo attribute being looked up in an override of __getattr__, > > __getattribute__, or is it a reserved slot that's internally doing this? > > That&#

Re: How does the super type present itself and do lookups?

2020-03-10 Thread Adam Preble
On Tuesday, March 10, 2020 at 9:28:11 AM UTC-5, Peter Otten wrote: > self.foo looks up the attribute in the instance, falls back to the class and > then works its way up to the parent class, whereas > > super().foo bypasses both instance and class, and starts its lookup in the > parent class. I

Re: How does the super type present itself and do lookups?

2020-03-09 Thread Adam Preble
On Monday, March 9, 2020 at 9:31:45 PM UTC-5, Souvik Dutta wrote: > This should be what you are looking for. > https://python-reference.readthedocs.io/en/latest/docs/functions/super.html I'm not trying to figure out how the super() function works, but rather the anatomy of the object is returns.

Re: How does the super type present itself and do lookups?

2020-03-09 Thread Adam Preble
On Wednesday, March 4, 2020 at 11:13:20 AM UTC-6, Adam Preble wrote: > Stuff I'm speculating that the stuff I don't see when poking are reserved slots. I figured out how much of a thing that is when I was digging around for how classes know how to construct themselves. I managed

How does the super type present itself and do lookups?

2020-03-04 Thread Adam Preble
Months ago, I asked a bunch of stuff about super() and managed to fake it well enough to move on to other things for awhile. The day of reckoning came this week and I was forced to implement it better for my personal Python project. I have a hack in place that makes it work well-enough but I fou

Re: Data model and attribute resolution in subclasses

2020-03-02 Thread Adam Preble
On Monday, March 2, 2020 at 3:12:33 PM UTC-6, Marco Sulla wrote: > Is your project published somewhere? What changes have you done to the > interpreter? I'm writing my own mess: https://github.com/rockobonaparte/cloaca It's a .NET Pythonish interpreter with the distinction of using a whole lot of

Re: Data model and attribute resolution in subclasses

2020-03-02 Thread Adam Preble
On Monday, March 2, 2020 at 7:09:24 AM UTC-6, Lele Gaifax wrote: > Yes, you just used it, although you may have confused its meaning: > Yeah I absolutely got it backwards. That's a fun one I have to fix in my project now! -- https://mail.python.org/mailman/listinfo/python-list

Re: Data model and attribute resolution in subclasses

2020-03-01 Thread Adam Preble
On Sunday, March 1, 2020 at 3:08:29 PM UTC-6, Terry Reedy wrote: > Because BaseClass is the superclass of SubClass. So there's a mechanism for parent classes to know all their children? -- https://mail.python.org/mailman/listinfo/python-list

Re: Data model and attribute resolution in subclasses

2020-03-01 Thread Adam Preble
Based on what I was seeing here, I did some experiments to try to understand better what is going on: class BaseClass: def __init__(self): self.a = 1 def base_method(self): return self.a def another_base_method(self): return self.a + 1 class SubClass(BaseCl

Data model and attribute resolution in subclasses

2020-02-27 Thread Adam Preble
I have been making some progress on my custom interpreter project but I found I have totally blown implementing proper subclassing in the data model. What I have right now is PyClass defining what a PyObject is. When I make a PyObject from a PyClass, the PyObject sets up a __dict__ that is used

Understanding bytecode arguments: 1 byte versus 2 bytes

2020-01-06 Thread adam . preble
I'm trying to understand the difference in disassemblies with 3.6+ versus older versions of CPython. It looks like the basic opcodes like LOAD_FAST are 3 bytes in pre-3.6 versions, but 2 bytes in 3.6+. I read online somewhere that there was a change to the argument sizes in 3.6: it became 2 byte

Help with tkinter

2019-08-09 Thread Ahmad Adam Kabbara
I am having trouble with tkinter can you please help help with tkinter Inbox A adam kabbara to python-list@python.org 8 days ago Details Hello I am having trouble with tkinter when I enter the command from tkinter import* I get an error message Sent from Mail <https://go.microsoft.

Re:help with tkinter

2019-08-09 Thread Ahmad Adam Kabbara
I one more thing I am using python 3 Sent from my Huawei Mobile Original Message Subject: Re: help with tkinter From: Ahmad Adam Kabbara To: Wildman CC: python-list@python.org so when I write**from tkinter import* t=Tk

Re: help with tkinter

2019-08-09 Thread Ahmad Adam Kabbara
rked is when I typed from tkinter import colorchooser colorchooser.askcolor() On Thu, Aug 1, 2019 at 7:30 PM Rhodri James wrote: > Hi there, Adam! > > On 01/08/2019 14:31, adam kabbara wrote: > > Hello I am having trouble with tkinter when I enter the command from > tkinter import* I get

help with tkinter

2019-08-01 Thread adam kabbara
Hello I am having trouble with tkinter when I enter the command from tkinter import* I get an error message Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

Re: pyodbc -> MS-SQL Server Named Instance ?

2019-07-02 Thread Adam Tauno Williams
On Tue, 2019-07-02 at 11:00 -0400, Adam Tauno Williams wrote: > On Tue, 2019-07-02 at 09:41 -0400, Adam Tauno Williams wrote: > > On Tue, 2019-07-02 at 07:36 +0200, Frank Millman wrote: > > > On 2019-07-01 10:13 PM, Adam Tauno Williams wrote: > > > > I am trying to

Re: pyodbc -> MS-SQL Server Named Instance ?

2019-07-02 Thread Adam Tauno Williams
On Tue, 2019-07-02 at 09:41 -0400, Adam Tauno Williams wrote: > On Tue, 2019-07-02 at 07:36 +0200, Frank Millman wrote: > > On 2019-07-01 10:13 PM, Adam Tauno Williams wrote: > > > I am trying to connect to a Named Instance on an MS-SQL server > > > using pyODBC. I

Re: pyodbc -> MS-SQL Server Named Instance ?

2019-07-02 Thread Adam Tauno Williams
On Tue, 2019-07-02 at 07:36 +0200, Frank Millman wrote: > On 2019-07-01 10:13 PM, Adam Tauno Williams wrote: > > I am trying to connect to a Named Instance on an MS-SQL server > > using pyODBC. > This is what I use - > >  conn = pyodbc.connect( >

pyodbc -> MS-SQL Server Named Instance ?

2019-07-01 Thread Adam Tauno Williams
JDBC client (DbVisualizer) by specifying the instance name and port 1434. -- Adam Tauno Williams <mailto:awill...@whitemice.org> GPG D95ED383 OpenGroupware Developer <http://www.opengroupware.us/> -- https://mail.python.org/mailman/listinfo/python-list

Re: Plumbing behind super()

2019-06-29 Thread adam . preble
Thanks for the replies from everybody. It looks like I should double check super_init and see what truck is coming from that which will hit me with a gotcha later. I'm very naively right now plucking the class from my locals and I was able to proceed in the very, very short term. I think I woul

Re: Plumbing behind super()

2019-06-27 Thread adam . preble
I was wrong in the last email because I accidentally in super_gettro instead of super_init. Just for some helper context: >>> class Foo: ... pass ... >>> class Bar(Foo): ... def __init__(self): ... super().__init__() ... self.a = 2 ... >>> dis(Bar) Disassembly of __init__: 3

Re: Plumbing behind super()

2019-06-27 Thread adam . preble
On Thursday, June 27, 2019 at 8:30:21 PM UTC-5, DL Neil wrote: > I'm mystified by "literally given nothing". I'm focusing there particularly on the syntax of writing "super()" without any arguments to it. However, internally it's getting fed stuff. > If a class has not defined an attribute, eg s

Plumbing behind super()

2019-06-27 Thread adam . preble
I'm trying to mimick Python 3.6 as a .NET science project and have started to get into subclassing. The super() not-a-keyword-honestly-guys has tripped me up. I have to admit that I've professionally been doing a ton Python 2.7, so I'm not good on my Python 3.6 trivia yet. I think I have the gen

Re: From parsing a class to code object to class to mappingproxy to object (oh my!)

2019-04-05 Thread adam . preble
On Friday, April 5, 2019 at 5:54:42 PM UTC-5, Gregory Ewing wrote: > But when compiling a class body, it uses a dict to hold the > locals, and generates LOAD_NAME and STORE_NAME opcodes to > access it. > > These opcodes actually date from very early versions of > Python, when locals were always ke

Re: From parsing a class to code object to class to mappingproxy to object (oh my!)

2019-04-04 Thread adam . preble
On Thursday, April 4, 2019 at 1:17:02 PM UTC-5, adam@gmail.com wrote: > Thanks for the response. I was meaning to write back earlier, but I've been > spending my free Python time in the evenings reimplementing what I'm doing to > work more correctly. I'm guessin

Re: From parsing a class to code object to class to mappingproxy to object (oh my!)

2019-04-04 Thread adam . preble
On Monday, April 1, 2019 at 1:23:42 AM UTC-5, Gregory Ewing wrote: > adam.pre...@gmail.com wrote: > https://eli.thegreenplace.net/2012/06/15/under-the-hood-of-python-class-definitions > > Briefly, it creates a dict to serve as the class's namespace dict, > then executes the class body function pas

From parsing a class to code object to class to mappingproxy to object (oh my!)

2019-03-31 Thread adam . preble
I have been mimicking basic Python object constructs successfully until I started trying to handle methods as well in my hand-written interpreter. At that point, I wasn't sure where to stage all the methods before they get shuffled over to an actual instance of an object. I'm having to slap this

Creating LF, NEL line terminators by accident? (python3)

2019-03-26 Thread Adam Funk
rs". I'd never come across NEL terminators until now, and I've never (AFAIK) created a file with them before. Any idea why this is happening? (I tried changing the input encoding from 'utf-8-sig' to 'utf-8' but got the same results with the output.) Thanks, Adam

Re: log file

2019-03-21 Thread adam . preble
On Thursday, March 21, 2019 at 10:26:14 PM UTC-5, Sharan Basappa wrote: > I am running a program and even though the program runs all fine, the log > file is missing. I have pasted first few lines of the code. > I am thinking--hoping, rather--that you just kind of double pasted there. Anyways, y

Re: REPL, global, and local scoping

2019-03-21 Thread adam . preble
On Tuesday, March 19, 2019 at 9:49:48 PM UTC-5, Chris Angelico wrote: > I would recommend parsing in two broad steps, as CPython does: > > 1) Take the source code and turn it into an abstract syntax tree > (AST). This conceptualizes the behaviour of the code more-or-less the > way the programmer w

Re: REPL, global, and local scoping

2019-03-19 Thread adam . preble
On Tuesday, March 19, 2019 at 3:48:27 PM UTC-5, Chris Angelico wrote: > > I can see in vartest() that it's using a LOAD_GLOBAL for that, yet first() > > and second() don't go searching upstairs for a meow variable. What is the > > basis behind this? > > > > Both first() and second() assign to th

REPL, global, and local scoping

2019-03-19 Thread adam . preble
I got hit on the head and decided to try to write something of a Python interpreter for embedding. I'm starting to get into the ugly stuff like scoping. This has been a good way to learn the real deep details of the language. Here's a situation: >>> meow = 10 >>> def vartest(): ... x = 1 ..

Re: Basic pynomo instructions not working

2018-12-10 Thread Adam Funk
On 2018-11-22, dieter wrote: > The "pynomo" version you have installed may have been developped for > Python 2 and not run in "python3". > > In Python 2, you have implicit relative imports. > As an example, it allows modules in the package "pynomo" > to use "import nomo_wrapper" to import the subm

Re: bottledaemon stop/start doesn't work if killed elsewhere

2018-11-20 Thread Adam Funk
On 2018-11-18, Dan Sommers wrote: > On 11/18/18 1:21 PM, MRAB wrote:> On 2018-11-18 17:50, Adam Funk wrote: > >> Hi, > >> > >> I'm using bottledaemon to run a little REST service on a Pi that takes > >> input from other machines on the LAN and stores

Re: Suggestions for plotting slide rule & sector scales?

2018-11-20 Thread Adam Funk
On 2018-11-08, Stefan Ram wrote: > Adam Funk writes: >>and get a line 100 mm long with a log scale on the top and a linear >>scale on the bottom. > > From what I have heard, > > pyqt.sourceforge.net/Docs/PyQt4/qx11info.html#appDpiX > > will give you the

Basic pynomo instructions not working

2018-11-20 Thread Adam Funk
linux Type "help", "copyright", "credits" or "license" for more information. >>> from pynomo.nomographer import * Traceback (most recent call last): File "", line 1, in File "/home/adam/.local/lib/python3.6/site-packages/pynomo/nomographer.

Re: bottledaemon stop/start doesn't work if killed elsewhere

2018-11-19 Thread Adam Funk
dpoint that accepts a few hundred bytes of JSON, validates it, & then appends a line to a TSV file. Thanks, Adam -- https://mail.python.org/mailman/listinfo/python-list

bottledaemon stop/start doesn't work if killed elsewhere

2018-11-18 Thread Adam Funk
I eventually notice something wrong with the output data, ssh into the Pi, and rm the two files then call 'start' on the daemon again. Is there a recommended or good way to handle this situation automatically? Thanks, Adam -- https://mail.python.org/mailman/listinfo/python-list

Suggestions for plotting slide rule & sector scales?

2018-11-08 Thread Adam Funk
side=bottom) for x in range(0,10): line.add_major_tick(x*10, label=str(x), side=bottom) and get a line 100 mm long with a log scale on the top and a linear scale on the bottom. Thanks, Adam -- It takes a thousand men to invent a telegraph, or a steam engine, or a phonograph, or a telep

pip not resolving newer package than required dependency

2018-08-27 Thread adam . preble
I have a module with a dependency specifically on pillow>=4.2.1. We are using an internal PyPI that has removed the pillow 4.x series, but it does have 5.2.0. If we try to install pillow>=4.2.1 it doesn't find anything. If we just instruct pip to install pillow, then it will end up installing pi

Re: Distributing a Python module as .rpm and .deb packages across major distributions

2018-06-13 Thread adam . preble
On Sunday, June 10, 2018 at 3:05:45 PM UTC-5, Barry wrote: > The way I learn about the details of RPM packaging is to look at examples > like what I wish to achieve. > > I would go get the source RPM for a python2 package from each distro you want > to supoort and read its .spec file. > > I se

Distributing a Python module as .rpm and .deb packages across major distributions

2018-06-08 Thread adam . preble
I have a situation where internally I need to distribute some Python code using Linux packages rather than simply relying on wheel files. This seems to be a solved problem because a lot of Python modules clearly get distributed as .rpm and .deb. It's not completely unreasonable because soon I wi

Re: Basic python understanding

2017-07-26 Thread Adam M
, > jave-Swing and/or GWT > > Much respect, > > Monica > 941-212-9085 You can try these websites: https://www.toptal.com/python/interview-questions https://devskiller.com/screen-python-developers-skills-find-best-guide-recruitment/ Regards Adam M. -- https://mail.python.org/mailman/listinfo/python-list

managing the RDFLib NamespaceManager

2017-03-14 Thread Adam Funk
ource/> . @prefix ns3: <http://dbpedia.org/resource/Category%3> . @prefix ns5: <http://dbpedia.org/resource/2> . and obviously the QName outputs are wrong. Is there any way to make an RDFLib NamespaceManager *not* generate any namespaces automatically? Thanks, Adam -- https://mail.python.org/mailman/listinfo/python-list

Re: How coding in Python is bad for you

2017-01-23 Thread Adam M
On Monday, January 23, 2017 at 3:41:17 PM UTC-5, Jon Ribbens wrote: > On 2017-01-23, alister wrote: > > On Tue, 24 Jan 2017 07:19:42 +1100, Chris Angelico wrote: > >> I believe that's "bad for you" in the sense that chocolate is bad for > >> you. > >> > >> It isn't. > > > > chocolate is a poison

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-07 Thread Adam M
On Saturday, November 5, 2016 at 8:58:36 PM UTC-4, Steve D'Aprano wrote: > On Sun, 6 Nov 2016 08:17 am, Ben Bacarisse wrote: > > > Steve D'Aprano writes: > > >> Here's the same program in Objective C: > >> > >> --- cut --- > >> > >> #import > >> > >> int main (int argc, const char * argv[]) > >

Re: distributed development methodology

2016-10-29 Thread Adam Jensen
On 10/29/2016 12:31 AM, Adam Jensen wrote: > On 10/28/2016 11:59 PM, Cameron Simpson wrote: >> Sync the virtualenv prerequisites file with your DVCS. Have a tiny >> script to update the local virtualenv prereq file and run its update >> command to honour any new prereqs

Re: distributed development methodology

2016-10-28 Thread Adam Jensen
On 10/28/2016 11:59 PM, Cameron Simpson wrote: > Sync the virtualenv prerequisites file with your DVCS. Have a tiny > script to update the local virtualenv prereq file and run its update > command to honour any new prereqs. Cool. I didn't mention that I am a python n00b, did I? What/where is the "

Re: distributed development methodology

2016-10-28 Thread Adam Jensen
On 10/28/2016 11:59 PM, Cameron Simpson wrote: > Sync the virtualenv prerequisites file with your DVCS. Have a tiny > script to update the local virtualenv prereq file and run its update > command to honour any new prereqs. Cool. I didn't mention that I am a python n00b, did I? What/where is the "

distributed development methodology

2016-10-28 Thread Adam Jensen
If one were to develop a Python application on multiple machines, what are some good methods for keeping them synchronized? For example, I develop on a FreeBSD machine and a CentOS machine, each with python2.7 and differing sets of site packages. On each machine, I can use virtualenv. But if I 'pip

Re: Internet Data Handling » mailbox

2016-10-24 Thread Adam Jensen
On 10/22/2016 11:56 PM, Jason Friedman wrote: >> >> for message in mailbox.mbox(sys.argv[1]): >> if message.has_key("From") and message.has_key("To"): >> addrs = message.get_all("From") >> addrs.extend(message.get_all("To")) >> for addr in add

Re: Internet Data Handling » mailbox

2016-10-22 Thread Adam Jensen
On 10/21/2016 11:22 PM, MRAB wrote: > The docs say that it's subclass of the email.message module's Message. > > You can get the email's header fields like it's a dict, except that the > field names are case-insensitive. The author(s) of the module couldn't > use a true dict because of the need fo

Re: Internet Data Handling » mailbox

2016-10-22 Thread Adam Jensen
On 10/22/2016 03:24 AM, dieter wrote: > In addition to the previous (excellent) responses: > > A "message" models a MIME (RFC1521 Multipurpose Internet Mail Extensions) > message (the international standard for the structure of emails). > The standard tells you that a message consists essentially

Re: Internet Data Handling » mailbox

2016-10-22 Thread Adam Jensen
On 10/22/2016 05:47 AM, andy wrote: > I would type: help(mailbox) after importing it. I guess the output of that might be more meaningful once I understand the underlying structures and conventions. -- https://mail.python.org/mailman/listinfo/python-list

Re: Internet Data Handling » mailbox

2016-10-22 Thread Adam Jensen
On 10/21/2016 11:45 PM, Ben Finney wrote: > So each instance you're getting has (a superset of) the API of > ``email.message.Message``, which is a lot of behaviour > https://docs.python.org/2.7/library/email.message.html#email.message.Message> > including being able to interrogate the message heade

Internet Data Handling » mailbox

2016-10-21 Thread Adam Jensen
The mailbox library documentation seems to be a little weak. In this example: https://docs.python.org/2.7/library/mailbox.html#examples import mailbox for message in mailbox.mbox('~/mbox'): subject = message['subject'] # Could possibly be None. if subject and 'python' in subject.low

Re: Making IDLE3 ignore non-BMP characters instead of throwing an exception?

2016-10-21 Thread Adam Funk
On 2016-10-17, eryk sun wrote: > On Mon, Oct 17, 2016 at 2:20 PM, Adam Funk wrote: >> I'm using IDLE 3 (with python 3.5.2) to work interactively with >> Twitter data, which of course contains emojis. Whenever the running >> program tries to print the text of a twe

Re: [FAQ] "Best" GUI toolkit for python

2016-10-18 Thread Adam M
If my dusty memory is not wrong they were two projects aiming for GUI designer for wx: wxGlade (with option to generate code for Python) and Boa Contructor. I have no idea however if they are still available or working with newer wx. I prefer for simple stuff Tk for something more sophisticated

Re: Making IDLE3 ignore non-BMP characters instead of throwing an exception?

2016-10-17 Thread Adam Funk
On 2016-10-17, Adam Funk wrote: > I'm using IDLE 3 (with python 3.5.2) to work interactively with > Twitter data, which of course contains emojis. Whenever the running > program tries to print the text of a tweet with an emoji, it barfs > this & stops running: > >

Making IDLE3 ignore non-BMP characters instead of throwing an exception?

2016-10-17 Thread Adam Funk
characters in position 102-102: Non-BMP character not supported in Tk Is there any way to set IDLE to ignore these characters (either drop them or replace them with something else) instead of throwing the exception? If not, what's the best way to strip them out of the string before prin

Re: print to previous line in console

2016-10-03 Thread Adam M
-- and > more complete -- help. In this case, I can't state authoritatively if > curses is available on Windows. You also don't know that I didn't hit > "send" on my original response then immediately head off to the North > Woods for a week of hiking. > &

pyicloud: TypeError: 'dict_values' object does not support indexing

2016-09-30 Thread Adam Funk
And I get the same exception trying to do anything with a single photo. Is this code not really Python 3 compatible? Or am I doing something stupid? Thanks, Adam -- A firm rule must be imposed upon our nation before it destroys itself. The United St

Raw Data from Website

2016-08-22 Thread adam . j . kerr
that is important is the "632" at the end, by adjusting this it changes the postcodes. Each postcode contains a large amount of data. Is there a way this all able to be exported into an excel document? Any help with this would be amazing. Thank you. Adam -- https://mail.python.or

Re: Altering sys.argv on startup in Python 2

2016-06-13 Thread Adam Bartoš
Thank you very much, the hook gets invoked at the right place. Adam Bartoš -- https://mail.python.org/mailman/listinfo/python-list

Altering sys.argv on startup in Python 2

2016-06-12 Thread Adam Bartoš
27;sys'] or sys.__dict__ to something that runs my code on PySys_SetArgv, but that doesn't work since PySys_SetArgv doesn't invoke any hooks like __setitem__ on sys.__dict__. So is there any way how to automatically run my code after sys.argv was set but before executing the main script

Re: crash while using PyCharm / Python3

2016-05-03 Thread Adam
"Jonathan N. Little" wrote in message news:ncqc7j$na1$1...@dont-email.me... > Adam wrote: >> "Adam" wrote in message >> news:ncprqb$tl9$1...@news.albasani.net... >>> >>> "Jonathan N. Little" wrote in message >>> news:ncp

Re: Why does pathlib not have is_readable() & things like that?

2016-04-29 Thread Adam Funk
On 2016-04-28, Grant Edwards wrote: > On 2016-04-28, Adam Funk wrote: >> On 2016-04-26, Random832 wrote: >> >>> On Tue, Apr 26, 2016, at 09:30, Adam Funk wrote: >>>> I recently discovered pathlib in the Python 3 standard library, & find >>>

Re: Why does pathlib not have is_readable() & things like that?

2016-04-28 Thread Adam Funk
On 2016-04-26, Random832 wrote: > On Tue, Apr 26, 2016, at 09:30, Adam Funk wrote: >> I recently discovered pathlib in the Python 3 standard library, & find >> it very useful, but I'm a bit surprised that it doesn't offer things >> like is_readable() and is_wr

Re: Why does pathlib not have is_readable() & things like that?

2016-04-28 Thread Adam Funk
On 2016-04-26, Steven D'Aprano wrote: > On Tue, 26 Apr 2016 11:30 pm, Adam Funk wrote: >> I've been improvising with things like this: >> >> import pathlib, os >> >> path = pathlib.Path('some/directory') >> writable = os.access(str(pat

Re: Howw to prevent the duplication of any value in a column within a CSV file (python)

2016-04-27 Thread Adam Davis
On Wednesday, 27 April 2016 07:37:42 UTC+1, Chris Angelico wrote: > On Wed, Apr 27, 2016 at 4:26 PM, Adam Davis wrote: > > I understand what you're saying! But where you say: " the_set = set()", > > what would go within the set brackets? > > Nothing. The em

Re: Howw to prevent the duplication of any value in a column within a CSV file (python)

2016-04-26 Thread Adam Davis
On Tuesday, 26 April 2016 21:23:58 UTC+1, MRAB wrote: > On 2016-04-26 21:07, Adam Davis wrote: > > On Tuesday, 26 April 2016 20:52:54 UTC+1, Ian wrote: > >> On Tue, Apr 26, 2016 at 1:05 PM, Joaquin Alzola > >> wrote: > >> > Just an example. Didn&#x

Re: Howw to prevent the duplication of any value in a column within a CSV file (python)

2016-04-26 Thread Adam Davis
On Tuesday, 26 April 2016 20:52:54 UTC+1, Ian wrote: > On Tue, Apr 26, 2016 at 1:05 PM, Joaquin Alzola > wrote: > > Just an example. Didn't use the csv but just hope that it helps. > > > > name=[] > > name_exist="Dop" > > > > with open("dop.csv") as f: > > for line in f: > >

Re: Howw to prevent the duplication of any value in a column within a CSV file (python)

2016-04-26 Thread Adam Davis
On Tuesday, 26 April 2016 17:01:41 UTC+1, Adam Davis wrote: > I am wondering how to make my code function so it does not allow any of the > same values to be entered into a column in my CSV file created through > python. So I need to read into the CSV file and check if any names have

Re: Howw to prevent the duplication of any value in a column within a CSV file (python)

2016-04-26 Thread Adam Davis
x27;) as csvfile: fieldnames = ["Name", "Score 1", "Score 2", "Score 3", "Average"] writer = csv.DictWriter(csvfile, fieldnames=fieldnames) #writer.writeheader() writer.writerow({"Name": name, "Score 1&qu

Re: Howw to prevent the duplication of any value in a column within a CSV file (python)

2016-04-26 Thread Adam Davis
On Tuesday, 26 April 2016 17:14:36 UTC+1, Ian wrote: > On Tue, Apr 26, 2016 at 10:01 AM, wrote: > > I am wondering how to make my code function so it does not allow any of the > > same values to be entered into a column in my CSV file created through > > python. So I need to read into the CSV

Why does pathlib not have is_readable() & things like that?

2016-04-26 Thread Adam Funk
I recently discovered pathlib in the Python 3 standard library, & find it very useful, but I'm a bit surprised that it doesn't offer things like is_readable() and is_writable. Is there a good reason for that? I've been improvising with things like this: import pathlib, os path = pathlib.Path('s

Re: crash while using PyCharm / Python3

2016-03-23 Thread Adam
"Adam" wrote in message news:ncikss$tks$1...@news.albasani.net... > > Host OS:Ubuntu Desktop 14.04 LTS / Unity > > System crashed while using PyCharm / Python3. > Booting takes forever and stuck at the purple screen with > the Ubuntu logo and the fiv

Re: crash while using PyCharm / Python3

2016-03-22 Thread Adam
"Jonathan N. Little" wrote in message news:ncrg2v$jo$2...@dont-email.me... > Adam wrote: >> Thanks, but why fix if it ain't broke?:-) > > No reason to. Yup, I agree. > > -- > Take care, > > Jonathan > --- > LIT

Re: crash while using PyCharm / Python3

2016-03-22 Thread Adam
"Big Bad Bob" wrote in message news:mp6dnavahbnh6gzlnz2dnuu7-y_nn...@earthlink.com... > On 03/21/16 17:23, Adam so wittily quipped: >> "Adam" wrote in message >> news:ncprqb$tl9$1...@news.albasani.net... >>> >>> "Jonathan N. Little

Re: crash while using PyCharm / Python3

2016-03-22 Thread Adam
"Jonathan N. Little" wrote in message news:ncqd2d$pab$1...@dont-email.me... > Adam wrote: >> Sure glad I did not reinstall Ubuntu. Whew!! > > Unless you really-really-really screw things up, you usually do not have > to. Linux is not Windows ;-) Even if you h

Re: crash while using PyCharm / Python3

2016-03-22 Thread Adam
"Jonathan N. Little" wrote in message news:ncqc7j$na1$1...@dont-email.me... > Adam wrote: >> "Adam" wrote in message >> news:ncprqb$tl9$1...@news.albasani.net... >>> >>> "Jonathan N. Little" wrote in message >>> news:ncp

  1   2   3   4   5   6   7   8   9   10   >