Re: Joining Strings

2016-04-07 Thread Emeka
Jussi, Thanks it worked when parsed with json.load. However, it needed this decode('utf'): data = json.loads(respData.decode('utf-8')) On Thu, Apr 7, 2016 at 6:01 AM, Jussi Piitulainen < jussi.piitulai...@helsinki.fi> wrote: > Emeka writes: > > > He

Joining Strings

2016-04-06 Thread Emeka
Hello All, import urllib.request import re url = 'https://www.everyday.com/ req = urllib.request.Request(url) resp = urllib.request.urlopen(req) respData = resp.read() paragraphs = re.findall(r'\[(.*?)\]',str(respData)) for eachP in paragraphs: print("".join(eachP.split(',')[1:-2]))

Error message

2016-01-29 Thread Emeka Ikele
Please I downloaded Python 3.5 (32 bit) for Windows software. I installed it but it keeps giving me an error message that a file was not found and I should please re-install to fix the problem. I've tried that severally but to no avail. Please what can I do or should I just install the 2.7 version

Is Python Lazy?

2012-05-05 Thread Emeka
Hello All, Could one say that generator expressions and functions are Python way of introducing Lazy concept? Regards, \Emeka -- *Satajanus Nig. Ltd * -- http://mail.python.org/mailman/listinfo/python-list

Re: Udacity CS 101

2012-03-03 Thread Emeka
Well, I checked unit 2 out the other day. It is indeed of poor standard and to some extend a waste of time for me. However, I see it as another way of having fun. On Sat, Mar 3, 2012 at 5:47 AM, Josh English wrote: > On Monday, February 27, 2012 6:37:25 PM UTC-8, Ray Clark wrote: > > > > You have

Re: Undoing character read from file

2012-02-17 Thread Emeka
e today. But who are we to question him concerning this issue. Is the above code the right way? Regards, \Emeka On Sat, Feb 18, 2012 at 5:17 AM, Emeka wrote: > Neil, > > Thanks. Could you throw a simple example? > > Regards, \Emeka > > > On Fri, Feb 17, 2012 at 3:12 PM, N

Re: Undoing character read from file

2012-02-17 Thread Emeka
Neil, Thanks. Could you throw a simple example? Regards, \Emeka On Fri, Feb 17, 2012 at 3:12 PM, Neil Cerutti wrote: > On 2012-02-16, MRAB wrote: > > On 16/02/2012 23:10, Emeka wrote: > >> Hello All, > >> > >> I know about seek and tell while using rea

Undoing character read from file

2012-02-16 Thread Emeka
Hello All, I know about seek and tell while using readline. What about if I am using read, and I want to undo the last character I just read(to return it back to the stream). How do I achieve this? Regards, \Emeka *Satajanus Nig. Ltd * -- http://mail.python.org/mailman/listinfo/python-list

Id of methods

