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
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

[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] 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 ___

[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

[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())

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] 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] 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] 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] 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

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 >> &

[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] 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 >--

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] 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

[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

[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] 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

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] 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

[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

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

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] 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

[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] 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] 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] 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] 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

[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

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:

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

[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

[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

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] 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] 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

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

[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] 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

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-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-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-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-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

[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] 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

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

[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

[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

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] 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

[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] 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] 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] 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

[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

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

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 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] 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

[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

[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 _

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] Recent Documents

2010-05-27 Thread John Storta Jr.
ly common as part of integrating a Python app with Gnome. I cannot image every app maintains their own list of recently used docs when it is already stored within the desktop. If anyone has any ideas, please let me know. Thanks, John S. ___ Tutor maillist -

Re: [Tutor] fibonacci.py task ???

2008-06-24 Thread John Patrick Gerdeman
Fibonacci.py calculates the Fibonacci numbers (the sum of the two previous numbers), also see http://en.wikipedia.org/wiki/Fibonacci_number Files that end in .py are python files. Much like .txt are text files and .odc is OpenOffice Calc file. Though you can name any file as you wish, the convent

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] 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] 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

Re: [Tutor] problem

2005-05-03 Thread Allen John Schmidt, Jr.
Feziwe Mpondo wrote: >hi >problem :modification of a guessing game excersize to a password asking >program. her's what i tried. >s = raw_input > > What is this here for? >#asks for a password >#prints it if correct >password = input( "Tell me a password: ") > > This is correct, but >passwor

[Tutor] Dictionary Inserts...

2005-05-05 Thread Allen John Schmidt, Jr.
Ok, I have had enough. I have looked all through the python docs and I cannot find it. How do you insert an entry into a dictionary? Thanx! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Dictionary Inserts...

2005-05-05 Thread Allen John Schmidt, Jr.
Arrgh! How could I be so stupid! :) Thanks for the help! I know many things about python, but I can't believe that I didn't know that! Thanx again! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Please help

2005-08-03 Thread Allen John Schmidt, Jr.
Hey, I had a similar problem not too long ago. My data came in the first format, but I didn't need it formated like that. Here is how I would have written it: import re col=re.compile('(AD.*?)\s*$') datas=re.compile('\s*(.+?)\s+(.+?)') f1 = open('xx','r') mind={} matching='' for i in meat:

Re: [Tutor] Please help

2005-08-03 Thread Allen John Schmidt, Jr.
Whoops! Had to correct it! Hey, I had a similar problem not too long ago. My data came in the first format, but I didn't need it formated like that. Here is how I would have written it: import re col=re.compile('(AD.*?)\s*$') datas=re.compile('\s*(.+?)\s+(.+?)') f1 = open('xx','r') mind={} match

Re: [Tutor] printing an acronym (fwd)

2005-09-26 Thread Allen John Schmidt, Jr.
Or a shorter version, a=lambda n: "".join([x[0].upper() for x in n.split()]) Then it is just: >>> a('random access memory') 'RAM' Danny Yoo wrote: Forwarding to tutor -- Forwarded message -- Date: Mon, 26 Sep 2005 08:32:02 -0500 From: Jason Massey <[EMAIL PROTECTED]> T

Re: [Tutor] MySQLdb question

