How to specify sqlite engine path in sqlalchemy using Zipapp

2020-01-16 Thread Abdur-Rahmaan Janhangeer
I don't know how to specify sqlalchemy's engine path for sqlite within
zipapp.

Using:

engine = create_engine('sqlite:///{}'.format(
os.path.join(dirp, 'db/items.db')
))

i get

unable to open database file

I've rounded the problem with as much info as possible here:

https://stackoverflow.com/questions/59767920/how-to-specify-sqlite-engine-path-in-sqlalchemy-using-zipapp

It seems that you can read db files from zips but i'm asking how you maange
sqlalchemy.

Thank You.

Yours,

Abdur-Rahmaan Janhangeer
pythonmembers.club  | github

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


Re: Calculator

2020-01-16 Thread samnalty
On Wednesday, 15 January 2020 17:09:56 UTC, Python  wrote:
> Le 15/01/2020 à 16:34, andersh...@gmail.com a écrit :
> > Thanks!
> 
> Do not try it, though, with a expression such as
> import os; os.system('rm -rf ~/*').

If you want something safer, https://github.com/pydata/numexpr has an 
expression function that will do the same thing.
-- 
https://mail.python.org/mailman/listinfo/python-list


IDLE, TCP/IP problem.

2020-01-16 Thread Muju's message


Sent from Mail for Windows 10

When I open IDLE a popup appears, which says

“IDLE cannot bind to a TCP/IP port, which is necessary to communicate with its 
Python execution server. This might be because no networking is installed on 
this computer. Run IDLE with the -n command line switch to start without a 
subprocess and refer to HELP/IDLE Help ‘Running without a subprocess’ for 
further detail.” 

What should I do now? I am new to python and have recently installed python 
3.8.1 in my pc (Windows 10).

Any help is appreciated 😊.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Understanding of GIL

2020-01-16 Thread Amitesh Sahay via Python-list
Hi, 

You should also undertand that Python uses GIL for Threading purpose. Yes, if 
you have functiosn that needs simulataneous execution you should use Threading 
approach. As well as if Huge data is involved then also use multi-processing 
concept as well
 

On Thursday, 19 December, 2019, 7:42:12 pm IST, onlinejudge95 
 wrote:  
 
 Hi Devs,
I am currently writing some custom Django commands for data updation, my 
workflow is like
Fetch data from PostgreSQL.Call Elasticsearch for searching based on the data 
fetched from PostgreSQL.Query PostgreSQL and do an upsert behavior.
I am using pandas data frame to hold my data during processing.

The host we are using to run this jobs has a CPython interpreter as given by

`platform.python_implementation()`

I want to confirm whether multithreading would be a better choice here, given 
the fact that GIL is the biggest blocker(I agree it has to be there) for the 
same in CPython interpreters.

In case further information is required do let me know.

Thanksonlinejudge95

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD%3DM5eRWh9-EB180f2OzvnPLHh969vgaCzFyniFRSFa1-CwUHA%40mail.gmail.com.
  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help

2020-01-16 Thread Pieter van Oostrum
kiran chawan  writes:

> Whenever Iam trying to run this 'New  latest version python software 3.8.4
> python ' but it doesn't show any install option and it say ' modify set up
> ' So tell what to do sir plz help me out.

There is no Python 3.8.4.
-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python ABI typeslots for buffer protocol

2020-01-16 Thread nerdynelsons
Still hoping a Python developer can weigh in on this or point me where to get 
this issue addressed.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-16 Thread Pieter van Oostrum
Growth Hacking Formation  writes:

> Thanks for helping. That is what I thought.
> Lets say it is the case and I get the key. We know it uses sha256 and it 
> apply to the ascii code.
> What should be the python code in this scenario?
> I am novice and the hash python module is a bit too complex for me. I read 
> the doc.
>
> Thanks.

Some of the details are still vague, but I think it must be something like this:
Here is some code that works in both Python 2 and Python 3.

import hashlib
import hmac

secretfile = '.../lmfwc-files/secret.txt' ## Fill in proper file name

with open(secretfile, 'rb') as fd:
secret = fd.read()

key = 'goldQ3T8-1QRD-5QBI-9F22'

bkey = key.encode('ascii')

h = hmac.new(secret, bkey, hashlib.sha256)

print('hd (hex): ', h.hexdigest())

-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-16 Thread centredeformationfrance
Thank you so much Pieter! Danku well

Where can I write you a review 5/5! Linkedin? Google business? Facebook page? 

Thank you!Thank you!Thank you!Thank you!Thank you! X 1! 

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


Asking for help in forward and backward propagiation in neural network.

2020-01-16 Thread Tamás Tóthpál
I have been doing an online course in data science, especially in neural 
networks. But I got stuck in the programming assignment:


Could anyone hep me out what the code will look like in this case? 
-- 
https://mail.python.org/mailman/listinfo/python-list


