Re: [Tutor] REQUIRED SUPPORT FOR CODE

2019-07-25 Thread john fabiani
Dabo has an AutoComplete method.  You review how it was done. Johnf On 7/25/2019 4:26 PM, Alan Gauld via Tutor wrote: On 25/07/2019 16:58, NITESH KUMAR wrote: I want to make Autocomplete searchbox using database .Please suggest me the code for this. Since you tell us next to noting we can onl

[Tutor] Download audios & videos using web scraping from news website or facebook

2019-06-14 Thread Sijin John
Hello Sir/Mam, I am trying to Download audios & videos using web scraping from news website (eg: https://www.bbc.com/news/video_and_audio/headlines) or Facebook & I could't. So in real scenario is it really possible to download audios/videos using python code ? Thanks & Regards _

[Tutor] Broadcasting using sockets over adhoc wifi

2019-06-11 Thread John Hoeksema
t;myServer.py", line 22, in broadcast server.sendto("GET OUT OF MY SWAMP", ('', port)) socket.error: [Errno 101] Network is unreachable Thank you for your time. Please let me know any information you think would be useful! Best, John -- *John Hoeksema* Computer Science

Re: [Tutor] Two Scripts, Same Commands, One Works, One Doesn't

2019-05-15 Thread John Collins
am a student not a tutor - this is wild speculation! Best Regards, John Collins. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to get the weeks of a month

2019-03-04 Thread john fabiani
On 3/4/19 2:47 PM, David Rock wrote: On Mar 4, 2019, at 16:30, Ben Finney wrote: john fabiani writes: My understanding is - a week starts on Monday and ends on Sunday. That's behaviour specific to a timezone. Which one are you using, and does your program know to consult the tim

Re: [Tutor] how to get the weeks of a month

2019-03-04 Thread john fabiani
On 3/4/19 1:35 PM, David Rock wrote: On Mar 4, 2019, at 15:28, john fabiani wrote: I knew there was a simple why to get it done! But where is it off my a day? comparing $ cal March 2019 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Re: [Tutor] how to get the weeks of a month

2019-03-04 Thread john fabiani
On 3/4/19 1:15 PM, David Rock wrote: On Mar 4, 2019, at 13:19, Alan Gauld via Tutor wrote: On 04/03/2019 18:54, john fabiani wrote: I need to print out the weeks of the month - given any month and any year. I'm not totally clear how you define a week. EDIT: OK I see the comment a

[Tutor] how to get the weeks of a month

2019-03-04 Thread john fabiani
Hi everyone, I'm not exactly a newbie but I can't seem to solve this problem. I need to print out the weeks of the month - given any month and any year. For example this month would have: 3/1/2019 - 3/3/2019   # notice that this a short week 3/4/2019 - 3/10/2019 3/11/2019 - 3/17/2019 3/18/2019

[Tutor] Problem using termcolor and colorama

2018-11-15 Thread John Blower
I try to create colour text by using these two modules , only returns the colour code, no colour text. How to solve this problem. >>> import termcolor >>> import colorama >>> colorama.init() >>> termcolor.cprint('Hello World','red') [31mHello World[0m Sent from Mail

Re: [Tutor] I have a problem with def

2018-02-23 Thread john fabiani
I don't what you are doing but it should be at least def func(): notice the colon at the end. Johnf On 02/22/2018 02:16 PM, David Bauer wrote: it doesn't work, you are suppsed to declare a function as def func() and it comes back as: File "", line 1 def func() ^ SyntaxEr

[Tutor] Need help fixing some code for a project

2017-11-27 Thread John Cocks
The task is broken down into three sections. Section 1 - User Input Section 2 - loop through the grocery list Section 3 - provide output to the console ''' #Task: Create the empty data structure grocery_item = {} grocery_history = [] #Variable used to check if the while loop condition is met sto

Re: [Tutor] Python programming for the absolute beginner

2017-09-29 Thread Larocca, John B
Hi Peter My company primarily uses 2.7, but as I understand it 2.x flavors are compatible with each other. 2.x scripts are generally not compatible with 3.x versions and vice versa So, keep that in mind. Regards, -John -Original Message- From: Tutor [mailto:tutor-bounces

[Tutor] sub-modules and python3

2017-05-31 Thread john
Hi folks, In the past I used a simple "import filename" for sub-modules in python 2. With python 3 I have run into errors reported (file not found) using python 2 import statements. But I'm not asking how to correct the import as I am able to change the way I write the import as a work arou

[Tutor] Could anyone provide a complex data processing automation testing example

2017-04-20 Thread John R
Hi All, Most of the examples in google are looking simple in automation so I am not getting an understanding of how a complex data processing application is to be tested using python. Can anyone please provide some real time examples for my understanding? Thanks In advance 91-9886754545

[Tutor] What are the few senarios of data science testing using Python

2017-04-20 Thread John R
me out Thanks in advance, John R ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Basic Tutorial for Python

2017-02-06 Thread Larocca, John B
I like this one... https://learnpythonthehardway.org/book/ It can be done all online -John -Original Message- From: Tutor [mailto:tutor-bounces+john.b.larocca=intel@python.org] On Behalf Of Hüseyin Ertugrul Sent: Monday, February 06, 2017 8:14 AM To: tutor@python.org Subject: [Tutor

Re: [Tutor] Book recommendation

2016-08-01 Thread John Wong
mediate -> advanced) * Learn Python the Hard Way (not so much into this, just personal preferences) Just my 3.1415 cents. John ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] wiped file

2016-07-14 Thread John Wong
Alan made really good points, standard practice, however, on Linux and MacOSX, usually if you use editors like VIM, a temporary file is always created. For Windows, I am not sure 100%. Check your editor, your editor may have saved a cache file but marked as hidden file. For example, Notepad++ has t

Re: [Tutor] Hello everybody

2016-06-14 Thread Joseph John
On Mon, Jun 13, 2016 at 11:55 PM, Влад <79099012...@yandex.ru> wrote: >Hi. I've just begin with Python? I'm 34. Is it late or what? If it is - > I >will cut it out. What you think guys? >** > Here myself 48 crossed, just started taking python step by step Welcome to the herd >--

[Tutor] Python ODBC driver for Oracle 9

2016-06-13 Thread Joseph John
search, did not find any proper links which is leadeing to the Oracle9i driver. And now I am trying to post here to get advice or url on how to get oracle 9 python driver. Thanks Joseph John ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Command statement work well on interactive mode, which running as pf file it throws error object has no attribute '__getitem__'

2016-06-09 Thread Joseph John
On Thu, Jun 9, 2016 at 12:49 PM, Joseph John wrote: > > > On Thu, Jun 9, 2016 at 12:07 PM, Alan Gauld via Tutor > wrote: > >> On 09/06/16 08:33, Joseph John wrote: >> >> > Now when I create a *.py file with all the above steps and run it, I am >> &

Re: [Tutor] Command statement work well on interactive mode, which running as pf file it throws error object has no attribute '__getitem__'

2016-06-09 Thread Joseph John
On Thu, Jun 9, 2016 at 12:07 PM, Alan Gauld via Tutor wrote: > On 09/06/16 08:33, Joseph John wrote: > > > Now when I create a *.py file with all the above steps and run it, I am > > getting error > > Traceback (most recent call last): > > File "./ReadingDat

[Tutor] Command statement work well on interactive mode, which running as pf file it throws error object has no attribute '__getitem__'

2016-06-09 Thread Joseph John
ke to request for guidance and feed back, please let me know why all my command statements work on interactive mode and when I run it in a py file some commands throws error Thanks Joseph John ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] import openpyxl throws error in-spite I have python-openpyxl installed.

2016-06-08 Thread Joseph John
sted it by logging in as another user) In my my user space,I solved it by giving pip install openpyxl Thanks Joseph John On Thu, Jun 9, 2016 at 8:51 AM, Joseph John wrote: > Hi All, > I am trying to explore python, trying to read from excel file. > I am using Ubuntu 16.04 > As a first

[Tutor] import openpyxl throws error in-spite I have python-openpyxl installed.

2016-06-08 Thread Joseph John
ve python-openpyxl installed. Like to request guidance and feedback Thanks Joseph John ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] UPDATE, pyhthon+postgre

2016-06-01 Thread john
cursor1.execute("""UPDATE employee SET name=%s, add=%s, add1=%s, city=%s, state_county=%s, country=%s, basic=%s, WHERE group_code = %s""" % (name,add,add1,city,state_county,country,basic,grpCode)) It appears that you are not required to provide any time or date since you created a default. Of c

Re: [Tutor] Best tool for programming interactive games in Python

2016-03-30 Thread john
On 03/30/2016 04:27 AM, wolfrage8...@gmail.com wrote: I have a few students who are interested in creating interactive games in Python. We have learned how to use tkinter but we are looking for something more robust. I tried using pygame I recommend Kivy; because then it is easy to take the app

Re: [Tutor] Noob: nested if-clauses

2016-01-29 Thread John Wong
just copy-paste you can run into issues, just FYI for the beginners. Thanks. John ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] How to call the path of an input file

2016-01-21 Thread John Villarraga
I would like to know what is the syntax to call the path of the input file. Below, my code is calling the input file, but not the path. Sorry for the inconvenience and thank you for your time. import sys path = sys.argv[1] y = map(str.lower, path.split())

[Tutor] how to debug python script which is a parameter of first

2015-11-18 Thread John Spitz
py it doesn't work??? Please help, thanks, John ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Debugging in Python

2015-11-17 Thread John Wong
ject) main() Now when I run main.py, I get an interpreter session inside the PDB debugger (it's similar to GDB if you have written C/C++ code). I can now type dir(file_object), play with file_object, or step inside code to inspect errors. Hope this helps. Thanks. John ___

Re: [Tutor] Python excel filter

2015-10-26 Thread john
take a look at python-excel xlwt is what I use. BTW there are others Johnf On 10/26/2015 05:21 AM, Lucas Mascia wrote: Hello, I would like some guidance in a way to filter data from an excel sheet (.xlsx) I will be exporting an extensive table from a website with 400x20 infos. In this sheet

[Tutor] Is context manager the answer to synchronous function calls?

2015-09-16 Thread John Wong
sleep(10) status = get_vm_status(...) print("done!") I was thinking about context manager. But I feel like that's not the right choice. If you can guess cloning a vm in my program will require several more function calls. What's your recommendati

Re: [Tutor] who makes FOR loop quicker

2015-08-06 Thread John Doe
bit. It would be great to work with You. You know, life is so shot.. And any talks don't make it better, alas. Just we can do. Alan Gauld 於 08/06/2015 09:54 PM 寫道: On 06/08/15 14:28, John Doe wrote: Well, I think, both of us understands that any reference isn't about any sort

Re: [Tutor] who makes FOR loop quicker

2015-08-06 Thread John Doe
7;Aprano 於 08/06/2015 05:21 PM 寫道: On Thu, Aug 06, 2015 at 08:57:34AM -0400, Joel Goldstick wrote: On Thu, Aug 6, 2015 at 4:34 AM, John Doe wrote: Can You, please, elaborate this "..Passing in Python is different than in C or other languages..." I hesitate, because this question is

Re: [Tutor] who makes FOR loop quicker

2015-08-06 Thread John Doe
5 04:45 PM 寫道: On Thu, Aug 06, 2015 at 11:34:51AM +0300, John Doe wrote: Can You, please, elaborate this "..Passing in Python is different than in C or other languages..." Argument passing in Python is: - different to Perl, C, Scala, Algol and Pascal; - the same as Ruby, Lua, Apple

Re: [Tutor] who makes FOR loop quicker

2015-08-06 Thread John Doe
TEMENT, which must be created only once. Any INITIATIONS make once. 'Cause it sucks CPU-memory-allocation-cycle. Does this point make sense for You? Joel Goldstick 於 08/06/2015 03:57 PM 寫道: On Thu, Aug 6, 2015 at 4:34 AM, John Doe wrote: Can You, please, elaborate this "..Passing in P

Re: [Tutor] who makes FOR loop quicker

2015-08-06 Thread John Doe
Can You, please, elaborate this "..Passing in Python is different than in C or other languages..." 'Cause as far as I know - default major Python's implementation CPython is written in C. Joel Goldstick 於 08/05/2015 03:44 PM 寫道: On Wed, Aug 5, 2015 at 3:53 AM, John

[Tutor] who makes FOR loop quicker

2015-08-05 Thread John Doe
To pass by reference or by copy of - that is the question from hamlet. ("hamlet" - a community of people smaller than a village python3.4-linux64) xlist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] i = 0 for x in xlist: print(xlist) print("\txlist[%d] = %d" % (i, x)) if x%2 == 0

Re: [Tutor] about the gui development

2015-06-13 Thread john
Interesting question - what will be the end platform. If you really want a python solution: Tablets. phones, desktops - Kivy (very promising) Tablets. phones, desktops - PyQt Desktops - wxPython, tk, Dabo (python 2.7 at the moment) All the other GUI frameworks either have a very small following

Re: [Tutor] How to do a PyQt VTK application in Python26

2015-02-19 Thread John R
Thanks Alan for suggesting Python 3.4, that seems to be correct but I am searching for any possibilities with python 2.6 Thank you guys for responding, I should try some other forum. On 19 Feb 2015 16:37, "Alan Gauld" wrote: > On 19/02/15 09:54, John R wrote: > >> Is it p

[Tutor] How to do a PyQt VTK application in Python26

2015-02-19 Thread John R
Is it possible to make a PyQt VTK application using Python26? My first sample Qt VTK application is not running!! And my VTK compiled Bin folder is python 26 compiled dll files and Win32 bit The error is Traceback (most recent call last): File "EmbedInPyQt.py", line 5, in from PyQt4 impo

[Tutor] Michael Dawson Chapter 6 Challenge 4

2014-11-23 Thread John Feleppa
Dear all, Has anyone solved the fourth challenge in Chapter 6 of Michael Dawson's book, 'Python Programming for the absolute beginner'? The challenge: 'Write a new *computer_move()* function for the Tic-Tac-Toe game to plug the hole in the computer's strategy. See if you can create an opponent t

Re: [Tutor] Iterating Lines in File and Export Results

2014-10-02 Thread John Doe
2014 at 6:08 PM, Peter Otten <__pete...@web.de> wrote: > John Doe wrote: > >> Hello List, >> I am in need of your assistance. I have a text file with random words >> in it. I want to write all the lines to a new file. Additionally, I am >> using Python 2

Re: [Tutor] printing all text that begins with "25"

2014-10-02 Thread John Doe
Hello, If you want to accomplish what you are looking for within linux (perhaps a bash script, instead?): $ hamachi list | grep -oP '25\.\d+\.\d+\.\d+' 25.0.0.0 25.255.255.255 For your python script, you want to group your regex: reg = re.compile(r'(25\.\d+\.\d+\.\d+)', re.MULTILINE) So when yo

[Tutor] Iterating Lines in File and Export Results

2014-10-02 Thread John Doe
Hello List, I am in need of your assistance. I have a text file with random words in it. I want to write all the lines to a new file. Additionally, I am using Python 2.7 on Ubuntu 12.04: Here is my code: def loop_extract(): with open('words.txt', 'r') as f: for lines in f:

Re: [Tutor] GUI development with Python 3.4.1

2014-09-18 Thread john
On 09/18/2014 06:07 AM, Juan Christian wrote: On Wed, Sep 17, 2014 at 2:01 PM, Juan Christian mailto:juan0christ...@gmail.com>> wrote: I need to develop a GUI for my Python pogram, I already read the GuiProgramming page (https://wiki.python.org/moin/GuiProgramming). For me, the best

Re: [Tutor] How to Create Webpage with Python

2014-07-25 Thread John Cast
project I have very little experience with any of this. That said I am looking for a fair balance of efficiency and ease to accomplish all of this. My time frame is about 3 weeks. I welcome any help/tips/opinions that you all can offer. Thanks On Tue, Jul 15, 2014 at 12:46 PM, Alan Gauld wr

Re: [Tutor] How to Create Webpage with Python

2014-07-15 Thread John Cast
pport). I don't think this will require very much code, but since I am new to the language and having trouble finding documentation on methods such as "saveAs", it's proving difficult. Thanks again On Tue, Jul 15, 2014 at 10:39 AM, Joel Goldstick wrote: > > > > On

Re: [Tutor] How to Create Webpage with Python

2014-07-15 Thread John Cast
in On Tue, Jul 15, 2014 at 1:20 AM, Chris “Kwpolska” Warrick < kwpol...@gmail.com> wrote: > > On Jul 15, 2014 3:17 AM, "John Cast" wrote: > > > > Hey everyone, > > > > I really appreciate all of the help you given me. > > I am making progress,

Re: [Tutor] How to Create Webpage with Python

2014-07-14 Thread John Cast
just trying to present my excel workbook on the web as it's shown in excel (retaining as much formatting as possible). Thanks again, John On Sat, Jul 12, 2014 at 4:32 PM, Danny Yoo wrote: > Hi Chris, > > Yikes. I need to say that as, for disclosure: I work at Google. I do >

Re: [Tutor] How to Create Webpage with Python

2014-07-10 Thread John Cast
Thanks everyone again for the great support. Right now I have a very basic server running using the http module (I'm using python 3). My next step is to generating the HTML pages so that the formatting of the excel docs stays pretty much the same except that it gets shown on the web. For future

Re: [Tutor] How to Create Webpage with Python

2014-07-09 Thread John Cast
o get these HTML page(s) to my site? I welcome any further input anyone is willing to give! Thanks On Wed, Jul 9, 2014 at 3:16 PM, Mark Lawrence wrote: > On 09/07/2014 19:26, John Cast wrote: > >> First, please forgive any ignorance in my post here as I am not good >> with

[Tutor] How to Create Webpage with Python

2014-07-09 Thread John Cast
First, please forgive any ignorance in my post here as I am not good with HTML and new to python. I have a bunch of excel spreadsheets (all in the same format) that I am writing a python script to go through and pick out some information and post to a wiki page. I'm new to python and have gone thr

Re: [Tutor] Storing dictionary value, indexed by key, into a variable

2014-04-05 Thread John Aten
I read the article on data driven programming that Danny linked too, and did some additional looking around. I couldn't find anything directly using Python, but I got an idea of the concept and went crazy with it. This may still be off the mark, but I created a complex combination of lists and d

Re: [Tutor] Storing dictionary value, indexed by key, into a variable

2014-04-03 Thread John Aten
I apologize for the omissions, I thought that I had isolated the problem, but I was way off the mark. The problem was, as suggested by Danny and Peter, in the function where the dictionary is assigned. I ran the type function, as Alex advised, and lo and behold the function was returning a strin

[Tutor] Storing dictionary value, indexed by key, into a variable

2014-03-31 Thread John Aten
Hey all, I am writing a program to drill the user on Latin demonstrative pronouns and adjectives (DPA). It displays a description, and the user has to enter the DPA that corresponds to the description. DPA vary for gender, number and case, and there are 3 separate DPA. I have these stored in a

Re: [Tutor] mixing 64 bit and 32 bit

2014-03-19 Thread John Fabiani
Thanks Johnf On 03/19/2014 11:01 AM, Reuben wrote: Hi John, The generated bytecodes will be different - but both version can run same code without issues Regards, Reuben On 19-Mar-2014 11:28 PM, "John Fabiani" <mailto:jo...@jfcomputer.com>> wrote: Hi, At my o

[Tutor] mixing 64 bit and 32 bit

2014-03-19 Thread John Fabiani
Hi, At my office we have a mix of XP (32bit) and Window 7 (64 bit). I installed python 64 bit on the windows 7 machines and 32 bit on the XP machines. The question is can the different version run the same code without causing issues. Can the 64 bit use the same byte code as the 32 bit? I

[Tutor] Finding the latest file in a dir

2014-01-05 Thread Joseph John
dir location to "/opt/AlfDB" , It does not. I am not able to apprehend how it is not working Guidance and advice requested Thanks Joseph John ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] basic function concept

2013-11-17 Thread John Aten
Too bad that doesn't work. On Nov 16, 2013, at 11:16 PM, Alex Kleider wrote: > On 2013-11-16 13:20, Byron Ruffin wrote: >> def main(x, y, z): >> print (x, y, z) >> def funct(): >> x = 1 >> y = 2 >> z = 3 >> return x, y, z >> main() >> Can someone tell me why main is not being

Re: [Tutor] Reading CSV files in Pandas

2013-10-20 Thread John Steedman
I have in front of me a copy an (unread, borrowed) copy of "Python for Data Analysis". Well, on page 104, there is the start of an answer. Pandas : has two useful functions: read_csv and read_table Numpy : see np.loadtxt and np.genfromtxt There is an example for using the first numpy function:

[Tutor] Python Programming for the absolute beginner 3e, Ch3 Challenge 4

2013-08-11 Thread John Feleppa
Thanks for getting back to me... I am using Python 3.3.2. The challenge is as follows: # Chapter 3 Challenge 4 # # Write the psudocode for a program where the player and the computer # trade places in the number guessing game. That is, the player picks a # random number between 1 and 100 that t

[Tutor] Python Programming for the absolute beginner 3e Ch3 Challenge 4

2013-08-08 Thread John Feleppa
Hello, I am working through Michael Dawson's book, "Python Programming for the absolute beginner 3rd edition". Have just completed Chapter 3, but cannot solve Challenge 4. Has anyone solved this yet - and be willing to share this code? I would much app

Re: [Tutor] Test Question

2013-07-01 Thread John Steedman
Many thanks, everyone. Great answers. I decided to read the manual properly. May take some time but well worth it. On Mon, Jul 1, 2013 at 2:40 PM, Steven D'Aprano wrote: > On 01/07/13 19:58, John Steedman wrote: > >> Good morning all, >> >> A question that I am

[Tutor] Test Question

2013-07-01 Thread John Steedman
ce" might be a either container class or a sequence type. An effective __hash__ function would be required for each "my_object". I HTINK you'd need to avoid using floating point variables that might round incorrectly. Are there other

Re: [Tutor] Function Return Values (or References)

2013-06-24 Thread John Steedman
Thanks for all these clear and knowledgeable answers. I'm much clearer on this now and will read up a bit more around these subjects. John On Mon, Jun 24, 2013 at 10:59 AM, Peter Otten <__pete...@web.de> wrote: > John Steedman wrote: > > > Hi Tutors, > > >

[Tutor] Function Return Values (or References)

2013-06-24 Thread John Steedman
: >>>// return x + 1 >>>x = x + 1 >>>return x >>> >>>y = 1 >>>z = Increment ( y ) >>>y 1 >>>z 2 By FACT 1 x should be a reference parameter...? By Fact 2 x would seem to be a copy...? What in the world of dyna

Re: [Tutor] 2 basic problems

2013-06-23 Thread John Harris
d to have parens to actually call the method. So instead of a.close we need a.close() Then your b.read() line will work, I get the output '168' when I call b.read(). Lastly, the line b = open("acc", "r") creates a new file object (b). From

Re: [Tutor] a little loop

2013-05-27 Thread John Steedman
Some other tools, if you haven't come across them yet. You already know about str.join () Slicing >>>b=['s','p','a','m'] b [ : 1 ] ['s'] b [ : 2 ] ['s', 'p'] Also, consider >>>len ( b) 4 >>>range ( 4 ) [ 0, 1, 2, 3, 4] # which I can iterate over. On Tue, May 28, 2013 at 4:54 AM, T

Re: [Tutor] Random Number Game: Returns always the same number - why?

2013-05-20 Thread John R Jones
gt; print (Random_Number) > > Count = Count + 1 > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tut

Re: [Tutor] model methods in Django

2013-05-19 Thread John Steedman
For the benefit of others,I believe the full class (from the Django Tutorial) is 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() - d

[Tutor] Fwd: Pi xels

2013-05-09 Thread John Steedman
I once dabbled with wxPython. The code below may not run straight off as I've cut it out of a bigger routine, but it may give you a flavour of a basic (very basic) set up. import wx import math def drawCircle (radius, canvas, strCol): centre = (100,100) cX = centre[0] cY = centre[1] d

[Tutor] Issue With a Python Game

2013-04-14 Thread John Bochicchio
I have a question about a game I am making. I finished the overall code, but keep getting errors when I try to play. This is my most common error: C:\Users\John\Documents\Python Games\Noah>python nickeladventuredemo.py Traceback (most recent call last): File "nickeladventuredemo.py&qu

[Tutor] Issue With a Python Game

2013-04-14 Thread John Bochicchio
I have a question about a game I am making. I finished the overall code, but keep getting errors when I try to play. This is my most common error: C:\Users\John\Documents\Python Games\Noah>python nickeladventuredemo.py Traceback (most recent call last): File "nickeladventuredemo.py&qu

Re: [Tutor] A Text Adventure Problem

2013-03-24 Thread John Bochicchio
ram to move to the next area of the code. On Sun, Mar 24, 2013 at 4:58 PM, bob gailer wrote: > On 3/24/2013 3:41 PM, John Bochicchio wrote: > > I've been trying to write a simple test text adventure, but have been > running into serious problems. Here is the error I get when I ru

[Tutor] A Text Adventure Problem

2013-03-24 Thread John Bochicchio
I've been trying to write a simple test text adventure, but have been running into serious problems. Here is the error I get when I run it. It will give me the opening text and lets me make my first choice. Then I get this. error "Traceback: (Most recent call last) file "game1.py", line 104, in R

[Tutor] Overriding equality tests in Python

2013-03-23 Thread John Steedman
to a list and successfully use the sorted () function on that list. It will enable you to have your list sorted by some other variables within your class, such as the number scored. John S ___ Tutor maillist - Tutor@python.org To unsubscribe

[Tutor] Python's OOP-Inheritance make me confuse.

2013-01-18 Thread Moore John
Hi, I am new to Python language. I have only 10 days experience on it. When I start learning there is no difficult, but it make me slow down when I reach "Object Oriented Concept", especially "Inherited". Some of my background knowledge about "Inherited is the child class can get all of characteris

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hi Mark, Thanks. I wouldn't know C if I fell over it. Until recently, the *only* language I'd ever used was (HP, GW)BASIC aside from Fortran 101, 3 decades ago! John. On 30/10/2012 2:45 AM, Mark Lawrence wrote: If you're more comfortable with C you can use printf style form

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
o back to year zero exercise I feel. John. On 30/10/2012 2:15 AM, Mark Lawrence wrote: It's 16 digits with 3.3.0. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
7f') '0.09952' Python says the precision is 15 decimal digits: >>> import sys >>> sys.float_info.mant_dig # bits of precision 53 >>> sys.float_info.dig# decimal digits 15 Regs, John. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
o many insights in one night - terrific! Wish I'd picked this language up *years* ago - it's so foreign to me now, yet so beautifully useful! Cheers, John. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
t after use', or will python just default back to what it sees next? I know this sounds silly, but to me the command 'looks' like it's setting a 'hidden pyton variable' to "15f" which may need to be explicitly revoked, or not,...??? John. ___

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
Hi Dave, You just lost me. If you don't use any transcendental functions, then a fraction has no quantization error. It's totally precise. Ah ha! Another light bulb moment - two in one night! Thank you Dave, and all! John. ___ Tuto

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
o display. Hmm, well, I did modify the original script by setting the convergence test value to 2.005e-16 up from 1e-6, s, I 'guess' 15 sig.figs. will be OK. I'll have a go! That's 3 orders of magnitude better for a few key strokes! Great! (maybe...) John.

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
ecimal. The class name within that module is Decimal. A minor thing to me, a non programmer, but I do understand that being very precise is very important to programmers, so thank you! John. ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
t lost me. Of more practical relevance may be something like gmpy <http://code.google.com/p/gmpy/> I've just had a peek. Looks like what I need. Haven't a clue if I'll understand how to 'patch it in' to the scripts. Doco read time! John. _

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
rr.write(str(dist) + "\n") if dist < 2.10005e-16: break # Output the points. for x, y, z in points: pprint(x, y, z) The nfaces.py used on the output from this is a tad longer! Well, yes, but only with some significant changes Well, it seems I may have to learn "

Re: [Tutor] greater precision?

2012-10-29 Thread John Collins
'machine' precision, one needs to change base 10 floats to a higher base, do foo, then come back. Sounds daunting! John. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] greater precision?

2012-10-29 Thread John Collins
her, but if I can squeeze out *at least* 15 sig figs, (30 or more would be better!) I'd be a happy camper! XNumbers addon for Excel allows over 200 sig figs by switching to base 256 IIRC. It is this with which I'd like to examine the output of these pyto scripts at finer re

[Tutor] greater precision?

2012-10-29 Thread John Collins
her, but if I can squeeze out *at least* 15 sig figs, (30 or more would be better!) I'd be a happy camper! XNumbers addon for Excel allows over 200 sig figs by switching to base 256 IIRC. It is this with which I'd like to examine the output of these pyto scripts at finer re

[Tutor] python 2.7.1

2012-09-06 Thread john
print "hello world" #this is just something to say >>> /Users/jonathan/Documents/hello.py File "", line 1 /Users/jonathan/Documents/hello.py ^ SyntaxError: invalid syntax what am i doing wrong? ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] understanding pydoc try

2012-08-30 Thread John Maclean
On 08/30/2012 05:15 PM, Alan Gauld wrote: On 30/08/12 15:43, John Maclean wrote: Thanks. This is a heck of a lot more clearer to me! BNF, huh? Another set TLA that I don't need to know ;-) Actually, BNF is one of those useful skills for any programmer because almost every langua

Re: [Tutor] understanding pydoc try

2012-08-30 Thread John Maclean
On 08/30/2012 03:05 PM, Dave Angel wrote: On 08/30/2012 09:30 AM, John Maclean wrote: What does the first line from `pydoc try` actually mean? This does not look like the syntax that one is supposed to use. try_stmt ::= try1_stmt | try2_stmt You're looking at the first of thre

[Tutor] understanding pydoc try

2012-08-30 Thread John Maclean
What does the first line from `pydoc try` actually mean? This does not look like the syntax that one is supposed to use. try_stmt ::= try1_stmt | try2_stmt I can write simple statements as shown below, but I want to actually understand what I am doing. try: import io print("import

[Tutor] PYFTDI Library for FT232H

2012-08-02 Thread John Battle
string to one of them to start a data download and then receive straming data on the other one. I have a C program that will do this but I need to do it in Python. Any help would be gretly appreciated. Thanks John Battle ___ Tutor maillist - Tutor

[Tutor] user created lists

2012-04-11 Thread john moore
Hello Pyhton World, I'm new at this and was wondering how I create a number of user specified lists? Example: "How many list would you like to create?" User inputs 5 creates five lists, list1 [] list2 [] list3 [] list4 [] list5 [] I can create one with append, but I don't know how to loop it to

Re: [Tutor] which gets called

2012-04-06 Thread John Fabiani
On Friday, April 06, 2012 06:54:28 AM John Fabiani wrote: > Hi, > > I want to create a class that inherits two other classes. > > class NewClass( A,B) > > But both "A" and "B" contain a method with the same name ("onKeyDown"). > > If

[Tutor] which gets called

2012-04-06 Thread John Fabiani
Hi, I want to create a class that inherits two other classes. class NewClass( A,B) But both "A" and "B" contain a method with the same name ("onKeyDown"). If my "NewClass" does not contain something to override the methods which one would be called if myinstance = NewClass() myinstance.onKe

  1   2   3   4   5   6   7   8   9   10   >