Re: Question about regular expression

2015-09-30 Thread Denis McMahon
On Wed, 30 Sep 2015 11:34:04 -0700, massi_srb wrote: > firstly the description of my problem. I have a string in the following > form: . The way I solved this was to: 1) replace all the punctuation in the string with spaces 2) split the string on space 3) process each thing in the list to

Re: Question about regular expression

2015-09-30 Thread Emile van Sebille
On 9/30/2015 12:20 PM, Tim Chase wrote: On 2015-09-30 11:34, massi_...@msn.com wrote: I guess this problem can be tackled with regular expressions, b ... However, if you *want* to do it with regular expressions, you can. It's ugly and might be fragile, but

Re: Question re class variable

2015-09-29 Thread alister
On Tue, 29 Sep 2015 02:27:23 -0700, plewto wrote: > I have a perplexing problem with Python 3 class variables. I wish to > generate an unique ID each time an instance of GameClass is created. > There are two versions of the __gen_id method with test run results for > each listed below the code. >

Re: Question re class variable

2015-09-29 Thread Antoon Pardon
Op 29-09-15 om 11:27 schreef ple...@gmail.com: > I have a perplexing problem with Python 3 class variables. I wish to generate > an unique ID each time an instance of GameClass is created. There are two > versions of the __gen_id method with test run results for each listed below > the code.

Re: Question re class variable

2015-09-29 Thread jmp
On 09/29/2015 01:02 PM, jmp wrote: class GameObject: @property def id(self): return id(self) #use the builtin id function print GameObject().id Cheers, JM I should add that until you don't serialize your object you're fine. If you need to serialize it, you may want to look at

Re: Question re class variable

2015-09-29 Thread Steven D'Aprano
On Tue, 29 Sep 2015 09:17 pm, Anssi Saari wrote: [...] >> The problem is that in python you can't change a class variable through >> an instance. The moment you try, you create an instance attribute. > > That much is clear but why does his other version of __gen_id() work > (after a fashion)? It

Re: Question re class variable

2015-09-29 Thread Anssi Saari
Antoon Pardon writes: > Op 29-09-15 om 11:27 schreef ple...@gmail.com: >> I have a perplexing problem with Python 3 class variables. I wish to >> generate an unique ID each time an instance of GameClass is >> created. There are two versions of the __gen_id method

Re: Question re class variable

2015-09-29 Thread jmp
On 09/29/2015 11:27 AM, ple...@gmail.com wrote: I have a perplexing problem with Python 3 class variables. Your problem is that when assigning values to your class attribute, you are actually creating a instance attribute. class Foo: bar = "I'm a class attribute" def __init__(self):

Re: Question re class variable

2015-09-29 Thread Antoon Pardon
Op 29-09-15 om 13:17 schreef Anssi Saari: > Antoon Pardon writes: > >> Op 29-09-15 om 11:27 schreef ple...@gmail.com: >>> I have a perplexing problem with Python 3 class variables. I wish to >>> generate an unique ID each time an instance of GameClass is >>> created.

Re: Question re class variable

2015-09-29 Thread John Gordon
In alister writes: > why not simply use pythons builtin id function? > each new instance of an object is automatically assigned a unique ID It's only guaranteed to be unique for objects that exist at the same time. If an

Re: Question about import

2015-09-11 Thread Frank Millman
"Ian Kelly" wrote in message news:calwzidm3khnagtt0ohveo5bhqk1tfejbuuuinw9tnuxrpnr...@mail.gmail.com... On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote: > That makes me wonder if, in my project, I can import all modules inside > 'start.py', and then just use 'import

Re: Question about import

2015-09-11 Thread dieter
"Frank Millman" writes: >... > My project comprises a number of modules, split into packages. Modules > frequently need to access the contents of other modules, in the same > or in a different package. I am getting better at it, but I still > occasionally bump my head against

Re: Question about import

2015-09-10 Thread Ian Kelly
On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote: > That makes me wonder if, in my project, I can import all modules inside > 'start.py', and then just use 'import package_name' inside each module? You can, but for readability and reuse I think it's better to be explicit

Re: Question about import

2015-09-10 Thread Peter Otten
Ian Kelly wrote: > On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote: >> That makes me wonder if, in my project, I can import all modules inside >> 'start.py', and then just use 'import package_name' inside each module? > > You can, but for readability and reuse I think

