Python to PHP Login System (HTTP Post)
Hi everyone, I'm creating a desktop Python application that requires web-based authentication for accessing additional application features. HTTP GET is really simple. HTTP POST is not (at least for me anyway);) I have tried a few different sources, but I cannot get HTTP POST to successfully log in. I can login using FireFox at http://www.magnetshare.com/main.php I suggest you register a dummy login to see what I mean (don't enter your real e-mail address). Now here's some code: -- msparams = urllib.urlencode({'user': self.components.User.text, 'pass': self.components.MagnetSharePassword.text, 'sublogin': '1'}) try: f = urllib() ***What should go here?*** fc = f.read() fc.close() except: self.statusBar.text = "Disconnected" result = dialog.alertDialog(self, 'Couldn\'t connect to MagnetShare.com! Please check your Internet connection, and then try again.') else: print fc --- Also, could you let us know what modules we should import? Thanks for checking this out! By the way, the PHP system I'm using is super easy to set up: http://www.evolt.org/article/PHP_Login_System_with_Admin_Features/17/60384/index.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Python to PHP Login System (HTTP Post)
On 22 Jun 2006 16:19:50 -0700, "Justin Azoff" <[EMAIL PROTECTED]> wrote: >Jeethu Rao wrote: >> You need to use httplib. >> http://docs.python.org/lib/httplib-examples.html >> >> Jeethu Rao > >Not at all. They need to read the documentation for urrlib: > >http://docs.python.org/lib/module-urllib.html >http://docs.python.org/lib/node483.html >"The following example uses the "POST" method instead:" > >Additionally, they probably need to use cookielib, otherwise the logged >in state will not be persistant. Here's what's strange... I tried using urllib like this: -- try: msparams = urllib.urlencode({'user': self.components.User.text, 'pass': self.components.MagnetSharePassword.text, 'sublogin': 1}) f = urllib.urlopen("http://www.magnetshare.com/process.php";, msparams) fc = f.read() fc.close() print fc except: self.statusBar.text = "Disconnected" result = dialog.alertDialog(self, 'Couldn\'t connect to MagnetShare.com! Please check your Internet connection, and then try again.') else: print fc --- ...and then I visited http://www.magnetshare.com/main.php to see if I was logged in. Sure enough I was logged in, but the exception was thrown anyway. I commented out the urlopen, f, and fc lines and tested it again. This time I made it to "else:" I'm stumped. I'm glad that the user can log in; however, the MagnetShare application needs to read in the response from the server, and then decide what to do with the information. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python to PHP Login System (HTTP Post)
On Sat, 24 Jun 2006 01:28:29 GMT, [EMAIL PROTECTED] (John J. Lee) wrote: >[EMAIL PROTECTED] writes: > >> On 22 Jun 2006 16:19:50 -0700, "Justin Azoff" >> <[EMAIL PROTECTED]> wrote: >> >> >Jeethu Rao wrote: >> >> You need to use httplib. >> >> http://docs.python.org/lib/httplib-examples.html >> >> >> >> Jeethu Rao >> > >> >Not at all. They need to read the documentation for urrlib: >> > >> >http://docs.python.org/lib/module-urllib.html >> >http://docs.python.org/lib/node483.html >> >"The following example uses the "POST" method instead:" >> > >> >Additionally, they probably need to use cookielib, otherwise the logged >> >in state will not be persistant. > >Or you may not be able to log in at all, for an everyday meaning of >"log in". > > >> Here's what's strange... I tried using urllib like this: >> -- >> try: >> msparams = urllib.urlencode({'user': >> self.components.User.text, 'pass': >> self.components.MagnetSharePassword.text, 'sublogin': 1}) >> f = urllib.urlopen("http://www.magnetshare.com/process.php";, >> msparams) >> fc = f.read() >> fc.close() >> print fc >> except: >> self.statusBar.text = "Disconnected" >> result = dialog.alertDialog(self, 'Couldn\'t connect to >> MagnetShare.com! Please check your Internet connection, and then try >> again.') >> else: >> print fc >> --- >> ...and then I visited http://www.magnetshare.com/main.php to see if I >> was logged in. Sure enough I was logged in, but the exception was > >That's not how it works (assuming you visited that URL in a browser, >not using Python). The "logged-in-ness" comes from a "session ID" >cookie that is stored in your browser (or in your Python code). The >server sends a cookie when you log in (and usually stores your cookie >in a database). The browser keeps the cookie. When you come back >later using the same browser (maybe even after you've closed the >browser, if it's the right kind of cookie), your browser sends the >cookie back and the server looks up the session ID from that cookie in >the database, and sees it's you. > >If you come back using a different browser (and your Python program is >effectively just a different browser than your copy of Firefox or IE >or whatever), then the server won't remember who you are, so you're >not logged in *in that browser session*, even if the server has you >recorded in its database as logged in from a different browser >session. > >So, the fact that you saw yourself as logged in when you looked using >your web browser doesn't really help your Python program -- it's still >out in the cold. > > >> thrown anyway. I commented out the urlopen, f, and fc lines and >> tested it again. This time I made it to "else:" >> >> I'm stumped. I'm glad that the user can log in; however, the >> MagnetShare application needs to read in the response from the server, >> and then decide what to do with the information. > >Here's one way: > >easy_install mechanize > >(install easy_install first if you don't have that: > >http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install > >) > >#--- >import mechanize > >SHOW_COOKIES = True > >br = mechanize.Browser() >if SHOW_COOKIES: >cj = mechanize.CookieJar() >br.set_cookiejar(cj) >br.open("http://www.magnetshare.com/main.php";) >br.select_form(nr=0) >br["user"] = "joe" >br["pass"] = "password" >r = br.submit() >assert "Logged In" in r.get_data() >if SHOW_COOKIES: >for cookie in cj: >print cj >#--- > > >(note the cookiejar is always there; you only need to create one and >pass it in in order to get at it to e.g. print out the cookies you've >collected) > > >John Thanks a lot John! This "mechanize" was exactly what I was looking for. There are some key improvements over urllib2 and also, cookies are turned on by default. Just an FYI for others, PHP can set $SESSIONID when the user refuses cookies. I haven't decided whether the application will use cookies or not, but luckily I got the login page response I was looking for. Now, I just parse the HTML using Python, and then go to the next screen in the MagnetShare application. Here's the test code I used. --- import mechanize br = mechanize.Browser() br.open("http://www.magnetshare.com/main.php";) br.select_form(nr=0) br["user"] = "test2" br["pass"] = "test2" response1 = br.submit() fc = response1.read() print fc Cheers! Ben -- http://mail.python.org/mailman/listinfo/python-list
Test
Its only test. Please klick on a link to test: http://www.surf-tipps.info/fclick/fclick.php?03 Thanks -- http://mail.python.org/mailman/listinfo/python-list
Problem - Serving web pages on the desktop (SimpleHTTPServer)
Hi there, Perhaps someone can help me. For some reason, when my Python script runs and loads an HTML page in a new browser window at the local host (desktop), the links to my stylesheet and all the images are broken. I did check the HTML file by itself...everything loaded fine ;) Here's my script: # File: webbrowser-test.py import webbrowser, SimpleHTTPServer from StringIO import StringIO f=open('testpage.html', 'rb') myPage = f.read() class MyRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def send_head(self): self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() return StringIO(myPage) webbrowser.open("http://127.0.0.1:8000";, new=0, autoraise=1) SimpleHTTPServer.test(MyRequestHandler) Here's my sample directory: - webbrowser-test.py testpage.html m_files/ |_stylesheet.css |_logo.gif Thanks for having a look. My next step is to process form input using AJAX. I'll post working snippets of code here as I progress. Ben -- http://mail.python.org/mailman/listinfo/python-list
Problem - Serving web pages on the desktop (SimpleHTTPServer)
Hi there, Perhaps someone can help me. For some reason, when my Python script runs and loads an HTML page in a new browser window at the local host (desktop), the links to my stylesheet and all the images are broken. I did check the HTML file by itself...everything loaded fine ;) Here's my script: # File: webbrowser-test.py import webbrowser, SimpleHTTPServer from StringIO import StringIO f=open('testpage.html', 'rb') myPage = f.read() class MyRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def send_head(self): self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() return StringIO(myPage) webbrowser.open("http://127.0.0.1:8000";, new=0, autoraise=1) SimpleHTTPServer.test(MyRequestHandler) Here's my sample directory: - webbrowser-test.py testpage.html m_files/ |_stylesheet.css |_logo.gif Thanks for having a look. My next step is to process form input using AJAX. I'll post working snippets of code here as I progress. Ben -- http://mail.python.org/mailman/listinfo/python-list
Problem - Serving web pages on the desktop (SimpleHTTPServer)
Hi there, Perhaps someone can help me. For some reason, when my Python script runs and loads an HTML page in a new browser window at the local host (desktop), the links to my stylesheet and all the images are broken. I did check the HTML file by itself...everything loaded fine ;) Here's my script: # File: webbrowser-test.py import webbrowser, SimpleHTTPServer from StringIO import StringIO f=open('testpage.html', 'rb') myPage = f.read() class MyRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def send_head(self): self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() return StringIO(myPage) webbrowser.open("http://127.0.0.1:8000";, new=0, autoraise=1) SimpleHTTPServer.test(MyRequestHandler) Here's my sample directory: - webbrowser-test.py testpage.html m_files/ |_stylesheet.css |_logo.gif Thanks for having a look. My next step is to process form input using AJAX. I'll post working snippets of code here as I progress. Ben -- http://mail.python.org/mailman/listinfo/python-list
relative import broken?
basic noob question here. i am trying to reference a package, i have the structure: mypack/ __init__.py test.py subdir1/ __init__.py mod1.py subdir2/ __init__.py mod2.py can someone please tell me why the statement: from mypack.subdir1.mod1 import * does NOT work from mod2.py nor from test.py? instead, if i use: from subdir1.mod1 import * it works perfectly from test.py. ? thank you, aj. -- http://mail.python.org/mailman/listinfo/python-list
Error installing packages or upgrading pip
Hi there, I hope you are in a great health I am having a problem with python even though I uninstall and reinstall it again multiple times the error I get when I try to upgrade or install a package for example pip install requests I get this error which I could not find a solution for pip install requests Requirement already satisfied: requests in c:\users\uly\appdata\local\programs\python\python310\lib\site-packages\requests-2.30.0-py3.10.egg (2.30.0) WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/charset-normalizer/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/charset-normalizer/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/charset-normalizer/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/charset-normalizer/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/charset-normalizer/ WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/requests/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/requests/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/requests/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/requests/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))': /simple/requests/ ERROR: Could not find a version that satisfies the requirement charset_normalizer<4,>=2 (from requests) (from versions: none) ERROR: No matching distribution found for charset_normalizer<4,>=2 WARNING: There was an error checking the latest version of pip. -- https://mail.python.org/mailman/listinfo/python-list
Re: Why float('Nan') == float('Nan') is False
This definition of NaN is much better in mentally visualizing all the so called bizarreness of IEEE. This also makes intuitive that no 2 NaN will be equal just as no 2 infinities would be equal. I believe in a hypothesis(of my own creation) that any arithmetic on a data type of NaN would be similar to any set of operations on the set of Infinities. On Thu, Feb 14, 2019, 12:33 AM Avi Gross I won't speak for the IEEE but NOT A NUMBER does not tell you what > something > IS. > > If "Hello, World!" is not a number as in an int or a float and we throw > away > the content and simply call it a NaN or something and then we notice that > an > object that is a list of fruits is also not a number so we call it a NaN > too, then should they be equal? > > A NaN is a bit like a black hole. Anything thrown in disappears and that is > about all we know about it. No two black holes are the same even if they > seem to have the same mass, spin and charge. All they share is that we > don't > know what is in them. > > When variable "a" is a Nan then it is sort of a pointer to a concept. The > pointer IS itself but the concepts may not be. > > -Original Message- > From: Python-list On > Behalf Of Grant Edwards > Sent: Wednesday, February 13, 2019 1:03 PM > To: python-list@python.org > Subject: Re: Why float('Nan') == float('Nan') is False > > On 2019-02-13, ast wrote: > > Hello > > > > >>> float('Nan') == float('Nan') > > False > > If you think that's odd, how about this? > > >>> n = float('nan') > >>> n > nan > >>> n is n > True > >>> n == n > False > >>> > > > Why ? > > IEEE says so. > > -- > Grant Edwards grant.b.edwardsYow! Like I always say > at -- nothing can beat > gmail.comthe BRATWURST here in >DUSSELDORF!! > > -- > 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: Lifetime of a local reference
Just to add on regarding file I/O. It would be more pythonic to use. with open(path): do_stuff() On Wed, Feb 27, 2019, 3:31 AM Marko Rauhamaa wrote: > > Consider this function: > > def fun(): > f = open("lock") > flock.flock(f, fcntl.LOCK_EX) > do_stuff() > sys.exit(0) > > Question: can a compliant Python implementation close f (and, > consequently, release the file lock) before/while do_stuff() is > executed? > > I couldn't find an immediate answer in the documentation. > > > Marko > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Managing pipenv virtualenvs
Nothing much i think. If you are properly managing dependencies for each venv, then each new venv should have the same state as the previous one along with some extra dependencies for each new chapter (haven't gone through the specific book, but I am assuming that in the book, every chapter builds on the previous one). On a personal note it sounds strange why the author wants to have different venv's for each chapter. On Wed, Mar 27, 2019, 3:30 AM Tim Johnson wrote: > I'm on ubuntu 16.04 > > using pipenv for the "Django for Beginners..." tutorial book. > > each chapter instructs me to create a new virtual environment with a > folder under ~/.local/share/virtualenvs > > folders are named with the project name followed by an hyphen and a > brief codified string. > examples > helloworld-_e28Oloi > pages-Du4qJjUr > > What would happen if I deleted the first folder, which was created > in a previous chapter? > > ... trying to minimize my SSD real estate. > thanks > -- > Tim Johnson > http://www.tj49.com > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Managing pipenv virtualenvs
If the chapters are not contiguous then I can't find a reason to delete them (previous venv). Moreover it would be better practice to keep separate venv and not to use a single venv for multiple codebase. Highly discouraged should be to use the systemwide interpreter. Moreover the whole idea of using pipenv/pip is to make the venv easy to recreate. That being said I would focus more on whether my pipfile/requirements.txt is maintained properly or not. If it is then spinning up the same venv is an easy task. On Wed, Mar 27, 2019, 4:21 AM Tim Johnson wrote: > * Test Bot [190326 14:18]: > > Nothing much i think. If you are properly managing dependencies for each > > venv, then each new venv should have the same state as the previous one > Good to hear > > > along with some extra dependencies for each new chapter (haven't gone > > through the specific book, but I am assuming that in the book, every > > chapter builds on the previous one). > The author's source code is on github, so I downloaded all of it > for my edification. > > It appears that consecutive chapters do not always build on the > following, i.e. have the previous chapter files. > > I guess I will find out why ... > thank you > > On a personal note it sounds strange why the author wants to have > different > > venv's for each chapter. > > > > On Wed, Mar 27, 2019, 3:30 AM Tim Johnson wrote: > > > > > I'm on ubuntu 16.04 > > > > > > using pipenv for the "Django for Beginners..." tutorial book. > > > > > > each chapter instructs me to create a new virtual environment with a > > > folder under ~/.local/share/virtualenvs > > > > > > folders are named with the project name followed by an hyphen and a > > > brief codified string. > > > examples > > > helloworld-_e28Oloi > > > pages-Du4qJjUr > > > > > > What would happen if I deleted the first folder, which was created > > > in a previous chapter? > > > > > > ... trying to minimize my SSD real estate. > > > thanks > > > -- > > > Tim Johnson > > > http://www.tj49.com > > > -- > > > https://mail.python.org/mailman/listinfo/python-list > > > > > -- > > https://mail.python.org/mailman/listinfo/python-list > > -- > Tim Johnson > http://www.tj49.com > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Search and Replace of string in a yaml file
Assuming you are asking about the logic at the uber level. You can try handling yaml file with pyyaml. It is a 3rd party package which has a good support for I/O related to yaml files. After you are able to read the data from the file, you need to apply your business logic to it. And log all the erroneous matches. For example import yaml with open(path/to/yaml/file, "r") as fp: yaml_data = yaml.safe_load(fp) On Sat, Mar 23, 2019, 5:33 PM Pradeep Patra wrote: > Hi all, > > I have several yaml files in a directory around 100s. I have some values > and my script should search a string(reading from the JSON file) from the > series of yaml files and run some validation like the key of the file that > is updated in the yaml file and run some basic validation tests like data > integrity of the replaced string with the source string read from JSON. Can > anyone suggest some reliable and efficient method to achieve this and > appreciate some examples for the same? > > Regards > Pradeep > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Handy utilities = Friday Filosofical Finking
+1 On Fri, Mar 29, 2019, 2:04 AM DL Neil wrote: > How do you keep, use, and maintain those handy snippets, functions, > classes... - units of code, which you employ over-and-over again? > > > Having coded 'stuff' once, most of us will keep units of code, > "utilities", which we expect will be useful in-future (DRY principle), > eg functions to rename files, choose unique back-up/new fileNMs, > accessing a DB, journalling (logging) start/stop msgs, building specs > from YAML/JSON/XML/.ini config files (tongue~cheek), etc. > > Do you 'keep' these, or perhaps next time you need something you've > 'done before' do you remember when/where a technique was last > used/burrow into 'history'? > (else, code it from scratch, all over again) > > How do you keep them updated, ie if add some new idea, better > err-checking, re-factor - how to add these 'back' into previous places > utility is used? > (who wants more "technical debt", plus handling classic > update/versioning issue) > > How do you keep these? eg special file/dir, within IDE, leave in app and > 'remember', on paper, ... If the former, how do you access/import them > from the various applications/systems? > (Python's import rules and restrictions, change control/version control) > > > Am interested to hear your tactics; to learn, compare, and contrast... > -- > Regards, > =dn > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: numpy results in segmentation fault
Firstly, in response to this " I tried to install numpy with 3.7.3 and it is for some reason not working and after import when I run import numpy at python console and press enter I get >>? i,e its not working properly. " the >> prompt after import numpy signifies that the numpy module has been loaded and is available in the session. Can you please provide the traceback you are getting along with the input. PS - Also, you have some coins like thing on hackerrank I guess to reveal the test cases, in case everything else fails. On Mon, Sep 16, 2019 at 5:32 PM Thomas Jollans wrote: > Please reply on-list. (both of you) > > > Forwarded Message > Subject: Re: numpy results in segmentation fault > Date: Mon, 16 Sep 2019 17:04:57 +0530 > From: Test Bot > To: Pradeep Patra > CC: Thomas Jollans > > Firstly, in response to this > " > I tried to install numpy with 3.7.3 and it is for some > reason not working and after import when I run import numpy at python > console and press enter I get >>? i,e its not working properly. > " > > the >> prompt after import numpy signifies that the numpy module has been > loaded and is available in the session. > > Can you please provide the traceback you are getting along with the input. > > PS - Also, you have some coins like thing on hackerrank I guess to reveal > the test cases, in case everything else fails. > > On Mon, Sep 16, 2019 at 3:08 PM Pradeep Patra > wrote: > >> Yes it is crashing in the hackerrank site and the testcases fails with >> segmentation fault. I tried to install numpy with 3.7.3 and it is for some >> reason not working and after import when I run import numpy at python >> console and press enter I get >>? i,e its not working properly. >> >> Can you please help letting me know the python and numpy compatibility >> matrix or I am missing anything? >> >> I tried some of the numpy code from the other github and it also fails >> with >> the segmentation fault :-(. I am guessing some numpy version compatility >> issue or some environment issue. >> >> On Thu, Sep 12, 2019 at 8:00 PM Thomas Jollans wrote: >> >> > On 12/09/2019 15.53, Pradeep Patra wrote: >> > > Hi , >> > > >> > > I was trying to solve the hackerrank and was using python 3.7.x. >> > > https://www.hackerrank.com/challenges/np-concatenate/problem >> > > >> > > While running the code sometimes I get success result and sometimes it >> > > fails with "Segmentation Fault" at Hacker rank UI. I dont have any >> clue >> > why >> > > the code is crashing ? Does anyone have any idea? >> > >> > >> > Are you sure it's your code that's crashing, and not something beyond >> > your control? (Such as the software that is starting Python for you) >> > Does it depend on the input? Can you reproduce the issue in a controlled >> > environment (i.e. on your own PC)? >> > >> > >> > > >> > > Regards >> > > Pradeep >> > > >> > > import numpy >> > > >> > > n,m,p = map(int,input().split()) >> > > tgt_arr1 = [] >> > > for i in range(n): >> > > row = list(map(int,input().split())) >> > > tgt_arr1.append(row) >> > > tgt_arr2 = [] >> > > for j in range(m): >> > > row = list(map(int,input().split())) >> > > tgt_arr2.append(row) >> > > >> > > num_arr1 = numpy.array(tgt_arr1,int) >> > > num_arr2 = numpy.array(tgt_arr2,int) >> > > >> > > print(numpy.concatenate((num_arr1,num_arr2),axis=0)) >> > >> > >> > -- >> > https://mail.python.org/mailman/listinfo/python-list >> > >> -- >> https://mail.python.org/mailman/listinfo/python-list >> > -- https://mail.python.org/mailman/listinfo/python-list
Unable to install Flask-Mongoengine
Hi Guys, I am unable to install *Flask-Mongoengine* using pip. Here are my specifications 1. *OS* => OSX 10.14.6 2. *Python* => Python 3.8.0 (Working in a virtualenv) 3. *Dependency Manager* => pip(19.3.1), setuptools(42.0.2) 3. *Flask-Mongoengine* => flask-mongoengine==0.9.5 I am inside my virtualenv and trying to install flask-mongoengine using > (env) $ pip install flask-mongoengine==0.9.5 Here is my error > distutils.errors.DistutilsError: Command > '['/Users/onlinejudge95/Workspace/GitHub/alma-serv/env/bin/python', '-m', > 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', > '/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/tmpgrvp80jd', '--quiet', > 'rednose']' returned non-zero exit status 1. Please Find attached my full error log. I am on a new system in which i installed python through the mac installer from python.org, i had run the *Install Certificates.command* for SSL related issues, if it might be of help. In case there is a more specific mailing list to redirect to, please let me know. Thanks, onlinejudge95 (env) $ pip install flask-mongoengine Collecting flask-mongoengine Using cached https://files.pythonhosted.org/packages/20/53/1bb8ad34ad5c2047a11651290325e55086bc18fce7cfdbbe6f5522bd0ae5/flask-mongoengine-0.9.5.tar.gz ERROR: Command errored out with exit status 1: command: /Users/onlinejudge95/Workspace/GitHub/alma-serv/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/pip-install-73496mgp/flask-mongoengine/setup.py'"'"'; __file__='"'"'/private/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/pip-install-73496mgp/flask-mongoengine/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/pip-install-73496mgp/flask-mongoengine/pip-egg-info cwd: /private/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/pip-install-73496mgp/flask-mongoengine/ Complete output (44 lines): WARNING: The wheel package is not available. ERROR: Command errored out with exit status 1: command: /Users/onlinejudge95/Workspace/GitHub/alma-serv/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/pip-wheel-z44wznx3/rednose/setup.py'"'"'; __file__='"'"'/private/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/pip-wheel-z44wznx3/rednose/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/pip-wheel-qz9lk008 cwd: /private/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/pip-wheel-z44wznx3/rednose/ Complete output (6 lines): usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'bdist_wheel' ERROR: Failed building wheel for rednose ERROR: Failed to build one or more wheels Traceback (most recent call last): File "/Users/onlinejudge95/Workspace/GitHub/alma-serv/env/lib/python3.8/site-packages/setuptools/installer.py", line 128, in fetch_build_egg subprocess.check_call(cmd) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/Users/onlinejudge95/Workspace/GitHub/alma-serv/env/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/tmpjzg2lnoc', '--quiet', 'rednose']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/private/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/pip-install-73496mgp/flask-mongoengine/setup.py", line 36, in setup( File "/Users/onlinejudge95/Workspace/GitHub/alma-serv/env/lib/python3.8/site-packages/setuptools/__init__.py", line 144, in setup _install_setup_requires(attrs) File "/Users/onlinejudge95/Workspace/GitHub/alma-serv/env/lib/python3.8/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires dist.fetch_build_eggs(dist.setup_requires) File "/Users/onlinejudge95/Workspace/GitHub/alma-serv/env/lib/python3.8/site-packages/setuptools/dist.py", line 718, in fetch_build_eggs resolved_dists = pkg_resources.working_set.resolve( File "/Users/onlinejudge95/Works
Re: Unable to install Flask-Mongoengine
No help with using pip3 On Sun, Dec 15, 2019 at 2:49 PM tommy yama wrote: > how about pip3? > > On Sun, Dec 15, 2019 at 5:16 PM Test Bot wrote: > >> Hi Guys, >> >> I am unable to install *Flask-Mongoengine* using pip. Here are my >> specifications >> >> 1. *OS* => OSX 10.14.6 >> 2. *Python* => Python 3.8.0 (Working in a virtualenv) >> 3. *Dependency Manager* => pip(19.3.1), setuptools(42.0.2) >> 3. *Flask-Mongoengine* => flask-mongoengine==0.9.5 >> >> I am inside my virtualenv and trying to install flask-mongoengine using >> >> > (env) $ pip install flask-mongoengine==0.9.5 >> >> >> Here is my error >> >> > distutils.errors.DistutilsError: Command >> > '['/Users/onlinejudge95/Workspace/GitHub/alma-serv/env/bin/python', >> '-m', >> > 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', >> > '/var/folders/r7/pgqw605n55x5f9018rp72hsmgn/T/tmpgrvp80jd', >> '--quiet', >> > 'rednose']' returned non-zero exit status 1. >> >> >> Please Find attached my full error log. >> >> I am on a new system in which i installed python through the mac installer >> from python.org, i had run the *Install Certificates.command* for SSL >> related issues, if it might be of help. >> >> In case there is a more specific mailing list to redirect to, please let >> me >> know. >> >> Thanks, >> onlinejudge95 >> -- >> https://mail.python.org/mailman/listinfo/python-list >> > -- https://mail.python.org/mailman/listinfo/python-list
Re: Server side Blazor-like framework in Python?
+1 Though the implementation might be good from an exercise perspective. But there is a general philosophy in Software Engineering namely Separation of Concern. Python as a language is not concerned about the "Front-End" side of things since it is not meant for that. Though i am a very devote Python programmer, i would still prefer to limit Python to backend tasks and have the Front End implemented in React. On Sun, Dec 15, 2019 at 5:47 PM Chris Angelico wrote: > On Sun, Dec 15, 2019 at 11:11 PM wrote: > > > > I've been doing a lot of development with server side Blazor on .NET > recently, and I think it's a very interesting UI model ( > https://docs.microsoft.com/en-us/aspnet/core/blazor/hosting-models?view=aspnetcore-3.1). > What would it take to make something similar in Python? I guess a lot of > relevant Python packages already exist. > > > > SSB works by having a component/DOM model running on the server. The > client web page sends events and receives DOM diffs over a > SignalR/websocket comnection. > > > > I *much* prefer to have the front end in charge of the UI, and the > back end work as an API. Just send and receive JSON with useful > information in it, and let the front end figure out how it wants to > display that. > > But hey, if you want to ship a DOM diff down the wire, go ahead. Just > don't ask me to use your tool. :) > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Python threading
I am wondering what happens to a thread in python in relation to win32com extensions. If I create a new thread, that uses the Dispatch method from win32com, what happens to the memory allocated in that thread when the thread is done. Will the Dispatch release the memory it created, or will the memory remain? The problem rises from the fact that Dispatch does not seem to release memory correctly every time. If I include the commands in a thread by themselves, will the thread clean up ALL memory it used after it is done? I did try the pythoncom.CoUnitialize() to release memory, but it doesn't seem to work (it does work about 30-45 seconds after the command is run). Any input is greatly appreciated (on the thread issue or how to use the pythoncom.CoUnitiliaze() to make it release memory right away). Thank you in advance! -- http://mail.python.org/mailman/listinfo/python-list
Re: Python threading
On Mar 8, 6:15 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 08 Mar 2007 14:25:02 -0300, <[EMAIL PROTECTED]> escribió: > All threads share the same memory space, there is not a "per-thread" > memory allocator, if that's what you are thinking. > Perhaps you hold a reference to some objects in the Thread object? Or you > still keep the Thread object itself? That is what I was thinking. A per-thread memory allocator of some sort. What I need is run a lot of commands from a COM object that can be run independently. There commands leak memory, so when the command finishes, the memory consumption jumps to 800MBs or so. Which begs the question, if I initialize the COM object in a separate thread and run the command, does finishing the thread clean up any and all memory the thread used or not. The output of each thread would actually be a file on disk, therefore there is no need to pass any data between the threads and the main program. > > I did try the pythoncom.CoUnitialize() to release memory, but it > > doesn't seem to work (it does work about 30-45 seconds after the > > command is run). > > I don't understand what you say here. > What means "it doesn't seem to work" and "it does work 30 seconds after"? pythoncom.CoUninitialize(), if I am not mistaken, releases a COM object (and therefore the memory it uses I assume). When the command is run (in PythonWin for example), the memory is not released but persists for quite a while. Using my watch and the Task Manager in Windows I can see that the memory is released approximately 30 seconds AFTER I run the pythoncom.CoUninitialize() command is run. > What memory do you want to release "right away"? The memory I want to release is the memory the COM object used (the one initialized with the win32com Dispatch command). The "right-away" is not much of an issue, but if I can release it before I run each command from the COM object that leaks memory, it would be nice. Running upwards to 800MBs of RAM for one 500 line python script seems a little bit too much for me. Thank you for your reply Gabriel. If you have any more input, I would greatly appreciate it. -- http://mail.python.org/mailman/listinfo/python-list
Operations Management 13th E by Stevenson Solution Manuals
Greetings Students, We do have Solution Manuals and Test Bank for OPERATIONS MANAGEMENT 13TH E BY STEVENSON at reasonable price. You can get above mentioned resources by sending email to pro.fast(@)hotmail(dot)com. Send your order queries at PRO.FAST(@)HOTMAIL(DOT)COM Below are details given for this book Book Name: OPERATIONS MANAGEMENT Authors: William J Stevenson Edition: 13th E ISBN-10: 1259667472 ISBN-13: 9781259667473 Product Format: MS Word Total Chapters: 19 Items available : Solution Manuals / Test Bank / PPT,s Please mention complete details for your book so we could send you sample accordingly. Best Regards, P.S : Please do not post your reply here. We do not monitor queries here. Simply send us an email directly to PRO.FAST (@) HOTMAIL (DOT) COM -- https://mail.python.org/mailman/listinfo/python-list
Test Bank for Corrections in the 21st Century 8th Edition by Frank Schmalleger
Greetings Students, We do have Test Bank for CORRECTIONS IN THE 21ST CENTURY 8TH EDITION BY SCHMALLEGER at reasonable price. You can get above mentioned resources by sending email to pro.fast(@)hotmail(dot)com Send your order queries at PRO.FAST(@)HOTMAIL(DOT)COM Below are details given for this book Book Name: CORRECTIONS IN THE 21ST CENTURY Authors: Frank Schmalleger, John Smykla Edition: 8th E ISBN-10: 1259916553 ISBN-13: 9781259916557 Product Format: MS Word Total Chapters: 12 Please mention complete details for your book so we could send you sample accordingly. Best Regards, P.S : Please do not post your reply here. We do not monitor queries here. Simply send us an email directly to PRO.FAST (@) HOTMAIL (DOT) COM -- https://mail.python.org/mailman/listinfo/python-list
Solution Manual Test Bank for Financial and Managerial Accounting for MBAs 5th Edition by Easton
Greetings Students, We do have Solution Manuals and Test Bank for FINANCIAL AND MANAGERIAL ACCOUNTING FOR MBAs 5TH EDITION BY EASTON at reasonable price. You can get above mentioned resources by sending email to pro.fast(@)hotmail(dot)com Send your order queries at PRO.FAST(@)HOTMAIL(DOT)COM Below are details given for this book Book Name: FINANCIAL AND MANAGERIAL ACCOUNTING FOR MBAs Authors: Peter D. Easton, Robert F. Halsey, Mary Lea McAnally, Al L. Hartgraves, Wayne J. Morse Edition: 5th E ISBN-10: 1618532324 ISBN-13: 9781618532329 Product Format: MS Word Total Modules: 25 Please mention complete details for your book so we could send you sample accordingly. Best Regards, P.S : Please do not post your reply here. We do not monitor queries here. Simply send us an email directly to PRO.FAST (@) HOTMAIL (DOT) COM -- https://mail.python.org/mailman/listinfo/python-list
Solution Manual Test Bank for Financial Accounting for MBAs 7th Edition by Easton
Greetings Students, We do have Solution Manuals and Test Bank for FINANCIAL ACCOUNTING FOR MBAs 7th EDITION BY EASTON at reasonable price. You can get above mentioned resources by sending email to pro.fast(@)hotmail(dot)com Send your order queries at PRO.FAST(@)HOTMAIL(DOT)COM Below are details given for this book Book Name: FINANCIAL ACCOUNTING FOR MBAs Authors: Peter D. Easton, John J. Wild, Robert F. Halsey, Mary Lea McAnally Edition: 7th E ISBN-13: 9781618532312 Product Format: MS Word Total Modules: 13 Please mention complete details for your book so we could send you sample accordingly. Best Regards, P.S : Please do not post your reply here. We do not monitor queries here. Simply send us an email directly to PRO.FAST (@) HOTMAIL (DOT) COM -- https://mail.python.org/mailman/listinfo/python-list
Solution Manual Test Bank for Financial Statement Analysis and Valuation 5th Edition by Easton
Greetings Students, We do have Solution Manuals and Test Bank for FINANCIAL STATEMENT ANALYSIS AND VALUATION BY EASTON at reasonable price. You can get above mentioned resources by sending email to pro.fast(@)hotmail(dot)com Send your order queries at PRO.FAST(@)HOTMAIL(DOT)COM Below are details given for this book Book Name: FINANCIAL STATEMENT ANALYSIS AND VALUATION Authors: Peter D. Easton, John J. Wild, Robert F. Halsey, Mary Lea McAnally Edition: 5th E ISBN-10: 1618532332 ISBN-13: 9781618532336 Product Format: MS Word Total Modules: 15 + Appendix A,B,C,D Please mention complete details for your book so we could send you sample accordingly. Best Regards, P.S : Please do not post your reply here. We do not monitor queries here. Simply send us an email directly to PRO.FAST (@) HOTMAIL (DOT) COM -- https://mail.python.org/mailman/listinfo/python-list