Re: [Tutor] I think I've broken my Python

2018-11-12 Thread Matthew Ngaha
On Mon, Nov 12, 2018 at 5:52 PM Mats Wichmann wrote: > but the real message is that it couldn't > find necessary Django pieces in the python environment (this is > consistent with your original message, suggesting it found and is > running manage, but other things are missing). > You're right, I w

Re: [Tutor] I think I've broken my Python

2018-11-12 Thread Matthew Ngaha
On Mon, Nov 12, 2018 at 5:35 PM Roger B. Atkins wrote: > > What about installing or reinstalling Django using the python version > that produced the error message? Yeah if all else fails I'll try this. Thanks. ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] I think I've broken my Python

2018-11-12 Thread Matthew Ngaha
On Mon, Nov 12, 2018 at 3:31 PM Mats Wichmann wrote: > > Reconstruct the virtualenv you want maybe? Their whole concept is that > they're cheap and easy and can just be thrown away. Of course, you then > have to remember what you did to create it in order to make a new one... It's been 3 years,

[Tutor] I think I've broken my Python

2018-11-12 Thread Matthew Ngaha
I haven't coded in about 3 years and I used to use Python3.4 on openSUSE13.1. I had a virtual environment with this Python for a development Django website. Before I stopped coding, I upgraded to Python3.5, but everything still worked if I remember correctly. But now I'm back to coding I tried to l

Re: [Tutor] When do you know you're ready to start applying for jobs?

2017-12-14 Thread Matthew Ngaha
Thank you all for replying, I really appreciate it. It's all I've been thinking about lately and your responses have really cleared up a lot of things for me. On Tue, Dec 12, 2017 at 11:37 PM, Alan Gauld via Tutor wrote: > > But there are things you can learn now that won't ever change. > And tha

[Tutor] When do you know you're ready to start applying for jobs?

2017-12-12 Thread Matthew Ngaha
Hi all. I took 2-3 years off in 2012 to teach myself programming. I learnt basic Javascript & Python with some Django. I don't have a Computer Science (CS) degree so I never applied for a job because I always thought I still had lots to learn and most jobs say a CS degree is required. In 2015 I had

Re: [Tutor] Python programming for the absolute beginner

2017-09-29 Thread Matthew Ngaha
On Fri, Sep 29, 2017 at 7:20 PM, Alan Gauld via Tutor wrote: > If you want to follow the book use the version the book > uses - probably 2.6 or something close? > I think the book uses either Python 3.0 or 3.1. It's been a while since I read it but it doesn't use Python 2. The 2nd edition written

Re: [Tutor] GUI development with Python 3.4.1

2014-09-18 Thread Matthew Ngaha
PyQt or PySide offers QtDesigner. Which is a drag and drop builder. They are both quite complex GUI toolkits so you will need some basic knowledge on them first, but I Imagine there are good guides on using QtDesigner if it's your last option. On Thu, Sep 18, 2014 at 2:14 PM, Juan Christian wrote

Re: [Tutor] python ssl error

2014-08-17 Thread Matthew Ngaha
On Sun, Aug 17, 2014 at 11:26 PM, Danny Yoo wrote: > I would recommend checking whether the 'cacerts.txt' file in that > subdirectory is user-readable or not. Make sure it's readable. If it > isn't, chmod it and try again: that will probably fix it. > Thanks ever so much for your efforts! I'm

[Tutor] python ssl error

2014-08-17 Thread Matthew Ngaha
Hi this might not be the correct place to ask this. I am using the google api and as soon as I use the build function: service = build('books', 'v1', developerKey=api_key) I get an SSL error. I'm not sure what build() does but it triggers an SSL error. Here's the error message: ssl.SSLE

Re: [Tutor] Python Socket Error: Connection refused

2014-07-07 Thread Matthew Ngaha
On Mon, Jul 7, 2014 at 12:55 PM, Dave Angel wrote: > You will want to configure your DOS Box to make it easier to cut > and paste. How is this done? I'm not on windows atm to test it. ___ Tutor maillist - Tutor@python.org To unsubscribe or change su