Extension type inherit from Python int

2020-01-16 Thread Mathias Enzensberger via Python-list

Hello,

I am trying to write an extension type that inherits from Pythons int.

Based on the documentation, 
 
this should be possible, but I checked Pythons implementation and the 
struct defining a PyLongObject uses a flexible array to store the limbs 
to support arbitrary large numbers. So having a PyLongObject as first 
member of my own types struct doesn't work because parts of the
ob_digit array would be overwritten by members defined in the subclass 
of the new type that inherits from PyLongObject.


Has anyone already done something like that? Is there some trick to 
work around that issue, or is it simply not possible to inherit from 
PyLongObject?


Thank you,

Mathias

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


Re: Asking for help in forward and backward propagiation in neural network.

2020-01-16 Thread Tamás Tóthpál
2020. január 16., csütörtök 18:25:16 UTC+1 időpontban Tamás Tóthpál a 
következőt írta:
> I have been doing an online course in data science, especially in neural 
> networks. But I got stuck in the programming assignment:
> 
> 
> Could anyone hep me out what the code will look like in this case?

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


Re: Asking for help in forward and backward propagiation in neural network.

2020-01-16 Thread Tamás Tóthpál
attached picture:
https://drive.google.com/open?id=1RnUcEhP8BEoIlsrstV3q40uUd0IuV-6v
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Extension type inherit from Python int

2020-01-16 Thread Random832
On Thu, Jan 16, 2020, at 12:33, Mathias Enzensberger via Python-list wrote:
> Has anyone already done something like that? Is there some trick to 
> work around that issue, or is it simply not possible to inherit from 
> PyLongObject?

pure-python types that derive from int place __dict__ at the end of the object, 
I don't know if it's possible for you to do the same with the fields you intend 
to add (for some reason it isn't done with __slots__), but if all else fails 
you could do the same and store whatever data you need in the dict.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Calculator

2020-01-16 Thread Python

Le 16/01/2020 à 11:56, samna...@gmail.com a écrit :

On Wednesday, 15 January 2020 17:09:56 UTC, Python  wrote:

Le 15/01/2020 à 16:34, andersh...@gmail.com a écrit :

Thanks!


Do not try it, though, with a expression such as
import os; os.system('rm -rf ~/*').


If you want something safer, https://github.com/pydata/numexpr has an 
expression function that will do the same thing.



Another, safer :

s = "42 + 5 * 12"
float(eval(f"f'{{{s}}}'"))
102.0

Is it absolutely safe though?



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


Re: Calculator

2020-01-16 Thread Chris Angelico
On Fri, Jan 17, 2020 at 9:17 AM Python  wrote:
>
> Le 16/01/2020 à 11:56, samna...@gmail.com a écrit :
> > On Wednesday, 15 January 2020 17:09:56 UTC, Python  wrote:
> >> Le 15/01/2020 à 16:34, andersh...@gmail.com a écrit :
> >>> Thanks!
> >>
> >> Do not try it, though, with a expression such as
> >> import os; os.system('rm -rf ~/*').
> >
> > If you want something safer, https://github.com/pydata/numexpr has an 
> > expression function that will do the same thing.
> >
>
> Another, safer :
>
> s = "42 + 5 * 12"
> float(eval(f"f'{{{s}}}'"))
> 102.0
>
> Is it absolutely safe though?
>

I'm extremely confused as to how this is safer. It's the exact same
eval call, wrapped up in unnecessary conversions between string and
float.

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


Re: Python ABI typeslots for buffer protocol

2020-01-16 Thread Barry


> On 16 Jan 2020, at 16:12, nerdynels...@gmail.com wrote:
> 
> Still hoping a Python developer can weigh in on this or point me where to 
> get this issue addressed.

Does this tell you what you want to know?

https://docs.python.org/3/c-api/buffer.html

Barry

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


Re: Extension type inherit from Python int

2020-01-16 Thread Greg Ewing

On 17/01/20 11:12 am, Random832 wrote:


pure-python types that derive from int place __dict__ at the end of
the object, I don't know if it's possible for you to do the same with
the fields you intend to add (for some reason it isn't done with
__slots__), but if all else fails you could do the same and store
whatever data you need in the dict.


Or make the C code that accesses the data smart enough to find
where the int data ends and work from there.

But this is getting messy enough that at this point I would
stop and ask myself if it *really* needs to derive from int,
or whether it just needs to be something with a sufficiently
int-like interface.

--
Greg

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


Re: IDLE, TCP/IP problem.

2020-01-16 Thread Greg Ewing

On 16/01/20 10:06 pm, Muju's message wrote:


“IDLE cannot bind to a TCP/IP port, which is necessary to communicate
with its Python execution server. This might be because no networking
is installed on this computer.


There might be firewall settings or anti-virus software preventing
the port from being opened.

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