Pip installs to unexpected place

2025-04-13 Thread Jonathan Gossage via Python-list
virtual environment*.* I expected that *sphinx* would be installed in the *site-packages* directory in the virtual environment. Instead, it was installed into the site-packages directory in */home/jonathan/.locals/lib/python3.13/site-packages* even though I did not specify *--user* to the *pip

Using __new__

2024-02-17 Thread Jonathan Gossage via Python-list
, **kwargs) -> None: our_attributes = ('h', 'x') if kwargs is not None: for k, v in kwargs.items(): if k in our_attributes: setattr(self, k, v) a = SingletonExample(h=1) and I get the following result: (PRV) jona

Re: Using generator expressions

2023-09-25 Thread Jonathan Gossage via Python-list
Mon, Sep 25, 2023 at 11:15 AM Thomas Passin via Python-list < python-list@python.org> wrote: > On 9/25/2023 10:15 AM, Jonathan Gossage via Python-list wrote: > > I am having a problem using generator expressions to supply the arguments > > for a class instance initialization.

Using generator expressions

2023-09-25 Thread Jonathan Gossage via Python-list
hat I tried generator expressions both inside parentheses and not, without success. -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Forward References

2023-09-03 Thread Jonathan Gossage via Python-list
: TypeAlias = RGB | int | str @dataclass(frozen=True, slots=True) class RGB(object): Can anyone suggest how I should fix this without reversing the statement order? pass -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Re: Persistent Error: Python was not found

2022-08-15 Thread Jonathan Owah
and didn't work because the tutorial was done on a MacBook, while I'm using a Windows device. Thanks for your help, Regards On Mon, Aug 15, 2022 at 8:14 AM Eryk Sun wrote: > On 8/13/22, Jonathan Owah wrote: > > > > I've been trying to configure my laptop to run

Persistent Error: Python was not found

2022-08-14 Thread Jonathan Owah
Good day, Great job on making Python easily accessible. I'm using a Windows 10, 64gb HP EliteBook. I've been trying to configure my laptop to run python scripts. This is the error I keep getting: Python was not found; run without arguments to install from the Microsoft Store, or disable this sho

Re: Seeking deeper understanding of python equality (==)

2022-05-17 Thread Jonathan Kaczynski
I have a great idea of what's going on, now. I appreciate you all. My goal now is to be able to work with the debugger, like Erik is, so that next time I am able to perform this investigation in-full. Should I create a new thread for this question? Thank you, Jonathan On Sat, May 14, 2022

Re: Seeking deeper understanding of python equality (==)

2022-05-14 Thread Jonathan Kaczynski
I'm still wondering how Py_TYPE(v)->tp_richcompare resolves to __eq__ on a user-defined class. Conversely, my understanding is, for a type defined in cpython, like str, there is usually an explicitly defined tp_richcompare function. Thank you, Jonathan On Fri, May 13, 2022 at 8:23 PM

Re: Seeking deeper understanding of python equality (==)

2022-05-13 Thread Jonathan Kaczynski
d on the left operand. If that method > doesn't exist or returns NotImplemented, it then looks for a dunder > method on the right operand. reads like the contents of the do_richcompare function. What I think I'm missing is how do the dunder methods relate to the tp_richcompare functio

Seeking deeper understanding of python equality (==)

2022-05-06 Thread Jonathan Kaczynski
ot@919d94c98191:/# apt-get --yes install python3 root@919d94c98191:/# cat >play.py <play.py < //play.py(5)() -> x == y (Pdb) s --Call-- > /usr/lib/python3.10/uuid.py(239)__eq__() -> def __eq__(self, other): Thank you, Jonathan -- https://mail.python.org/mailman/listinfo/python-list

Using PIP in Python 3.10 on Windows 10

2022-01-14 Thread Jonathan Gossage
thon installed at c:\Program Files\Python3.10 whereas it has actually been installed at D:\Users\jgoss\AppData\local\python\python3.10. It seems that the launcher has not been updated to the latest installation location for python and that it also needs to handle a non-default install location. The

OT: Accessibility: Jana Schroeder's Holman Prize Application

2021-05-10 Thread Jonathan Fine
//tinyurl.com/blindcodersurvey Finally, The Holman Prize: https://holman.lighthouse-sf.org/ best regards Jonathan -- https://mail.python.org/mailman/listinfo/python-list