Re: Question about import

2015-09-10 Thread Ian Kelly
On Thu, Sep 10, 2015 at 8:47 AM, Peter Otten <__pete...@web.de> wrote: > Ian Kelly wrote: >> That surprises me also, but I suspect it's because they're >> subdirectories of the current working directory rather than packages >> found on the sys.path. > > So even the experts cannot keep up with all

Re: Question About Image Processing in Python

2015-05-28 Thread Alan Gauld
On 28/05/15 11:34, Serge Christian Ibala wrote: I want to know which version of Python is compatible (or can be associated with which version of which tools or package for image processing) It would help if you told us what kind of image processing. If you mean programmatic manipulation of

Re: Question About Image Processing in Python

2015-05-28 Thread Oscar Benjamin
On 28 May 2015 at 11:34, Serge Christian Ibala christian.ib...@gmail.com wrote: Hello All, I want to know which version of Python is compatible (or can be associated with which version of which tools or package for image processing) I am working under Window and it is so complicated to find

Re: Question About Image Processing in Python

2015-05-28 Thread Todd
On Thu, May 28, 2015 at 1:05 PM, Terry Reedy tjre...@udel.edu wrote: On 5/28/2015 6:34 AM, Serge Christian Ibala wrote: I want to use the following package “numpy, matplotib, mahotas, ipython OpenCV and SciPy opencv seems to be the only one not available for 3.x. OpenCV 3 (which is

Re: Question About Image Processing in Python

2015-05-28 Thread Terry Reedy
On 5/28/2015 6:34 AM, Serge Christian Ibala wrote: I want to know which version of Python is compatible (or can be associated with which version of which tools or package for image processing) pillow is a one standard for image processing but I see that mahotas does different things. pillow

Re: Question About Image Processing in Python

2015-05-28 Thread Sturla Molden
Serge Christian Ibala christian.ib...@gmail.com wrote: Or what is the recommendation of Python for image processing? Basic setup everyone should have: Python NumPy SciPy (e.g. scipy.ndimage) Cython C and C++ compiler matplotlib scikit-image scikit-learn pillow Also consider: mahotas tifffile

Re: Question Installing latest Python

2015-04-29 Thread Steven D'Aprano
On Wed, 29 Apr 2015 04:57 pm, Φώντας Λαδοπρακόπουλος wrote: Thank you very much Steven! Indeed it worked!! One last thing. Can you please explain to me inplain English what exactly was that weird problem? Probably not. I'm not a C expert and don't really understand in full detail how

Re: Question Installing latest Python

2015-04-29 Thread Steven D'Aprano
On Wednesday 29 April 2015 12:50, Φώντας Λαδοπρακόπουλος wrote: The guide i followed is this one: https://devops.profitbricks.com/tutorials/install-python-3-in-centos-7/ The actual command i used to install Python 3.3.2 was this one: yum -y install python33 ===

Re: Question Installing latest Python

2015-04-29 Thread Steven D'Aprano
On Wednesday 29 April 2015 16:13, Φώντας Λαδοπρακόπουλος wrote: Τη Τετάρτη, 29 Απριλίου 2015 - 8:57:25 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: Okay, I googled that error message and I think I understand what is failing, even though I don't understand why it is failing. First, run

Re: Question Installing latest Python

2015-04-29 Thread Chris Angelico
On Wed, Apr 29, 2015 at 9:42 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 29 Apr 2015 04:57 pm, Φώντας Λαδοπρακόπουλος wrote: Thank you very much Steven! Indeed it worked!! One last thing. Can you please explain to me inplain English what exactly was that weird

Re: Question Installing latest Python

2015-04-28 Thread Steven D'Aprano
On Wed, 29 Apr 2015 05:26 am, Φώντας Λαδοπρακόπουλος wrote: Τη Τρίτη, 28 Απριλίου 2015 - 10:02:24 π.μ. UTC+3, ο χρήστης Φώντας Λαδοπρακόπουλος έγραψε: First of all Steven thank youvery much for your detailed help. Secondly prior of seeing your post i tried to folowe a guid and isntall

Re: Question Installing latest Python

2015-04-28 Thread Albert-Jan Roskam
On Mon, Apr 27, 2015 4:55 PM CEST Steven D'Aprano wrote: On Mon, 27 Apr 2015 01:11 am, Φώντας Λαδοπρακόπουλος wrote: Τη Κυριακή, 26 Απριλίου 2015 - 6:05:50 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: On Mon, 27 Apr 2015 01:00 am, Φώντας Λαδοπρακόπουλος wrote:

Re: Question Installing latest Python

2015-04-27 Thread Steven D'Aprano
On Mon, 27 Apr 2015 01:11 am, Φώντας Λαδοπρακόπουλος wrote: Τη Κυριακή, 26 Απριλίου 2015 - 6:05:50 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: On Mon, 27 Apr 2015 01:00 am, Φώντας Λαδοπρακόπουλος wrote: Hello, Can you please tell me how to install latest Python 3.4.x without

Re: Question Installing latest Python

2015-04-26 Thread Steven D'Aprano
On Mon, 27 Apr 2015 01:00 am, Φώντας Λαδοπρακόπουλος wrote: Hello, Can you please tell me how to install latest Python 3.4.x without disturbing the other default python v2.7.5 intallation that i currently have on my VPS server and access it as Python 3? Thank you. Not unless you tell us

Re: Question about importlib

2015-03-07 Thread Chris Angelico
On Sun, Mar 8, 2015 at 6:30 PM, Frank Millman fr...@chagford.com wrote: Actually, as I write this, I realise that there is a more important question that had not occurred to me before. Is this a potential security risk? My intention is that the caller would only call functions within my own

Re: Question about importlib

2015-03-07 Thread Frank Millman
Chris Angelico ros...@gmail.com wrote in message news:CAPTjJmrXp4MSO9f=xb_brupnrz7xrksktkbfvo-e5n7lr_m...@mail.gmail.com... On Sun, Mar 8, 2015 at 6:30 PM, Frank Millman fr...@chagford.com wrote: Actually, as I write this, I realise that there is a more important question that had not

Re: Question about 'x' in pymc.invlogit(a+b*x)

2015-03-07 Thread Terry Reedy
On 3/7/2015 11:44 AM, fl wrote: Hi, I once learnt Python for a few weeks. Now, I try to using a Python package pymc. It has the following example code: import pymc import numpy as np n = 5*np.ones(4,dtype=int) x = np.array([-.86,-.3,-.05,.73]) x is defined here as a module ('global') name

Re: Question about python package numpy

2015-03-02 Thread Robert Kern
On 2015-03-01 20:32, fl wrote: Hi, It is difficult to install numpy package for my PC Windows 7, 64-bit OS. In the end, I install Enthought Canopy, which is recommended on line because it does install numpy automatically. Now, I can test it with import numpy it succeeds. On

Re: Question about python package numpy

2015-03-01 Thread Andrea D'Amore
On 2015-03-01 20:32:34 +, fl said: import numpy it succeeds. On http://wiki.scipy.org/Cookbook, it shows some interesting code example snippet, such as Cookbook / ParticleFilter, Markov chain etc. I don't know how I can access these code examples, because I don't know where Enthought

Re: Question about python package numpy

2015-03-01 Thread fl
On Sunday, March 1, 2015 at 1:25:59 PM UTC-8, Andrea D'Amore wrote: On 2015-03-01 20:32:34 +, fl said: import numpy it succeeds. On http://wiki.scipy.org/Cookbook, it shows some interesting code example snippet, such as Cookbook / ParticleFilter, Markov chain etc. I don't know how

Re: Question on asyncio

2015-02-23 Thread Marko Rauhamaa
pfranke...@gmail.com: Hello Marko! Am Sonntag, 22. Februar 2015 22:21:55 UTC+1 schrieb Marko Rauhamaa: In asyncio, you typically ignore the value returned by yield. While generators use yield to communicate results to the calling program, coroutines use yield only as a trick to implement

Re: Question on asyncio

2015-02-23 Thread Jonas Wielicki
On 23.02.2015 14:27, Marko Rauhamaa wrote: pfranke...@gmail.com: The corresponding call is a call to the python smbus library. It includes several sleeps (even though they are only about 50ms). Therefore I think it is worthwhile to encapsulate it into a coroutine. Maybe. Then you'll

Re: Question on asyncio

2015-02-23 Thread pfranken85
Hello Marko! Am Sonntag, 22. Februar 2015 22:21:55 UTC+1 schrieb Marko Rauhamaa: In asyncio, you typically ignore the value returned by yield. While generators use yield to communicate results to the calling program, coroutines use yield only as a trick to implement cooperative multitasking

Re: Question on asyncio

2015-02-22 Thread Marko Rauhamaa
pfranke...@gmail.com: I have some functions which are reading values from hardware. If one of the values changes, I want a corresponding notification to the connected clients. The network part shouldn't be the problem. Here is what I got so far: @asyncio.coroutine def check(): old_val =

Re: question on string object handling in Python 2.7.8

2014-12-25 Thread Denis McMahon
On Tue, 23 Dec 2014 20:28:30 -0500, Dave Tian wrote: Hi, There are 2 statements: A: a = ‘h’ B: b = ‘hh’ According to me understanding, A should be faster as characters would shortcut this 1-byte string ‘h’ without malloc; B should be slower than A as characters does not work for 2-byte

Re: question on string object handling in Python 2.7.8

2014-12-24 Thread Steven D'Aprano
Dave Tian wrote: Hi, There are 2 statements: A: a = ‘h’ B: b = ‘hh’ According to me understanding, A should be faster as characters would shortcut this 1-byte string ‘h’ without malloc; B should be slower than A as characters does not work for 2-byte string ‘hh’, which triggers the

Re: question on string object handling in Python 2.7.8

2014-12-24 Thread Dave Angel
On 12/23/2014 08:28 PM, Dave Tian wrote: Hi, Hi, please do some things when you post new questions: 1) identify your Python version. In this case it makes a big difference, as in Python 2.x, the range function is the only thing that takes any noticeable time in this code. 2) when