2012-02-08 Thread Emeka
Boo.__dict__ {'__module__': '__main__', 'ball': , 'daf': , '__dict__ ..} print hex(id(Boo.daf)) 0x27de5a0 My question is why is it that the id of Boo.daf is different from daf's hex value in the above dict? Regards, \Emeka *Satajanu

Re: MySQLdb not allowing hyphen

2012-02-05 Thread Emeka
Dennis , Chris Thanks so much! On Mon, Feb 6, 2012 at 1:23 AM, Dennis Lee Bieber wrote: > On Mon, 6 Feb 2012 00:41:24 +0200, Emeka wrote: > > >Hello All, > > > >I noticed that MySQLdb not allowing hyphen may be way to prevent injection > >attack. > &

MySQLdb not allowing hyphen

2012-02-05 Thread Emeka
ot; ) ProgrammingError(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't know where to go. How do I work around this error? Regards, Emeka -- *Satajanus Nig. Ltd * -- http://mail.python.org/mailman/listinfo/python-list

Python lib for creating Database tables

2012-01-11 Thread Emeka
. I look forward to your feedback and comments. https://github.com/janus/cheeta Thanks in advance! Regards, Emeka * * -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb Error

2012-01-11 Thread Emeka
Thanks. Regards, Janus On Wed, Jan 11, 2012 at 7:12 PM, Dennis Lee Bieber wrote: > On Wed, 11 Jan 2012 09:57:43 +0200, Emeka wrote: > > > >_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL > >syntax; check the manual that corresponds to you

MySQLdb Error

2012-01-11 Thread Emeka
ass, errorvalue _mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' street_number int, country_name varchar, street_name char(40) , user_name ch' at line 1"

dict_to_xml

2011-12-30 Thread Emeka
Hello All, I have a dictionary object I would like to convert to xml. Could some assist with the link to libs to use? Or good examples. Regards, Janus -- *Satajanus Nig. Ltd * -- http://mail.python.org/mailman/listinfo/python-list

Re: Get Class properties

2011-12-29 Thread Emeka
Chris, Thanks a million! Regards, Emeka On Thu, Dec 29, 2011 at 1:27 AM, Chris Angelico wrote: > On Wed, Dec 28, 2011 at 11:13 PM, Emeka wrote: > > Hello All, > > > > I have seen what I am looking for.. __dict__. > > > > Yep! You may also want to look

Get Class properties

2011-12-28 Thread Emeka
Hello All, Say I have a class like below class Town: state = StateClass() cities = CityClass() Is there way to introspect such that one can list the properties keys and their values in such a way that it would look like playing around dictionary ? Regards, Janus -- *Satajanus Nig

Re: Get Class properties

2011-12-28 Thread Emeka
Hello All, I have seen what I am looking for.. __dict__. Thanks! Regards, Janus On Wed, Dec 28, 2011 at 1:05 PM, Emeka wrote: > > Hello All, > > Say I have a class like below > > class Town: > state = StateClass() > cities = CityClass() > > > Is

globals function

2011-12-28 Thread Emeka
Hello All, What is the downside of using globals function Regards, Janus -- *Satajanus Nig. Ltd * -- http://mail.python.org/mailman/listinfo/python-list

Re: Please explain this for me

2011-12-20 Thread Emeka
Noah, Calvin Thanks so much! Regards, Emeka On Wed, Dec 21, 2011 at 6:57 AM, Noah Hall wrote: > On Wed, Dec 21, 2011 at 4:39 AM, Emeka wrote: > > > > Hello All, > > > v = [] > > > > def add_to_list(plist): > > u = plist.append(90) > >

Please explain this for me

2011-12-20 Thread Emeka
one returns nothing, why? Regards, Emeka -- *Satajanus Nig. Ltd * -- http://mail.python.org/mailman/listinfo/python-list

Working with Descriptors

2011-12-11 Thread Emeka
.__dict__[self.side] = value class Game(object): d6 = Die() d10 = Die(sides=10) d20 = Die(sides=20) Game.d3 = 90 (This failed) Regards, Emeka -- *Satajanus Nig. Ltd * -- http://mail.python.org/mailman/listinfo/python-list

Re: TK + MVC

2011-10-03 Thread Emeka
Alex, The question was not meant for you. I was responding to Greg's comment. Regards, Emeka On Mon, Oct 3, 2011 at 12:14 AM, Alexander Kapps wrote: > On 03.10.2011 00:15, Emeka wrote: > >> Greg, >> >> Do you have an example where the Controller is connected? &

Re: TK + MVC

2011-10-02 Thread Emeka
Greg, Do you have an example where the Controller is connected? Regards, EMeka On Sun, Oct 2, 2011 at 4:40 AM, Gregory Ewing wrote: > Alexander Kapps wrote: > > But I think a simple (and quick 'n' dirty) Tk MVC example can look like >> this: >> > > The Con

TK + MVC

2011-10-01 Thread Emeka
Hello All, I need a basic example where MVC pattern is used with Python TK. Regards, Emeka -- *Satajanus Nig. Ltd * -- http://mail.python.org/mailman/listinfo/python-list

Re: Code Review

2011-09-17 Thread Emeka
Philipp, Thanks so much for your time and comment. I will re-work my code accordingly. Regards, Emeka On Sat, Sep 17, 2011 at 12:19 PM, Philipp Hagemeister wrote: > Instead of comments, you can often use docstrings > (http://www.python.org/dev/peps/pep-0257/ ): > > This is hard to

Code Review

2011-09-16 Thread Emeka
Hello All, While learning Python I put together another Text Twist. I would want somebody to go through it and comment. https://github.com/janus/Text-Twist -- Regards, Emeka * * -- http://mail.python.org/mailman/listinfo/python-list

Tkinter's unbind method

2010-12-13 Thread Emeka
Hello All I have an uncompleted version of a game http://pastebin.com/gkhTaYPZ I am trying to code I have struggled to make method unbind work. But it has refused to listen to me. Could someone come to my help? Regards, Emeka http://pastebin.com/gkhTaYPZ -- *Satajanus Nig. Ltd

Background image with Tkinter

2010-10-23 Thread Emeka
. For now, I would like to stick with Tkinter, I checked out PIL. It seems like support for Python27 is jet to be included. Regards, Emeka -- *Satajanus Nig. Ltd * -- http://mail.python.org/mailman/listinfo/python-list

Re: Introducing Kids to Programming: 2 or 3?

2010-09-29 Thread Emeka
the future and not the past. So, go for Python 3. Being new to programming, what matters most is learning programming and not the minor syntactical differences. Get them to understand the real thing and they would build up from there. Regards , Emeka On Mon, Sep 27, 2010 at 4:48 PM, Marco Gallotta wr

Re: Creating Classes

2009-12-19 Thread Emeka
Hello Dave > > There are more complex things that can go on, like creating "bound" > function objects, but I think this should get you pretty far. > > Could explain the complex things for me? Regards, Janus -- http://mail.python.org/mailman/listinfo/python-list

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-12-19 Thread Emeka
Okay if that is the case, why do we need it? By having int a = 65, b = 66 , why should we also have *kwlist[]? static PyObject* foo(PyObject *self, PyObject *args, PyObject *kwrds) { int a=65, b=66; char *kwlist[] = {"a", "b", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwrds, "|CC",

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-12-18 Thread Emeka
Case, Thanks so much! However, I am still confused. This is what I understood; foo (a = "a", b = "b") so function , foo, has default values which are "a" and "b". pointer kwlist[] is a way of specifying default values . Regards, Emeka On Fri, Dec 18

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-12-18 Thread Emeka
char *kwlist[] = {"a", "b", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwrds, "|CC", kwlist, &a, &b)) I am yet to understand what pointer kwlist[] does and why it is needed? Regards, Emeka On Fri, Dec 18, 2009 at 8:17 AM, casevh wrote: >

Fwd: PyArg_ParseTupleAndKeywords in Python3.1

2009-12-18 Thread Emeka
t, &a, &b)) return NULL; return Py_BuildValue("(CC)", a, b); } Regards, Emeka The following code seems to work fine for me: static PyObject* foo(PyObject *self, PyObject *args, PyObject *kwrds) { int a=65, b=66; char *kwlist[] = {"a", "b", NULL}; I

C to Python

2009-12-10 Thread Emeka
Hello All, I am finding it difficult getting my head around PyObject_CallObject(x,y). I need a gentle and thorough introduction to it. I also need examples. Could someone come to my need? Thanks. Janus. -- http://mail.python.org/mailman/listinfo/python-list

New hire

2009-10-10 Thread Emeka
Hello All, I am new to python , and my aim is to use it to write sugar-based applications on XO(OLPC). I am not new to programming in general, I would want to know the best route to take in learning python. I have background in FP and Imperative languages. Regards, Emeka -- http