Typing modules

2020-07-20 Thread Jonathan Gossage
I have the following code and I would like to type the variable *contents*: contents: something = importlib._import_module(name) I have been unable to find out what *something* should be. -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Function type in typing

2020-07-08 Thread Jonathan Gossage
. -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Asynchronous generators

2020-06-23 Thread Jonathan Gossage
-- I am attempting to learn how to use asyncio and I have been unable to find any documentation or Internet posts that give information on the principles underlying asyncio, let alone any examples showing how asynchronous generators should be used. I have built a toy program to test trying to read

Re: [Python-Dev] [RELEASE] Python 3.7.7rc1 is now available for testing

2020-03-04 Thread Jonathan Goble
On Wed, Mar 4, 2020 at 1:02 PM Ned Deily wrote: > Details here: > > > https://discuss.python.org/t/python-3-7-7rc1-is-now-available-for-testing/3638 "Assuming no critical problems are found prior to *2020-02-10*..." I would like to know how you expect people to travel back in time to report pr

Re: Python/SQLite best practices

2019-08-06 Thread Jonathan Moules
* To be reliably INSERTed Byte data should be first converted to sqlite3.Binary(my_data) explicitly Interesting. Is that Python 2 specific, or also in Python 3. Because the latter would surprise me (not saying it isn't the case). Only tried on Python 3. I'm inserting raw byte versions of web

Re: Python/SQLite best practices

2019-08-05 Thread Jonathan Moules
Some gotcha tips from using SQLite with Python that I've encountered. You may already know some/all of these: * SQLite doesn't have a "Truncate" function - simply delete the file if possible for larger datasets. * Explicitly committing is good because the default python sqlite3 library does it

Boolean comparison & PEP8

2019-07-28 Thread Jonathan Moules
Hi List, Lets say I want to know if the value of `x` is bool(True). My preferred way to do it is: if x is True:     pass Because this tests both the value and the type. But this appears to be explicitly called out as being "Worse" in PEP8: """ Don't compare boolean values to True or False usin

Re: Most "pythonic" syntax to use for an API client library

2019-05-14 Thread Jonathan Leroy - Inikup via Python-list
Le dim. 28 avr. 2019 à 20:58, Jonathan Leroy - Inikup a écrit : > Which of the following syntax do you expect an API client library to > use, and why? Thank you all for your feedbacks! I will go with #2. Le lun. 29 avr. 2019 à 05:43, DL Neil a écrit : > Doesn't the framework

Most "pythonic" syntax to use for an API client library

2019-04-28 Thread Jonathan Leroy - Inikup via Python-list
...any other? #3 seems to be more "pretty" to me, but I did not find any "official" recommendation online. Thanks. -- Jonathan. -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Jonathan Cast
C is the same as its declaration, but with the variable name deleted. So: char (*(*[3])())[5] That is, an array of 3 pointers to functions that return pointers to arrays of 5 characters. Jonathan -- https://mail.python.org/mailman/listinfo/python-list

Re: "Edit with IDLE" doesn't work any more ?

2017-07-15 Thread jonathan . blanck89
Am Freitag, 28. April 2017 14:48:22 UTC+2 schrieb Yip, Kin: > Hi, > > I've finally known why By chance, I went to the installation directory > : C:\Program Files\Python36\Lib\tkinter > > to check on files. I did "EDIT with IDLE" on any files there. It all works > ! Then, I went bac

Re: Why not allow empty code blocks?

2016-07-24 Thread Jonathan Hayward
about: > > Use syntax highlighting, use a smart editor, use a version control system, > use a linter, use 'tabnanny', use tool X, Y or Z to get around the > problems, use obscure language options.. > > The thing is, if everyone does depend more on such tools, then it reall

Re: crash while using PyCharm / Python3

2016-03-22 Thread Jonathan N. Little
Adam wrote: Thanks, but why fix if it ain't broke?:-) No reason to. -- Take care, Jonathan --- LITTLE WORKS STUDIO http://www.LittleWorksStudio.com -- https://mail.python.org/mailman/listinfo/python-list

Re: crash while using PyCharm / Python3

2016-03-21 Thread Jonathan N. Little
" sdb1 "14.04-root" sdb5 "new-home" So from a live session when I mount both drives it is easy to keep things straight when I copy my profiles from old drive on sda to new drive with newer version of Ubuntu on sdb... -- Take care, Jonathan ---

Re: crash while using PyCharm / Python3

2016-03-21 Thread Jonathan N. Little
Adam wrote: "Adam" wrote in message news:ncprqb$tl9$1...@news.albasani.net... "Jonathan N. Little" wrote in message news:ncpjj0$7ug$1...@dont-email.me... Adam wrote: There ought to be a way to just reinstall the graphics subsystem rather than an all-or-none installation

Re: crash while using PyCharm / Python3

2016-03-21 Thread Jonathan N. Little
lem:_Need_to_purge_-fglrx> -- Take care, Jonathan --- LITTLE WORKS STUDIO http://www.LittleWorksStudio.com -- https://mail.python.org/mailman/listinfo/python-list

Confirm: About python Registration

2016-03-04 Thread Jonathan Qin
Dear Manager, (Please forward this to your CEO, because this is urgent. Thanks!) This is Jonathan Qin---the manager of domain name registration and solution center in China. On February 29th, 2016, we received an application from Baiyao Holdings Ltd requested “python” as their internet keyword

New user group: Rochester, MN, USA

2016-01-20 Thread Jonathan Hartley
http://www.meetup.com/PyRochesterMN First meeting planned for Thu 28th January 2016 -- Jonathan Hartley tart...@tartley.com +1 507-513-1101 -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is array.array('u') deprecated?

2015-05-08 Thread jonathan . slenders
, match=b'y'> > >>> data[101] = "z" > >>> re.search(b"y", data) > <_sre.SRE_Match object; span=(400, 401), match=b'y'> > >>> re.search(b"yz", data) > >>> re.search(b"y\0\0\0z", data) > <_sre.SRE_Match object; span=(400, 405), match=b'y\x00\x00\x00z'> > > but if that is good enough you can use a bytearray in the first place. Maybe I'll try that. Thanks for the suggestions! Jonathan -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is array.array('u') deprecated?

2015-05-08 Thread jonathan . slenders
> Can you expand a bit on how array("u") helps here? Are the matches in the > gigabyte range? I have a string of unicode characters, e.g.: data = array.array('u', u'x' * 10) Then I need to change some data in the middle of this string, for instance: data[50] = 'y' Then I want to u

Re: Why is array.array('u') deprecated?

2015-05-08 Thread jonathan . slenders
Le vendredi 8 mai 2015 12:29:15 UTC+2, Steven D'Aprano a écrit : > On Fri, 8 May 2015 07:14 pm, jonathan.slenders wrote: > > > Why is array.array('u') deprecated? > > > > Will we get an alternative for a character array or mutable unicode > > string? > > > Good question. > > Of the three main

Why is array.array('u') deprecated?

2015-05-08 Thread jonathan . slenders
Why is array.array('u') deprecated? Will we get an alternative for a character array or mutable unicode string? Thanks! Jonathan -- https://mail.python.org/mailman/listinfo/python-list

Re: Python implementations in JavaScript

2015-02-16 Thread Jonathan Hayward
@all, thanks. I think I have Brython to try out first and others to maybe fall back on, which is the kind of information I wanted. Thanks, On Mon, Feb 16, 2015 at 3:59 PM, Jonathan Hayward < jonathan.hayw...@pobox.com> wrote: > @all, thanks. I think I have Brython to try out first a

Python implementations in JavaScript

2015-02-14 Thread Jonathan Hayward
What is the relative maturity of different Python implementations in JavaScript? Are any of the implementations ready to rely on? -- [image: Christos Jonathan Seth Hayward] <http://jonathanscorner.com/> Jonathan S. Hayward, a full stack web developer with Python/Django and AngularJS/

Re: How do I check if a string is a prefix of any possible other string that matches a given regex.

2014-10-08 Thread jonathan . slenders
Le mercredi 8 octobre 2014 01:40:11 UTC+2, MRAB a écrit : > If you're not interested in generating an actual regex, but only in > > matching the prefix, then it sounds like you want "partial matching". > > > > The regex module supports that: > > > > https://pypi.python.org/pypi/regex Wow, t

Re: How do I check if a string is a prefix of any possible other string that matches a given regex.

2014-10-07 Thread jonathan . slenders
> > Logically, I'd think it should be possible by running the input string > > against the state machine that the given regex describes, and if at some > > point all the input characters are consumed, it's a match. (We don't have > > to run the regex until the end.) But I cannot find any librar

How do I check if a string is a prefix of any possible other string that matches a given regex.

2014-10-07 Thread jonathan . slenders
n regex describes, and if at some point all the input characters are consumed, it's a match. (We don't have to run the regex until the end.) But I cannot find any library that does it... Thanks a lot, if anyone knows the answer to this question! Cheers, Jonathan -- https://mail.python.org/mailman/listinfo/python-list

Re: Examples of modern GUI python programms

2014-03-31 Thread Jonathan Harden
On 31 Mar 2014 00:21, "D. Xenakis" wrote: > ... Snip ... > What i need is to develop an android looking program (entirelly in python) for windows, but dunno if this is possible (most propably is), and which tool between those would help me most: tkinter - wxpython - pyqt - pygtk . > > Any exampl

Re: New user's initial thoughts / criticisms of Python

2013-11-09 Thread Jonathan
On Saturday, November 9, 2013 8:27:02 AM UTC-5, Joshua Landau wrote: > `select` is quite an odd statement, in that in most cases it's just a > weaker variant of `if`. By the time you're at the point where a > `select` is actually more readable you're also at the point where a > different control f

Aide pour bien démarrer en Python

2013-09-27 Thread jonathan . corriveau
Je sais qu'il y a plein d'information à lire un peu partout, mais j'ai vraiment du mal à voir pourquoi Python est si fantastique... Je m'explique Pour moi python c'est un langage de script très cryptique avec des noms de méthodes courts, pas claire, dans une identation pas toujours facile à

Re: Looking for a name for a deployment framework...

2013-06-25 Thread jonathan . slenders
Le mardi 25 juin 2013 06:38:44 UTC+2, Chris Rebert a écrit : > Er, Salt is likewise written in Python. You're right. Salt is also Python, excuse me, and it's very powerful as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a name for a deployment framework...

2013-06-24 Thread jonathan . slenders
Thanks everyone, I'll think about it. The main reason is that I'm working on the documentation, and this a a good opportunity to think about the naming. python-deploy-framework or python-deployer could be too boring. -- http://mail.python.org/mailman/listinfo/python-list

Looking for a name for a deployment framework...

2013-06-24 Thread jonathan . slenders
e and supports introspection. It supports parallel deployments, and interactivity. And it has a nice commandline shell with autocompletion for traversing the deployment tree. The repository: https://github.com/jonathanslenders/python-deployer/tree/refactoring-a-lot-v2 Suggestions welcome :) Jon

New line conversion with Popen attached to a pty

2013-06-21 Thread Jonathan Harden
ne conversion would be incorrect, and what I could do to fix it? In fact if anyone even has any pointers to where this might be going wrong I'd be very helpful, I've done a lot of hours of fiddling with this and googling to no avail. Thanks, Jonathan #!/usr/bin/env python2.6.4 impo

Getting ASCII encoding where unicode wanted under Py3k

2013-05-13 Thread Jonathan Hayward
27;' edit_table += '' if russian != None: edit_table += '''''' % locals() edit_table += '\n' edit_table += '' edit_table += '''''' % locals() edit_table += ''

Re: Experimental Python-based shell

2012-10-03 Thread Jonathan Hayward
12 at 11:25 AM, Amirouche Boubekki < amirouche.boube...@gmail.com> wrote: > > > 2012/10/3 Jonathan Hayward > >> The chief benefit besides the searching, so far, is that you can use Py3k >> mixed with shell commands as the scripting language--so script in Python >>

Re: Experimental Python-based shell

2012-10-03 Thread Jonathan Hayward
tion is a bit crude, but it is reasonably powerful. I have other things on the agenda, like making it able to run scripts and doing fuzzy matching, but for now those are the main two attractions. On Wed, Oct 3, 2012 at 8:52 AM, Amirouche Boubekki < amirouche.boube...@gmail.com> wrote: > H

Re: Hiring Python Developer @ CA, USA

2012-09-18 Thread Jonathan Holloway
Incidentally and I know this is region specific, but what's the average salary approximately in the US/UK for a Senior Python programmer? ITJobsWatch in the UK says - http://www.itjobswatch.co.uk/jobs/uk/python.do Is that about right? Jon. On 18 September 2012 08:40, Paul Rudin wrote: > nithi

Re: psphere: how to make thread safe

2012-08-26 Thread jonathan . kinred
On Sunday, 26 August 2012 22:45:25 UTC+10, jonatha...@gmail.com wrote: > On Wednesday, 22 August 2012 22:03:48 UTC+10, sajuptpm wrote: > > > Hi, > > > > > > > > > > > > psphere: Python interface for the VMware vSphere Web Services SDK > > > > > > > > > > > > I already developed an

Re: psphere: how to make thread safe

2012-08-26 Thread jonathan . kinred
On Wednesday, 22 August 2012 22:03:48 UTC+10, sajuptpm wrote: > Hi, > > > > psphere: Python interface for the VMware vSphere Web Services SDK > > > > I already developed an app using https://bitbucket.org/jkinred/psphere. But > getting lot of errors since psphere is not thread safe (I think

Re: Is Django v1.3 documentation the newest version?

2012-07-02 Thread Jonathan Harris
Hello It isn't Having been frustrated with out of date books, specifically the Apress published 'Definitive Guide To Django', I've downloaded the Kindle edition of Django 1.4 documentation It's a good tutorial J On Mon, Jul 2, 2012 at 11:00 AM, levi nie wrote: > Is Django v1.3 documentation t

Re: calling a simple PyQt application more than once

2012-05-20 Thread Jonathan
Hello Jabba, Did you ever find a solution to the problem? If so, can you please post it? Thanks, Jonathan -- View this message in context: http://python.6.n6.nabble.com/calling-a-simple-PyQt-application-more-than-once-tp4335946p4975385.html Sent from the Python - python-list mailing list

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Jonathan Lange
On Wed, Dec 21, 2011 at 9:21 AM, Pierre-Yves David wrote: ... > The most notable exception is Ubuntu Hardy and LTS release from april 2008 > with > 2.5. But this LTS is out of support for almost 1 year now and current LTS > (Lucid) ship 2.6. Not quite. Ubuntu 8.04 LTS is supported on the server

Re: easy_install doesn't install non-package *.py file

2011-11-10 Thread Jonathan Hartley
Hey. I don't know the details, but your setup.py needs to use either the 'package_data' or the 'data_files' entry in the dict you pass to setup. These can specify files you want included in the sdist which aren't package files. There are many complications with using them though. One of them in

Re: A Python script to put CTAN into git (from DVDs)

2011-11-07 Thread Jonathan Fine
ling me about gitpan. -- Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: A Python script to put CTAN into git (from DVDs)

2011-11-07 Thread Jonathan Fine
a tag. But no commit. That was a bad accident that there is a tag that points directly to a tree of _initial import_, not something to copy. Because git is a distributed version control system, anyone who wants to can create such a directed acyclic graph of commits. And if it's useful I'll gladly add it to my copy of the repository. best regards Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: A Python script to put CTAN into git (from DVDs)

2011-11-06 Thread Jonathan Fine
On 06/11/11 16:42, Jakub Narebski wrote: Jonathan Fine writes: Hi This it to let you know that I'm writing (in Python) a script that places the content of CTAN into a git repository. https://bitbucket.org/jfine/python-ctantools I hope that you meant "repositories" (pl

A Python script to put CTAN into git (from DVDs)

2011-11-06 Thread Jonathan Fine
oes not have arrays or numbers. If my project interests you, reply to this message or contact me directly (or both). -- Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: leftover pyc files

2011-11-04 Thread Jonathan Hartley
Apologies for all my messasges appearing twice. I'm using google groups web ui and have no idea why it's doing that. I'll stop using it. -- http://mail.python.org/mailman/listinfo/python-list

Re: leftover pyc files

2011-11-04 Thread Jonathan Hartley
I like to install a Bash shell of some kind on windows boxes I work on, specifically so I can use shell commands like this, just like on any other operating system. Cywin works just fine for this. svn also has hooks, but sadly not a checkout hook: http://svnbook.red-bean.com/en/1.1/ch05s02.html

Re: leftover pyc files

2011-11-03 Thread Jonathan Hartley
This can be added to your project's .git/hooks/post-checkout: #!/usr/bin/env bash cd ./$(git rev-parse --show-cdup) find . -name '*.pyc' -exec rm '{}' ';' -- http://mail.python.org/mailman/listinfo/python-list

Re: leftover pyc files

2011-11-03 Thread Jonathan Hartley
This can be added to git as a post-checkout hook: In your project's .git/hooks/post-checkout: #!/usr/bin/env bash cd ./$(git rev-parse --show-cdup) find . -name '*.pyc' -exec rm '{}' ';' -- http://mail.python.org/mailman/listinfo/python-list

Re: leftover pyc files

2011-11-03 Thread Jonathan Hartley
A task like this is more suited to bash than Python: find . -name '*.pyc' -exec rm '{}' ';' -- http://mail.python.org/mailman/listinfo/python-list

Books to lean Python 3 Web Programming?

2011-10-22 Thread Jonathan Loescher
Can anyone recommend a good book to learn the web programming aspects of Python 3? -- http://mail.python.org/mailman/listinfo/python-list

Re: executing arbitrary statements

2011-10-03 Thread Jonathan Hartley
Fair points Steven. Thanks for further refining my initial refinement. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: executing arbitrary statements

2011-10-02 Thread Jonathan Hartley
On Saturday, October 1, 2011 8:06:43 AM UTC+1, Chris Rebert wrote: > On Fri, Sep 30, 2011 at 11:31 PM, Jason Swails wrote: > > I'm probably missing something pretty obvious, but I was wondering if there > > was a way of executing an arbitrary line of code somehow (such as a line of > > code based

Re: cause __init__ to return a different class?

2011-09-15 Thread Jonathan Hartley
Perhaps a more idiomatic way of achieving the same thing is to use a factory function, which returns instances of different classes: def PersonFactory(foo): if foo: return Person() else: return Child() Apologies if the code is messed up, I'm posting from Google g

Re: How to structure packages

2011-09-08 Thread Jonathan Hartley
On Thursday, September 8, 2011 1:29:26 AM UTC+1, Steven D'Aprano wrote: > Steven D'Aprano wrote: > > Other than that, is there any justification > for this rule? Any Java fans want to defend this? > > If "one class per file", why not "one method per class" too? Why is the > second rule any more si

Re: Writing a MUD Console

2011-07-22 Thread Jonathan Gardner
whirl! > That code is surprisingly simple. Let me write one that uses asyncore so that the looping can incorporate other async processes as well. -- Jonathan Gardner jgard...@jonathangardner.net -- http://mail.python.org/mailman/listinfo/python-list

Writing a MUD Console

2011-07-22 Thread Jonathan Gardner
character's name. 1 Traceback (most recent call last): File "./telnetsubprocess.py", line 17, in cmd = raw_input() EOFError Connection closed by foreign host. Any ideas on what is going on here? -- Jonathan Gardner jgard...@jonathangardner.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Can someone help please

2011-07-22 Thread Jonathan Hartley
Hey Billy. That may not be the important part of the code, but the many people giving up their free time to read it and help you don't know that. It's probably most helpful to give them a working example so as not to waste their time. Just sayin for future, is all. :-) Best regards,

Re: Can someone help please

2011-07-22 Thread Jonathan Hartley
Hey! Is Billy a responder, rather than the OP? Sorry then! My previous point is entirely nullified. -- http://mail.python.org/mailman/listinfo/python-list

Re: Functional style programming in python: what will you talk about if you have an hour on this topic?

2011-07-14 Thread Jonathan Hartley
On Jul 14, 4:32 am, Gregory Ewing wrote: > Anthony Kong wrote: > > So I have picked this topic for one of my presentation. It is because > > functional programming technique is one of my favorite in my bag  of python > > trick. > > I'm not sure it's a good idea to emphasise functional > programmi

Re: Functional style programming in python: what will you talk about if you have an hour on this topic?

2011-07-14 Thread Jonathan Hartley
On Jul 13, 1:39 pm, Anthony Kong wrote: > (My post did not appear in the mailing list, so this is my second try. > Apology if it ends up posted twice) > > Hi, all, > > If you have read my previous posts to the group, you probably have some idea > why I asked this question. > > I am giving a few

Re: Newby Python help needed with functions

2011-06-03 Thread Jonathan Gardner
dict.get(inp, None) That returned value is actually callable! That is, you can then do something like: fn("This is the input string") Of course, as you already know, you should test fn to see if it is None. If so, they typed in an option you don't recognize. Secondly

Re: English Idiom in Unix: Directory Recursively

2011-05-21 Thread Jonathan de Boyne Pollard
The supposed inefficiency of recursive implementations is based largely on the properties of hardware that is now obsolete. With modern processors there's no great efficiency hit. In some of the smaller microcontrollers, it's true, you do have to worry about stack overflow; but the ARM processo

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Jonathan de Boyne Pollard
I think what happens is that the “recursive” has become a idiom associated with directory to such a degree that the unix people don't know what the fuck they are talking about. They just simply use the word to go with directory whever they mean the whole directory. In the emacs case: “Recursiv

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Jonathan de Boyne Pollard
AFAICS what emacs calls "recursive delete" is what the ordinary person would simply call "delete". Presumably the non-recursive delete is called simply "delete" but is actually something more complicated than delete, and you're supposed to know what that is. The "non-recursive delete" would be

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Jonathan de Boyne Pollard
〈English Idiom in Unix: Directory Recursively〉 http://xahlee.org/comp/idiom_directory_recursively.html -- English Idiom in Unix: Directory Recursively Xah Lee, 2011-05-17 Today, let's discuss something in the category of lingustics. You know how in unix

Re: lightweight way to create new projects from templates

2011-05-12 Thread Jonathan Hartley
Hey Chris, Thanks for the thoughts. I must confess I had already given up on a 'single file' approach, because I want to make it easy for people to create their own templates, so I have to handle copying a template defined by creating a new directory full of diles. If I'm already handling this

lightweight way to create new projects from templates

2011-05-11 Thread Jonathan Hartley
ample, G{author} will be replaced with the value for 'author' supplied either on the command-line: $ genesis myproj author=Jonathan Or in your ~/.genesis/config file (a python file read using 'exec'): author = 'Jonathan' * The default template should embody go

Re: Development tools and practices for Pythonistas

2011-05-06 Thread Jonathan Hartley
.net/docs/pph/ Also, where I work we have tried many IDEs, but happily and productively use GVim and very little else, so don't feel you *have* to use an IDE. Best regards, Jonathan Hartley -- http://mail.python.org/mailman/listinfo/python-list

Re: Vectors

2011-04-25 Thread Jonathan Hartley
On Apr 20, 2:43 pm, Andreas Tawn wrote: > > Algis Kabaila writes: > > > > Are there any modules for vector algebra (three dimensional > > > vectors, vector addition, subtraction, multiplication [scalar > > > and vector]. Could you give me a reference to such module? > > > NumPy has array (and mat

Re: Validating Command Line Options

2011-03-23 Thread Jonathan Gossage
See inline comments On Wed, Mar 23, 2011 at 2:13 PM, Alex Willmer wrote: > On Mar 23, 3:20 pm, T wrote: > > Thanks! argparse is definitely what I need..unfortunately I'm running > > 2.6 now, so I'll need to upgrade to 2.7 and hope that none of my other > > scripts break. > > Argparse was a thi

Re: PEP for module naming conventions

2011-03-17 Thread Jonathan Gossage
I have found this approach problematic if you have packages separately developed and maintained in different directory trees, resulting in more than one PYTHONPATH entry with the same root metapackage name. What happens is that only the first entry in the PYTHONPATH containing the metapackage name

Re: Efficient python 2-d arrays?

2011-01-18 Thread Jonathan Hartley
On Jan 17, 10:20 pm, Jake Biesinger wrote: > Hi all, > > Using numpy, I can create large 2-dimensional arrays quite easily. > > >>> import numpy > >>> mylist = numpy.zeros((1,2), dtype=numpy.int32) > > Unfortunately, my target audience may not have numpy so I'd prefer not to use > it. > >

Re: continuing development on modules after they're installed

2010-12-10 Thread Jonathan Gardner
are just as trivial as the Unix ones.) Now, there is a link from the lib/python2.6/site-packages files to YourProject. (Or Python2.7 or whatever version you are using.) I'd also look at using Paster to create the package. It gives you a pretty decent setup for straight up Python packages. -- Jonathan Gardner jgard...@jonathangardner.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacing globals in exec by custom class

2010-12-09 Thread Jonathan S
Thanks for your response! (And sorry about the syntax error, I forgot to test my code after cleaning up some debug statements before posting, the else should have been elif indeed.) It's very interesing, how Python works internally. According to a thread on the Python mailing list in 2002, it seem

Replacing globals in exec by custom class

2010-12-08 Thread Jonathan S
Hi all, I wonder if anyone can explain some weird behaviour in Python. What I'm trying to do is to execute a string of python code through the 'exec' statement. I pass an instance of my Global class, which acts like a dict. By overriding the __getitem__ method, the Global should pretend that a glo

Re: is py2exe still active ?

2010-12-08 Thread Jonathan Hartley
t; > Steve Holden           +1 571 484 6266   +1 800 494 3119 > > PyCon 2011 Atlanta March 9-17      http://us.pycon.org/ > > See Python Video!      http://python.mirocommunity.org/ > > Holden Web LLC                http://www.holdenweb.com/ Hey, Yes, they are all Python packages or applications, and yes, PyPI aka The Cheese Shop is a single repository for them. However, they do not share mailing lists or issue trackers. Each project maintains its own bug tracking, etc. Best regards, Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: is py2exe still active ?

2010-12-08 Thread Jonathan Hartley
t; > Steve Holden           +1 571 484 6266   +1 800 494 3119 > > PyCon 2011 Atlanta March 9-17      http://us.pycon.org/ > > See Python Video!      http://python.mirocommunity.org/ > > Holden Web LLC                http://www.holdenweb.com/ Hey, Yes, they are all Python packages or applications, and yes, PyPI aka The Cheese Shop is a single repository for them. However, they do not share mailing lists or issue trackers. Each project maintains its own bug tracking, etc. Best regards, Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: unittests with different parameters

2010-11-23 Thread Jonathan Hartley
On Nov 22, 11:38 am, Ulrich Eckhardt wrote: > Hi! > > I'm writing tests and I'm wondering how to achieve a few things most > elegantly with Python's unittest module. > > Let's say I have two flags invert X and invert Y. Now, for testing these, I > would write one test for each combination. What I

Re: Ways of accessing this mailing list?

2010-11-11 Thread Jonathan Hartley
ind *this* list (comp.lang.python) for ages, despite scrutinising possible aliases. For anyone else in the same boat, you are looking for gmane.comp.python.general. Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: playful coding problems for 10 year olds

2010-11-02 Thread Jonathan Hartley
On Nov 1, 8:31 pm, Daniel Fetchinson wrote: > Hi folks, > > My niece is interested in programming and python looks like a good > choice (she already wrote a couple of lines :)) She is 10 and I > thought it would be good to have a bunch of playful coding problems > for her, stuff that she could cod

Re: OO and game design questions

2010-10-21 Thread Jonathan Hartley
On Oct 20, 12:11 pm, dex wrote: > On Oct 20, 12:25 pm, Jonathan Hartley wrote: > > > > > On Oct 18, 8:28 am, dex wrote: > > > > I'm building a turn based RPG game as a hobby. The design is becoming > > > increasingly complicated and confusing, a

Re: OO and game design questions

2010-10-21 Thread Jonathan Hartley
On Oct 20, 12:11 pm, dex wrote: > On Oct 20, 12:25 pm, Jonathan Hartley wrote: > > > > > On Oct 18, 8:28 am, dex wrote: > > > > I'm building a turn based RPG game as a hobby. The design is becoming > > > increasingly complicated and confusing, a

Re: OO and game design questions

2010-10-21 Thread Jonathan Hartley
On Oct 20, 12:11 pm, dex wrote: > On Oct 20, 12:25 pm, Jonathan Hartley wrote: > > > > > On Oct 18, 8:28 am, dex wrote: > > > > I'm building a turn based RPG game as a hobby. The design is becoming > > > increasingly complicated and confusing, a

  1   2   3   4   5   6   7   >