Re: [Tutor] python sockets

2014-06-10 Thread Matthew Ngaha
On Tue, Jun 10, 2014 at 5:28 PM, Jon Engle wrote: > > startingPort=input("\nPlease enter starting port: ") > startingPort=int(startingPort) > > def setup(PORT): > PORT = startingPort#arbitrary port not currently in use There's a conflict with this PORT variable. _

Re: [Tutor] Question about scraping

2014-05-30 Thread Matthew Ngaha
Thanks for the response Alan. I forgot to reply to tutor on my 2nd comment. Just incase someone might want to see it, here it is: "Okay I think learning how to scrap (library or framework) is not worth the trouble. Especially if some people consider it illegal. Thanks for the input." _

[Tutor] Question about scraping

2014-05-30 Thread Matthew Ngaha
Hey all. I've been meaning to get into web scraping and was pointed to the directions of lxml (library) and scrapy (framework). Can I ask in terms of web scraping, what's the difference between a library and a framework? Surely everyone should use a framework but I get the idea more people use the

Re: [Tutor] Recommendation For A Complete Noob

2014-02-12 Thread Matthew Ngaha
> Hi, > > I'm completely new to programming in general and everything I have read so > far has pointed me to Python. I was just hoping to get some input as to where > I might start. > Start with Python programming for the absolute beginner Great author. The book gives you lots of exercises a

Re: [Tutor] Windows Install Issue

2014-01-11 Thread Matthew Ngaha
On Sun, Jan 12, 2014 at 1:13 AM, eryksun wrote: > The pre-built versions of PyQt4 and PyQt5 don't use the same version > of SIP. If you don't have a build system (e.g. Visual Studio 2010, the > Windows 7 SDK, or MinGW), then using a virtual environment should work > around the problem. > > http:/

Re: [Tutor] Windows Install Issue

2014-01-11 Thread Matthew Ngaha
On Sat, Jan 11, 2014 at 2:55 PM, Mark Lawrence wrote: > > On Windows finding a binary installer is always the first thing to do, > makefiles indeed. Go here > http://www.riverbankcomputing.co.uk/software/pyqt/download5, find the > section "Binary Packages" and this gives Windows 32 and 64 bit ins

[Tutor] Windows Install Issue

2014-01-11 Thread Matthew Ngaha
Hi I'm trying to install pyqt5.2 for Windows Vista (Python3.3). 1st i need to install sip but i run into this issue. after ./configure, a MAKEFILE is created. I'm supposed to do 'make' and 'make install', but i get this cmd error: C:\path>make 'make' is not recognized as an internal or external c

Re: [Tutor] ubuntu hassles.

2014-01-06 Thread Matthew Ngaha
On Tue, Jan 7, 2014 at 12:40 AM, eryksun wrote: > > virtualenv allows you to specify the target Python: > > virtualenv --python=/usr/bin/python3.3 myenv > > Refer to `man virtualenv` for more options. > > Or use synaptic if you prefer a GUI interface. > > Ubuntu has a Python 3.3 package. Ins

[Tutor] ubuntu hassles.

2014-01-06 Thread Matthew Ngaha
Hi i wrote about a week ago about the problems i had with importing sqlite3 on python 3.3 on ubuntu 12.04. Due to this ive tried to revert back to python 3.2 which is the default installation along wit 2.7. I've run into 2 problems. 1) I'm new to ubuntu and someone helped me install python3.3 from

Re: [Tutor] python problems on android

2014-01-04 Thread Matthew Ngaha
On Sat, Jan 4, 2014 at 11:24 AM, wrote: > > I havent included the script as it seems to be the use ' input' on my phone > that now wont work. > Even if the error is with 'input', it is still an odd error and no one will be able to debug your program or have a clue what's going wrong if you don'

Re: [Tutor] sqlite3 import problem

