what windows compiler for python 3.5?
I read this https://docs.python.org/dev/whatsnew/3.5.html which incidentally marks the release as 3.6.0a0 :) but failed to find any details regarding which windows compiler is required. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list
Re: what windows compiler for python 3.5?
On 24/07/2015 11:20, Robin Becker wrote: I read this https://docs.python.org/dev/whatsnew/3.5.html which incidentally marks the release as 3.6.0a0 :) but failed to find any details regarding which windows compiler is required. more searching I find this on the 3.5 b1 download page "Windows users: The Windows binaries were built with Microsoft Visual Studio 2015, which is not yet officially released. (It's currently offered in "Preview" mode, which is akin to a "beta".) It is our intention to ship Python 3.5 using VS2015, although right now VS2015's final release date is unclear." -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list
Re: what windows compiler for python 3.5?
On Fri, Jul 24, 2015 at 8:25 PM, Robin Becker wrote: > On 24/07/2015 11:20, Robin Becker wrote: >> >> I read this >> >> https://docs.python.org/dev/whatsnew/3.5.html which incidentally marks the >> release as 3.6.0a0 :) >> >> but failed to find any details regarding which windows compiler is >> required. > > > more searching I find this on the 3.5 b1 download page > > "Windows users: The Windows binaries were built with Microsoft Visual Studio > 2015, which is not yet officially released. (It's currently offered in > "Preview" mode, which is akin to a "beta".) It is our intention to ship > Python 3.5 using VS2015, although right now VS2015's final release date is > unclear." That would be correct, if you're seeking to match the python.org builds (eg if you're building an extension module). I've no idea what the compiler requirements are if you simply want to build CPython from source. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: what windows compiler for python 3.5?
On 24/07/2015 11:38, Chris Angelico wrote: On Fri, Jul 24, 2015 at 8:25 PM, Robin Becker wrote: ... more searching I find this on the 3.5 b1 download page "Windows users: The Windows binaries were built with Microsoft Visual Studio 2015, which is not yet officially released. (It's currently offered in "Preview" mode, which is akin to a "beta".) It is our intention to ship Python 3.5 using VS2015, although right now VS2015's final release date is unclear." That would be correct, if you're seeking to match the python.org builds (eg if you're building an extension module). I've no idea what the compiler requirements are if you simply want to build CPython from source. ... yes I build extensions for reportlab. Unfortunately, despite our MSDN subscription to the Visual Studio stuff we have no access to the Visual Studio Version 2015. Last one in my downloads is currently 2013. Pity. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list
Re: what windows compiler for python 3.5?
On Fri, Jul 24, 2015 at 8:53 PM, Robin Becker wrote: > yes I build extensions for reportlab. Unfortunately, despite our MSDN > subscription to the Visual Studio stuff we have no access to the Visual > Studio Version 2015. Last one in my downloads is currently 2013. Pity. Ah. You may well be somewhat out of luck for the moment, then; I've no idea what status is during the betas. Once Python 3.5 is released, VS 2015 should also be available, or else the official compiler for CPython 3.5 will probably be changed. In the meantime, you could possibly ask on python-dev; Steve Dower of Microsoft hangs out there, and he's the one who's driving the compiler choice - he may be able to advise as to where to get the prerelease compiler. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: what windows compiler for python 3.5?
On 24/07/2015 11:53, Robin Becker wrote: On 24/07/2015 11:38, Chris Angelico wrote: On Fri, Jul 24, 2015 at 8:25 PM, Robin Becker wrote: ... more searching I find this on the 3.5 b1 download page "Windows users: The Windows binaries were built with Microsoft Visual Studio 2015, which is not yet officially released. (It's currently offered in "Preview" mode, which is akin to a "beta".) It is our intention to ship Python 3.5 using VS2015, although right now VS2015's final release date is unclear." That would be correct, if you're seeking to match the python.org builds (eg if you're building an extension module). I've no idea what the compiler requirements are if you simply want to build CPython from source. ... yes I build extensions for reportlab. Unfortunately, despite our MSDN subscription to the Visual Studio stuff we have no access to the Visual Studio Version 2015. Last one in my downloads is currently 2013. Pity. I'm successfully building with Visual Studio Version 2015 Community Edition RC. It's a good job that modern drives have so much space as it takes up *EIGHT GIG* of space, so the download and install takes quite a time. I'm aware that Steve Dower is trying to get a much smaller install made available for those who just want to build from the command line. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: problem with selecting remote procedure calls
- Original Message - From: "Irmen de Jong" Eric, if you're concerned about performance, Pyro4 (the source distribution) comes with several examples that do simple performance related tests. You could run these and see what figures you get on your setup to see if it's anywhere acceptable, before even building anything with Pyro yourself. sounds like a plan. I managed to get around the initial problem I had because apparently the natlink extension for NaturallySpeaking is semi-persistent. Sometimes the statically created RPC connection would work, other times it wouldn't. The current workaround is to place the RPC connection initialization in the code that activates the grammar. Interesting project btw. it has been a long time since a project like this has made me smile ear-to-ear. For example, yesterday I had to create twelve open VPN configuration files and key pairs. With broken hands like mine, it would be an extremely painful hour to two hours to entering the data over and over again even with easy RSA. I was able to complete this task in about 10 to 15 minutes. Now that's what accessibility is all about. I believe my experiment shows that a two dimensional grid with names for both rows and columns can allow a speech recognition dependent user much faster data entry than one could have with straight speech recognition. With some enhancements, it should be possible to use this technique to remember something on the fly. ideally I'd like to take a tool like treesheets , put some Python power underneath the grid, and explore how a grid tool can help accessibility but I'd need a volunteer to make that happen. -- https://mail.python.org/mailman/listinfo/python-list
Re: what windows compiler for python 3.5?
On 24/07/2015 12:04, Chris Angelico wrote: > On Fri, Jul 24, 2015 at 8:53 PM, Robin Becker wrote: >> yes I build extensions for reportlab. Unfortunately, despite our MSDN >> subscription to the Visual Studio stuff we have no access to the Visual >> Studio Version 2015. Last one in my downloads is currently 2013. Pity. > > Ah. You may well be somewhat out of luck for the moment, then; I've no > idea what status is during the betas. Once Python 3.5 is released, VS > 2015 should also be available, or else the official compiler for > CPython 3.5 will probably be changed. > > In the meantime, you could possibly ask on python-dev; Steve Dower of > Microsoft hangs out there, and he's the one who's driving the compiler > choice - he may be able to advise as to where to get the prerelease > compiler. Visual Studio 2015 Community was relased earlier this week so there is no need to work with the prerelease version. -- https://mail.python.org/mailman/listinfo/python-list
Re: Integers with leading zeroes
On Wed, 22 Jul 2015 20:11:47 -0600, Michael Torrie wrote: > On 07/22/2015 07:51 AM, Grant Edwards wrote: >> On 2015-07-22, Ben Finney wrote: >>> Laura Creighton writes: >>> The biggest use I have for decimal numbers that begin with 0 is in credit card numbers, account numbers and the like where the first check you do is 'does this thing have the correct number of digits'. >>> >>> The following are examples of types from the real world that people >>> think of, and casually discuss, as “numbers”. >>> >>> * Postal code * Credit card number * Telephone number * Car >>> registration plate number * Personal Identification Number (PIN) >> >> Those are all strings. Not numbers. > > That depends. A credit card number is indeed a number, and there are > mathematical formulas for determining if a particular number is a valid > (as in well-formed) credit card number, and possibly to identify what > kind of card it is. no it is a string,that happens to be made up out of digits. the digits can be manipulated but you do not perform maths on a credit card number as a whole -- Did I do an INCORRECT THING?? -- https://mail.python.org/mailman/listinfo/python-list
Re: Find Minimum for element in multiple dimensional array
On Wednesday, July 22, 2015 at 5:54:30 PM UTC-5, Robert Davis wrote:
> Given a set of arrays within an array how do I find the arrays with the
> minimum values based on two elements/columns in the array? Those two
> elements/columns are the destination zip code and distance.
>
> I have an array of arrays that have a origin zip code, origin latitude,
> origin longitude, destination zip code, destination latitude, destination
> longitude, and miles between the two points.
>
> I need to keep only those combinations that represent the minimum mileage
> between to the destination zip code. For example a point in New Jersey may
> have a distance from the Philadelphia Office that is 45 miles, from the
> Newark Office that is 78 miles and one from the Delaware Office that is 58
> miles.
>
> I need to keep the mileage from the Philadelphia Office that is 45 miles and
> produce a .csv file that has origin zip code, origin latitude, origin
> longitude, destination zip code, destination latitude, destination longitude,
> and miles between the two points.
>
> The array looks like this:
>
> [['37015', 'TN31', 36.2777, -87.0046, 'NY', 'White Plains', '10629',
> 41.119008, -73.732996, 77.338920003],
> ['72202', 'ARB1', 34.739224, -92.27765, 'NY', 'White Plains', '10629',
> 41.119008, -73.732996, 1099.7837975322097]]
>
> My code looks like this :
>
> import csv
> import math
>
>
> def calculate_distance(lat1, lon1, lat2, lon2):
>
> if (not lat1) or (not lon1) or (not lat2) or (not lon2):
> return -1
>
> lat1 = float(lat1) * math.pi/180
> lon1 = float(lon1) * math.pi/180
> lat2 = float(lat2) * math.pi/180
> lon2 = float(lon2) * math.pi/180
>
> return 3959.0 * math.acos(math.sin(lat1) * math.sin(lat2) +
> math.cos(lat1) * math.cos(lat2) * math.cos(lon2-lon1))
>
> #Above function changed from the following URL: http://iamtgc.com/geocoding-
> with-python/
>
>
> InputPath = "C:\\Users\\jacobs\\Downloads\\ZipCodes\\"
>
> ZipCodes = "zipcode.csv"
> RptgOfficeFile = "Reporting_Office_2015072001.csv"
> InputFile = InputPath+RptgOfficeFile
> zInputFile = InputPath+ZipCodes
> zOutputFile = InputPath+'Zip_Code_Distance.csv'
> z1OutputFile = InputPath+'Minimum_Distance_Zip_Code_File.csv'
>
>
> f = open(InputFile, 'r')
>
> zO = open(zOutputFile,'w')
> z1 = open(z1OutputFile,'w')
>
> lines = [ ]
> OfficeZipcodes = []
> ZipRptOffice = {}
> OLatitude = [ ]
> OLongitude = [ ]
> OLocationCode = []
> dzip = []
> dLatitude = []
> dLongitude = []
> dCity = []
> dState = []
> Combined =[]
> Answers = []
>
> for line in f:
> l = [i.strip() for i in line.split(',')]
> OfficeZipcodes.append(l[4])
> ZipRptOffice[l[4]]= l[3]
> OLatitude.append(l[5])
> OLongitude.append(l[6])
> OLocationCode.append(l[3])
>
> del OfficeZipcodes[0]
> del OLatitude[0]
> del OLongitude[0]
> del OLocationCode[0]
>
>
> zf = csv.DictReader(open(zInputFile))
> #http://courses.cs.washington.edu/courses/cse140/13wi/csv-parsing.html
>
> for row in zf:
> dzip.append(row["zip"])
> dLatitude.append(float(row["latitude"]))
> dLongitude.append(float(row["longitude"]))
> dCity.append(row["city"])
> dState.append(row["state"])
>
>
> for i in range(len(OfficeZipcodes)):
> for j in range(len(dzip)):
> Distance = calculate_distance(OLatitude[i],
> OLongitude[i],dLatitude[j],dLongitude[j])
> Combined.append([OfficeZipcodes[i],
> OLocationCode[i],float(OLatitude[i]),float(OLongitude[i]),dState[j],dCity[j],dzip[j],
> dLatitude[j],dLongitude[j],Distance])
> for i in range(len(Combined)):
>
> zO.write(str(Combined[i][0])+","+str(Combined[i][1])+","+str(Combined[i][2])+","+
> str(Combined[i][3])+","+str(Combined[i][4])+","+ str(Combined[i][5])+","+
> str(Combined[i][6])+","+str(Combined[i][7])+","+
> str(Combined[i][8])+","+str(Combined[i][9])+"\n")
>
> zO.close()
> f.close()
>
> I am using Python 2.7 on a Windows 7 machine.
>
> Please help me get my head around how to accomplish this task.
>
> Thank you very much.
>
> Robert Davis
Thank you Denis.
--
https://mail.python.org/mailman/listinfo/python-list
Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]
On 2015-07-24, Paul Rubin wrote: > Grant Edwards writes: > >> You can always pick out the topologist at a conference: he's the one >> trying to dunk his coffee cup in his doughnut. > > Did you hear about the idiot topologist? He couldn't tell his butt > from a hole in the ground, but he *could* tell his butt from two > holes in the ground. Wow. Now I know _two_ topologist jokes. The girls are going to be impressed! -- Grant Edwards grant.b.edwardsYow! I just got my PRINCE at bumper sticker ... But now gmail.comI can't remember WHO he is ... -- https://mail.python.org/mailman/listinfo/python-list
register cleanup handler
I have code like: if (condition): do_something_needing_cleanup code_executed_unconditionally Now, how can I make sure cleanup happens? Actually, what I really would like, is: if (condition): do_something_needing_cleanup register_scoped_cleanup (cleanup_fnc) code_executed_unconditionally So, any thoughts/hopes of python being able to do something like this? I know we have try/finally, but I don't think that helps here, because code_executed_unconditionally couldn't be inside the try. Or am I missing something obvious? -- https://mail.python.org/mailman/listinfo/python-list
Re: register cleanup handler
In a message of Fri, 24 Jul 2015 10:57:30 -0400, Neal Becker writes: >I know we have try/finally, but I don't think that helps here, because >code_executed_unconditionally couldn't be inside the try. Or am I missing >something obvious? I think so. Either that or I am badly misunderstanding you. What is wrong with try: if (condition): do_something_needing_cleanup else: do_something_else code_executed_unconditionally finally: do_cleanup Laura -- https://mail.python.org/mailman/listinfo/python-list
Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]
Grant Edwards writes: >> Did you hear about the idiot topologist? He couldn't tell his butt >> from a hole in the ground, but he *could* tell his butt from two >> holes in the ground. > > Wow. Now I know _two_ topologist jokes. The girls are going to be > impressed! I got it from here: http://mathoverflow.net/questions/1083/do-good-math-jokes-exist -- https://mail.python.org/mailman/listinfo/python-list
Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]
On 24/07/2015 15:13, Grant Edwards wrote: On 2015-07-24, Paul Rubin wrote: Grant Edwards writes: You can always pick out the topologist at a conference: he's the one trying to dunk his coffee cup in his doughnut. Did you hear about the idiot topologist? He couldn't tell his butt from a hole in the ground, but he *could* tell his butt from two holes in the ground. Wow. Now I know _two_ topologist jokes. The girls are going to be impressed! Here comes the third. Q: How many topologists does it take to change a light bulb? A: It really doesn't matter, since they'd rather knot. https://www.ocf.berkeley.edu/~mbarrien/jokes/lightblb.txt -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: register cleanup handler
Laura Creighton wrote: > In a message of Fri, 24 Jul 2015 10:57:30 -0400, Neal Becker writes: >>I know we have try/finally, but I don't think that helps here, because >>code_executed_unconditionally couldn't be inside the try. Or am I missing >>something obvious? > > I think so. Either that or I am badly misunderstanding you. What is > wrong with > > try: >if (condition): > do_something_needing_cleanup >else: > do_something_else >code_executed_unconditionally > finally: >do_cleanup > > Laura do_cleanup has do be done only if do_something_needing_cleanup was done first. This would work, but is not very elegant. I hope for a better way. need_cleanup = False try: if (condition): do_something_needing_cleanup need_cleanup = True else: do_something_else code_executed_unconditionally finally: if need_cleanup: do_cleanup -- https://mail.python.org/mailman/listinfo/python-list
Re: register cleanup handler
On 24-7-2015 16:57, Neal Becker wrote: > I have code like: > > if (condition): > do_something_needing_cleanup > > code_executed_unconditionally > > or exception> > > Now, how can I make sure cleanup happens? Actually, what I really would > like, is: > > if (condition): > do_something_needing_cleanup > register_scoped_cleanup (cleanup_fnc) > > code_executed_unconditionally > > > So, any thoughts/hopes of python being able to do something like this? > > I know we have try/finally, but I don't think that helps here, because > code_executed_unconditionally couldn't be inside the try. Or am I missing > something obvious? > Sounds like you want a context manager, see https://docs.python.org/3/library/contextlib.html#replacing-any-use-of-try-finally-and-flag-variables Irmen -- https://mail.python.org/mailman/listinfo/python-list
How may I learn Python Web Frameworks
Dear Group, I am slightly new in Python Web Frameworks. I could learn bit of Django, Flask and Bottle. But I am looking for a good web based tutorial like Python or NLTK. Somehow, I did not find documentations for web frameworks are very good, one has to do lot of experiments even to learn basic things. I am looking for a good book like Dive into Python or some good web based tutorials. I tried to search but unfortunately could not find. I am using Python2.7+ on Windows 7. If any one of the members may kindly suggest. Regards, Subhabrata Banerjee. -- https://mail.python.org/mailman/listinfo/python-list
Re: register cleanup handler
Irmen de Jong wrote: > On 24-7-2015 16:57, Neal Becker wrote: >> I have code like: >> >> if (condition): >> do_something_needing_cleanup >> >> code_executed_unconditionally >> >> > continue or exception> >> >> Now, how can I make sure cleanup happens? Actually, what I really would >> like, is: >> >> if (condition): >> do_something_needing_cleanup >> register_scoped_cleanup (cleanup_fnc) >> >> code_executed_unconditionally >> >> >> So, any thoughts/hopes of python being able to do something like this? >> >> I know we have try/finally, but I don't think that helps here, because >> code_executed_unconditionally couldn't be inside the try. Or am I >> missing something obvious? >> > > Sounds like you want a context manager, see > https://docs.python.org/3/library/contextlib.html#replacing-any-use-of-try-finally-and-flag-variables > > Irmen Yes, that looks great! I'm using py2.7.10, so I tried 'contexter' package. if (condition): with ExitStack() as stack: if condition: do_something() def cleanup_resources(): some_cleanup_using_closure() stack.callback(cleanup_resources) unconditionally_executed_code_no_worrying_about_cleanup() -- https://mail.python.org/mailman/listinfo/python-list
Re: How may I learn Python Web Frameworks
web2py http://www.web2py.com/ has extensive tutorials, videos, and a book. Laura -- https://mail.python.org/mailman/listinfo/python-list
Which GUI?
Hi all! I am about to write an application (python3 in linux) that needs: 1. Display time series graphics dynamically changed as the application runs, i.e. the graphics should reflect some internal variables states. 2. The same but for some network like diagrams. Basically nodes and connections (straight lines). Nodes can have different colors depending on their activity levels and also, together with connection lines, may be created and deleted dynamically. 3. Interaction with the user (not sure yet, here). 4. Some modules may need to be moved to C++ in case of lack of enough speed. So, the possibility of the GUI libs be used with C++ may be an advantage. Anyway I can always stay in Python and write a C++ extension. 5. Several multi processor segments. 6. For now single user - possible but unlikely multi-user in the future. Which technology is better? matplotlib? tkinter? wxwidgets? qt? Web: ajax (I don't know much about this - need to learn), using cherrypy or django? Any other? Thanks for any help or comments. -- https://mail.python.org/mailman/listinfo/python-list
Re: Which GUI?
You might checkout pyqtgraph. I think a ton of the examples will be relevant to your use case. On Fri, Jul 24, 2015 at 1:31 PM, Paulo da Silva < [email protected]> wrote: > Hi all! > > I am about to write an application (python3 in linux) that needs: > > 1. Display time series graphics dynamically changed as the application > runs, i.e. the graphics should reflect some internal variables states. > > 2. The same but for some network like diagrams. Basically nodes and > connections (straight lines). Nodes can have different colors depending > on their activity levels and also, together with connection lines, may > be created and deleted dynamically. > > 3. Interaction with the user (not sure yet, here). > > 4. Some modules may need to be moved to C++ in case of lack of enough > speed. So, the possibility of the GUI libs be used with C++ may be an > advantage. Anyway I can always stay in Python and write a C++ extension. > > 5. Several multi processor segments. > > 6. For now single user - possible but unlikely multi-user in the future. > > Which technology is better? > matplotlib? > tkinter? > wxwidgets? > qt? > Web: ajax (I don't know much about this - need to learn), using cherrypy > or django? > Any other? > > Thanks for any help or comments. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: what windows compiler for python 3.5?
Brian Gladman wrote: > Visual Studio 2015 Community was relased earlier this week so there is no need to work with the prerelease version. Hope MS have fixed all the "internal compiler errors". E.g. trying to compile GeoIpApi-C [1], consistently reports: libGeoIP/regionName.c(7596): fatal error C1026: parser stack overflow, program too complex here. The regionName.c look pretty lame, but not that complex IMHO. [1] https://github.com/maxmind/geoip-api-c/blob/master/libGeoIP/regionName.c -- https://mail.python.org/mailman/listinfo/python-list
Re: Which GUI?
You may be interested in bokeh. http://bokeh.pydata.org/en/latest/ It's a python interactive visualisation library. Laura -- https://mail.python.org/mailman/listinfo/python-list
Re: what windows compiler for python 3.5?
On 24/07/2015 11:53, Robin Becker wrote: yes I build extensions for reportlab. Unfortunately, despite our MSDN subscription to the Visual Studio stuff we have no access to the Visual Studio Version 2015. Last one in my downloads is currently 2013. Pity. I received an email today re my work MSDN subscription telling me VS2015 was now available to download. Sorry I didn't study it to see if all the versions were available now or just some. I've only just started using VS2013 at work so wasn't worried about VS2015! -- https://mail.python.org/mailman/listinfo/python-list
Re: How may I learn Python Web Frameworks
you'll find a very extensive Flask tutorial at http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world . -- https://mail.python.org/mailman/listinfo/python-list
Re: Which GUI?
On Friday 24 Jul 2015 20:37 CEST, Christopher Mullins wrote: > You might checkout pyqtgraph. I think a ton of the examples will be > relevant to your use case. Top-posting is (rightly) frowned upon in this group. Could you use inline posting next time? A3: Please. Q3: Should I avoid top posting on this mailing list? A2: Because, by reversing the order of a conversation, it leaves the reader without much context, and makes them read a message in an unnatural order. Q2: Why is top posting irritating? A1: It is the practice of putting your reply to a message before the quoted message, instead of after the (trimmed) message. Q1: What is top posting? > On Fri, Jul 24, 2015 at 1:31 PM, Paulo da Silva > wrote: > > Hi all! > > I am about to write an application (python3 in linux) that needs: > > 1. Display time series graphics dynamically changed as the > application > runs, i.e. the graphics should reflect some internal variables > states. > > 2. The same but for some network like diagrams. Basically nodes and > connections (straight lines). Nodes can have different colors > depending > on their activity levels and also, together with connection lines, > may > be created and deleted dynamically. > > 3. Interaction with the user (not sure yet, here). > > 4. Some modules may need to be moved to C++ in case of lack of > enough > speed. So, the possibility of the GUI libs be used with C++ may be > an > advantage. Anyway I can always stay in Python and write a C++ > extension. > > 5. Several multi processor segments. > > 6. For now single user - possible but unlikely multi-user in the > future. > > Which technology is better? > matplotlib? > tkinter? > wxwidgets? > qt? > Web: ajax (I don't know much about this - need to learn), using > cherrypy > or django? > Any other? > > Thanks for any help or comments. > -- > https://mail.python.org/mailman/listinfo/python-list -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list
About this mailing list
Hi all, This mail is just to check if you receive it because I think I have a problem with this list. Could you reply me to check it works ? Thank you -- Stéphane Wirtel - http://wirtel.be - @matrixise -- https://mail.python.org/mailman/listinfo/python-list
Re: About this mailing list
On 24/07/2015 21:27, Stéphane Wirtel wrote: Hi all, This mail is just to check if you receive it because I think I have a problem with this list. Could you reply me to check it works ? Thank you -- Stéphane Wirtel - http://wirtel.be - @matrixise No, sorry :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: register cleanup handler
On Fri, 24 Jul 2015 12:01:58 -0400, Neal Becker wrote: > > This would work, but is not very elegant. I hope for a better way. > > need_cleanup = False try: >if (condition): > do_something_needing_cleanup need_cleanup = True >else: > do_something_else >code_executed_unconditionally > finally: >if need_cleanup: > do_cleanup if condition: try: do_something_needing_cleanup() code_executed_unconditionally() finally: do_cleanup() else: do_something_else() code_executed_unconditionally() -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list
Re: password authentication failed (SOLVED)
On 07/22/2015 04:44 PM, Chris Angelico wrote: On Thu, Jul 23, 2015 at 9:35 AM, Gary Roach wrote: At this point, I'm confused about a few things. Does the postgresql server and my archivedb reside globally or are they inside my archivedb virtual environment. I think globally. Your virtual environment is a Python construct only. That's where Python packages get installed, so if you don't activate it, you might not be able to use psycopg2, but as you surmise, the database itself is elsewhere on the system. To get pgAdmin3 to work, I have to have it set so that it logs in as gary ( no choice with this) and set group to root. Then in application > advanced options set run as different user to root. This assumes that you are using a KDE4 desktop and have these option by right clicking the icons. pgAdmin3 data: Server Group > Server(1) > archivedb |_ Host name - 127.0.0.1 |_ username - archive |_ connected - no Archivedb requires a password to go deeper and takes the xx password that is in the django settings.py file. This opens up access to archivedb and lists archivedb > Schema(1) > public > tables(10). At this point I found that all of the sequences and all of the tables are owned by root. This is probably the root (no pun intended) cause. Now what do I do about it. I'm not sure how this came about so don't know how to fix it. Ah, all owned by root. Okay! I've never actually tried this, but you might be able to directly reassign a bunch of things: http://www.postgresql.org/docs/9.4/static/sql-reassign-owned.html Make sure you have a backup. Reassigning root in this way is quite possibly a bad idea. If there aren't too many tables, you could use ALTER TABLE: http://www.postgresql.org/docs/9.4/static/sql-altertable.html ALTER TABLE tablename OWNER TO archives; But in theory, you shouldn't need to worry about owners at all - just make sure permissions are all assigned. Which you have done. So it's entirely possible none of this will change anything. :( Worst case, you may need to do an SQL dump of the entire database, then check the export, make sure ownership is correct, and reimport into a brand new database. Tedious, but it's certain to fix the problem. ChrisA pgAdmin3 showed two potential problems. The first connection listed in pg_hba.conf was: local all postgres radius. I removed this line so that the first line would be: local all all trust. Since all connections will be handled through Django? there should not be a problem with keeping loose security at this point. The second problem was that all fo the sequence and table files in archivedb showed the owner to be root. I changed them all to archive - the user listed in Django's settings.py file. Python manage.py migrate now works with no errors. Thank you for your help. I found an O'Reilly book - PosgreSQL Up & Running, 2nd Edition, by Regina Obe and Leo Hsu that is very good. If I had read the book first, I would have avoided some of these problems. One of the things that I have found very frustrating is that most of the documentation is too compartmentalized. If an author is writing about Django they get sloppy with the database setup and visa versa. It now seems to me that: Postgresql should be set up first, the setup being completely disconnected from the Python / Django project All communication with the database will pass through Django with the exception of admin maintenance. Please correct me if I'm wrong. Gary R. -- https://mail.python.org/mailman/listinfo/python-list
42**1000000 is CPU time free
Of course, computing 42**100 is not free:
# --
import time
a=time.clock()
N=100
42**N
b=time.clock()
print("CPU TIME :", b - a)
# --
~~
CPU TIME : 2.37
real0m2.412s
user0m2.388s
sys 0m0.016s
~~
So please, explain the following:
# --
import time
a=time.clock()
42**100
b=time.clock()
print("CPU TIME :", b - a)
# --
~~
CPU TIME : 0.0
real0m2.410s
user0m2.400s
sys 0m0.008s
~~
(focus on the CPU TIME!!)
--
https://mail.python.org/mailman/listinfo/python-list
Re: About this mailing list
Blast ;) On 24 Jul 2015, at 22:38, Mark Lawrence wrote: > On 24/07/2015 21:27, Stéphane Wirtel wrote: >> Hi all, >> >> This mail is just to check if you receive it because I think I have a >> problem with this list. >> >> Could you reply me to check it works ? >> >> Thank you >> >> -- >> Stéphane Wirtel - http://wirtel.be - @matrixise > > No, sorry :) > > -- > My fellow Pythonistas, ask not what our language can do for you, ask > what you can do for our language. > > Mark Lawrence > > -- > https://mail.python.org/mailman/listinfo/python-list -- Stéphane Wirtel - http://wirtel.be - @matrixise -- https://mail.python.org/mailman/listinfo/python-list
Re: 42**1000000 is CPU time free
As you are doing an operation on a literal, Python is computing the value
at import time, which occurs before your time.clock() calls run.
Basically, what you really wrote in your code is:
import time
a = time.clock()
42000...00 # Replace the ...
with zeros until you have the actual value.
b = time.clock()
The computation time is still being shown in the real and user times
reported by the external call. Similarly, if you were to put time.clock()
calls around the import statement, you would see the time there, for the
first import statement (Python caches imports, so they generally only run
once per instance).
The first example can measure the time as you are using a variable, which
bypasses Python's literal optimization.
Chris
On Fri, Jul 24, 2015 at 1:54 PM, candide wrote:
> Of course, computing 42**100 is not free:
>
>
> # --
> import time
>
> a=time.clock()
>
> N=100
> 42**N
>
> b=time.clock()
>
> print("CPU TIME :", b - a)
> # --
>
>
> ~~
> CPU TIME : 2.37
>
> real0m2.412s
> user0m2.388s
> sys 0m0.016s
> ~~
>
> So please, explain the following:
>
>
> # --
> import time
>
> a=time.clock()
>
> 42**100
>
> b=time.clock()
>
> print("CPU TIME :", b - a)
> # --
>
> ~~
> CPU TIME : 0.0
>
> real0m2.410s
> user0m2.400s
> sys 0m0.008s
> ~~
>
> (focus on the CPU TIME!!)
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
https://mail.python.org/mailman/listinfo/python-list
Re: 42**1000000 is CPU time free
On Fri, Jul 24, 2015 at 3:54 PM, candide wrote: > Of course, computing 42**100 is not free: > So please, explain the following: > > (focus on the CPU TIME!!) In your second example, the peephole optimizer gets hold of it and does the calculation at compile time: Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from dis import dis >>> def with_var(): N = 100; return 42**N ... >>> def no_var(): return 42**100 ... >>> dis(with_var) 1 0 LOAD_CONST 1 (100) 3 STORE_FAST 0 (N) 6 LOAD_CONST 2 (42) 9 LOAD_FAST0 (N) 12 BINARY_POWER 13 RETURN_VALUE >>> dis(no_var) 1 0 LOAD_CONST 3 (211314374101136073653004404552311399169887833071358006126447793439156491987549688215057732151811172029315247932158994879668553186145824710950394684126712037376) 3 RETURN_VALUE >>> -- Zach -- https://mail.python.org/mailman/listinfo/python-list
Re: 42**1000000 is CPU time free
On 24/07/2015 21:54, candide wrote:
Of course, computing 42**100 is not free:
# --
import time
a=time.clock()
N=100
42**N
b=time.clock()
print("CPU TIME :", b - a)
# --
~~
CPU TIME : 2.37
real0m2.412s
user0m2.388s
sys 0m0.016s
~~
So please, explain the following:
# --
import time
a=time.clock()
42**100
b=time.clock()
print("CPU TIME :", b - a)
# --
~~
CPU TIME : 0.0
real0m2.410s
user0m2.400s
sys 0m0.008s
~~
(focus on the CPU TIME!!)
I suggest that you use the dis module to compare the code generated for
the snippet using 'N' and that using the constant 100.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
Re: 42**1000000 is CPU time free
On Friday 24 Jul 2015 22:54 CEST, candide wrote:
> Of course, computing 42**100 is not free:
>
>
> # --
> import time
>
> a=time.clock()
>
> N=100
> 42**N
>
> b=time.clock()
>
> print("CPU TIME :", b - a)
> # --
>
>
> ~~
> CPU TIME : 2.37
>
> real0m2.412s
> user0m2.388s
> sys 0m0.016s
> ~~
>
> So please, explain the following:
>
>
> # --
> import time
>
> a=time.clock()
>
> 42**100
>
> b=time.clock()
>
> print("CPU TIME :", b - a)
> # --
>
> ~~
> CPU TIME : 0.0
>
> real0m2.410s
> user0m2.400s
> sys 0m0.008s
> ~~
>
> (focus on the CPU TIME!!)
I cannot reproduce this. The first gives:
CPU TIME : 0.62627899
and the second:
CPU TIME : 0.6343649
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.python.org/mailman/listinfo/python-list
Re: 42**1000000 is CPU time free
Thanks to all for your response, I was not aware that the interpreter evaluated pure litteral expressions at compile time. -- https://mail.python.org/mailman/listinfo/python-list
Re: Which GUI?
On Fri, 24 Jul 2015 19:31:36 +0100, Paulo da Silva wrote: [snip] > Which technology is better? > matplotlib? > tkinter? > wxwidgets? > qt? Sadly - I don't think wxpython has been ported to python3 yet. -- https://mail.python.org/mailman/listinfo/python-list
Re: Which GUI?
On 24/07/2015 23:20, Frank Miles wrote: On Fri, 24 Jul 2015 19:31:36 +0100, Paulo da Silva wrote: [snip] Which technology is better? matplotlib? tkinter? wxwidgets? qt? Sadly - I don't think wxpython has been ported to python3 yet. http://wxpython.org/Phoenix/docs/html/main.html -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: About this mailing list
On Fri, Jul 24, 2015 at 9:27 PM, Stéphane Wirtel wrote: > Hi all, > > This mail is just to check if you receive it because I think I have a > problem with this list. > > Could you reply me to check it works ? > We hear you loud and clear > > Thank you > > You are welcome > -- > Stéphane Wirtel - http://wirtel.be - @matrixise > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: How may I learn Python Web Frameworks
The official Django docs is pretty detailed https://docs.djangoproject.com/en/1.8/ You could also look at the Django book but it confesses to being written for version 1.4 even though it goes ahead to assure us that it's not outdated https://django-book.readthedocs.org/en/latest/ -- https://mail.python.org/mailman/listinfo/python-list
Re: what windows compiler for python 3.5?
On 24/07/2015 13:24, Brian Gladman wrote: On 24/07/2015 12:04, Chris Angelico wrote: On Fri, Jul 24, 2015 at 8:53 PM, Robin Becker wrote: yes I build extensions for reportlab. Unfortunately, despite our MSDN subscription to the Visual Studio stuff we have no access to the Visual Studio Version 2015. Last one in my downloads is currently 2013. Pity. Ah. You may well be somewhat out of luck for the moment, then; I've no idea what status is during the betas. Once Python 3.5 is released, VS 2015 should also be available, or else the official compiler for CPython 3.5 will probably be changed. In the meantime, you could possibly ask on python-dev; Steve Dower of Microsoft hangs out there, and he's the one who's driving the compiler choice - he may be able to advise as to where to get the prerelease compiler. Visual Studio 2015 Community was relased earlier this week so there is no need to work with the prerelease version. No idea how I managed to miss that. Still upgrade achieved and it only took around four hours 30 minutes. We've terms like software, middleware, firmware, vapourware and so on and so forth, but I'm not certain what VS2015 comes under, explodedware possibly? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
scalar vs array and program control
Hello, I'm fairly new to Python, struggling to write in a more object-oriented, functional style. I just wrote a function that takes two arrays representing sine (y) and cosine (x) angle coordinates, and returns the angle in degrees. I had initially written the function to take array-like arguments x/y, but I'd like to generalize and take scalars as well. However, the function has a subsetting operations, which don't work with scalars: vmag = np.sqrt((x ** 2) + (y ** 2)) ang = np.arctan2(y, x) ang[ang < 0] = ang[ang < 0] + (2 * np.pi) # output range 0 - 2*pi ang[vmag == 0] = 0 # when magnitude is 0 the angle is also 0 ang[ang == 0] = 2 * np.pi # convention If I want to take scalars x/y, I naively thought about implementing an if/else statement right before the subsetting operations. However, my intuition tells me there must be a proper object-oriented solution to this. Any tips appreciated. Cheers, -- Seb -- https://mail.python.org/mailman/listinfo/python-list