Re: question on string object handling in Python 2.7.8

2014-12-24 Thread Ned Batchelder
On 12/23/14 8:28 PM, Dave Tian wrote: Hi, There are 2 statements: A: a = ‘h’ B: b = ‘hh’ According to me understanding, A should be faster as characters would shortcut this 1-byte string ‘h’ without malloc; B should be slower than A as characters does not work for 2-byte string ‘hh’, which

Re: question on string object handling in Python 2.7.8

2014-12-24 Thread Ian Kelly
On Wed, Dec 24, 2014 at 4:22 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: What happens here is that you time a piece of code to: - Build a large list containing 100 million individual int objects. Each int object has to be allocated at run time, as does the list. Each int

Re: question on string object handling in Python 2.7.8

2014-12-24 Thread Gregory Ewing
Dave Tian wrote: A: a = ‘h’ B: b = ‘hh’ According to me understanding, A should be faster as characters would shortcut this 1-byte string ‘h’ without malloc; It sounds like you're expecting characters to be stored unboxed like in Java. That's not the way Python works. Objects are used

Re: Question on lambdas

2014-12-09 Thread Dave Angel
On 12/09/2014 02:15 AM, memilanuk wrote: On 12/08/2014 09:30 PM, Ben Finney wrote: memilanuk memila...@gmail.com writes: ... lambda: update_label2('A', 100) would this work the same? (I don't know what you mean here by “the same”; the same as what?) The above creates a new function, which

Re: Question on lambdas

2014-12-09 Thread Thomas Rachel
Am 09.12.2014 04:09 schrieb memilanuk: so in the first example in my original post: ... lambda: update_label2('A', 100) would this work the same? It looks as though it'd be passing the same two parameters to the same function... lambda: 'A', 100: update_label2() No. Even if it would be

Re: Question on lambdas

2014-12-09 Thread Christoph M. Becker
Ben Finney wrote: Christoph Becker cmbecke...@gmx.de writes: Ben Finney wrote: It's best to remember that ‘lambda’ is syntactic sugar for creating a function; the things it creates are not special in any way, they are normal functions, not “lambdas”. Could you please elaborate why

Re: Question on lambdas

2014-12-08 Thread Chris Angelico
On Tue, Dec 9, 2014 at 10:43 AM, memilanuk memila...@gmail.com wrote: What I'm having trouble finding a concrete answer to is the difference between: lambda: some_func lambda e: some_func These two are quite simple. (In each case, it's an expression, not a function, for what it's worth.)

Re: Question on lambdas

2014-12-08 Thread Ben Finney
memilanuk memila...@gmail.com writes: What I'm having trouble finding a concrete answer to is the difference between: (Note that where you write “some_func” the syntax requires an expression, not a function. I've changed your examples to be clear). lambda: some_expr This creates a new

