Re: BitChan (python project)

2024-09-06 Thread Schimon Jehudah via Python-list
Greetings, 711!

This is very good!

Do you know of Plebbit?

It might be good to interoperate with Plebbit too.

https://plebbit.com/

Kind regards,
Schimon

On Thu, 5 Sep 2024 04:53:05 -
711 Spooky Mart via Python-list  wrote:

>  from https://github.com/813492291816/BitChan
> 
> BitChan is a decentralized anonymous imageboard inspired by BitBoard
> and built on top of Bitmessage with Tor, I2P, and GnuPG.
> 
> BitChan solves a number of security and free speech problems that have
> plagued most imageboards. Centralized imageboards can be taken offline
> or hijacked and can leak user data. BitChan reduces the likelihood of
> this by being decentralized, allowing each user to host their own
> instance of the software, requiring all connections to go through
> Tor/I2P, and not requiring JavaScript.
> 
> Users of centralized forums often have to deal with overzealous
> moderators and sometimes even pressure from state powers that tend to
> suffocate the forum's culture. BitChan's moderation is multifaceted,
> but to be brief, the option exists to create entirely unmoderatable
> boards to post content on. Due to its decentralized design, BitChan
> cannot be moderated by its developers, the government, or any other
> entity. Indeed, there is no way to disconnect BitChan from the
> internet, and as long as people are still running Bitmessage, BitChan
> is completely untouchable.
> 
> ─┏┓──┏━━┓───┏━━┓──Spooky Mart Channel
> ─┗━━┓─┃──┗┓─┃───┗┓─┃──[chan] 711
> ┃─┃──┏┛─┗┓──┏┛─┗┓─always open | stay spooky
> ┗━┛──┗━━━┛──┗━━━┛─https://bitmessage.org
> 
-- 
https://mail.python.org/mailman/listinfo/python-list


BitChan (python project)

2024-09-05 Thread 711 Spooky Mart via Python-list
 from https://github.com/813492291816/BitChan

BitChan is a decentralized anonymous imageboard inspired by BitBoard
and built on top of Bitmessage with Tor, I2P, and GnuPG.

BitChan solves a number of security and free speech problems that have
plagued most imageboards. Centralized imageboards can be taken offline
or hijacked and can leak user data. BitChan reduces the likelihood of
this by being decentralized, allowing each user to host their own
instance of the software, requiring all connections to go through
Tor/I2P, and not requiring JavaScript.

Users of centralized forums often have to deal with overzealous
moderators and sometimes even pressure from state powers that tend to
suffocate the forum's culture. BitChan's moderation is multifaceted,
but to be brief, the option exists to create entirely unmoderatable
boards to post content on. Due to its decentralized design, BitChan
cannot be moderated by its developers, the government, or any other
entity. Indeed, there is no way to disconnect BitChan from the
internet, and as long as people are still running Bitmessage, BitChan
is completely untouchable.

─┏┓──┏━━┓───┏━━┓──Spooky Mart Channel
─┗━━┓─┃──┗┓─┃───┗┓─┃──[chan] 711
┃─┃──┏┛─┗┓──┏┛─┗┓─always open | stay spooky
┗━┛──┗━━━┛──┗━━━┛─https://bitmessage.org

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GIL-Removal Project Takes Another Step (Posting On Python-List Prohibited)

2024-03-20 Thread Chris Angelico via Python-list
On Wed, 20 Mar 2024 at 18:31, Greg Ewing via Python-list
 wrote:
>
> On 20/03/24 4:14 pm, Lawrence D'Oliveiro wrote:
> > not to
> > mention the latency when there isn’t quite enough memory for an allocation
> > and you have to wait until the next GC run to proceed. Run the GC a
> > thousand times a second, and the latency is still 1 millisecond.
>
> That's not the way it usually works. If you run out of memory, you
> run a GC there and then. You don't have to wait for GCs to occur on
> a time schedule.
>
> Also, as a previous poster pointed out, GCs are typically scheduled
> by number of allocations, not by time.
>

FYI you're violating someone's request by responding to them in a way
that results in it getting onto python-list, so it's probably safest
to just ignore cranks and trolls and let them stew in their own
juices.

But normally the GC doesn't need to be scheduled at all. In CPython,
the only reason to "run garbage collection" is to detect cycles, so
you would have to be generating inordinate amounts of cyclic garbage
for this to matter at all.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GIL-Removal Project Takes Another Step (Posting On Python-List Prohibited)

2024-03-20 Thread Greg Ewing via Python-list

On 20/03/24 4:14 pm, Lawrence D'Oliveiro wrote:

not to
mention the latency when there isn’t quite enough memory for an allocation
and you have to wait until the next GC run to proceed. Run the GC a
thousand times a second, and the latency is still 1 millisecond.


That's not the way it usually works. If you run out of memory, you
run a GC there and then. You don't have to wait for GCs to occur on
a time schedule.

Also, as a previous poster pointed out, GCs are typically scheduled
by number of allocations, not by time.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: PEP about recommended project folder layout

2022-07-31 Thread Chris Angelico
On Sun, 31 Jul 2022 at 20:27, Weatherby,Gerard  wrote:
>
> I’m not aware of any standard convention for laying out packages.
>
> PEP 8 (https://peps.python.org/pep-0008/) specifies conventions for how to 
> write Python, so a standard layout PEP would not be inconsistent.
>

PEP 8 species rules for laying out the code of the Python standard
library. Its adoption by other projects does not constitute the Python
developers declaring that it's a convention for how to write all
Python code.

A better example would be PEP 257 https://peps.python.org/pep-0257/
but even that is more for the purpose of tooling. It does at least try
to describe usage conventions, though.

Conventions for laying out packages (as opposed to actual requirements
defined by the packaging system itself) would be better described
somewhere other than a PEP.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PEP about recommended project folder layout

2022-07-31 Thread Weatherby,Gerard
I’m not aware of any standard convention for laying out packages.

PEP 8 (https://peps.python.org/pep-0008/) specifies conventions for how to 
write Python, so a standard layout PEP would not be inconsistent.

—
Gerard Weatherby | Application Architect NMRbox | NAN | Department of Molecular 
Biology and Biophysics
 UConn Health 263 Farmington Avenue, Farmington, CT 06030-6406 uchc.edu
On Jul 30, 2022, 4:37 PM -0400, Barry , wrote:
*** Attention: This is an external email. Use caution responding, opening 
attachments or clicking on links. ***

On 30 Jul 2022, at 13:52, c.bu...@posteo.jp wrote:

Isn't there a PEP?

PEP are for improving python. They are not for telling people how to use python.
I would be surprised to fine a PEP that addressed this.

Barry


On 2022-07-26 07:14 c.bu...@posteo.jp wrote:
Hello,

I am not sure if I looked into the correct sources. I was looking in
"PEP 609 – Python Packaging Authority (PyPA) Governance" [1] and the
"PyPA specifications" [2].

My question in short: Is there an official document (e.g. a PEP)
about a recommended layout for project folders.

Looking into the wild and past there are a lot of variations of such
layouts. I am far away from being a pro but depending on experience
in my own projects and what I have learned from others (e.g. in
blog-posts/tutorials) I recommend to have the "test" folder and the
package folder side by side on the same level in the project folder
(the root).

my_project
|- tests
| └ test_*.py
|- my_package
| └ __init__.py
└-- README.md

I sometimes add to it the so called "src"-Layout where the package
folder is one level deeper in an extra "src" folder.

my_project
|- tests
| └ test_*.py
|- src
| └- my_package
| └ __init__.py
└-- README.md

I don't want to discuss the pros and cons of all variations. What I
need is an official document I can use in discussions with other
maintainers. If there is a PEP/document against my current
recommendation I am also fine with this. ;)

Kind
Christian

[1] -- 
<https://urldefense.com/v3/__https://peps.python.org/pep-0609/__;!!Cn_UX_p3!ipqSQS5_ZFxO37h5h5XALf2DxE3eV-x6qNSrVnKJU3cLZIkLfKhuTzSxi1fb-BvYNVPXeT-nYFX8ogu6BLuJjA$
 >
[2] -- 
<https://urldefense.com/v3/__https://packaging.python.org/en/latest/specifications__;!!Cn_UX_p3!ipqSQS5_ZFxO37h5h5XALf2DxE3eV-x6qNSrVnKJU3cLZIkLfKhuTzSxi1fb-BvYNVPXeT-nYFX8oguyjbg15g$
 >

--
https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!ipqSQS5_ZFxO37h5h5XALf2DxE3eV-x6qNSrVnKJU3cLZIkLfKhuTzSxi1fb-BvYNVPXeT-nYFX8ogse6_J2Hg$

--
https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!ipqSQS5_ZFxO37h5h5XALf2DxE3eV-x6qNSrVnKJU3cLZIkLfKhuTzSxi1fb-BvYNVPXeT-nYFX8ogse6_J2Hg$
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PEP about recommended project folder layout

2022-07-30 Thread Barry


> On 30 Jul 2022, at 13:52, c.bu...@posteo.jp wrote:
> 
> Isn't there a PEP?

PEP are for improving python. They are not for telling people how to use python.
I would be surprised to fine a PEP that addressed this.

Barry

> 
>> On 2022-07-26 07:14 c.bu...@posteo.jp wrote:
>> Hello,
>> 
>> I am not sure if I looked into the correct sources. I was looking in 
>> "PEP 609 – Python Packaging Authority (PyPA) Governance" [1] and the 
>> "PyPA specifications" [2].
>> 
>> My question in short: Is there an official document (e.g. a PEP)
>> about a recommended layout for project folders.
>> 
>> Looking into the wild and past there are a lot of variations of such 
>> layouts. I am far away from being a pro but depending on experience
>> in my own projects and what I have learned from others (e.g. in 
>> blog-posts/tutorials) I recommend to have the "test" folder and the 
>> package folder side by side on the same level in the project folder
>> (the root).
>> 
>> my_project
>> |- tests
>> |  └ test_*.py
>> |- my_package
>> |  └ __init__.py
>> └-- README.md
>> 
>> I sometimes add to it the so called "src"-Layout where the package 
>> folder is one level deeper in an extra "src" folder.
>> 
>> my_project
>> |- tests
>> |  └ test_*.py
>> |- src
>> |  └- my_package
>> | └ __init__.py
>> └-- README.md
>> 
>> I don't want to discuss the pros and cons of all variations. What I
>> need is an official document I can use in discussions with other
>> maintainers. If there is a PEP/document against my current
>> recommendation I am also fine with this. ;)
>> 
>> Kind
>> Christian
>> 
>> [1] -- <https://peps.python.org/pep-0609/>
>> [2] -- <https://packaging.python.org/en/latest/specifications>
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PEP about recommended project folder layout

2022-07-30 Thread c.buhtz
Isn't there a PEP?

On 2022-07-26 07:14 c.bu...@posteo.jp wrote:
> Hello,
> 
> I am not sure if I looked into the correct sources. I was looking in 
> "PEP 609 – Python Packaging Authority (PyPA) Governance" [1] and the 
> "PyPA specifications" [2].
> 
> My question in short: Is there an official document (e.g. a PEP)
> about a recommended layout for project folders.
> 
> Looking into the wild and past there are a lot of variations of such 
> layouts. I am far away from being a pro but depending on experience
> in my own projects and what I have learned from others (e.g. in 
> blog-posts/tutorials) I recommend to have the "test" folder and the 
> package folder side by side on the same level in the project folder
> (the root).
> 
> my_project
> |- tests
> |  └ test_*.py
> |- my_package
> |  └ __init__.py
> └-- README.md
> 
> I sometimes add to it the so called "src"-Layout where the package 
> folder is one level deeper in an extra "src" folder.
> 
> my_project
> |- tests
> |  └ test_*.py
> |- src
> |  └- my_package
> | └ __init__.py
> └-- README.md
> 
> I don't want to discuss the pros and cons of all variations. What I
> need is an official document I can use in discussions with other
> maintainers. If there is a PEP/document against my current
> recommendation I am also fine with this. ;)
> 
> Kind
> Christian
> 
> [1] -- <https://peps.python.org/pep-0609/>
> [2] -- <https://packaging.python.org/en/latest/specifications>

-- 
https://mail.python.org/mailman/listinfo/python-list


PEP about recommended project folder layout

2022-07-26 Thread c . buhtz

Hello,

I am not sure if I looked into the correct sources. I was looking in 
"PEP 609 – Python Packaging Authority (PyPA) Governance" [1] and the 
"PyPA specifications" [2].


My question in short: Is there an official document (e.g. a PEP) about a 
recommended layout for project folders.


Looking into the wild and past there are a lot of variations of such 
layouts. I am far away from being a pro but depending on experience in 
my own projects and what I have learned from others (e.g. in 
blog-posts/tutorials) I recommend to have the "test" folder and the 
package folder side by side on the same level in the project folder (the 
root).


my_project
|- tests
|  └ test_*.py
|- my_package
|  └ __init__.py
└-- README.md

I sometimes add to it the so called "src"-Layout where the package 
folder is one level deeper in an extra "src" folder.


my_project
|- tests
|  └ test_*.py
|- src
|  └- my_package
| └ __init__.py
└-- README.md

I don't want to discuss the pros and cons of all variations. What I need 
is an official document I can use in discussions with other maintainers. 
If there is a PEP/document against my current recommendation I am also 
fine with this. ;)


Kind
Christian