2006-04-14 Thread Allen John Schmidt, Jr.
Patty wrote: >I have a data structure in a python file that looks something like this: > >my_map= { "host1": {"target1", "target2", "target3" }, > "host2": {"target4", "target5", "target6" }, > } > >cursor.execute("""SELECT %s FROM targets >WHERE target_name = %s """ %

[Tutor] Need Help

2006-07-11 Thread Shappell, John J CW2
unt: def __init__(self, initial): self.balance = initial def deposit(self, amt): self.balance = self.balance + amt def withdraw(self,amt): self.balance = self.balance - amt def getbalance(self): return self.balance V/R CW2 John Shap

Re: [Tutor] Need Help

2006-07-11 Thread John or Margaret Montgomery
On Tue, 11 Jul 2006 06:41:23 -0500 Luke Paireepinart <[EMAIL PROTECTED]> wrote: > Hi. > Shappell, John J CW2 wrote: > > > > Here is the assignment > > > [snip assignment] > Please don't ask about homework in the future. Did your professor tell > you t

[Tutor] building strings of specific length

2005-04-04 Thread Vines, John (Civ, ARL/CISD)
Hello. I have a question regarding strings. How do I format a string to be a specific length? For example I need 'string1' to be 72 characters long. Thanks for your time, John ___ Tutor maillist - Tutor@python.org http://mail.python.o

[Tutor] problem with mmap

2007-05-30 Thread Ertl, John C CIV 63134
this code but I do not even get to that part...the mmap call is bad. I have never used mmap before so this is new to me. I am running python 2.4 John # code from mmap import mmap import os from bisect import bisect_left import sys class Zipcodes(object): """Use mm

[Tutor] Best way to POST XML to CGI

2007-06-07 Thread Ertl, John C CIV 63134
r friendly. My guess is I am missing something about how cgi can work. I bet Python has a simple way to receive a XML post so I do not have to look for a specific form name? Any help would be appreciated. Thanks, John Web page code to post XML in a text area http:///cgi-bin/p

Re: [Tutor] Best way to POST XML to CGI

2007-06-07 Thread Ertl, John C CIV 63134
am missing some pieces. Maybe XML/RPC. Thanks again for the advice...I will rethink how I am doing this. John Ertl Meteorologist FNMOC 7 Grace Hopper Ave. Monterey, CA 93943 (831) 656-5704 [EMAIL PROTECTED] From: [EMAIL PROTECTED] on behalf of Alan Gauld

[Tutor] how to return an error from a CGI

2008-05-12 Thread Ertl, John C CIV 63134
URL error. If I understand correctly, I am supposed to return something similar to say a 500 error. I think this is a HTTP error and I tried a few things but no luck. Thanks for the ideas. John Ertl Meteorologist FNMOC 7 Grace Hopper Ave. Monterey, CA 93943 (831) 656-5704 [EMAIL PROTECTED

[Tutor] Python 2.4 threading

2008-10-21 Thread Ertl, John C CIV 63134
. John Ertl Meteorologist FNMOC 7 Grace Hopper Ave. Monterey, CA 93943 (831) 656-5704 [EMAIL PROTECTED] Classification: UNCLASSIFIED Caveat (s): FOUO ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] threading not working how about fork?

2008-10-22 Thread Ertl, John C CIV 63134
to run through all 5 "forks" without waiting for the previous one to complete? That was all five would be done in about 10 seconds. This is simpler than my real problem but I can not even figure this one out. Thanks for the help. John Ertl Meteorologist FNMOC 7 Grace Hopper Ave. Mon

[Tutor] How to use function from specific module and then switch to other module

2008-11-06 Thread Ertl, John C CIV 63134
: def __init__(self):   self.model=B   def rain(self):    self.calTime() # this function is in the main forecast class    self. rain = do stuff for model B     Thanks for any ideas you might have.   John Ertl Meteorologist   FNMOC 7 Grace Hopper Ave. Monterey, CA

Re: [Tutor] How to use function from specific module and then switch to other module

2008-11-07 Thread Ertl, John C CIV 63134
again. John Ertl Meteorologist FNMOC 7 Grace Hopper Ave. Monterey, CA 93943 (831) 656-5704 [EMAIL PROTECTED] Classification: UNCLASSIFIED Caveat (s): FOUO From: Kent Johnson Sent: Thu 11/6/2008 7:36 PM To: Ertl, John C CIV 63134 Cc: tutor@python.org Subject: Re: [Tutor] How to use function from

<    6   7   8   9   10   11