Re: Question on lambdas

2014-12-08 Thread Gary Herron
On 12/08/2014 03:43 PM, memilanuk wrote: So... I was browsing some questions on reddit, and one of them involved tkinter and lambdas. Managed to help the person out, but in the process ended up with more questions of my own :/ My basic confusion revolves around this: in one instance I see

Re: Question on lambdas

2014-12-08 Thread Chris Angelico
On Tue, Dec 9, 2014 at 10:58 AM, Ben Finney ben+pyt...@benfinney.id.au wrote: lambda x=some_value: some_expr This creates a new function which expects one parameter named ‘x’, which parameter has a default value of ‘some_value’. The function, when called, will return the value of ‘some_expr’.

Re: Question on lambdas

2014-12-08 Thread MRAB
On 2014-12-08 23:58, Ben Finney wrote: memilanuk memila...@gmail.com writes: What I'm having trouble finding a concrete answer to is the difference between: (Note that where you write “some_func” the syntax requires an expression, not a function. I've changed your examples to be clear).

Re: Question on lambdas

2014-12-08 Thread Christoph Becker
Ben Finney wrote: It's best to remember that ‘lambda’ is syntactic sugar for creating a function; the things it creates are not special in any way, they are normal functions, not “lambdas”. Could you please elaborate why ‘lambda’ does not create “lambdas”. I'm a Python beginner (not new to

Re: Question on lambdas

2014-12-08 Thread Chris Angelico
On Tue, Dec 9, 2014 at 12:44 PM, Christoph Becker cmbecke...@gmx.de wrote: Ben Finney wrote: It's best to remember that ‘lambda’ is syntactic sugar for creating a function; the things it creates are not special in any way, they are normal functions, not “lambdas”. Could you please elaborate

Re: Question on lambdas

2014-12-08 Thread Terry Reedy
On 12/8/2014 8:53 PM, Chris Angelico wrote: On Tue, Dec 9, 2014 at 12:44 PM, Christoph Becker cmbecke...@gmx.de wrote: Ben Finney wrote: It's best to remember that ‘lambda’ is syntactic sugar for creating a function; the things it creates are not special in any way, they are normal functions,

Re: Question on lambdas

2014-12-08 Thread memilanuk
On 12/08/2014 03:58 PM, Ben Finney wrote: memilanuk memila...@gmail.com writes: What I'm having trouble finding a concrete answer to is the difference between: lambda: some_expr This creates a new function which expects zero parameters. The function, when called, will return the value

Re: Question on lambdas

2014-12-08 Thread Ben Finney
Christoph Becker cmbecke...@gmx.de writes: Ben Finney wrote: It's best to remember that ‘lambda’ is syntactic sugar for creating a function; the things it creates are not special in any way, they are normal functions, not “lambdas”. Could you please elaborate why ‘lambda’ does not

Re: Question on lambdas

2014-12-08 Thread Ben Finney
memilanuk memila...@gmail.com writes: ... lambda: update_label2('A', 100) would this work the same? (I don't know what you mean here by “the same”; the same as what?) The above creates a new function, which expects no parameters (because there are no parameters before its ‘:’). The

Re: Question on lambdas

2014-12-08 Thread Steven D'Aprano
On Tue, 09 Dec 2014 02:44:12 +0100, Christoph Becker wrote: Ben Finney wrote: It's best to remember that ‘lambda’ is syntactic sugar for creating a function; the things it creates are not special in any way, they are normal functions, not “lambdas”. Could you please elaborate why

Re: Question on lambdas

2014-12-08 Thread Rustom Mody
On Tuesday, December 9, 2014 5:28:49 AM UTC+5:30, Ben Finney wrote: memilanuk writes: What I'm having trouble finding a concrete answer to is the difference between: (Note that where you write “some_func” the syntax requires an expression, not a function. I've changed your examples to

Re: Question on lambdas

2014-12-08 Thread memilanuk
On 12/08/2014 09:30 PM, Ben Finney wrote: memilanuk memila...@gmail.com writes: ... lambda: update_label2('A', 100) would this work the same? (I don't know what you mean here by “the same”; the same as what?) The above creates a new function, which expects no parameters (because there are

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-16 Thread Grant Edwards
On 2014-11-16, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Grant Edwards wrote: On 2014-11-15, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: pythonista wrote: I am developing a python application as a contractor. I would like to know if someone can provide

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 3:28 AM, Grant Edwards invalid@invalid.invalid wrote: But, you're right: anybody who spent more than a half hour on this is either a flaming incompetent or a scam artist. Half an hour of human time, maybe, but potentially spread across a few hours of wall time. Building

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Steven D'Aprano
pythonista wrote: I am developing a python application as a contractor. I would like to know if someone can provide me with some insight into the problems that then infrastructure team has been having. The scope of the project was to install python 2.7.8 and 4 modules/site packages on a

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Grant Edwards
On 2014-11-15, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: pythonista wrote: I am developing a python application as a contractor. I would like to know if someone can provide me with some insight into the problems that then infrastructure team has been having. The scope

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Michael Torrie
On 11/14/2014 08:01 PM, pythonista wrote: Can anyone provide me with insight as to the scope what the problem could have been? Well the fact is that RHEL 6 uses Python 2.6 as a core system package. Many system utilities depend on it, so it cannot be replaced with a newer version. You must

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Michael Torrie
On 11/15/2014 08:15 AM, Steven D'Aprano wrote: A fresh linux build of Red Hat Linux 6? RHL 6 was discontinued in 2000. Yes I know you're making a point about not assuming anything, but the odds are very good that the OP meant RHEL6. And meaning RHEL6, there are some good reasons why the

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Michael Torrie
On 11/14/2014 08:01 PM, pythonista wrote: The scope of the project was to install python 2.7.8 and 4 modules/site packages on a fresh linux build. I neglected to put the URL for software collections in my reply to you. Here it is. https://www.softwarecollections.org/en/scls/rhscl/python27/

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Michael Torrie
On 11/15/2014 10:13 AM, Michael Torrie wrote: If it's a package that won't conflict, such as Python 2.4, you can Ahem, that should have been 3.4 -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Steven D'Aprano
Grant Edwards wrote: On 2014-11-15, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: pythonista wrote: I am developing a python application as a contractor. I would like to know if someone can provide me with some insight into the problems that then infrastructure team has

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Chris Angelico
On Sun, Nov 16, 2014 at 12:08 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Assuming it was RHEL 6, then installing Python 2.7 from source as a separate application from the system Python should be trivially easy, half an hour's work. Download the source, untar, run

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Michael Torrie
On 11/15/2014 06:08 PM, Steven D'Aprano wrote: Assuming it was RHEL 6, then installing Python 2.7 from source as a separate application from the system Python should be trivially easy, half an hour's work. Download the source, untar, run ./configure, make, make altinstall and you should be

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Chris Angelico
On Sun, Nov 16, 2014 at 12:57 PM, Michael Torrie torr...@gmail.com wrote: In my last system administration job, we forbade installing from source, at least in the manner you are describing. It's a maintenance nightmare. Especially when it comes time to upgrade the system and get things up

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-14 Thread Chris Angelico
On Sat, Nov 15, 2014 at 2:01 PM, pythonista software.by.pyt...@gmail.com wrote: The scope of the project was to install python 2.7.8 and 4 modules/site packages on a fresh linux build. The first team failed after almost 3 weeks of work. Then they put their star Linux administrator on the

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-14 Thread Cameron Simpson
On 14Nov2014 19:01, pythonista software.by.pyt...@gmail.com wrote: I am developing a python application as a contractor. I would like to know if someone can provide me with some insight into the problems that then infrastructure team has been having. The scope of the project was to install

Re: Question about PANDAS

2014-10-20 Thread Ryan Shuell
Thanks guys. I just feel frustrated that I can't do something useful. I'm reading all about dictionaries, and types, and touples. Then I read about string manipulation and loops; two of my favorite things to do. Then I read about logic: -719 = 833 False That's great, but it's just not very

Re: Question about PANDAS

2014-10-20 Thread Mark Lawrence
On 19/10/2014 20:57, Ryan Shuell wrote: Thanks guys. I just feel frustrated that I can't do something useful. I'm reading all about dictionaries, and types, and touples. Then I read about string manipulation and loops; two of my favorite things to do. Then I read about logic: -719 = 833 False

Re: Question about PANDAS

2014-10-20 Thread giacomo boffi
Ryan Shuell ryanshu...@gmail.com writes: Thanks guys.  I just feel frustrated that I can't do something useful. I had read many of your messages in the recent past, and I'm under the impression that your frustration has more to do with Python the Infrastructure rather than Python the Language

Re: Question about PANDAS

2014-10-20 Thread Johann Hibschman
giacomo boffi pec...@pascolo.net writes: 2. choose ONE flavour of python, either 2.7.x or 3.4.x - future is with 3.4, - most exaples you'll find were written (are still written...) for 2.7.x If you're interested in statistics (as comparisons to R suggest), I'd recommend

Re: Question about PANDAS

2014-10-19 Thread Mark Lawrence
On 18/10/2014 21:00, ryguy7272 wrote: I'm trying to install Pandas. I went to this link. https://pypi.python.org/pypi/pandas/0.14.1/#downloads I downloaded this: pandas-0.14.1.win32-py2.7.exe (md5) I have Python27 installed. So, I run the executable and re-run my Python script and I get the

Re: Question about PANDAS

2014-10-19 Thread Joel Goldstick
On Sun, Oct 19, 2014 at 10:19 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 18/10/2014 21:00, ryguy7272 wrote: I'm trying to install Pandas. I went to this link. https://pypi.python.org/pypi/pandas/0.14.1/#downloads I downloaded this: pandas-0.14.1.win32-py2.7.exe (md5) I have

Re: Question about PANDAS

2014-10-19 Thread Joel Goldstick
On Sun, Oct 19, 2014 at 3:57 PM, Ryan Shuell ryanshu...@gmail.com wrote: Thanks guys. I just feel frustrated that I can't do something useful. I'm reading all about dictionaries, and types, and touples. Then I read about string manipulation and loops; two of my favorite things to do. Then

Re: Question about PANDAS

2014-10-19 Thread Rustom Mody
On Sun, Oct 19, 2014 at 3:57 PM, Ryan Shuell wrote: Thanks guys. I just feel frustrated that I can't do something useful. I'm reading all about dictionaries, and types, and touples. Then I read about string manipulation and loops; two of my favorite things to do. Then I read about logic:

Re: Question About Running Python code

2014-10-16 Thread Andrew Jaffe
On 15/10/2014 23:50, ryguy7272 wrote: The error that I get is this. 'invalid syntax' The second single quote in this line is highlighted pink. print 'Downloading data from Yahoo for %s sector' % sector This is a script written for Python 2.*, but you say you are using Python 3.4. In Python

Re: Question About Running Python code

2014-10-15 Thread Dan Stromberg
On Wed, Oct 15, 2014 at 3:50 PM, ryguy7272 ryanshu...@gmail.com wrote: I'm trying to run this script (using IDLE 3.4) I would be most appreciative if someone could respond to a few questions. The error that I get is this. 'invalid syntax' You may get better help if you give the context of

Re: Question About Running Python code

2014-10-15 Thread Cameron Simpson
On 15Oct2014 16:09, Dan Stromberg drsali...@gmail.com wrote: On Wed, Oct 15, 2014 at 3:50 PM, ryguy7272 ryanshu...@gmail.com wrote: #1) That's very bizarre to mix single quotes and double quotes in a single language. Does Python actually mix single quotes and double quotes? I'm not

Re: Question About Running Python code

2014-10-15 Thread Ian Kelly
On Oct 15, 2014 7:04 PM, Cameron Simpson c...@zip.com.au wrote: On 15Oct2014 16:09, Dan Stromberg drsali...@gmail.com wrote: On Wed, Oct 15, 2014 at 3:50 PM, ryguy7272 ryanshu...@gmail.com wrote: #1) That's very bizarre to mix single quotes and double quotes in a single language. Does

Re: Question about uninstallation.

2014-09-28 Thread Fabien
On 28.09.2014 03:07, Gregory Johannes-Kinsbourg wrote: both Python 2 3 (I’m on OS X 10.10 btw) and first of all was curious to know if they will clash I am also quite new to the python business, and had the same kind of questions (how to install/uninstall a package, will different

Re: Question about uninstallation.

2014-09-28 Thread Ned Deily
In article captjjmonhfm1mr+2ssiy8r6ntvduzxqsxxjraxmi6deqh9h...@mail.gmail.com, Chris Angelico ros...@gmail.com wrote: On Sun, Sep 28, 2014 at 11:07 AM, Gregory Johannes-Kinsbourg harmonoisemu...@gmail.com wrote: Anyway, I’ve basically ended up installing both Python 2 3 (I’m on OS X

Re: Question about uninstallation.

2014-09-28 Thread Chris Angelico
On Mon, Sep 29, 2014 at 9:17 AM, Ned Deily n...@acm.org wrote: That's odd advice. ... And, while OS X 10.10 Yosemite is still a few weeks away from its expected official release data, you can be sure that the current releases of Python have been tested with the public beta and with developer

Re: Question about uninstallation.

2014-09-28 Thread Ned Deily
In article CAPTjJmq-55xV2nbsVgc6UFz8Xkw_wnh_S9RejduwZteU=2o...@mail.gmail.com, Chris Angelico ros...@gmail.com wrote: On Mon, Sep 29, 2014 at 9:17 AM, Ned Deily n...@acm.org wrote: That's odd advice. ... And, while OS X 10.10 Yosemite is still a few weeks away from its expected official

Re: Question about uninstallation.

2014-09-27 Thread Chris Angelico
On Sun, Sep 28, 2014 at 11:07 AM, Gregory Johannes-Kinsbourg harmonoisemu...@gmail.com wrote: Anyway, I’ve basically ended up installing both Python 2 3 (I’m on OS X 10.10 btw) and first of all was curious to know if they will clash with each when being used in terminal and how do i safely

Re: Question about asyncio doc example

2014-07-24 Thread Terry Reedy
On 7/24/2014 1:15 AM, Saimadhav Heblikar wrote: On 24 July 2014 05:54, Terry Reedy tjre...@udel.edu wrote: On 7/23/2014 6:43 AM, Saimadhav Heblikar wrote: Hi, The example in question is https://docs.python.org/3/library/asyncio-task.html#example-hello-world-coroutine. I'd like to learn the

Re: Question about asyncio doc example

2014-07-24 Thread Marko Rauhamaa
Terry Reedy tjre...@udel.edu: 18.5.3. Tasks and coroutines, seems to be devoid of event wait examples. However, there is a 'yield from' network example in 18.5.5 Streams using socket functions wrapped with coroutines. These should definitely be used instead of sleep. In fact, for

Re: Question about asyncio doc example

2014-07-24 Thread Ian Kelly
On Jul 24, 2014 1:26 AM, Marko Rauhamaa ma...@pacujo.net wrote: Terry Reedy tjre...@udel.edu: 18.5.3. Tasks and coroutines, seems to be devoid of event wait examples. However, there is a 'yield from' network example in 18.5.5 Streams using socket functions wrapped with coroutines. These

Re: Question about asyncio doc example

2014-07-24 Thread Marko Rauhamaa
Ian Kelly ian.g.ke...@gmail.com: Callbacks can easily schedule coroutines, but they can't wait on them, because that would require suspending their execution, dropping back to the event loop, and resuming later -- in other words, the callback would need to be a coroutine also. I guess the

Re: Question about Pass-by-object-reference?

2014-07-24 Thread alex23
On 23/07/2014 10:27 AM, Terry Reedy wrote: When you call a function, Python binds function parameter names to argument objects in the function's local namespace, the same as in name assignments. Given def f(a, b): pass a call f(1, 'x') starts by executing a, b = 1, 'x' in the local

Re: Question about Pass-by-object-reference?

2014-07-23 Thread Chris Angelico
On Wed, Jul 23, 2014 at 3:35 PM, Steven D'Aprano st...@pearwood.info wrote: If you say nothing is being passed, then my response would be Oh, you aren't calling the function at all? Or just calling it with no arguments? The latter. Suppose you have a class method that takes optional args, and

Re: Question about Pass-by-object-reference?

2014-07-23 Thread Ben Finney
Steven D'Aprano st...@pearwood.info writes: On Wed, 23 Jul 2014 11:59:45 +1000, Ben Finney wrote: fl rxjw...@gmail.com writes: On Tuesday, July 22, 2014 8:27:15 PM UTC-4, Terry Reedy wrote: Nothing is being 'passed'. Thanks, but I don't understand your point yet. Could you give me

Re: Question about asyncio doc example

2014-07-23 Thread Yaşar Arabacı
asyncio.sleep() returns you a Future. When you yield from a future, your coroutine blocks, until the Future completes. In the meantime, event loop continutes to execute other things that are waiting to be executed. The Future returned from asyncio.sleep gets completed after specified seconds.

<    2   3   4   5   6   7   8   9   10   11   >