[1] -- <https://peps.python.org/pep-0609/>
[2] -- <https://packaging.python.org/en/latest/specifications>
--
https://mail.python.org/mailman/listinfo/python-list


Re: For a hierarchical project, the EXE file generated by "pyinstaller" does not start.

2021-12-08 Thread Mohsen Owzar
Chris Angelico schrieb am Dienstag, 7. Dezember 2021 um 19:16:54 UTC+1:
> On Wed, Dec 8, 2021 at 4:49 AM Mohsen Owzar  wrote: 
> > *** 
> > GPIOContrl.py 
> > *** 
> > class GPIOControl: 
> > def my_print(self, args): 
> > if print_allowed == 1: 
> > print(args) 
> > 
> > def __init__(self):
> Can't much help with your main question as I don't do Windows, but one 
> small side point: Instead of having a my_print that checks if printing 
> is allowed, you can conditionally replace the print function itself. 
> 
> if not print_allowed: 
> def print(*args, **kwargs): pass 
> 
> ChrisA

Thanks Chris
Your answer didn't help me to solve my problem, but gave me another idea to 
write a conditional print statement.

Regards
Mohsen
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: For a hierarchical project, the EXE file generated by "pyinstaller" does not start.

2021-12-07 Thread Chris Angelico
On Wed, Dec 8, 2021 at 4:49 AM Mohsen Owzar  wrote:
> ***
> GPIOContrl.py
> ***
> class GPIOControl:
> def my_print(self, args):
> if print_allowed == 1:
> print(args)
>
> def __init__(self):

Can't much help with your main question as I don't do Windows, but one
small side point: Instead of having a my_print that checks if printing
is allowed, you can conditionally replace the print function itself.

if not print_allowed:
def print(*args, **kwargs): pass

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


For a hierarchical project, the EXE file generated by "pyinstaller" does not start.

2021-12-07 Thread Mohsen Owzar
Hi all, 

I have a problem with "pyinstaller".
When I compile a single Python file, an EXE file is created in the "dist" 
directory, with which I can start the program and the GUI appears after a few 
seconds.
But when I try to compile my project with "pyinstaller 
Relais_LastDauerTester.py" and generate an EXE file from it, an ".exe" file is 
also created in the "dist" directory, but nothing happens when I run both .exe 
files from Windows Explorer with a double click or from the DOS shell by 
invoking it.
The mouse pointer changes briefly to an hourglass and then back and nothing 
happens.
The only difference between these two programs is that the first is just a 
single file and my project is structured hierarchically. I tried to demonstrate 
the structure of the project below with two "DIR" DOS commands.
In PyCharm you only need to run the top file "Relais_LastDauerTester.py", so I 
used this file for "pyinstaller".
But it looks like I have to give (I believe) an extra argument for a 
hierarchical project.
I googled all weekend to find a workable solution. But all I found was for 
converting a ".py" file and not a project like mine.
With some suggestions, I should add a "pause" or "input ()" command to the code 
to prevent the DOS shell from disappearing quickly, which is out of the 
question for me.
Do you have any idea what it could be?
I thank you in advance for any useful advice that could help me.

Greeting
Mohsen

PS 
I work on a PC with 
1201 INFO: PyInstaller: 4.7 
1202 INFO: Python: 3.9.5 
1282 INFO: Platform: Windows-10-10.0.18363-SP0 

Project Structure from PyCharm
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 
...\SW\Relais_LastDauerTester_V0.5 
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 
 .idea 
 Logfiles 
 Relais_LastDauerTester 
276 Relais_LastDauerTester.py 
 Screenshotfiles 
405 settings.ini 

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 
...\SW\Relais_LastDauerTester_V0.5\Relais_LastDauerTester 
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 
9’308  GPIOControl.py 
90’618   GUI_View.py 
998 main.py 
28’625  TestControl.py 
269  __init__.py 
   __pycache__ 


Simplified project files with the "import" lines 
*** 
Relais_LastDauerTester.py.py 
*** 
#!/usr/bin/env python3 
# -*- coding: utf-8 -*- 
from Relais_LastDauerTester.main import main 

if __name__ == "__main__": 
main() 

*** 
main.py 
*** 
import sys 

from PyQt5.QtCore import * 
from PyQt5.QtWidgets import QApplication 
from .GUI_View import MainWindow 

def main(): 
app = QApplication(sys.argv) 

window = MainWindow() 
window.show() 

sys.exit(app.exec_()) 

if __name__ == '__main__': 
main() 

*** 
GUI_View.py 
*** 
import sys 
import subprocess 

import PyQt5.QtGui as qtg 
from PyQt5.QtWidgets import (QLabel, QPushButton, QLineEdit, QCheckBox, 
QWidget, 
QVBoxLayout, QHBoxLayout, QGridLayout, QDialog, QFileDialog) 
from .TestControl import * 

class MainWindow(QWidget): 
def __init__(self): 
super().__init__() 

def createMainWindow(self): 
... 

def exitMainWindow(self): 
... 

def ChangeToPrefWindow(self): 
self.prefwindow.show() 
self.hide() 

class PrefWindow(QWidget): 
def __init__(self, parent=None): 
super().__init__() 
self.parent = parent 
... 
self.createPrefWindow() 

def ChangeToMainWindow(self): 
... 

def createPrefWindow(self): 
... 

class CustomLineEdit(QLineEdit): 
clicked = pyqtSignal() 

def mousePressEvent(self, QMouseEvent): 
self.clicked.emit() 

class Keypad_Window_New(QDialog): 
def __init__(self, num=0, parent=None): 
super().__init__(parent) 
self.parent = parent 
... 

TestContrl.py 
*** 
from PyQt5.QtCore import * 
from .GPIOControl import GPIOControl 

class WorkerSignals(QObject): 
signal_Update_Label = pyqtSignal() 

class TestControl(QRunnable): 
signals = WorkerSignals() 

def __init__(self, parent=None): 
super().__init__() 
self.parent = parent 
... 

*** 
GPIOContrl.py 
*** 
class GPIOControl: 
def my_print(self, args): 
if print_allowed == 1: 
print(args) 

def __init__(self):
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] Re: Looking for people interested in a Python register virtual machine project

2021-03-23 Thread Guido van Rossum
On Tue, Mar 23, 2021 at 12:40 PM Skip Montanaro 
wrote:

> I've not attempted to make any changes to calling conventions. It
> occurred to me that the LOAD_METHOD/CALL_METHOD pair could perhaps be
> merged into a single opcode, but I haven't really thought about that.
> Perhaps there's a good reason the method is looked up before the
> arguments are pushed onto the stack (call_function()?). In a
> register-based VM there's no need to do things in that order.
>

IIRC the reason is that Python's language reference promises left-to-right
evaluation here. So o.m(f()) needs to evaluate o.m (which may have a side
effect if o overrides __getattr__) before it calls f().

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-23 Thread Skip Montanaro
> a) You're working with CPython bleeding edge.
> b) You find that (bleeding edge) adding extra chore.
> c) Nobody told you to work on bleeding (nor boss, nor a maintainer who
> said "I'll merge it once you've done"),
>
> Then: why do you complicate your task by working on bleeding edge?
> Could take not too old CPython version, e.g. 3.8/3.9, instead, and work
> with that.

I started this in the 3.9 alpha timeframe. Staying up-to-date wasn't
too difficult. It never occurred to me that the virtual machine would
undergo so much churn for 3.10, so I just stuck with main/master and
paid the price when the changes started to arrive in earnest. When the
3.10 branch is created I will take that off-ramp this time.

> Btw, from just "pep", it's unclear if, and how much, you reuse Victor's
> work. If not, why? (The answer is useful to contributors - you ask them
> to "reuse" your code - how it's regarding your reuse of code of folks
> who were before you?).

Both Victor's and my earlier work took place in the dim dark past.
There have been so many functional changes to the virtual machine that
directly reusing either old code base wasn't feasible. I do have a
copy of Victor's work though which I have referred to from
time-to-time. I just never tried to merge it with something recent,
like 3.9.

> > > explicitly. Would be interesting to read (in the following "pep"
> > > sections) what makes them "almost completely distinct".
> >
> > Well, sure. The main difference is the way two pairs of instructions
> > (say, BINARY_ADD vs BINARY_ADD_REG) get their operands and save their
> > result. You still have to be able to add two objects, call functions,
> > etc.
>
> I'd note that your reply skips answering question about calling
> convention for register-based VM, and that's again one of the most
> important questions (and one I'd be genuinely interested to hear).

I've not attempted to make any changes to calling conventions. It
occurred to me that the LOAD_METHOD/CALL_METHOD pair could perhaps be
merged into a single opcode, but I haven't really thought about that.
Perhaps there's a good reason the method is looked up before the
arguments are pushed onto the stack (call_function()?). In a
register-based VM there's no need to do things in that order.

> > The fact that I treat the current frame's stack space as registers
> > makes it pretty much impossible to execute both stack and register
> > instructions within the same frame.
>
> I don't see how that would be true (in general, I understand that you
> may have constraints re: that, but that's exactly why I bring that up -
> why do you have constraints like that?). Even existing Python VM allows
> to use both in the same frame, e.g. LOAD_FAST. It takes value of
> register and puts it on a stack.

Sure, but that's because it must. All operands must be on the stack.
My code does have a step where it tries to remove LOAD_FAST_REG and
STORE_FAST_REG opcodes. It's not very good though. Pesky implicit
references cause problems. Still, I am able to remove some of them.
This should get better over time. And, it is possible that at some
point I decide to add back in some stack space for stuff like calling
functions, constructing lists, etc.

> Do you mean details like need to translate stack-based instructions
> into 2 (or more) instructions of: a) actual register-register
> instruction and; b) stack pointer adjustment, so stack-based
> instructions still kept working?

Yes, but I see (I think) what you're getting at. If I continued to
maintain the stack pointer, in theory stack opcodes could exist along
with register opcodes.

> Yes, you would need to do that, until you fully switch to
> register-based ones. But then there's 2 separate tasks:
>
> 1. Make register VM work. (Should be medium complexity.)
> 2. Make it fast. (Likely will be hard.)

I'm not too worried about #2 yet. :-) And as demonstrated by the
current project's incompleteness, either I'm not up to medium
complexity tasks anymore or it's harder than you think. :-)

Some of the second step isn't too hard, I don't think. I already
mentioned eliding generated fast LOAD/STORE instructions, and in my
previous email mentioned copying constants from the code object to the
frame object on creation. I also think opcode prediction and fast
dispatch should be straightforward. I just haven't bothered with that
yet.

> If you want to achieve both right from the start - oh-oh, that may be
> double-hard.
>
> > Victor's implementation did things
> > differently in this regard. I believe he just allocated extra space
> > for 256 registers at the end of each frame, so (in theory, I suppose),
> > you could have instructions from both executed in the same frame.
>
> I hope you have a plan of how to deal with more than 256 registers,
> etc. Register VM adds a lot of accidental implementation complexity ;-).

One of the reasons I just reused the current stack space as my
register space harkens back to a thread with Tim Peters back in th

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
Thanks for the response. I will try to address your comments inline.

> I guess it should be a good idea to answer what's the scope of this
> project - is it research one or "production" one? If it's research one,
> why be concerned with the churn of over-modern CPython versions?
> Wouldn't it be better to just use some scalable, incremental
> implementation which would allow to forward-port it to a newer version,
> if it ever comes to that?

The motivation for revisiting this idea was/is largely personal. As I
indicated, I first messed around with it over 20 years ago and it's
been in the back of my mind ever since. Somehow I never lost the code
despite I'm not sure how many computers came and went and that the
code was never uploaded to any sort of distributed version control
system. I decided to pick things up again as a way to mostly keep my
head in the game after I retired. So, neither "research" nor
"production" seems to be a correct descriptor. Still, if taken to
functional completion — functional enough for performance testing and
application to more than just toy scripts — I realized pretty quickly
that I'd need help.

> Otherwise, if it's "production", who's the "customer" and how they
> "compensate" you for doing work (chasing the moving target) which is
> clearly of little interest to you and conflicts with the goal of the
> project?

Nobody is compensating me. I have no desire to try and turn it into
something I do for hire. Maybe I misunderstood your question?

> > This PEP proposes the addition of register-based instructions to the
> > existing Python virtual machine, with the intent that they eventually
> > replace the existing stack-based opcodes.
>
> Sorry, what? The purpose of register-based instructions is to just
> replace stack-based instructions? That's not what's I'd like to hear as
> the intro phrase. You probably want to replace one with the other
> because register-based ones offer some benefit, faster execution
> perhaps? That's what I'd like to hear instead of "deciphering" that
> between the lines.

Replacing stack-based instructions would be a reasonable initial goal,
I think. Victor reported performance improvements in his
implementation (also a translator). As I indicated in the "PEP" (I use
that term rather loosely, as I have no plans at the moment to submit
it for consideration, certainly not in its current, incomplete state),
a better ultimate way to go would be to generate register instructions
directly from the AST. The current translation scheme allows me to
write simple test case functions, generate register instructions, then
compare that when called the two produce the same result.

> > They [2 instruction sets] are almost completely distinct.
>
> That doesn't correspond to the mental image I would have. In my list,
> the 2 sets would be exactly the same, except that stack-based encode
> argument locations implicitly, while register-based - explicitly. Would
> be interesting to read (in the following "pep" sections) what makes them
> "almost completely distinct".