2014-01-03 Thread Matthew Ngaha
On Fri, Jan 3, 2014 at 10:36 AM, Alan Gauld wrote: > On 03/01/14 02:17, Matthew Ngaha wrote: >> >> im having problems importing sqlite3 on ubuntu python3. >> >>File "/usr/local/lib/python3.3/sqlite3/__init__.py", line 23, in >> >> from s

[Tutor] sqlite3 import problem

2014-01-02 Thread Matthew Ngaha
im having problems importing sqlite3 on ubuntu python3. File "/usr/local/lib/python3.3/sqlite3/__init__.py", line 23, in from sqlite3.dbapi2 import * File "/usr/local/lib/python3.3/sqlite3/dbapi2.py", line 26, in from _sqlite3 import * ImportError: No module named '_sqlite3' i have

Re: [Tutor] certain packages won't install

2013-12-22 Thread Matthew Ngaha
one there also:( On Sun, Dec 22, 2013 at 11:21 PM, Steven D'Aprano wrote: > On Sun, Dec 22, 2013 at 11:10:13PM +, Matthew Ngaha wrote: >> hey i've tried installing a few packages with pip that failed. i'm on >> windows and python3.3. > > You're trying to

[Tutor] certain packages won't install

2013-12-22 Thread Matthew Ngaha
hey i've tried installing a few packages with pip that failed. i'm on windows and python3.3. I have tried 'pip install pycurl' and 'pip install flup' which is something i need for django. I tried flup today and what bothers me is even though it failed, it's making some temp folders in places i neve

Re: [Tutor] more html/css question than python

2013-12-21 Thread Matthew Ngaha
On Sat, Dec 21, 2013 at 5:56 PM, Alan Gauld wrote: > You really need to know html and css if you are building > modern web UIs. That's because most good modern web sites > use a lot of client side(browser) scripting, usually using > JQuery. JQuery requires that you really understand how > html ta

[Tutor] more html/css question than python

2013-12-21 Thread Matthew Ngaha
hey guys ive got the very basics of django down. i was able to design a very basic dynamite site and interacted with django. It's basic & limited in every way, with the little it does, and the plain ugly design. This won't be good enough to put up anywhere but on localhost. My question is, How do

Re: [Tutor] Reading CSV files in Pandas

2013-10-20 Thread Matthew Ngaha
Does pandas do the same thing numpy does? I've never used them and unsure of what they are about. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] global variables

2013-08-22 Thread Matthew Ngaha
On Thu, Aug 22, 2013 at 4:35 PM, Steven D'Aprano wrote: > Good question! And one that needs a long answer. Hey i just checked mail again... A big thank you for your responses, i will read all of them now.. im pretty my programs/designs will be much cleaner by the time i done. And yes i was talki

Re: [Tutor] global variables

2013-08-22 Thread Matthew Ngaha
On Thu, Aug 22, 2013 at 3:04 PM, Alan Gauld wrote: > On 22/08/13 13:36, Matthew Ngaha wrote: > Global variables in themselves are not the problem. > It's how they tend to get used that causes problems. > Globals that are only changed via a set of > dedicated functions ar

Re: [Tutor] global variables

2013-08-22 Thread Matthew Ngaha
On Thu, Aug 22, 2013 at 2:52 PM, Chris Down wrote: >I would doubt that anyone has told you "don't ever use classes", because > that's nonsense; you've probably misread a dissuasion from that path in a > single instance as applying more broadly than was intended. I am being totally honest here. I

Re: [Tutor] global variables

2013-08-22 Thread Matthew Ngaha
On Thu, Aug 22, 2013 at 1:40 PM, Chris Down wrote: > It sounds like you want to use a class. > Why would you not just use a class if you want to store state? I don't feel my program needs a class. Also i have been told to stop using classes by some very experienced Python programmers on irc even

[Tutor] global variables

2013-08-22 Thread Matthew Ngaha
I'm always told to avoid using them. I read discussions on the python irc channel about them but honestly i feel there are some times where i can't avoid using them. Like where i want to keep track of a state variable in many different functions that may or may not alter its value and also not want

Re: [Tutor] Fwd: QT Python: How to re-use the return value of fileDialog.openFileName() ?

2013-05-27 Thread Matthew Ngaha
On Mon, May 27, 2013 at 2:14 PM, SM wrote: >But then I also had to use self.fileDialog from within the function. Not > sure how I could avoid using fileDialog. > > Thanks. No problem. to do it without the instance variable, you access its method directly. so replace: path = self.fileDialog.getO

[Tutor] Fwd: QT Python: How to re-use the return value of fileDialog.openFileName() ?

2013-05-27 Thread Matthew Ngaha
Sorry for the forward, i forgot to reply to tutor On Mon, May 27, 2013 at 3:53 AM, Sunitha Misra wrote: > self.fileDialog = QtGui.QFileDialog() > > QtCore.QObject.connect(self.toolButton, > QtCore.SIGNAL(_fromUtf8("clicked()")), self.fileDialog.getOpenFileName) > i think the way youre doing it

Re: [Tutor] Difference between types

2013-05-23 Thread Matthew Ngaha
wait for someone more knowledgeable to answer, but from what i know, Yes it does have a profound meaning. Strings consist of character sets. Something that was here way before Python Like i said my experience is limited so i too would like to hear some reponses ___

Re: [Tutor] challenge-chapter 2

2013-05-22 Thread Matthew Ngaha
On Wed, May 22, 2013 at 6:02 AM, Andrew Triplett wrote: > I am on chapter two for Python Programming working on the challenges and the > question is: > > 1. Create a list of legal and illegal variable names. Describe why each is > either legal or illegal. Next, create a list of "good" and "bad" le

Re: [Tutor] model methods in Django

2013-05-19 Thread Matthew Ngaha
o you are > quoting. > > On 20/05/13 00:23, Matthew Ngaha wrote: ok thanks i didnt think about that. I was quoting eryksun. I'll includethat line from now on ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription option

Re: [Tutor] model methods in Django

2013-05-19 Thread Matthew Ngaha
> options.py is the biggest module in the admin package. The link I > posted is to the get_actions method of ModelAdmin. In the tutorial, > PollAdmin extends this class. > oh ok thanks, yes i will definately look through it > I'm not coming from any framework. My knowledge of web development is >

Re: [Tutor] model methods in Django

2013-05-19 Thread Matthew Ngaha
> class Poll(models.Model): > > question = models.CharField(max_length=200) > pub_date = models.DateTimeField('date published') > > > > def was_published_recently(self): > return self.pub_date >= timezone.now() - datetime.timedelta(days=1) > > # > > > was_published_recen

Re: [Tutor] model methods in Django

2013-05-19 Thread Matthew Ngaha
> The default description is the name with underscores removed, unless > you set a custom description in the function's "short_description" > attribute. I'm not experienced with Django, so I can't ramble off lots > of examples, but hopefully you get the gist. Thanks that does clear it up. Also tha

Re: [Tutor] model methods in Django

2013-05-19 Thread Matthew Ngaha
Thanks guys i had no idea about these method attributes and also these underlying oop __objects__ @ eryksun i understand your explanation, im still having trouble figuring out how django is being used in the tutorial. class Poll(models.Model): # ... def was_published_recently(self):

[Tutor] model methods in Django

2013-05-18 Thread Matthew Ngaha
im following the official docs and after learning Python im sure of how methods work, but the model example on the beginners guide has me really confused. The model definition is omitted but can anyone explain how this methed (was_published_recently) is given these attributes: class Poll(models.

Re: [Tutor] Interested in learning Python

2013-05-15 Thread Matthew Ngaha
i recommend getting a copy of Python Programming for the absolute beginner. It offers end of chapter exercises to make sure you understand everything you are reading. It was a great read for me and made my learning experience really fun. I garantee by the end you would have gained a lot of confiden

Re: [Tutor] Python Programming for the Absolute Beginner

2013-05-15 Thread Matthew Ngaha
i completed this book and i did every exercise. are you asking for help with the challenges, or have you completed them and want code to compare yours too? im relunctant to share challenge code, incase you havent done them. They are really good exercises to try doing. __

Re: [Tutor] env var packages

2013-05-15 Thread Matthew Ngaha
Thank you Vasya and Eryksun. Sorry i didn't mention my OS i am on windows. Thanks for the links and detailed explanations which after following, i now have django up and running! thanks again ___ Tutor maillist - Tutor@python.org To unsubscribe or chang

[Tutor] env var packages

2013-05-14 Thread Matthew Ngaha
i have to install django and ive come across some weird instructions. it says to set Django's django-admin.py file to my environment variable. I was instructed to get django via easy installer that was located in my Python/Scripts folder. it installed django to a different place in site-packages,

Re: [Tutor] help regarding game code

2013-05-12 Thread Matthew Ngaha
>> bWater.clicked.connect( water_clicked ) AttributeError: 'int use a paste site like http://bpaste.net/+python to show us the code. i am no expert @ programming myself but that error is telling you you used an int and tried to access an int method called connect somewhere in your code. ints do n

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
> Unless you're looking for something specific from the URL that the > tutorial uses, then you could use any address > > Bodsda thanks i did that and to my suprise an extra file showed up in my folder, of the page i just visited:) thanks ___ Tutor mailli

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
>org/2/library/urllib.html#urllib.urlretrieve > or > http://docs.python.org/3/library/urllib.request.html#urllib.request.urlretrieve sorry about the top posting gmail has changed the way their messages are done, it gave me a blank field i didnt realize i was writing above the message. i must have

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
Gauld wrote: > On 07/04/13 17:20, Matthew Ngaha wrote: >>> >>> Look in the module docs for urlib.request. >>> >> >> Hi. Ive never used the urllib before > > > In Python 3 urllib combines (the best) features of > urllib and urllib2 fro

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
> > You might want to look at requests module: > http://docs.python-requests.org/en/latest/ > Many people think it is easier to use than the native python support. > are all of these modules related to web programming like clients and (HTTP)servers? I've come across urllib a lot of times but only

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
> Look in the module docs for urlib.request. > Hi. Ive never used the urllib before unless it was typing in something from an unrelated tutorial. I've also never done anything related to web programming. I'm looking at the urllib.request page and i really don't understand what i'm looking at. I'm

Re: [Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
the whole program depends on the urlretrieve 3rd argument, the function to be called.. is there no options to include a callback? def _download(self): def reporthook(pos, block, total): if self.size != total: self._size = total self.on_size.emit

[Tutor] urllib.urlretrieve ?

2013-04-07 Thread Matthew Ngaha
Im following a tutorial on what i believe is using Python 2 and i'm a bit confused. I use Python 3 on windows vista. I believe urlretrieve() is a python 2 function that isnt in 3, but why is the tutorial using urllib instead of urllib2? Also when i run the program on Python 3, it says: AttributeEr

Re: [Tutor] break

2013-03-14 Thread Matthew Ngaha
thanks guys ive finally got it working. even though i didnt use the flag due to invalid syntax i realized since i was getting no errors i wasnt actually doing anything wrong. My mistake was i removed the ememy ship but for some reason forgot to remove the missile so it was still active on the next

Re: [Tutor] break

2013-03-14 Thread Matthew Ngaha
> One good approach is to have a separate function or method with > both loops: > > def attack(self, Enemy): > > for missile in self.missiles: > for rect in Enemy.rects: > if QPoint(missile.x + 5, missile.y) in rect: > explosion = Explosion(rect.x(), rect.y()

Re: [Tutor] break

2013-03-14 Thread Matthew Ngaha
>> if Enemy.ships: >> for missile in self.missiles: > >flag = False >> >> for rect in Enemy.rects: > >assert(!flag) > >> if QPoint(missile.x + 5, missile.y) in rect: >>

[Tutor] break

2013-03-14 Thread Matthew Ngaha
i cant seem to break out of this loop. let me explain the variables you see: Enemy.ships = [] #an Enemy class variable that contains enemy ships self.missiles = [] an instance variable that appends how many Visible missiles my ship has fired Enemy.rects = [] an Enemy class variable that represents

Re: [Tutor] following on

2013-02-18 Thread Matthew Ngaha
Hey, a Big thanks to everyone that has offered their input. I really appreciate it. Also thanks for all the additional links, i will definately start to read up on data structures , source code and everything else that was suggested ___ Tutor maillist -

Re: [Tutor] following on

2013-02-18 Thread Matthew Ngaha
>> understanding of how everything works. > > Use it., Experiment with it. Break it. > Thats the best way. Read the source code its all available in > Python or C. > Hey can you please tell me which source code youre referring too? The initial files that come with Python? also the C code, where ca

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> In a cmd shell, check that 'assoc .py' is "Python.File" and that > 'ftype Python.File' points to py.exe in your Windows directory, e.g. > "C:\Windows\py.exe "%1" %*'. If it's wrong, re-install. Or fix it > manually using assoc and ftype in an elevated cmd shell, which updates > the local machine

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
On Thu, Jan 24, 2013 at 9:35 PM, eryksun wrote: > On Thu, Jan 24, 2013 at 1:56 PM, Matthew Ngaha wrote: >> >> py is not recognized and and it said "depending on how it was >> installed". the problem is it didnt allow me to select a path when >> ins

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> Did you find the "control-panel-way" to modify the PATH (assuming py.exe > wasn't already in there) ? Without it, I'd be surprised if right-click > would work correctly. > > And as for IDLE, there are two different IDLEs, one in each directory. So > run the one that corresponds to the python you

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> I'm not using it, since I'm not using Windows. So these are guesses based > on years stuck\b\b\b\b\b spent in the Windows environment. > > Clearly, the name of the program is py.exe, so that's what you should try > searching for. From the cmd prompt, try dir /s py.exe > > Or, you could just

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> > Have you added shebang lines to those scripts yet? > yes i added them. i think the problem is at the start where it asks me to: You should ensure the launcher is on your PATH - depending on how it was installed it may already be there, but check just in case it is not. >From a command-prompt,

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> yes the 2nd option (standalone pylauncher) sounds more convienient for > me. i just have to try and comprehend all the instructions given.. > hopefully ill get there in the end i managed to install the laucher. on the site when i click the correct launcher 32bit, i chose "run" and it automatical

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> > You don't have to uninstall 3.1 but you would have to install all the > downloaded modules or packages that you have in your 3.1 site packages > folder to the 3.3 site packages folder. Maybe it's easier to simply grab > the standalone pylauncher as I suggested earlier. Only you know what is t

Re: [Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
> > Python 3.3 for Windows comes with a "launcher", which will approximate (for > Python only) what Unix and Linux users have had for years for any scripting > language. You can get it separately, as Mark Lawrence has said, but maybe > it's time to bring your 3.x current. > there was a lot of read

[Tutor] how can i use python 2 alongside 3?

2013-01-24 Thread Matthew Ngaha
hi guys i am a python 3.1.1. user but really need to use python 2 to be able to use certain libraries and frameworks. i have installed python 2.7 but they cant run together as all .py and .pyw files are opened with python 3. i can open simple python 2 files by right clicking and finding pythons 2's

Re: [Tutor] Traffic Light

2013-01-19 Thread Matthew Ngaha
On Sun, Jan 20, 2013 at 12:05 AM, Matthew Ngaha wrote: > On Sat, Jan 19, 2013 at 11:29 PM, anthonym wrote: >> Sure thing. Here is the code. And after that is the box I get with the >> radio buttons but no shapes. > i might be way off as im struggling to understand how tki

Re: [Tutor] Traffic Light

2013-01-19 Thread Matthew Ngaha
On Sat, Jan 19, 2013 at 10:56 PM, anthonym wrote: > Thanks again for the info Alan. I am still passing the button process > until I can get my rectangle and ovals on the canvass. The program runs > and produces a window with the radio buttons on top. I would like them on > the bottom but change

[Tutor] unclear topic

2013-01-14 Thread Matthew Ngaha
hey guys, this is not really a Python question. When ever im doing a tutorial, it could be pygame or some gui application, i usually find everything straight forward until the demonstration involves drawing. Then maths is applied and i can't follow along as easily. In the end by commenting out cert

Re: [Tutor] Python Programming for Absolute Beginners, 3rd Edition

2013-01-02 Thread Matthew Ngaha
> With the code not being on the page, I went to the directed website and got > the downloads, yet I couldn't find the source code > anywhere to be found. Am I missing something plainly obvious? what exactly did you download? all the source code for every chapter is included in the download __

Re: [Tutor] exercise

2012-12-14 Thread Matthew Ngaha
> return {e for (e, g) in self.sort_email.items() > if g & groups_list} > guys i think ive got it. The & in that comprehension was really confusing me, but i found out it means intersection, so i took the sets manually and saw the results i got using intersection and it became more

Re: [Tutor] Proper useage of "open"

2012-12-12 Thread Matthew Ngaha
> I typed in to my script: > a = open (dupli, r) > and got an error stating that "dupli" is not deffined. it needs the quotes around it. so try: a = open ("dupli", "r") ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription option

Re: [Tutor] help

2012-11-20 Thread Matthew Ngaha
> Traceback (most recent call last): > File "Match finder GUI.py", line 87, in ? > app = Application(root) > File "\Match finder GUI.py", line 23, in __init__ > self.create_widgets() > File "Match finder GUI.py", line 61, in create_widgets > self.submit_bttn = Button(self, text =

Re: [Tutor] help

2012-11-19 Thread Matthew Ngaha
It's asking a lot if you want people to read your whole code to try and spot the errors. Try to run it from the console and paste what the errors are here. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mai

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > "Py" is a directory. > > Once you've added the Python executable's directory to the path, you > can start the http.server module as a script by running the following: > > python -m http.server > > Don't use "pythonw" in this case. The latter is associated with the > .pyw file extension, use

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > No, in your case it's > > set PATH=%PATH%;D:\Data\Program Files Data\Py > > That's just a temporary modification for the current cmd process. It's > easiest to show how to change it permanently with screen captures; > search for "vista set path". > i followed the instructions at http://ban

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > The interpreter executable in Windows is always called "python" > (console) or "pythonw" (no console). The 3.1 installer doesn't put the > executable's directory on the system PATH. The option to add this was > added to the 3.3 installer. Otherwise you'll have to add the directory > manually. I

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > Don't run it from inside IDLE. You were right to run it from cmd. > > Pasting the error message you showed elsewhere: > > 'python3' is not recognized as an internal or external > command, operable program or batch file. > > That simply says that the PATH does not point to your PYTHON3.bat or >

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > If you got an error, quote it in full in your message (using copy/paste, > not by retyping or paraphrasing. As it stands, we don't know if the > error was in bash, in csh, in cmd, or in Python, and if it was in > python, we don''t know what version. > > > python3 -m http.server > > Where did y

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > > > Works for me with 3.3: > > > aclark@Alexs-MacBook-Pro:~/ > python3.3 -m http.server > Serving HTTP on 0.0.0.0 port 8000 ... > > > hey how do you start it or where do you run it from. did you type that in the command line? ___ Tutor maillist - Tu

Re: [Tutor] need help

2012-11-01 Thread Matthew Ngaha
> > > > Always, *always* include the *full* error message, otherwise we have to > guess. Not fun. Some other questions: What operating system are you using? > What version of Python does your tutorial assume? Do you in fact have > Python 3 installed on your system? > > > maybe im running it from

[Tutor] need help

2012-11-01 Thread Matthew Ngaha
working through my tutorial ive been told to set up a simple webserver. i can't even get started because the 1st line of code its asked me to do fails with a syntax error. here's the code: python3 -m http.server any ideas what is going wrong? it asked me to make some simple .html files, then in t

Re: [Tutor] help with homework

2012-10-28 Thread Matthew Ngaha
> > In your original getNames do something like this. >> Initialise a counter to zero. >> Every time you get a valid name increment the count. >> If the count is three you're finished. >> > hey i was looking at the question as im learning also. With the counter, would you use a while loop instead o

Re: [Tutor] Which is better Practice and why

2012-10-22 Thread Matthew Ngaha
oh ok i understand it.. Thanks for the help guys ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Which is better Practice and why

2012-10-22 Thread Matthew Ngaha
In many of the tutorial examples ive come across, the main code's program is never at the top level, but always in a function of some sort. i understand why but, there is always a different way used to access the main code, i want to know which is the best. main() main's code #top level mai

Re: [Tutor] hasattr()

2012-10-14 Thread Matthew Ngaha
Thank you xDog and Steven. The whole assignment makes a lot of sense now after your explanations of what hasattr is doing. Thanks ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinf

[Tutor] hasattr()

2012-10-13 Thread Matthew Ngaha
im trying to understand this hasattr function. i am supposed to pass in an object and an attribute name into its parametres... so im trying to get it to return True. Here's a quick test class Test: def __init__(self): self.att = "testing" >>> e = Test() >>> hasattr(e, e.att) False >>

Re: [Tutor] need an explanation

2012-10-12 Thread Matthew Ngaha
Thanks for everyone that replied. I really gained a lot from all the input. Also thanks to Dave and Prasad for explaining why i had errors trying to run the program. I fully understand the code now and im able to run it without errors. ___ Tutor maillist

Re: [Tutor] need an explanation

2012-10-11 Thread Matthew Ngaha
> > > Obviously a Monty Python fan as I see 3 methods :) > lol i dont know what i was looking at.. yes its 3 methods sorry:( > >> def __init__(self): >> self.zipping_directory = "unzipped-{}".format(filename) >> > > Where did filename appear from above? > > > sorry i didnt write everything.

[Tutor] need an explanation

2012-10-11 Thread Matthew Ngaha
i need help on 2 topics. 1) can someone please tell me what sys is doing, and why its using weird indexing? if __name__ == "__main__": A_Class(*sys.argv[1:4]).A_Class_Method() is sys able to call methods? if so why does it need indexing if it uses * . --

Re: [Tutor] [Tkinter-discuss] whats Style()

2012-10-07 Thread Matthew Ngaha
> > sorry i sent the email directly by mistake. Just like to say thanks once > again for all the help > this email was a mistake, meant for anything mailing section.. please ignore it ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscr

Re: [Tutor] [Tkinter-discuss] whats Style()

2012-10-07 Thread Matthew Ngaha
sorry i sent the email directly by mistake. Just like to say thanks once again for all the help ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] [Tkinter-discuss] displaying an image

2012-10-04 Thread Matthew Ngaha
> You need to install PIL to use the tutorial you are doing. > > http://www.pythonware.com/products/pil/ the site says " The current free version is PIL 1.1.7. This release supports Python 1.5.2 and newer, including 2.5 and 2.6. A version for 3.X will be released later. " i have python 3. all the

Re: [Tutor] Relative import help

2012-09-22 Thread Matthew Ngaha
> You had forward slashes in your description of the folder layout, so I > assumed you were on a linux box or a mac. I think I have now learned the > lesson and will make fewer assumptions in the future. > > First, in idle's "shell" window type > import sys print(sys.executable) > > (dont

Re: [Tutor] Relative import help

2012-09-22 Thread Matthew Ngaha
> You probably have a path that reaches into Domestic or Europe sub-package. > That can happen if e. g. Project/Domestic/Europe is your current working > directory. > > Try to cd into the Project folder's parent directory and see if > > $ python -c 'import Project.Domestic.Europe.winners' > > works

Re: [Tutor] Relative import help

2012-09-22 Thread Matthew Ngaha
> cd is a shell command; you do it before starting Python. You didn't > mention what OS you're running, but cd should be about the same for > Linux, Windows, or Mac. im on windows. i always start Python via IDLE. ive never started it for editing though the shell, run > cmd etc? ill type that int

  1   2   >