Well, sure. The main difference is the way two pairs of instructions
(say, BINARY_ADD vs BINARY_ADD_REG) get their operands and save their
result. You still have to be able to add two objects, call functions,
etc.

> > Within a single function only one set of opcodes or the other will
> > be used at any one time.
>
> That would be the opposite of "scalable, incremental" development
> approach mentioned above. Why not allow 2 sets to freely co-exist, and
> migrate codegeneration/implement code translation gradually?

The fact that I treat the current frame's stack space as registers
makes it pretty much impossible to execute both stack and register
instructions within the same frame. Victor's implementation did things
differently in this regard. I believe he just allocated extra space
for 256 registers at the end of each frame, so (in theory, I suppose),
you could have instructions from both executed in the same frame.

> > ## Motivation
>
> I'm not sure the content of the section corresponds much to its title.
> It jumps from background survey of the different Python VM optimizations
> to (some) implementation details of register VM - leaving "motivation"
> somewhere "between the lines".
>
> > Despite all that effort, opcodes which do nothing more than move data
> > onto or off of the stack (LOAD_FAST, LOAD_GLOBAL, etc) still account
> > for nearly half of all opcodes executed.
>
> ... And - you intend to change that with a register VM? In which way and
> how? As an example, LOAD_GLOBAL isn't going anywhere - it loads a
&g

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
> Yeah, that is old writing, so is probably less clear (no pun intended)
> than it should be. In frame_dealloc, Py_CLEAR is called for
> stack/register slots instead of just Py_XDECREF. Might not be
> necessary.

Also, the intent is not to change any semantics here. The
implementation of RETURN_VALUE_REG still Py_INCREFs the to-be-returned
value. It's not like the data can get reclaimed before the caller
receives it.

S
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
> In the "Object Lifetime" section you say "registers should be cleared upon 
> last reference". That isn't safe, since there can be hidden dependencies on 
> side effects of __del__, e.g.:
>
> process_objects = create_pipeline()
> output_process = process_objects[-1]
> return output_process.wait()
>
> If the process class terminates the process in __del__ (PyQt5's QProcess 
> does), then implicitly deleting process_objects after the second line will 
> break the code.

Yeah, that is old writing, so is probably less clear (no pun intended)
than it should be. In frame_dealloc, Py_CLEAR is called for
stack/register slots instead of just Py_XDECREF. Might not be
necessary.

Skip
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-20 Thread Skip Montanaro
Yes, I remember Parrot. As I understand it their original goal was a
language-agnostic virtual machine, which might have complicated things.

I will do a bit of reading and add some text to the "PEP."

Skip

On Sat, Mar 20, 2021, 11:36 AM David Mertz  wrote:

> The Parrot project was also intended to be the same thing, and for a while
> had a fair number of contributors. Unfortunately, it never obtained the
> performance wins that were good for.
>
> On Sat, Mar 20, 2021, 11:55 AM Skip Montanaro 
> wrote:
>
>> Back in the late 90s (!) I worked on a reimagining of the Python
>> virtual machine as a register-based VM based on 1.5.2. I got part of
>> the way with that, but never completed it. In the early 2010s, Victor
>> Stinner got much further using 3.4 as a base. The idea (and dormant
>> code) has been laying around in my mind (and computers) these past
>> couple decades, so I took another swing at it starting in late 2019
>> after retirement, mostly as a way to keep my head in the game. While I
>> got a fair bit of the way, it stalled. I've picked it up and put it
>> down a number of times in the past year, often needing to resolve
>> conflicts because of churn in the current Python virtual machine.
>> Though I kept getting things back in sync, I realize this is not a
>> one-person project, at least not this one person. There are several
>> huge chunks of Python I've ignored over the past 20 years, and not
>> just the internals. (I've never used async anything, for example.) If
>> it is ever to truly be a viable demonstration of the concept, I will
>> need help. I forked the CPython repo and have a branch (register2) of
>> said fork which is currently synced up with the 3.10 (currently
>> master) branch:
>>
>> https://github.com/smontanaro/cpython/tree/register2
>>
>> I started on what could only very generously be called a PEP which you
>> can read here. It includes some of the history of this work as well as
>> details about what I've managed to do so far:
>>
>> https://github.com/smontanaro/cpython/blob/register2/pep-.rst
>>
>> If you think any of this is remotely interesting (whether or not you
>> think you'd like to help), please have a look at the "PEP". Because
>> this covers a fair bit of the CPython implementation, chances to
>> contribute in a number of areas exist, even if you have never delved
>> into Python's internals. Questions/comments/pull requests welcome.
>>
>> Skip Montanaro
>> ___
>> Python-ideas mailing list -- python-id...@python.org
>> To unsubscribe send an email to python-ideas-le...@python.org
>> https://mail.python.org/mailman3/lists/python-ideas.python.org/
>> Message archived at
>> https://mail.python.org/archives/list/python-id...@python.org/message/IUKZPH4ZSZ22RZFKMITQ3Q6A22P4BXWX/
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Looking for people interested in a Python register virtual machine project

2021-03-20 Thread Skip Montanaro
Back in the late 90s (!) I worked on a reimagining of the Python
virtual machine as a register-based VM based on 1.5.2. I got part of
the way with that, but never completed it. In the early 2010s, Victor
Stinner got much further using 3.4 as a base. The idea (and dormant
code) has been laying around in my mind (and computers) these past
couple decades, so I took another swing at it starting in late 2019
after retirement, mostly as a way to keep my head in the game. While I
got a fair bit of the way, it stalled. I've picked it up and put it
down a number of times in the past year, often needing to resolve
conflicts because of churn in the current Python virtual machine.
Though I kept getting things back in sync, I realize this is not a
one-person project, at least not this one person. There are several
huge chunks of Python I've ignored over the past 20 years, and not
just the internals. (I've never used async anything, for example.) If
it is ever to truly be a viable demonstration of the concept, I will
need help. I forked the CPython repo and have a branch (register2) of
said fork which is currently synced up with the 3.10 (currently
master) branch:

https://github.com/smontanaro/cpython/tree/register2

I started on what could only very generously be called a PEP which you
can read here. It includes some of the history of this work as well as
details about what I've managed to do so far:

https://github.com/smontanaro/cpython/blob/register2/pep-.rst

If you think any of this is remotely interesting (whether or not you
think you'd like to help), please have a look at the "PEP". Because
this covers a fair bit of the CPython implementation, chances to
contribute in a number of areas exist, even if you have never delved
into Python's internals. Questions/comments/pull requests welcome.

Skip Montanaro
-- 
https://mail.python.org/mailman/listinfo/python-list


need help with a ctypes project for PyPI

2021-02-03 Thread Simon Zhang
Hi,

I have created a ctypes project as in the following link's first answer:
https://stackoverflow.com/questions/42585210/extending-setuptools-extension-to-use-cmake-in-setup-py

Since my machine's gcc is too high version or something, I used the docker
image located here:
https://quay.io/repository/pypa/manylinux2014_x86_64
to compile the copied .whl file. I ran auditwheel repair on my whl file
then copied it back to my local machine without complaints.

I'm not sure I understand the subsequent process I need to do with PyPI.

If I copy the manylinux2014 wheel back to my local machine  (into the dist
folder) and run the command:

python3 -m twine upload --repository testpypi dist/*

following the instructions from:
https://packaging.python.org/tutorials/packaging-projects/

when I pip3 install spamplusplus (this is the name I gave my test project)
https://test.pypi.org/project/spamplusplus/

I get that the CMakeLists.txt file is not existent. I used the same
setup.py file given in the link:
https://stackoverflow.com/questions/42585210/extending-setuptools-extension-to-use-cmake-in-setup-py

However I get the error that CMakeLists.txt file is not being uploaded?

 cmake /tmp/pip-build-6ff9ifuu/spamplusplus
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-build-6ff9ifuu/spamplusplus/build/lib.linux-x86_64-3.6/spamplusplus
-DCMAKE_BUILD_TYPE=Release
  CMake Error: The source directory
"/tmp/pip-build-6ff9ifuu/spamplusplus" does not appear to contain
CMakeLists.txt.

I think this is something basic involving paths but could be more involved.

Can anyone help!!

Thanks,

Simon Zhang
-- 
https://mail.python.org/mailman/listinfo/python-list


Asyncio project code review

2021-01-08 Thread James

Good day for everyone.

I have new asyncio project which use aiohttp connector and asyncio 
protocols/transports for tunneling packets through Tor Network cleanly. 
Project called aiotor: https://github.com/torpyorg/aiotor


If someone with experience in asyncio field can make code review I will 
be appreciated for any comments.


I prepared pull request to make it convenient to review and comment on 
the code: https://github.com/torpyorg/aiotor/pull/1


Thanks in advance.
--
https://mail.python.org/mailman/listinfo/python-list


asyncio project code review

2021-01-08 Thread James

Good day everyone.

I have new asyncio project which use aiohttp connector and asyncio 
protocols/transports for tunneling packets through Tor Network cleanly. 
Project called aiotor: https://github.com/torpyorg/aiotor


If someone with experience in asyncio field can make code review I will 
be appreciated for any comments.


I prepared pull request to make it convenient to review and comment on 
the code: https://github.com/torpyorg/aiotor/pull/1



--
https://mail.python.org/mailman/listinfo/python-list


A new project to be started

2020-10-06 Thread Agnese Camellini
Hello to everyone, i don't have a clear idea about who to write about this
project, which is only an idea, but it has to be written i think.
At first it was just a comparative literature research project, but now
that i am more involved in development, it has started to become more like
a different programming language or framework.
There is someone here who can receive attachments and who has the time to
read the research project and look at the presentation i am making?
Is anyone interested in developing a new language/framework on python? Who
should i ask to?
I only have a degree in Philosophy, i didn't have the money to take a new
one in computer science and so i studied by myself (luckily the university
exam bibliographies are public in Italy).
I have an idea of these two fields but there is another one involved, that
is Theory of language and logic (mathematical and constructivist logic).
However is  there anyone here i can speak to about those arguments?
Thanks a lot.
Agnese Camellini
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The FaQ project - Single or Double quotes

2020-06-11 Thread Abdur-Rahmaan Janhangeer
I'm still unsure whether or not to have a summary instead of just listing
the
texts

Kind Regards,

Abdur-Rahmaan Janhangeer
compileralchemy <https://compileralchemy.github.io/> | blog
<https://abdur-rahmaanj.github.io/>
github <https://github.com/Abdur-RahmaanJ>
Mauritius


On Thu, Jun 11, 2020 at 10:00 PM Abdur-Rahmaan Janhangeer <
arj.pyt...@gmail.com> wrote:

> Since the single vs double quote thread
> i decided to reactivate the FaQ project.
>
> You can view it here
>
> https://abdur-rahmaanj.github.io/pyfaq/[list]_Single_or_double_quotes.html
>
> The index has some some more summaries:
>
> https://abdur-rahmaanj.github.io/pyfaq/
> <https://abdur-rahmaanj.github.io/pyfaq/>
>
> I auto pull the messages with some manual edits like
> filtering empty mails etc
>
> Mr Christopher maintains one for python-ideas
> https://github.com/PythonCHB/PythonListsSummaries
>
> This one is intended to have even some common questions
> like where do i start etc
>
> Kind Regards,
>
> Abdur-Rahmaan Janhangeer
> compileralchemy <https://compileralchemy.github.io/> | blog
> <https://abdur-rahmaanj.github.io/>
> github <https://github.com/Abdur-RahmaanJ>
> Mauritius
>
-- 
https://mail.python.org/mailman/listinfo/python-list


The FaQ project - Single or Double quotes

2020-06-11 Thread Abdur-Rahmaan Janhangeer
Since the single vs double quote thread
i decided to reactivate the FaQ project.

You can view it here

https://abdur-rahmaanj.github.io/pyfaq/[list]_Single_or_double_quotes.html

The index has some some more summaries:

https://abdur-rahmaanj.github.io/pyfaq/
<https://abdur-rahmaanj.github.io/pyfaq/>

I auto pull the messages with some manual edits like
filtering empty mails etc

Mr Christopher maintains one for python-ideas
https://github.com/PythonCHB/PythonListsSummaries

This one is intended to have even some common questions
like where do i start etc

Kind Regards,

Abdur-Rahmaan Janhangeer
compileralchemy <https://compileralchemy.github.io/> | blog
<https://abdur-rahmaanj.github.io/>
github <https://github.com/Abdur-RahmaanJ>
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


My New Project : Aduct

2020-04-12 Thread J.Arun Mani via Python-list
Hello,
I made my first Python package that can be installed via PIP. It is called 
"Aduct".
https://github.com/atornel/Aduct.
Aduct is a toolkit to design graphical applications that can be dynamically 
changed with a little work as possible. It is designed by inheriting objects 
provided by [Gtk](http://www.gtk.org/) and thus by following principles of 
Aduct with Gtk, one can make powerful applications that are easy for a 
developer to develop, third-party person to improve and end user to use.
Put simply, Aduct lets you make complex interfaces which can be easily changed 
by users without any trouble.
What help I need :
This is my first project where I put a much work in writing docs and things. So 
I'm a pretty noob who needs a help from various people with different ideas. 
Hence I kindly request you to spend time with Aduct (if you can) :
1. Use Aduct - please use it and tell me your feedback, I will be really happy
2. Requesting features and reporting bugs - as already said, you might have a 
different perspective of how a feature should work, I welcome those.
3. Criticisms - They are always hurting, but still I'm ready to face it.
4. Sharing with others - If you think that there is someone who can make use of 
Aduct, you can help by sharing Aduct.
5. Writing docs - The docs could be unclear, could be improved, you can help me 
here.
6. Improving source code - I salute those brave hearts who are ready to dive 
into business of coding. Don't worry, formatting won't be so poor, I used 
Black, Pylint, Bandit to make it readable and powerful.
7. Star it - The most easy one; it encourages me.

This is not any spam or promotion. Aduct is released in LGPL license and is 
completely free. Improving and using Aduct, strengthens the community work, 
meaning of open source, gives me a satisfaction.

Thank you for reading till here,
J Arun Mani
:)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: NLP Project with Python

2020-04-09 Thread Souvik Dutta
I thought about an app that would be similar to Google's current sound
recording that records sounds and turns them into words and characters. I
was thinking that you might be able to make an app or atleast a program
that takes a picture and saves it in the form of text document which could
be played when someone wants.

For example let us suppose you take a picture of a book. The program should
be able to extract all the words and save them in form of a text file. It
should also be able to play the file that is convert it into an audiobook
when requested to do so.

I think this will take time.

Souvik flutter dev

On Wed, Apr 8, 2020, 12:45 PM  wrote:

> Hello everyone
> I`m new to python. I need to select a project idea so that I can work with
> it during this semester. the project should be in the area of business and
> finance
> at first I was thinking of creating a project using NLP but I don`t know
> what exactly to create
> also I would like to create something related to blockchain, such as
> tracking the currency at which its sold and bought, customers reviews and
> the value of cryptocurrencies during this outbreak of the coronavirus
> I welcome all your ideas just please inspire me. I`m lost in my own
> thoughts.
> thanks in advance
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: NLP Project with Python

2020-04-08 Thread joseph pareti
if you want to do work in NLP there are numerous opportunities, especially
with the virus oubreak
see e.g.
https://www.cnbc.com/2020/03/03/bluedot-used-artificial-intelligence-to-predict-coronavirus-spread.html

Am Mi., 8. Apr. 2020 um 09:18 Uhr schrieb :

> Hello everyone
> I`m new to python. I need to select a project idea so that I can work with
> it during this semester. the project should be in the area of business and
> finance
> at first I was thinking of creating a project using NLP but I don`t know
> what exactly to create
> also I would like to create something related to blockchain, such as
> tracking the currency at which its sold and bought, customers reviews and
> the value of cryptocurrencies during this outbreak of the coronavirus
> I welcome all your ideas just please inspire me. I`m lost in my own
> thoughts.
> thanks in advance
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Regards,
Joseph Pareti - Artificial Intelligence consultant
Joseph Pareti's AI Consulting Services
https://www.joepareti54-ai.com/
cell +49 1520 1600 209
cell +39 339 797 0644
-- 
https://mail.python.org/mailman/listinfo/python-list


NLP Project with Python

2020-04-08 Thread dreamyladygirl
Hello everyone
I`m new to python. I need to select a project idea so that I can work with it 
during this semester. the project should be in the area of business and finance
at first I was thinking of creating a project using NLP but I don`t know what 
exactly to create
also I would like to create something related to blockchain, such as tracking 
the currency at which its sold and bought, customers reviews and the value of 
cryptocurrencies during this outbreak of the coronavirus
I welcome all your ideas just please inspire me. I`m lost in my own thoughts.
thanks in advance 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Would you be interested in this Python open source project?

2019-10-12 Thread oliver
There are tons of projects that need help, I recommend that instead of
re-inventing the wheel as there are enough choices out there re cicd and
very likely you will find that your goal of 10/90 is unrealistic.

Have a look at codetriage.com, and github has a feature that allows you to
search for projects that need help.

Another major advantage of helping an existing project is that you will be
seeing how others write python code so you will learn best practices faster
(dont kid yourself, if you do it on your own the code you write now you
will find horrible in a year, and you certainly will not be interested in
rewriting it!).

Keep up the good work!

On Wed., Oct. 9, 2019, 08:35 Simon Connah,  wrote:

>
> On 08/10/2019 15:05, Bill Deegan wrote:
> > You might just consider working with the BuildBot project to add support
> > for lighter weight build workers.
> > Re-Re-Re-inventing the wheel is almost always wasted effort.
>
> Buildbot looks good. I'll check to make sure its open source license is
> compatible with the Affero General Public License version 3. On the
> other hand I do have a desire to build something similar myself just to
> get the hang of things like this. Thank you for your reply.
>
> > On Tue, Oct 8, 2019 at 8:33 AM Rhodri James 
> wrote:
> >
> >> On 08/10/2019 11:22, Simon Connah wrote:
> >>> I'm posting this message as a way to gauge interest in the project and
> >>> to see if it is worth moving forward with. There are probably hundreds
> >>> of CI/CD tools out there and many more general devops tools but what I
> >>> want to build is a CI/CD tool that ONLY supports Python 3.6 or greater
> >>> and only runs on one Linux distribution (my preference is Ubuntu). This
> >>> way configuration would be much more simple than the vast majority of
> >>> devops tools which try to support every programming language that is
> >>> popular (or so it seems) on many different Linux distributions and even
> >>> Windows and macOS.
> >>>
> >>> My theory is that if you limit the devops tool to a very limited
> >>> subsection of the available options the system will be easier to
> >>> configure for users, more stable, easier to patch bugs in and generally
> >>> just be a better all around things for Python developers.
> >>>
> >>> I'd love to hear some feedback on the idea.
> >>>
> >> I think your reasoning is sound.  I probably wouldn't make a lot of use
> >> of it, but I live in Embedded Systems land where it's notoriously hard
> >> to do CI off the target silicon.  Other people living in more tractable
> >> problem spaces will probably be more enthusiastic.
> >>
> >> --
> >> Rhodri James *-* Kynesim Ltd
> >> --
> >> https://mail.python.org/mailman/listinfo/python-list
> >>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Would you be interested in this Python open source project?

2019-10-09 Thread Simon Connah



On 08/10/2019 15:05, Bill Deegan wrote:

You might just consider working with the BuildBot project to add support
for lighter weight build workers.
Re-Re-Re-inventing the wheel is almost always wasted effort.


Buildbot looks good. I'll check to make sure its open source license is 
compatible with the Affero General Public License version 3. On the 
other hand I do have a desire to build something similar myself just to 
get the hang of things like this. Thank you for your reply.



On Tue, Oct 8, 2019 at 8:33 AM Rhodri James  wrote:


On 08/10/2019 11:22, Simon Connah wrote:

I'm posting this message as a way to gauge interest in the project and
to see if it is worth moving forward with. There are probably hundreds
of CI/CD tools out there and many more general devops tools but what I
want to build is a CI/CD tool that ONLY supports Python 3.6 or greater
and only runs on one Linux distribution (my preference is Ubuntu). This
way configuration would be much more simple than the vast majority of
devops tools which try to support every programming language that is
popular (or so it seems) on many different Linux distributions and even
Windows and macOS.

My theory is that if you limit the devops tool to a very limited
subsection of the available options the system will be easier to
configure for users, more stable, easier to patch bugs in and generally
just be a better all around things for Python developers.

I'd love to hear some feedback on the idea.


I think your reasoning is sound.  I probably wouldn't make a lot of use
of it, but I live in Embedded Systems land where it's notoriously hard
to do CI off the target silicon.  Other people living in more tractable
problem spaces will probably be more enthusiastic.

--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


--
https://mail.python.org/mailman/listinfo/python-list


Re: Would you be interested in this Python open source project?

2019-10-09 Thread Simon Connah


On 08/10/2019 13:17, Rhodri James wrote:

On 08/10/2019 11:22, Simon Connah wrote:
I'm posting this message as a way to gauge interest in the project 
and to see if it is worth moving forward with. There are probably 
hundreds of CI/CD tools out there and many more general devops tools 
but what I want to build is a CI/CD tool that ONLY supports Python 
3.6 or greater and only runs on one Linux distribution (my preference 
is Ubuntu). This way configuration would be much more simple than the 
vast majority of devops tools which try to support every programming 
language that is popular (or so it seems) on many different Linux 
distributions and even Windows and macOS.


My theory is that if you limit the devops tool to a very limited 
subsection of the available options the system will be easier to 
configure for users, more stable, easier to patch bugs in and 
generally just be a better all around things for Python developers.


I'd love to hear some feedback on the idea.



I think your reasoning is sound.  I probably wouldn't make a lot of 
use of it, but I live in Embedded Systems land where it's notoriously 
hard to do CI off the target silicon.  Other people living in more 
tractable problem spaces will probably be more enthusiastic.


Thank you for your reply. I'll keep working on this project and see how 
it turns out. I'm quite excited about it actually as I find that most 
CI/CD systems are so complicated when it comes to simple tasks. I want 
to build something where the developer spends 10 minutes reading the 
documentation and then can do 90% of what he needs with no more hand 
holding or Googling.


--
https://mail.python.org/mailman/listinfo/python-list


Re: Would you be interested in this Python open source project?

2019-10-08 Thread Bill Deegan
You might just consider working with the BuildBot project to add support
for lighter weight build workers.
Re-Re-Re-inventing the wheel is almost always wasted effort.

On Tue, Oct 8, 2019 at 8:33 AM Rhodri James  wrote:

> On 08/10/2019 11:22, Simon Connah wrote:
> > I'm posting this message as a way to gauge interest in the project and
> > to see if it is worth moving forward with. There are probably hundreds
> > of CI/CD tools out there and many more general devops tools but what I
> > want to build is a CI/CD tool that ONLY supports Python 3.6 or greater
> > and only runs on one Linux distribution (my preference is Ubuntu). This
> > way configuration would be much more simple than the vast majority of
> > devops tools which try to support every programming language that is
> > popular (or so it seems) on many different Linux distributions and even
> > Windows and macOS.
> >
> > My theory is that if you limit the devops tool to a very limited
> > subsection of the available options the system will be easier to
> > configure for users, more stable, easier to patch bugs in and generally
> > just be a better all around things for Python developers.
> >
> > I'd love to hear some feedback on the idea.
> >
>
> I think your reasoning is sound.  I probably wouldn't make a lot of use
> of it, but I live in Embedded Systems land where it's notoriously hard
> to do CI off the target silicon.  Other people living in more tractable
> problem spaces will probably be more enthusiastic.
>
> --
> Rhodri James *-* Kynesim Ltd
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Would you be interested in this Python open source project?

2019-10-08 Thread Rhodri James

On 08/10/2019 11:22, Simon Connah wrote:
I'm posting this message as a way to gauge interest in the project and 
to see if it is worth moving forward with. There are probably hundreds 
of CI/CD tools out there and many more general devops tools but what I 
want to build is a CI/CD tool that ONLY supports Python 3.6 or greater 
and only runs on one Linux distribution (my preference is Ubuntu). This 
way configuration would be much more simple than the vast majority of 
devops tools which try to support every programming language that is 
popular (or so it seems) on many different Linux distributions and even 
Windows and macOS.


My theory is that if you limit the devops tool to a very limited 
subsection of the available options the system will be easier to 
configure for users, more stable, easier to patch bugs in and generally 
just be a better all around things for Python developers.


I'd love to hear some feedback on the idea.



I think your reasoning is sound.  I probably wouldn't make a lot of use 
of it, but I live in Embedded Systems land where it's notoriously hard 
to do CI off the target silicon.  Other people living in more tractable 
problem spaces will probably be more enthusiastic.


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Would you be interested in this Python open source project?

2019-10-08 Thread Simon Connah
I'm posting this message as a way to gauge interest in the project and 
to see if it is worth moving forward with. There are probably hundreds 
of CI/CD tools out there and many more general devops tools but what I 
want to build is a CI/CD tool that ONLY supports Python 3.6 or greater 
and only runs on one Linux distribution (my preference is Ubuntu). This 
way configuration would be much more simple than the vast majority of 
devops tools which try to support every programming language that is 
popular (or so it seems) on many different Linux distributions and even 
Windows and macOS.


My theory is that if you limit the devops tool to a very limited 
subsection of the available options the system will be easier to 
configure for users, more stable, easier to patch bugs in and generally 
just be a better all around things for Python developers.


I'd love to hear some feedback on the idea.

--
https://mail.python.org/mailman/listinfo/python-list


Re: What's the latest best practice on Python project directory layouts?

2019-06-14 Thread Cameron Simpson

On 14Jun2019 09:23, Malcolm Greene  wrote:

I have a collection of command line scripts that share a collection of common 
modules. This code collection is for internal use and will run under a single 
version of Python 3.6+ and a single OS. My understanding of best practice is to 
organize this collection of Python files into a folder structure like this:

# common files
.gitignore
readme.md
requirements.txt
setup.py  <--- what is the advantage of this file for internally distributed 
code bases?

# app specific package folders
app-1
   __init__.py (optional; if needed)
   __main__.py
   app-1-module-1.py
   app-1-module-2.py
   app-1-module-N.py

app-2
   __init__.py (optional; if needed)
   __main__.py
   app-2-module-1.py
   app-2-module-2.py
   app-2-module-N.py

# modules shared across multiple apps
common
   common-module-1.py
   common-module-2.py
   common-module-N.py

# tests - place at package level with sub-packages for each package -OR- 
underneath each app package?
tests
   app-1
test_app-1-module-1.py
test_app-1-module-2.py
test_app-1-module-N.py
   app-2
test_app-2-module-1.py
test_app-2-module-2.py
test_app-2-module-N.py

# virtual env folder placed at same level as packages ???
venv
   

And execute each app via the following ...

python -m app-1 

Questions

1. Does the above structure sound reasonable?


Yes. Though I like to get them out of the top directory, details below.


2. Where to place virtual env files and what to call this folder? venv, .env, 
etc?


I use "venv" myself.


3. Where to put tests (pytest)? In a tests folder or under each package?


Personally, I'd do it however you would do them if the apps and the 
common modules were standalone. I use a foo_tests.py beside my foo.py 
module file myself, but a naming scheme adhering to the discoverability 
of your test running tool would also be a good choice.


4. Use a src folder or not? If so, where to put above files relative to 
the src folder?


Well, yeah. Always a subdirectory, I hate littering the top level.

Here is how I lay out a project, based on my current one (nonPython bits 
elided):


 project/
   bin/
   lib/python/all-modules-here
   venv/

Various points:

- I dislike using Python's "search for modules in the current 
 directory"; I would _always_ rather set $PYTHONPATH for specific 
 control.


- The lib/python depth is to accomodate lib/other-languages according to 
 the mix in the project.


Some context: I'm making a full stack app for a client at present. The 
client's code is like this:


 lib/python/clientname/appname/*.py

It happens that all the "common" code is in the appname subdirectory 
because it is self contained, but were it not it would be in


 lib/python/clientname/*.py

or possibly

 lib/python/clientname/util/*.py

(or "common" if you prefer).

One important aspect of this is that it lets me keep the client code 
away from conflicts with other library names, so the "clientname" module 
path component is important for this, _and_ it better labels the purpose 
of the module.


So the environment setup looks like this:

 project=/path/to/project  # or $(dirname "$0") if $0 is useful
 PYTHONPATH=$project/lib/python
 PATH=$project/bin:$project/venv/bin:$PATH
 export PYTHONPATH PATH

and the app is run:

 python -m clientname.appname args...

The app does relative imports for itself:

 from .util import SomeAppClass

and would import common code absolutely:

 from clientname.util import SomeCommonClass

In my current project I've actually got a small shell script which does 
the environment setup above and invokes the python app (or various other 
utility tasks like "init the database" etc). I find this approach 
generally useful.


Anyway, this might inform what choices you make. Happy to elaborate on 
specifics, though they get more personal and idiosyncratic the more fine 
grained we get.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


What's the latest best practice on Python project directory layouts?

2019-06-14 Thread Malcolm Greene
I have a collection of command line scripts that share a collection of common 
modules. This code collection is for internal use and will run under a single 
version of Python 3.6+ and a single OS. My understanding of best practice is to 
organize this collection of Python files into a folder structure like this:

# common files
.gitignore
readme.md
requirements.txt
setup.py  <--- what is the advantage of this file for internally distributed 
code bases?

# app specific package folders
app-1
__init__.py (optional; if needed)
__main__.py 
app-1-module-1.py
app-1-module-2.py
app-1-module-N.py

app-2
__init__.py (optional; if needed)
__main__.py 
app-2-module-1.py
app-2-module-2.py
app-2-module-N.py

# modules shared across multiple apps
common
common-module-1.py
common-module-2.py
common-module-N.py

# tests - place at package level with sub-packages for each package -OR- 
underneath each app package?
tests
app-1
 test_app-1-module-1.py
 test_app-1-module-2.py
 test_app-1-module-N.py
app-2
 test_app-2-module-1.py
 test_app-2-module-2.py
 test_app-2-module-N.py

# virtual env folder placed at same level as packages ???
venv


And execute each app via the following ...

python -m app-1 

Questions

1. Does the above structure sound reasonable?
2. Where to place virtual env files and what to call this folder? venv, .env, 
etc?
3. Where to put tests (pytest)? In a tests folder or under each package?
4. Use a src folder or not? If so, where to put above files relative to the src 
folder?

Malcolm

-- 
https://mail.python.org/mailman/listinfo/python-list


[Project Announcement] tglogger: Sending Live Logging Records to A Python Chat

2019-05-14 Thread Eray Erdin
I hereby announce my new project called tglogger to Python community. Check
it out here <https://github.com/erayerdin/tglogger>.

*What It Does*

tglogger contains custom handler and formatter implementations in order to
send logging records directly to a chat, which means you get logging feed
from your application almost instantly.

*Features*

 - The message has hashtags so that you can search chat history easily.
 - Can be integrated with Django. Even date time stamp in the message is
integrated to Django's settings.
 - Message contains detailed info about log record, such as hashtagged
level, which file and line the log was captured, under which method or
function the log occured, information about process and thread.

Contributions, reviews and usages are very welcome.

Have a good day.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Mailing List Digest Project

2019-03-29 Thread Jason Friedman
>
>  Pretty cool.  FYI, the index page (now containing 4 articles) with Google
>> Chrome 72.0.3626.x prompts me to translate to French.  The articles
>> themselves do not.
>>
>
> I'm now getting the translation offer on other web pages with Chrome, not
just this one.
Thus, please ignore my prior posting.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Mailing List Digest Project

2019-03-27 Thread Abdur-Rahmaan Janhangeer
continuing a better effort here:
https://github.com/PythonCHB/PythonListsSummaries
moving to an impersonal repo later!


Garanti
sans virus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Mailing List Digest Project

2019-03-27 Thread Abdur-Rahmaan Janhangeer
hum maybe beacuse i speak french some settings got configured but i don't
see how. btw we are moving to a better repo with sphinx


Garanti
sans virus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Mar 28, 2019 at 5:48 AM Jason Friedman  wrote:

> On Mon, Mar 25, 2019 at 11:03 PM Abdur-Rahmaan Janhangeer <
> arj.pyt...@gmail.com> wrote:
>
> > As proposed on python-ideas, i setup a repo to turn mail threads into
> > articles.
> >
> > i included a script to build .md to .html (with syntax highlighting) here
> > is the index
> >
> > https://abdur-rahmaanj.github.io/py-mailing-list-summary/
> >
> >  Pretty cool.  FYI, the index page (now containing 4 articles) with
> Google
> Chrome 72.0.3626.x prompts me to translate to French.  The articles
> themselves do not.
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Abdur-Rahmaan Janhangeer
http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Mailing List Digest Project

2019-03-27 Thread Jason Friedman
On Mon, Mar 25, 2019 at 11:03 PM Abdur-Rahmaan Janhangeer <
arj.pyt...@gmail.com> wrote:

> As proposed on python-ideas, i setup a repo to turn mail threads into
> articles.
>
> i included a script to build .md to .html (with syntax highlighting) here
> is the index
>
> https://abdur-rahmaanj.github.io/py-mailing-list-summary/
>
>  Pretty cool.  FYI, the index page (now containing 4 articles) with Google
Chrome 72.0.3626.x prompts me to translate to French.  The articles
themselves do not.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Mailing List Digest Project

2019-03-26 Thread Abdur-Rahmaan Janhangeer
#agree
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Mailing List Digest Project

2019-03-26 Thread Christopher Barker
 On Tue, Mar 26, 2019 at 8:32 AM Abdur-Rahmaan Janhangeer <
arj.pyt...@gmail.com> wrote:

> Great! will see sphinx but if i find the html hard to customise, i'll drop
> it.
>

Sphinx has theming support, plus you can do custom CSS if you want. But
Highly discourage you from worrying about formatting — decent structure is
good enough, and content is what matters.

Search feature and tags coming.
>

Sphinx has search built in.

also, currently i'm formatting the mails rather than an article, i don't
> know if a real summary of the topic preferable ...
>

These mailing lists are really big, and the threads are long and scattered,
and they are archived and searchable already.

So I think the real value would be article-style summaries (with links to
the threads).

For Python-Ideas, I’m thinking kind of a mini rejected PEP ...

-CHB

>





> Abdur-Rahmaan Janhangeer
> Mauritius
>
-- 
Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Mailing List Digest Project

2019-03-26 Thread Christopher Barker
On Mon, Mar 25, 2019 at 10:01 PM Abdur-Rahmaan Janhangeer <
arj.pyt...@gmail.com> wrote:

> As proposed on python-ideas, i setup a repo to turn mail threads into
> articles.
>

Thanks for doing this — I find myself frequently telling people about past
relevant threads on this list - it will be great to have a single place to
point people. It can be hard to find stuff in the archives if you’re not
sure what to search for.

here is the repo
>
> https://github.com/Abdur-rahmaanJ/py-mailing-list-summary
>
> i included a script to build .md to .html
>

Maybe Sphinx and  RST instead? For consistency with other Python docs?

But markup is far less important than content.

-CHB

(with syntax highlighting) here is the index
>
> https://abdur-rahmaanj.github.io/py-mailing-list-summary/
>
> included 3 articles as a start
>
> if you want to contribute an article, just follow existing .md format and
> put it in the .md folder
>
> planning to go across ideas, list and dev
>
> i can tell you, it's a really enjoyable experience.
>
> psst. we can enhance some html later
>
> --
> Abdur-Rahmaan Janhangeer
> Mauritius
>
-- 
Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Mailing List Digest Project

2019-03-26 Thread Abdur-Rahmaan Janhangeer
Great! will see sphinx but if i find the html hard to customise, i'll drop
it.

Search feature and tags coming.

also, currently i'm formatting the mails rather than an article, i don't
know if a real summary of the topic preferable ...

Abdur-Rahmaan Janhangeer
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


The Mailing List Digest Project

2019-03-25 Thread Abdur-Rahmaan Janhangeer
As proposed on python-ideas, i setup a repo to turn mail threads into
articles.

here is the repo

https://github.com/Abdur-rahmaanJ/py-mailing-list-summary

i included a script to build .md to .html (with syntax highlighting) here
is the index

https://abdur-rahmaanj.github.io/py-mailing-list-summary/

included 3 articles as a start

if you want to contribute an article, just follow existing .md format and
put it in the .md folder

planning to go across ideas, list and dev

i can tell you, it's a really enjoyable experience.

psst. we can enhance some html later

-- 
Abdur-Rahmaan Janhangeer
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


Slack NLP : open source project

2018-12-30 Thread bhagvanarch
If you would like to join the slack NLP project, please share your github id to 
email address is bhagv...@quanticacomputacao.com or bhagv...@gmail.com.


Slack NLP github repository

https://github.com/bhagvank/slacknlp



Slack channel

http://goo.gl/BMGHjr



Telegram group

https://t.me/joinchat/KisuQBRcgs9F7x6lQESpmg



check out my latest presentation on open source project-SlackNLP at Pycon 2018

https://goo.gl/hpWu12
-- 
https://mail.python.org/mailman/listinfo/python-list


Monte Carlo Quant: Opensource project

2018-12-29 Thread bhagvanarch
Quantica computacao has started an open source initiative in python. We invite 
students and professionals to be part of it . My email address is 
bhagv...@quanticacomputacao.com or bhagvana...@gmail.com

Repository link is : https://github.com/bhagvank/Montecarlo_Quant
If you want to participate and get invitation, please share the github ids.



A slack channel for monte carlo open source:

https://goo.gl/iM29fH

Telegram Group for Monte Carlo Open source:

https://t.me/joinchat/KisuQBYtJbinYm5tBytOTw
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Project Structure for Backend ETL Project

2018-08-21 Thread Terry Reedy

On 8/21/2018 11:46 AM, Jeff M wrote:

Is this a good example to follow for a project that does mostly python to 
interact with external data sources including files, transformation, and import 
into Postgres?

https://github.com/bast/somepackage


AFAIK, the recommendations in the README are a plausible beginning. 
Some of them obviously depend on programming philosophy and tyle. 
Depending on your background (other languages), you might prefer 
unittest to pytest.  You might prefer another code checker to pycodestyle.



I have a SWE background but not with python, and I want to make sure my team is 
following good practices.


I think the most important 'good practice' is rigorous testing, with  at 
least the basics repeated with every commit.


  I am aware of pep8 but does that have project structure examples also?

If you intend to use github, I would look at a few other packages on github.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Project Structure for Backend ETL Project

2018-08-21 Thread Jeff M
Is this a good example to follow for a project that does mostly python to 
interact with external data sources including files, transformation, and import 
into Postgres?

https://github.com/bast/somepackage

I have a SWE background but not with python, and I want to make sure my team is 
following good practices.  I am aware of pep8 but does that have project 
structure examples also?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Design of my project

2018-06-14 Thread ftg
Hello,

thanks for this nice answer I didn't see at first (I have parallely asked again 
in the list, sorry about the inconvenience).
I will read deeply your proposal I will come bakc with my quesitons if any ;)

Thanks!

June 14 2018 12:37 AM, "Cameron Simpson"  wrote:
> On 13Jun2018 15:23, Fabien LUCE  wrote:
> 
>> Here is a small picture of my project.
>> I'd like to fetch several datas from a website representing races results.
>> Each line of the result contains rank, runner's name and other attributes
>> of the runner (like club etc...).
>> For now I have created 2 classes (Race and Runner).
>> Methods of Race allow me to fetch datas on the www thanks to beautifulsoup
>> module.I instanciate a race at the beginning of the scan and for each line
>> I instanciate a Runner.
>> I want to store all those information in a database (for both Race and
>> Runner), but here is the point, I have the feeling, on a programming
>> elegance point of view, that I have to separate methods that fetch from
>> method that store and also have a kind of superior object that controls
>> those 2 features.
>> Moreover fetching will interact with storage: if race is already in
>> database, no need to fetch again.
>> How should I "design" this? Should I have only (despite my first
>> impression) one class and all the methods in it? Should I create a parent
>> class along with 2 childrens that manage the two kind of methods?
>> Is there a design pattern for this?
> 
> My inclination would be to start by providing a class which "wraps" your Race 
> database table, and
> presents it as a mapping.
> 
> Something along the lines of:
> 
> class RaceTable:
> def __init__(self, database_connection, table_name):
> self.conn = database_connection
> self.table_name = table_name
> def __contains__(self, race_id):
> ... do SQL to see if the race_id is already present, return True or False
> def __getitem__(self, race_id):
> ... do SQL to fetch a Race row from the table and return it ...
> def __setitem__(self, race_id, race_info):
> ... do SQL to store race_info in the table ...
> 
> The special __foo__ methods (called "dunder" methods in the Puython world 
> because of the "double
> underscore") are what make the class look like a Python "dict" from outside: 
> when you perform a
> mapping method like "value in x" or "x[key] = value", Python calls 
> x.__contains__ or x.__setitem__
> for you.
> 
> Look up "Emulating Container Types" here:
> 
> https://docs.python.org/3/reference/datamodel.html#emulating-container-types
> 
> That will show you how to write a class like the above example to implement a 
> "maping" interface.
> You don't need to implement everything, just what you need. The example above 
> only implements 3
> methods.
> 
> Then your outer code can look a bit like:
> 
> race_store = RaceTable(database_connection, 'race_table_name_here')
> ...
> if race_id in race_store:
> ... mention that this race_id is already stored ...
> else:
> race_store[race_id] = race_info
> 
> So the objective here is a simple class that makes it easy to talk about 
> where your information is
> stored in nice Pythonic terms, and which hides the details of database access 
> - that lets you talk
> about the data in a sensbile and clear way outside the storage class, and 
> also leaves scrope for
> changing the storage mechanism later without changing the main code (eg from 
> a conventional SQL
> database to some other service).
> 
> Cheers,
> Cameron Simpson 
> -- https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Design of my project

2018-06-13 Thread Cameron Simpson

On 13Jun2018 15:23, Fabien LUCE  wrote:

Here is a small picture of my project.
I'd like to fetch several datas from a website representing races results.
Each line of the result contains rank, runner's name and other attributes
of the runner (like club etc...).
For now I have created 2 classes (Race and Runner).
Methods of Race allow me to fetch datas on the www thanks to beautifulsoup
module.I instanciate a race at the beginning of the scan and for each line
I instanciate a Runner.
I want to store all those information in a database (for both Race and
Runner), but here is the point, I have the feeling, on a programming
elegance point of view, that I have to separate methods that fetch from
method that store and also have a kind of superior object that controls
those 2 features.
Moreover fetching will interact with storage: if race is already in
database, no need to fetch again.
How should I "design" this? Should I have only (despite my first
impression) one class and all the methods in it? Should I create a parent
class along with 2 childrens that manage the two kind of methods?
Is there a design pattern for this?


My inclination would be to start by providing a class which "wraps" your Race 
database table, and presents it as a mapping.


Something along the lines of:

 class RaceTable:
   def __init__(self, database_connection, table_name):
 self.conn = database_connection
 self.table_name = table_name
   def __contains__(self, race_id):
 ... do SQL to see if the race_id is already present, return True or False
   def __getitem__(self, race_id):
 ... do SQL to fetch a Race row from the table and return it ...
   def __setitem__(self, race_id, race_info):
 ... do SQL to store race_info in the table ...

The special __foo__ methods (called "dunder" methods in the Puython world 
because of the "double underscore") are what make the class look like a Python 
"dict" from outside: when you perform a mapping method like "value in x" or 
"x[key] = value", Python calls x.__contains__ or x.__setitem__ for you.


Look up "Emulating Container Types" here:

 https://docs.python.org/3/reference/datamodel.html#emulating-container-types

That will show you how to write a class like the above example to implement a 
"maping" interface. You don't need to implement everything, just what you need.  
The example above only implements 3 methods.


Then your outer code can look a bit like:

 race_store = RaceTable(database_connection, 'race_table_name_here')
 ...
 if race_id in race_store:
   ... mention that this race_id is already stored ...
 else:
   race_store[race_id] = race_info

So the objective here is a simple class that makes it easy to talk about where 
your information is stored in nice Pythonic terms, and which hides the details 
of database access - that lets you talk about the data in a sensbile and clear 
way outside the storage class, and also leaves scrope for changing the storage 
mechanism later without changing the main code (eg from a conventional SQL 
database to some other service).


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Design of my project

2018-06-13 Thread Fabien LUCE
 Hello everyone,

Here is a small picture of my project.
I'd like to fetch several datas from a website representing races results.
Each line of the result contains rank, runner's name and other attributes
of the runner (like club etc...).
For now I have created 2 classes (Race and Runner).
Methods of Race allow me to fetch datas on the www thanks to beautifulsoup
module.I instanciate a race at the beginning of the scan and for each line
I instanciate a Runner.
I want to store all those information in a database (for both Race and
Runner), but here is the point, I have the feeling, on a programming
elegance point of view, that I have to separate methods that fetch from
method that store and also have a kind of superior object that controls
those 2 features.
Moreover fetching will interact with storage: if race is already in
database, no need to fetch again.
How should I "design" this? Should I have only (despite my first
impression) one class and all the methods in it? Should I create a parent
class along with 2 childrens that manage the two kind of methods?
Is there a design pattern for this?

I precise I am relatively new in "intelligent" python programming ;)

Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


Project tree and import module

2018-06-08 Thread ftg
Hello,

here is my project hierarchy:
myproject
 |
 |- django-project-name
 | |- django-project-name
 | | |-urls.py
 | | |-views.py
 | |- manage.py
 |- my-package

Is my projet tree correct? Shouldn't I put my-package into my 
django-project-name folder?
Because I am facing some questionning about how to reach my-package from 
views.py and in the current situation, 
I have to insert a sys.path.append line (with full path) in my views.py file, 
and I don't find this very elegant.
What if my package is really in another folder location? Should I need to use 
the sys.path.append function anyway?

Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


css script project refractor code

2018-05-18 Thread Abdur-Rahmaan Janhangeer
i have a project at :

README :
https://github.com/Abdur-rahmaanJ/css-script/blob/master/README.md

SITE :
https://abdur-rahmaanj.github.io/css-script/

and i want to refractor the main file :

https://github.com/Abdur-rahmaanJ/css-script/blob/master/css_script/main.py

if this was an old project of yours, what advices do you give for
improvements?

Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
-- 
https://mail.python.org/mailman/listinfo/python-list


How would you split project into 2 parts?

2018-04-24 Thread Viacheslav Kondratiuk
I need to split a project into 2 parts. To have one part as the main
project and include the second one as a submodule. Those parts located at
different parts of a project.

I can see 2 ways how I can do that:
1. Use PyCharm Refactor->Move functionality. It works fine. It takes a
module or a package, changes all project imports to a new namespace, sorts
those imports according to pep8 (which is not necessary and seems there is
no way to disable it). There are 2 problems with this approach:
a. If I want to move a module to a new package I have to recreate manually
whole dir tree.
b. It's too slow. It takes nearly 1 hour to move a package with 11 modules
into a new namespace.

2. I wrote a script. It has a mapping from an old_path to a new_path. I
extract all namespaces from old_path and replace those with new_path
namespaces by iterating over all *.py files from a project. I can use
fileinput module to replace namespaces in inplace. And when it's done apply
git mv for all specified path.

I wonder if there any tool to do that about which I don't know? Do you see
any problems with my approach? How would you do that?

- Slava
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: py2exe maintainer abandoned the project; is there any replacements? Or, anyone willing to continue the work?

2018-02-21 Thread Kryptxy via Python-list
I like pyinstaller. It's one-file exe creation is pretty good. You can give it 
a try.

 Original Message 
On 21 Feb 2018, 23:00, MGHSM wrote:

> Am 21.02.18 um 18:30 schrieb MGHSM: > Thomas Heller himself says he's 
> "retiring" from py2exe in 
> https://sourceforge.net/p/py2exe/mailman/message/36033869/ > > Is there any 
> suitable replacement with similar or better capabilities? > There is 
> PyInstaller, which works on all major OS: http://www.pyinstaller.org/ 
> Christian -- https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: py2exe maintainer abandoned the project; is there any replacements? Or, anyone willing to continue the work?

2018-02-21 Thread Christian Gollwitzer

Am 21.02.18 um 18:30 schrieb MGHSM:

Thomas Heller himself says he's "retiring" from py2exe in 
https://sourceforge.net/p/py2exe/mailman/message/36033869/

Is there any suitable replacement with similar or better capabilities?


There is PyInstaller, which works on all major OS:

http://www.pyinstaller.org/

Christian
--
https://mail.python.org/mailman/listinfo/python-list


py2exe maintainer abandoned the project; is there any replacements? Or, anyone willing to continue the work?

2018-02-21 Thread MGHSM
Thomas Heller himself says he's "retiring" from py2exe in 
https://sourceforge.net/p/py2exe/mailman/message/36033869/

Is there any suitable replacement with similar or better capabilities?

Is there any desires to continue the project?
-- 
https://mail.python.org/mailman/listinfo/python-list


Install PyDev package or any other regular package during runtime in the python project

2018-01-31 Thread user2301
I am trying to dynamically install PyDev package at runtime. I have a PyDev 
project created in eclipse. I have a PyDev package on network location. Based 
on some configuration and input in my PyDev project, I want to install and load 
the PyDev package from network location. The classes contained in modules 
within this package will be used later. How can I install the regular(PyDev 
package) at runtime?. Is it possible to install the package at runtime? To 
which location I have to add this package ? project root directory or sys.path?

What I had done: I had created the PyDev package inside my project root 
directory. Then import the module in the package dynamically.

from pydoc import locate

#package already created/installed within the project root
def load(self):
  myclass = locate('package.module.classname') #importing module dynamically
  instance = myclass()

what I need to do:

from pydoc import locate

#package not yet installed within the project root
def load(self):
  # install the module first from given network path? how?
  myclass = locate('package.module.classname') #importing module 
 dynamically
  instance = myclass()
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OT: MPC-HC project ending? [Re: Lies in education [was Re: The "loop and a half"]]

2017-10-12 Thread breamoreboy
On Thursday, October 12, 2017 at 12:33:09 PM UTC+1, Chris Angelico wrote:
> On Thu, Oct 12, 2017 at 8:12 PM, Thomas Jollans wrote:
> > On 2017-10-12 02:51, Chris Angelico wrote:
> >> If it wants new life, it's probably going to need a Linux version,
> >> because that's where a lot of developers hang out. The reality is that
> >> open source developers are much more likely to develop on Linux than
> >> on Windows; you can maintain a Windows port of a Linux program with
> >> fewer Windows experts than maintaining the entire program on Windows.
> >>
> >> The other option, though, would be for the useful parts to become
> >> feature suggestions for VLC.
> >
> >
> > It's the year of the Linux desktop!
> >
> > (No, actually, that was a few years ago, but nobody noticed at the time)
> 
> I'm typing this up from my primary Linux system. Beside me, my laptop
> also runs Linux. I use these computers for basically everything -
> coding, testing, work, gaming, the lot. Just finished playing an
> episode of The Walking Dead, streamed to Twitch.tv; yes, that game
> wasn't released for Linux, but thanks to Wine, I can run the Windows
> version, and it's flawless.
> 
> It's the year of the Linux desktop alright. Has been for some time,
> gonna still be for a while yet.
> 
> ChrisA

I have to agree as I've now moved to Linux, Ubuntu as it happens.  I wish I'd 
done it years ago as it feels as if I've had a major hardware upgrade as it's 
so much more responsive.  The most noticeable thing is that when watching 
videos from YouTube the sound and picture always stay in sync.  Not a chance of 
that with Windows 10.

--
Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OT: MPC-HC project ending? [Re: Lies in education [was Re: The "loop and a half"]]

2017-10-12 Thread Chris Angelico
On Thu, Oct 12, 2017 at 8:12 PM, Thomas Jollans  wrote:
> On 2017-10-12 02:51, Chris Angelico wrote:
>> If it wants new life, it's probably going to need a Linux version,
>> because that's where a lot of developers hang out. The reality is that
>> open source developers are much more likely to develop on Linux than
>> on Windows; you can maintain a Windows port of a Linux program with
>> fewer Windows experts than maintaining the entire program on Windows.
>>
>> The other option, though, would be for the useful parts to become
>> feature suggestions for VLC.
>
>
> It's the year of the Linux desktop!
>
> (No, actually, that was a few years ago, but nobody noticed at the time)

I'm typing this up from my primary Linux system. Beside me, my laptop
also runs Linux. I use these computers for basically everything -
coding, testing, work, gaming, the lot. Just finished playing an
episode of The Walking Dead, streamed to Twitch.tv; yes, that game
wasn't released for Linux, but thanks to Wine, I can run the Windows
version, and it's flawless.

It's the year of the Linux desktop alright. Has been for some time,
gonna still be for a while yet.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OT: MPC-HC project ending? [Re: Lies in education [was Re: The "loop and a half"]]

2017-10-12 Thread Thomas Jollans
On 2017-10-12 02:51, Chris Angelico wrote:
> If it wants new life, it's probably going to need a Linux version,
> because that's where a lot of developers hang out. The reality is that
> open source developers are much more likely to develop on Linux than
> on Windows; you can maintain a Windows port of a Linux program with
> fewer Windows experts than maintaining the entire program on Windows.
> 
> The other option, though, would be for the useful parts to become
> feature suggestions for VLC.


It's the year of the Linux desktop!

(No, actually, that was a few years ago, but nobody noticed at the time)


-- 
Thomas Jollans

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OT: MPC-HC project ending? [Re: Lies in education [was Re: The "loop and a half"]]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 11:38 AM, boB Stepp  wrote:
> On Wed, Oct 11, 2017 at 4:45 PM, Mikhail V  wrote:
>
>>
>> PS Off-topic:
>> I have a related observation regarding popularity of software.
>> There is such a program "VLC", which is a video player. Some would
>> think it is sort of best free player, etc. I was also under impression,
>> but then I've found a video player called "MPC-HC".
>> I have started to use it and quickly understood that it is by far more
>> superior player than VLC, literally by all core parameters - performance,
>> codec support, customizable key bindings with a lot of internal commands.
>> (Remark for Linux users: there is no Linux version of that player, it
>> is Windows-only)
>
> I went to https://mpc-hc.org/2017/07/16/1.7.13-released-and-farewell/
> and it says:
>
> 
>
>  July 16, 2017  XhmikosR
>
> v1.7.13, the latest, and probably the last release of our project…
>
> For quite a few months now, or even years, the number of active
> developers has been decreasing and has inevitably reached zero. This,
> unfortunately, means that the project is officially dead and this
> release would be the last one.
>
> …Unless some people step up that is.
>
> So, if someone’s willing to really contribute and has C/C++
> experience, let me know on IRC or via e-mail.
>
> Otherwise, all things come to an end and life goes on. It’s been a
> nice journey and I’m personally pretty overwhelmed having to write
> this post.
>
> Thanks to everyone who has contributed in any way all these years;
> Remember, MPC-HC is an 11-year old project.
>
> 

If it wants new life, it's probably going to need a Linux version,
because that's where a lot of developers hang out. The reality is that
open source developers are much more likely to develop on Linux than
on Windows; you can maintain a Windows port of a Linux program with
fewer Windows experts than maintaining the entire program on Windows.

The other option, though, would be for the useful parts to become
feature suggestions for VLC.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


OT: MPC-HC project ending? [Re: Lies in education [was Re: The "loop and a half"]]

2017-10-11 Thread boB Stepp
On Wed, Oct 11, 2017 at 4:45 PM, Mikhail V  wrote:

>
> PS Off-topic:
> I have a related observation regarding popularity of software.
> There is such a program "VLC", which is a video player. Some would
> think it is sort of best free player, etc. I was also under impression,
> but then I've found a video player called "MPC-HC".
> I have started to use it and quickly understood that it is by far more
> superior player than VLC, literally by all core parameters - performance,
> codec support, customizable key bindings with a lot of internal commands.
> (Remark for Linux users: there is no Linux version of that player, it
> is Windows-only)

I went to https://mpc-hc.org/2017/07/16/1.7.13-released-and-farewell/
and it says:



 July 16, 2017  XhmikosR

v1.7.13, the latest, and probably the last release of our project…

For quite a few months now, or even years, the number of active
developers has been decreasing and has inevitably reached zero. This,
unfortunately, means that the project is officially dead and this
release would be the last one.

…Unless some people step up that is.

So, if someone’s willing to really contribute and has C/C++
experience, let me know on IRC or via e-mail.

Otherwise, all things come to an end and life goes on. It’s been a
nice journey and I’m personally pretty overwhelmed having to write
this post.

Thanks to everyone who has contributed in any way all these years;
Remember, MPC-HC is an 11-year old project.






-- 
boB
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: django project avoid reload page where work algorithm

2017-10-08 Thread Richard Damon

On 10/8/17 4:46 PM, Xristos Xristoou wrote:

Τη Κυριακή, 8 Οκτωβρίου 2017 - 10:48:38 μ.μ. UTC+3, ο χρήστης Richard Damon 
έγραψε:

On 10/8/17 11:58 AM, Xristos Xristoou wrote:

Τη Κυριακή, 8 Οκτωβρίου 2017 - 6:35:28 μ.μ. UTC+3, ο χρήστης MRAB έγραψε:

On 2017-10-08 15:27, Xristos Xristoou wrote:



Do you mean "long reload"?


user can put some numbers in my html template and i take that numbers and i sue 
it in specific mathematical algorithm that algorithm to create result need time 
 between 5-10 minutes in that time browser stay on reload...that i mean



It sounds like the fundamental problem is that you are doing the
calculation in the web page handler. This means that the browser will be
stuck in the page load until the calculation finishes, and that if the
user aborts the access (or loses connection) then the web page handler
is aborted.

What you need to do is rather than doing the calculation in the page
handler, you need to kick off an independent process to do the
calculation, and then immediately finish the page (maybe giving the use
a link to a page they can check to see if a result is available).


yes this is nice can you help me to do that?



I haven't done it myself, but you may want to look at the various 
os.spawn* methods.

--
https://mail.python.org/mailman/listinfo/python-list


Re: django project avoid reload page where work algorithm

2017-10-08 Thread Michael Torrie
On 10/08/2017 02:46 PM, Xristos Xristoou wrote:
> Τη Κυριακή, 8 Οκτωβρίου 2017 - 10:48:38 μ.μ. UTC+3, ο χρήστης Richard Damon 
> έγραψε:
>> It sounds like the fundamental problem is that you are doing the 
>> calculation in the web page handler. This means that the browser will be 
>> stuck in the page load until the calculation finishes, and that if the 
>> user aborts the access (or loses connection) then the web page handler 
>> is aborted.
>>
>> What you need to do is rather than doing the calculation in the page 
>> handler, you need to kick off an independent process to do the 
>> calculation, and then immediately finish the page (maybe giving the use 
>> a link to a page they can check to see if a result is available).
> 
> yes this is nice can you help me to do that?

I'm sure google can give you some ideas on how to implement this.  Have
you done a google search? Maybe start with the terms "django
long-running process" and see what comes up. Good luck.  Learning is a
fun adventure!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: django project avoid reload page where work algorithm

2017-10-08 Thread Xristos Xristoou
Τη Κυριακή, 8 Οκτωβρίου 2017 - 10:48:38 μ.μ. UTC+3, ο χρήστης Richard Damon 
έγραψε:
> On 10/8/17 11:58 AM, Xristos Xristoou wrote:
> > Τη Κυριακή, 8 Οκτωβρίου 2017 - 6:35:28 μ.μ. UTC+3, ο χρήστης MRAB έγραψε:
> >> On 2017-10-08 15:27, Xristos Xristoou wrote:
> > 
> >> Do you mean "long reload"?
> > 
> > user can put some numbers in my html template and i take that numbers and i 
> > sue it in specific mathematical algorithm that algorithm to create result 
> > need time  between 5-10 minutes in that time browser stay on reload...that 
> > i mean
> > 
> 
> It sounds like the fundamental problem is that you are doing the 
> calculation in the web page handler. This means that the browser will be 
> stuck in the page load until the calculation finishes, and that if the 
> user aborts the access (or loses connection) then the web page handler 
> is aborted.
> 
> What you need to do is rather than doing the calculation in the page 
> handler, you need to kick off an independent process to do the 
> calculation, and then immediately finish the page (maybe giving the use 
> a link to a page they can check to see if a result is available).

yes this is nice can you help me to do that?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: django project avoid reload page where work algorithm

2017-10-08 Thread Richard Damon

On 10/8/17 11:58 AM, Xristos Xristoou wrote:

Τη Κυριακή, 8 Οκτωβρίου 2017 - 6:35:28 μ.μ. UTC+3, ο χρήστης MRAB έγραψε:

On 2017-10-08 15:27, Xristos Xristoou wrote:



Do you mean "long reload"?


user can put some numbers in my html template and i take that numbers and i sue 
it in specific mathematical algorithm that algorithm to create result need time 
 between 5-10 minutes in that time browser stay on reload...that i mean



It sounds like the fundamental problem is that you are doing the 
calculation in the web page handler. This means that the browser will be 
stuck in the page load until the calculation finishes, and that if the 
user aborts the access (or loses connection) then the web page handler 
is aborted.


What you need to do is rather than doing the calculation in the page 
handler, you need to kick off an independent process to do the 
calculation, and then immediately finish the page (maybe giving the use 
a link to a page they can check to see if a result is available).

--
https://mail.python.org/mailman/listinfo/python-list


Re: django project avoid reload page where work algorithm

2017-10-08 Thread Xristos Xristoou
Τη Κυριακή, 8 Οκτωβρίου 2017 - 6:35:28 μ.μ. UTC+3, ο χρήστης MRAB έγραψε:
> On 2017-10-08 15:27, Xristos Xristoou wrote:

> Do you mean "long reload"?

user can put some numbers in my html template and i take that numbers and i sue 
it in specific mathematical algorithm that algorithm to create result need time 
 between 5-10 minutes in that time browser stay on reload...that i mean
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: django project avoid reload page where work algorithm

2017-10-08 Thread MRAB

On 2017-10-08 15:27, Xristos Xristoou wrote:



You can use the smtplib module to send an email.
  


ok but how to avoid pong reload on page ?can you help me ?


Do you mean "long reload"?

If you have the user's email address from when they registered, you 
could have the user log in to get the results. If the user has closed 
the window, or the session has expired, well they'd have to log in 
again.

--
https://mail.python.org/mailman/listinfo/python-list


Re: django project avoid reload page where work algorithm

2017-10-08 Thread Xristos Xristoou

> You can use the smtplib module to send an email.
 

ok but how to avoid pong reload on page ?can you help me ?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: django project avoid reload page where work algorithm

2017-10-08 Thread MRAB

On 2017-10-08 11:27, Xristos Xristoou wrote:


You mentioned email, so why not just ask for an email address to which 
you will send the result?


i have user email from register i need to do all automate,how to use celery for 
this ?


You can use the smtplib module to send an email.
--
https://mail.python.org/mailman/listinfo/python-list


Re: django project avoid reload page where work algorithm

2017-10-08 Thread Xristos Xristoou

> You mentioned email, so why not just ask for an email address to which 
> you will send the result?

i have user email from register i need to do all automate,how to use celery for 
this ?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: django project avoid reload page where work algorithm

2017-10-07 Thread MRAB

On 2017-10-08 01:40, Xristos Xristoou wrote:

I have a website where the user can be put three numbers on my html template 
and get some results from my personal mathematical algorithm. the result save 
at user personal table on my database and can see in specific tab in my website.
my problem is where the algorithm to calculate result maybe take time between 
5-10 minutes in this time the browser stay on reload. if user change tab or 
close browser or maybe have problem with internet connection then loose that 
request and need again to put the numbers and again wait for results.
I want after the user request from my form in html to keep this request and 
work my algorithm without reload the page and where the algorithm finish then 
to send the user some email or message or just need the user visit the tab of 
results to see new results.
that I want to avoid the problems where the algorithm is in running and user 
loose data or request or time.
is easy to do that using suproccess,celery or RabbitMQ ?
any idea ?

[snip]

You mentioned email, so why not just ask for an email address to which 
you will send the result?

--
https://mail.python.org/mailman/listinfo/python-list


django project avoid reload page where work algorithm

2017-10-07 Thread Xristos Xristoou
I have a website where the user can be put three numbers on my html template 
and get some results from my personal mathematical algorithm. the result save 
at user personal table on my database and can see in specific tab in my website.
my problem is where the algorithm to calculate result maybe take time between 
5-10 minutes in this time the browser stay on reload. if user change tab or 
close browser or maybe have problem with internet connection then loose that 
request and need again to put the numbers and again wait for results.
I want after the user request from my form in html to keep this request and 
work my algorithm without reload the page and where the algorithm finish then 
to send the user some email or message or just need the user visit the tab of 
results to see new results.
that I want to avoid the problems where the algorithm is in running and user 
loose data or request or time.
is easy to do that using suproccess,celery or RabbitMQ ?
any idea ?
here the code
views.py
def math_alg(request):
if request.method == "POST":
test = request.POST.get('no1')
test = request.POST.get('no3')
test = request.POST.get('no3')
#start algorith
calc_math(no1,no1,no3,result)
instance = rmodel.objects.create(user=request.user,rfield=result)
instance.save
return render(request, 'page.html', {'result': result})
html :
{% csrf_token %}
  op math calculate:
  
  
  

  
{{result }}

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hatch - A modern project, package, and virtual env manager

2017-09-28 Thread ofekmeister
Hatch 0.20.0 features easy cross-platform Conda installation and interactive 
project creation! https://github.com/ofek/hatch/blob/master/HISTORY.rst#0200
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-26 Thread Ben Finney
Kryptxy via Python-list  writes:

> Yep. I will wait for a response. Thank you!

There remains, of course, the option to keep developing and distributing
the work under GNU GPL.

As Chris points out, the GNU GPL terms are plenty permissive enough and
keep the playing field guaranteed level for all. You can continue with
that license grant indefinitely.

-- 
 \  “One time I went to a drive-in in a cab. The movie cost me |
  `\  ninety-five dollars.” —Steven Wright |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Project Euler 20.

2017-09-24 Thread Paul Rubin
Ian Kelly  writes:
 sum(int(c) for c in str(math.factorial(100)))

Doh!  Using int(c) didn't occur to me and I didn't know about
math.factorial.  Notice also that WJ hasn't yet dared posting his crap
on comp.lang.haskell.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Project Euler 20.

2017-09-24 Thread Ian Kelly
On Sun, Sep 24, 2017 at 4:35 PM, Paul Rubin  wrote:
>
> "Robert L."  writes:
> >> Find the sum of the digits in the number 100!
> > In Python?
>
> So you have come to plague us here too.
>
> >>> sum(ord(c)-ord('0') for c in str(reduce(lambda a,b: a*b, range(1,101),1)))
> 648

Or for any Python 2.6 or greater:

>>> sum(int(c) for c in str(math.factorial(100)))
648
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Project Euler 20.

2017-09-24 Thread Paul Rubin
"Robert L."  writes:
>> Find the sum of the digits in the number 100!
> In Python?

So you have come to plague us here too.

>>> sum(ord(c)-ord('0') for c in str(reduce(lambda a,b: a*b, range(1,101),1)))
648
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-23 Thread Tim Chase
On 2017-09-23 19:14, Chris Angelico wrote:
> On Sat, Sep 23, 2017 at 7:07 PM, Kryptxy 
> wrote:
> > Thank you all! I opened a ticket about the same (on github).
> > I got response from most of them, and all are agreeing to the
> > change. However, one contributor did not respond at all. I tried
> > e-mailing, but no response.
> > Can I still proceed changing the licence? It has been more than a
> > week since the ticket was opened.  
> 
> Nope. Contributions made under the GPL have a guarantee that they
> will only and forever be used in open source projects. You're
> trying to weaken that guarantee, so you have to get clear
> permission from everyone involved.
> 
> Unless you can show that the contributions in question are so
> trivial that there's no code that can be pinpointed as that
> person's, or you replace all that person's code, you can't proceed
> to relicense it without permission.

Alternatively, you can rip out that contributor's code and re-code it
from scratch in a clean-room without consulting their code.  Then
their code is under their license while your re-implementation code
is under whatever license you like.

If their contributions were minor, this might be a nice route to go.
If they were a major contributor, you could be looking at a LOT of
work.

But those are your options:

- keep the project as GPL

- get *ALL* contributors to formally agree to the license change,

- confirm that the contributions of recalcitrant contributor(s)
  are limited to trivial changes, or

- recreate all GPL code in a clean-room under your own license


-tkc




-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-23 Thread Michael Torrie
On 09/23/2017 03:07 AM, Kryptxy via Python-list wrote:
> Thank you all! I opened a ticket about the same (on github).
> I got response from most of them, and all are agreeing to the change.
> However, one contributor did not respond at all. I tried e-mailing, but no 
> response.
> Can I still proceed changing the licence? It has been more than a week since 
> the ticket was opened.

If you remove the contributor's contributions from your project, then
you can proceed without his permission. Otherwise, Chris and Leam are
correct.

You could replace all the contributor's code with your own code.  This
is a bit tricky as you've seen the contributor's code.  One way around
this is to tell someone what the contributor's patch did, and have them
recreate it, without looking at that person's patch.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-23 Thread Kryptxy via Python-list
Yep. I will wait for a response. Thank you!

 Original Message 
On 23 Sep 2017, 16:57, Chris Angelico wrote:

> On Sat, Sep 23, 2017 at 7:44 PM, Leam Hall  wrote:
>> Like Chris said, evaluate the level of effort on the code. Wait, or replace.
>> You will be happier when you take the honorable path.
>
> Remembering that that, of course, is Plan B; plan A is to keep trying
> to contact that last contributor.. S/he hasn't refused, so there's
> still every possibility of getting that last okay.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list @gmail.com>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-23 Thread Chris Angelico
On Sat, Sep 23, 2017 at 7:44 PM, Leam Hall  wrote:
> Like Chris said, evaluate the level of effort on the code. Wait, or replace.
> You will be happier when you take the honorable path.

Remembering that that, of course, is Plan B; plan A is to keep trying
to contact that last contributor.. S/he hasn't refused, so there's
still every possibility of getting that last okay.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-23 Thread Leam Hall

On 09/23/2017 05:14 AM, Chris Angelico wrote:

On Sat, Sep 23, 2017 at 7:07 PM, Kryptxy  wrote:

Thank you all! I opened a ticket about the same (on github).
I got response from most of them, and all are agreeing to the change.
However, one contributor did not respond at all. I tried e-mailing, but no
response.
Can I still proceed changing the licence? It has been more than a week since
the ticket was opened.


Nope. Contributions made under the GPL have a guarantee that they will
only and forever be used in open source projects. You're trying to
weaken that guarantee, so you have to get clear permission from
everyone involved.

Unless you can show that the contributions in question are so trivial
that there's no code that can be pinpointed as that person's, or you
replace all that person's code, you can't proceed to relicense it
without permission.


I'm with Chris on this one. You made a social, and in many places 
legally binding, agreement. Can't change it without everyone's agreement.


Like Chris said, evaluate the level of effort on the code. Wait, or 
replace. You will be happier when you take the honorable path.


Leam
--
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-23 Thread Chris Angelico
On Sat, Sep 23, 2017 at 7:07 PM, Kryptxy  wrote:
> Thank you all! I opened a ticket about the same (on github).
> I got response from most of them, and all are agreeing to the change.
> However, one contributor did not respond at all. I tried e-mailing, but no
> response.
> Can I still proceed changing the licence? It has been more than a week since
> the ticket was opened.

Nope. Contributions made under the GPL have a guarantee that they will
only and forever be used in open source projects. You're trying to
weaken that guarantee, so you have to get clear permission from
everyone involved.

Unless you can show that the contributions in question are so trivial
that there's no code that can be pinpointed as that person's, or you
replace all that person's code, you can't proceed to relicense it
without permission.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-23 Thread Kryptxy via Python-list
Thank you all! I opened a ticket about the same (on github).
I got response from most of them, and all are agreeing to the change.
However, one contributor did not respond at all. I tried e-mailing, but no 
response.
Can I still proceed changing the licence? It has been more than a week since 
the ticket was opened.

Sent with [ProtonMail](https://protonmail.com) Secure Email.

>  Original Message 
> Subject: Re: Change project licence?
> Local Time: 15 September 2017 5:54 AM
> UTC Time: 15 September 2017 00:24
> From: ros...@gmail.com
> To: python-list@python.org 
>
> On Fri, Sep 15, 2017 at 10:17 AM, Ben Finney  
> wrote:
>>> I know how to change the licence, but I want to know is it fine and
>>> wise to change the licence at this point? (The project already has 19
>>> clones, 250+ GitHub stars. Here: https://github.com/kryptxy/torrench)
>>
>> Those represent a whole lot of recipients, who received GPLv3-or-later
>> license grant, guaranteeing the freedom of the work for all recipients
>> in all modified forms. I would consider it poor form to allow non-free
>> redistribution at this point.
>
> Those recipients can still do everything they previously could,
> *including redistributing the code under the GPLv3*. They have lost
> nothing.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Test Bank for Management, Operations Management, Supply Chain Management, Project Management for all editions

2017-09-21 Thread louisacorey
Organizational Behavior and Management, 11th Edition by Robert Konopaske and 
John Ivancevich and Michael Matteson
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hatch - A modern project, package, and virtual env manager

2017-09-18 Thread ofekmeister
Hatch now supports per-project package management! 
https://github.com/ofek/hatch/blob/master/HISTORY.rst#0140
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-14 Thread Chris Angelico
On Fri, Sep 15, 2017 at 10:17 AM, Ben Finney  wrote:
>> I know how to change the licence, but I want to know is it fine and
>> wise to change the licence at this point? (The project already has 19
>> clones, 250+ GitHub stars. Here: https://github.com/kryptxy/torrench)
>
> Those represent a whole lot of recipients, who received GPLv3-or-later
> license grant, guaranteeing the freedom of the work for all recipients
> in all modified forms. I would consider it poor form to allow non-free
> redistribution at this point.

Those recipients can still do everything they previously could,
*including redistributing the code under the GPLv3*. They have lost
nothing.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-14 Thread Ben Finney
Kryptxy via Python-list  writes:

> I have an opensource (python) project under GPL3 licence.

Is the license “GNU GPLv3 only”, or “GNU GPL v3 or later”, or something
else? It doesn't materially affect the question, but it will make the
discussion easier if we know what is the actual license grant.

I will assume the grant of license is “GNU GPLv3 or later”.

> I wish switch to MIT licence

You may wish that. Who else holds copyright in that work? Their
contributions – whether prior to or concurrent with or later than your
contributions – are presumably licensed to you only under the GNU
GPLv3-or-later.

> so as to make it more permissive.

So, it is a deliberate feature of that license grant that no-one who
redistributes the work, whether modified or not, can restrict the
freedoms granted by that license. How do you know that every other
copyright holder wishes to abandon that feature now?

> I know how to change the licence, but I want to know is it fine and
> wise to change the licence at this point? (The project already has 19
> clones, 250+ GitHub stars. Here: https://github.com/kryptxy/torrench)

Those represent a whole lot of recipients, who received GPLv3-or-later
license grant, guaranteeing the freedom of the work for all recipients
in all modified forms. I would consider it poor form to allow non-free
redistribution at this point.

-- 
 \   “[W]hoever is able to make you absurd is able to make you |
  `\unjust.” —Voltaire |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-14 Thread Chris Angelico
On Fri, Sep 15, 2017 at 6:04 AM, Michael Torrie  wrote:
> Finally, even if you are the sole copyright holder, while you can change
> the license on your code at any time to any terms, you cannot change the
> license on code that has already been forked under your original GPLv3
> license. In other words, if someone clones your project before the
> license change, they can continue under original license, as per its
> terms.  You can't retroactively change the license on code that's
> already been distributed, at least under the terms of the GPLv3. (I'm
> sure there's some license somewhere that expressly states the terms can
> be retroactively modified. But not the GPLv3.)

This is true; however the choice of license makes this moot. Code
licensed MIT can be used in anything, so it can be GPL3'd to go into
another project or anything. But yes, the old versions will still be
available under the terms of the GPL3; you can make them *also*
available under another license, but you aren't revoking the previous
one.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-14 Thread Michael Torrie
On 09/14/2017 11:22 AM, Kryptxy via Python-list wrote:
> Hi,
> I have an opensource (python) project under GPL3 licence. I wish
> switch to MIT licence so as to make it more permissive. I know how to
> change the licence, but I want to know is it fine and wise to change
> the licence at this point? (The project already has 19 clones, 250+
> GitHub stars. Here: https://github.com/kryptxy/torrench)

If you are the sole copyright holder on the project, and haven't taken
in any contributions from anyone else, then you can change the license
however you like, regardless of clones/forks, with the caveat below.

If you've integrated pull's from other people, then they now own a piece
of the copyright and you would have to talk to each person and get
permission to relicense their code contribution.  Note that clone of
your repo does not constitute a contribution. I'm talking about a pull
request or patch that was contributed to your mainline repo.

Finally, even if you are the sole copyright holder, while you can change
the license on your code at any time to any terms, you cannot change the
license on code that has already been forked under your original GPLv3
license. In other words, if someone clones your project before the
license change, they can continue under original license, as per its
terms.  You can't retroactively change the license on code that's
already been distributed, at least under the terms of the GPLv3. (I'm
sure there's some license somewhere that expressly states the terms can
be retroactively modified. But not the GPLv3.)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Change project licence?

2017-09-14 Thread Chris Angelico
On Fri, Sep 15, 2017 at 3:22 AM, Kryptxy via Python-list
 wrote:
> Hi,
> I have an opensource (python) project under GPL3 licence. I wish switch to 
> MIT licence so as to make it more permissive.
> I know how to change the licence, but I want to know is it fine and wise to 
> change the licence at this point?
> (The project already has 19 clones, 250+ GitHub stars. Here: 
> https://github.com/kryptxy/torrench)
>
> Thank you.

Only if every contributor says it's okay. Anything that you create
(and own copyright on), you can license under any terms you like; if
anyone else has contributed anything to the project, you have to get
their permission to relicense it.

For solo projects, that's simple. For huge things like the CPython
interpreter, it's virtually impossible.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Change project licence?

2017-09-14 Thread Kryptxy via Python-list
Hi,
I have an opensource (python) project under GPL3 licence. I wish switch to MIT 
licence so as to make it more permissive.
I know how to change the licence, but I want to know is it fine and wise to 
change the licence at this point?
(The project already has 19 clones, 250+ GitHub stars. Here: 
https://github.com/kryptxy/torrench)

Thank you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hatch - A modern project, package, and virtual env manager

2017-09-12 Thread ofekmeister
0.10.0 features environment-aware testing, full Xonsh shell support, and more 
colors! https://github.com/ofek/hatch#0100
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hatch - A modern project, package, and virtual env manager

2017-09-10 Thread ofekmeister
Hatch now supports all major shells!!! https://github.com/ofek/hatch#090
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hatch - A modern project, package, and virtual env manager

2017-09-08 Thread ofekmeister
Temporary venvs support and terminal colors in 0.8.0! 
https://github.com/ofek/hatch#080
-- 
https://mail.python.org/mailman/listinfo/python-list


  1   2   3   4   5   6   7   8   9   10   >