Re: [Tutor] PDF Scrapping

2015-11-25 Thread Python Beginner
Oh, I forgot to mention that I am using Python 3.4. Thanks again for your help pointing me in the right direction. ~Chris On Tue, Nov 24, 2015 at 1:36 PM, Python Beginner < pythonbeginner...@gmail.com> wrote: > Hi, > > I am looking for the best way to scrape the following PDF's:

[Tutor] PDF Scrapping

2015-11-24 Thread Python Beginner
that pdftables 0.0.4 is an excellent way to scrape tabular data from PDF'S (see https://blog.scraperwiki.com/2013/07/pdftables-a-python-library-for-getting-tables-out-of-pdf-files/ ). I downloaded pdftables 0.0.4 (see https://pypi.python.org/pypi/pdftables). I am new to Python and having trouble

Re: [Tutor] ssh socks proxy

2012-05-16 Thread kushal . kumaran+python
Adam Gold adamg...@lavabit.com wrote: I'm trying to write a 'simple' script that will set up a socks proxy over ssh and maintain the connection until manually terminated. It's not possible to use key-based authentication so a password will need to be supplied. Also, note, the user is presented

Re: [Tutor] ssh socks proxy

2012-05-16 Thread kushal . kumaran+python
kushal.kumaran+pyt...@gmail.com wrote: Adam Gold adamg...@lavabit.com wrote: I'm trying to write a 'simple' script that will set up a socks proxy over ssh and maintain the connection until manually terminated. It's not possible to use key-based authentication so a password will need to be

Re: [Tutor] Python Saved the Day

2011-12-04 Thread python
an evaluation version of a commercial product ... which after several weeks of extensive testing (and hundreds of man hours) never produced the correct results. It amazes me what can done with simple Python scripts and a KISS attitude. Malcolm ___ Tutor

[Tutor] Personal: Re: Tutor Digest, Vol 90, Issue 97

2011-08-29 Thread python
Hi Frank, Please don't unsubscribe. Book reviews are always welcome. Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Object designer applications - are there any?

2011-08-05 Thread python
Stephen, You might check out the SQL management tools from Embarcadero. They may provide some of the conversion capabilities you are looking for. And they generate beautiful documentation. Perhaps you could wrap the features of this product with Python scripts to acheive your goals? Malcolm

Re: [Tutor] decorators

2011-06-24 Thread python
Steven, Here's my cheap introduction to decorators... Beautifully explained! Thank you, Malcolm (not the OP) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Excited about python

2011-06-10 Thread jon vs. python
Dive into Python: http://diveintopython.org/ is what you're looking for. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Excited about python

2011-06-10 Thread python
For a handy reference, you can't beat Python Essential Reference by David Beazley (along with the online documentation, of course!). I think this book is obligatory if you are going to be working with Python a lot. I own all four editions :) But you wanted something more in depth

Re: [Tutor] accessing another system's environment

2011-02-26 Thread python
Bill, Coming into this thread late: If you are working with Windows workstations, try posting your question on the Python Windows API mailing list. http://mail.python.org/mailman/listinfo/python-win32 You may be able to use WMI (via Python) to accomplish what you're trying to do. Malcolm

Re: [Tutor] tkinter, create widgets during runtime?

2011-01-27 Thread python
Elwin, There is a dedicated Python Tkinter mailing list called tkinter-discuss. I would post your question to this mailing list - I've found them very helpful. Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Writing Python Script to read battery level

2011-01-17 Thread python
FT, Is there a way to read the battery level using Python? Check out the following code snippet: Get info on power/battery status http://nullege.com/codes/show/src@jaraco.windows-1.6@jaraco@wind...@power.py/14/ctypes.wintypes.BOOL This code snippet requires the following 3rd party packages

Re: [Tutor] Choice of Python

2010-12-28 Thread python
Marc/Emile, If you're looking for a good hosting service that supports Python, I strongly recommend webfaction.com. I've worked with a lot of hosting companies and webfaction gets my highest endorsement: Great support, helpful user community, very flexible support for hosting Python applications

Re: [Tutor] vim as a python editor; FOLLOW-UP QUESTION

2010-12-16 Thread python
Joel, One more question: IDLE does not appear to have a way to review your command history, e.g., by hitting the up arrow. To move through your command history, use Alt+P (previous) and Alt+N (next). Malcolm ___ Tutor maillist - Tutor@python.org

Re: [Tutor] %T as a strftime format identifier

2010-11-27 Thread python
32-bit Python 2.7 for Windows: import time time.strftime(%T) Traceback (most recent call last): File pyshell#97, line 1, in module time.strftime(%T) ValueError: Invalid format string Malcolm ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Simple counter to determine frequencies of words in a document

2010-11-21 Thread python
it is difficult for me not to be profuse in my thanks because you guys really go beyond the call of duty. I love this list. The responses in this list most of the times don't just address the problem at hand but are also useful in a more general sense and help people become better

Re: [Tutor] Too different 2.6 vs 2.7?

2010-11-08 Thread python
Jorge, Python 2.7 supports an updated version of the Tkinter GUI framework with support for native themes (ttk). This makes it possible to create professional looking user interfaces without having to install a separate GUI framework like wxPython or pyQt. Malcolm

Re: [Tutor] Problem with python

2010-10-24 Thread python
I just wanted to note that Steven is a great teacher! +1 Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Where to start with Unit Testing

2010-08-01 Thread python
Mac, My answer falls in the category feedback ... I'm not the OP, but I wanted to let you know that I really enjoyed your feedback - excellent writeup! Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] web-based python?

2010-08-01 Thread python
Alex, I have an IPowerWeb.com server, which claims to support Python Many hosting providers claim to support Python. The best hosting service I've found for Python is webfaction.com. Originally this hosting provider specialized in just Python hosting and this enthusiasm for Python and hands

Re: [Tutor] How to get script to detect whether a file exists?

2010-08-01 Thread python
Richard, Look at the os.path.isfile function. Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Confirm that Python 2.6 ftplib does not support Unicode file names? Alternatives?

2010-06-26 Thread python
Updating this thread for users searching the archives. Additional commentary can be found in this thread I started on Stackoverflow.com. http://stackoverflow.com/questions/3120295/confirm-that-python-2-6-ftplib-does-not-support-unicode-file-names-alternatives Gabriel Genellina added

[Tutor] Confirm that Python 2.6 ftplib does not support Unicode file names? Alternatives?

2010-06-23 Thread python
Can someone confirm that Python 2.6 ftplib does *NOT* support Unicode file names? Or must Unicode file names be specially encoded in order to be used with the ftplib module? The following email exchange seems to support my conclusion that the ftplib module only supports ASCII file names. Should

Re: [Tutor] a class query

2010-06-07 Thread python
Not the OP, but I was surprised to see class Name() work (in Python 2.6.5 at least). Is this equivalent to class Name( object ) or does this create an old style class? Going forward into the 2.7/3.x world, is there a preferred style? Thanks, Malcolm

Re: [Tutor] a class query

2010-06-07 Thread python
Hi Mark, I was surprised to see class Name() work (in Python 2.6.5 at least). Is this equivalent to class Name( object ) or does this create an old style class? Going forward into the 2.7/3.x world, is there a preferred style? RTFM? :) I am reading TFM :) Here's why I'm confused

Re: [Tutor] a class query

2010-06-07 Thread python
In Python 2.x, all classes are old-style unless you directly or indirectly inherit from object. If you inherit from nothing, it is an old-style class regardless of whether you say class Name: pass or class Name(): pass. In Python 3.x, there are no old-style classes. Thanks Steven! Malcolm

Re: [Tutor] a class query

2010-06-07 Thread python
Steven, Thanks again for your explanations. I thought I had missed a major change in Python class behavior - relieved to find that I'm up-to-date. Cheers, Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

Re: [Tutor] a class query

2010-06-07 Thread python
Hi Mark, I see that Stephen D'Aprano has already replied twice so I won't bother. Apart from that no offence meant, I hope none taken. Your RTFM reply actually gave me a good laugh. No (zero) offence taken. And I appreciate your many helpful posts in these forums. Cheers, Malcolm

Re: [Tutor] portability of pickle and shelve across platforms and different python versions?

2010-05-06 Thread python
Garry, I asked a similar question on Stackoverflow.com and got some great responses including at least one from a member of the Python development team. Best way to save complex Python data structures across program sessions (pickle, json, xml, database, other) http://stackoverflow.com/questions

Re: [Tutor] Iterating through a list of strings

2010-05-03 Thread python
Agreed that line = line[:line.index('%')] is slightly more readable than line = line.split('%', 1)[0] How about: line = line.partition('%')[0] partition() works even if '%' isn't present. The index() and split() techniques raise exceptions if '%' isn't present. Malcolm

Re: [Tutor] Encoding

2010-03-07 Thread python
puzzled why anyone would use the regular open() for anything but binary operations. Malcolm - Original message - From: spir denis.s...@gmail.com To: Python tutor tutor@python.org Date: Sun, 7 Mar 2010 14:29:11 +0100 Subject: Re: [Tutor] Encoding On Sun, 7 Mar 2010 13:23:12 +0100 Giorgio

Re: [Tutor] Bowing out

2010-03-03 Thread python
Hi Kent, Your posts and web pages really helped me during my early days with python. Wishing you great success in your new endeavors!!! Cheers, Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] Python Tutorials: How to create useful programs after learning the syntax?

2009-07-09 Thread python
Wesley, You mean my check is not in the mail? Damn! Well, no more positive reviews for you :) Since you've stepped off your soapbox, I'll also mention your free hour long video hosted by Safari Books (you may have to signup for a free account to see the video). What is Python by CPP (Core

Re: [Tutor] Python Tutorials: How to create useful programs after learning the syntax?

2009-07-08 Thread python
but if you ever come across a copy of Core Python Programming, i've put lots of exercises at the end of every chapter. +1 from a reader/customer (vs. the author) Core Python Programming is an excellent resource for learning Python. I enjoyed the exercises - they force you to master

Re: [Tutor] mac os x executable

2009-07-07 Thread python
Alan, After all with Python 2.3 pre installed on MacOS X Is Python 2.3 really the most recent version of Python distributed with new Macs? So if I wanted to distribute a Python 2.6 script to a Mac user, I would need to instruct the Mac user how to download and install a separate version

[Tutor] reading and processing xml files with python

2009-06-20 Thread python . list
Hi, I am a total python XML noob and wanted some clarification on using python with reading remote XML data. All examples I have found assumes the data is stored localy or have I misunderstood this? If I browse to: 'user:passw...@domain.com/external/xmlinterface.jsp?cid=xxxresType

[Tutor] Handling Generator exceptions in Python 2.5

2009-06-19 Thread Joe Python
I have a generator as follows to do list calculations. *result = [(ListA[i] - ListB[i-1])/ListA[i] for i in range(len(ListA))]* The above generator, throws '*ZeroDivisionError*' exception if ListA[i] = 0. Is there a way to say 'Don't divide by ListA[i] if its equal to 0 (within that

Re: [Tutor] Handling Generator exceptions in Python 2.5

2009-06-19 Thread Joe Python
Python jopyt...@gmail.com wrote: I have a generator as follows to do list calculations. *result = [(ListA[i] - ListB[i-1])/ListA[i] for i in range(len(ListA))]* The above generator, throws '*ZeroDivisionError*' exception if ListA[i] = 0. Is there a way to say 'Don't divide by ListA[i

Re: [Tutor] Best Python Editor

2009-06-13 Thread python
Alan, I spoke a wee bit too soon. The editor is nice but the debugger and some of the other tools windows (eg variables) are broken. Pity, lots of potential here. The current release of Pyscripter is not stable. Drop back one release and you'll find a very solid product. Malcolm

Re: [Tutor] Best Python Editor

2009-06-13 Thread python
The current release of Pyscripter is not stable. Drop back one release and you'll find a very solid product. Sounds interesting. What is the stable version and where can it be found? Ken, Here's the version we use: Version 1.7.2, Oct 2006 http://mmm-experts.com/Downloads.aspx?ProductId=4

Re: [Tutor] clean text

2009-05-19 Thread python
Denis, Untested idea: 1. Fill a dict with pre-calculated repr() values for chars you want to replace (replaceDict) 2. Create a set() of chars that you want to replace (replaceSet). 3. Replace if (n 32) ... test with if char in replaceSet 4. Lookup the replacement via replaceDict[ char ] vs.

Re: [Tutor] clean text

2009-05-19 Thread python
Denis, Thank you for sharing your detailed analysis with the list. I'm glad on didn't bet money on the winner :) ... I'm just as surprised as you that the regex solution was the fastest. Malcolm ___ Tutor maillist - Tutor@python.org

[Tutor] Pythonic way to normalize vertical whitespace

2009-05-08 Thread python
Note: Following cross-posted to python-list where it got queued due to suspicious subject line. I'm looking for suggestions on technique (not necessarily code) about the most pythonic way to normalize vertical whitespace in blocks of text so that there is never more than 1 blank line between

Re: [Tutor] importance of Docstring

2009-04-16 Thread python
Albert, That was a great writeup on docstrings. I'm going to share that with my dev team. Thank you! Malcolm ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Yet another Python book

2009-04-11 Thread python
Dave, Great stuff!!! Thanks for sharing your hard work with the community! Malcolm ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Possible to change values of scalar function parameters?

2009-02-17 Thread python
Is there a way to change values of scalar function parameters? I know you can change the values of parameters if the parameter is a mutable type like a list, but is there a way to update the value of scalar parameters of type integer or string? Simple example: Is there a way to have the following

Re: [Tutor] Possible to change values of scalar function parameters?

2009-02-17 Thread python
Kent, No, not a simple way at least. Possibly you can do it with hackery involving stack frames but I wouldn't recommend that. Either pass the values in some kind of container (list, dict, class instance) or return the new value and assign it in the caller. That's what I thought. Thank you!

Re: [Tutor] Possible to change values of scalar function parameters?

2009-02-17 Thread python
Alan, But don't forget that in python you can return multiple values from a function. Yes. Thank you! Malcolm ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Simple PassGen

2009-02-11 Thread python
:16:11 +1100 Subject: Re: [Tutor] Simple PassGen On Wed, Feb 11, 2009 at 2:26 AM, [1]pyt...@bdurham.com wrote: Are you sure it isn't python 3.x you're playing with? The reason why simple print function works in python 2.x is because of a syntactical coincidence, it is still a 100% statement

Re: [Tutor] Simple PassGen

2009-02-10 Thread python
Kent, Except they are not equivalent when you want to print more than one thing. ... Python 2.6: In [1]: print(3, 4) (3, 4) I'm running Python 2.6.1 (32-bit) on Windows XP. I don't get the tuple-like output that you get. Here's what I get: print( 3, 4 ) 3 4 Malcolm

Re: [Tutor] Simple PassGen

2009-02-10 Thread python
DOH! I just realized why we're getting different results. Sorry for the confusion - I wasn't trying to be a smart-ass! We've been trying to future proof our new code for Python 3.x so we automatically have 3.0 print() functionality enabled in our Python 2.6 dev environments. Malcolm

Re: [Tutor] Psyco module

2008-12-08 Thread Python Nutter
It only runs on Intel 386-compatible processors. Once we know what CPU you are using then we can figure it out better. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Sorting Dictionary of Dictionary by certain Value

2008-09-23 Thread Joe Python
Hi Pythonistas, I have a large dictionary of dictionary (50,000+ keys) which has a structure as follows: DoD = { 'flintstones' : { 'husband' : fred, 'pal' : barney, 'income': 500, }, 'jetsons' : { 'husband' : george, 'wife'

[Tutor] Confused about import Numeric vs import numpy for Arrays

2008-08-08 Thread S Python
Hi Everyone, I would like to create a two-dimensional array but am confused as to how to go about it. I've read about Numeric Python and Numpy. Are they one and the same? Also, how do I install them? I am working on a Windows machine. I've been getting the following error messages: import

Re: [Tutor] Confused about import Numeric vs import numpy for Arrays

2008-08-08 Thread S Python
No, they are not the same. Numeric is older; NumArray is another older package. You should use Numpy if you can. http://numpy.scipy.org/#older_array snip Now you should be able to import numpy. Kent Thanks, Kent. I ended up using: from numpy import * I wasn't sure what the difference

Re: [Tutor] Confused about import Numeric vs import numpy for Arrays

2008-08-08 Thread S Python
In general from module import * is a very bad idea. import module imports a module into its own namespace (e.g., to access its functionality you would have to do module.foo() and module.bar() The form that you chose to use imports all of a module's contents into the current namespace. This

Re: [Tutor] Confused about import Numeric vs import numpy forArrays

2008-08-08 Thread S Python
A useful tip is that if you have a long module name you can also use import module as shortname eg import numpy as n and then access numpy.foo() as n.foo() Sacves a lot of typing for a slight loss of clarity in maintenance - you have to remember which module the short names refer

Re: [Tutor] Confused about import Numeric vs import numpy for Arrays

2008-08-08 Thread S Python
Another reason not to use from xx import * is that it can make it very difficult to discover where a name is defined. If you have several from xx import * lines and then later you use a function foo() there is no easy way to tell which module foo came from. An alternative is to list just the

[Tutor] Reading List from File

2008-07-31 Thread S Python
Hi Everyone, I am trying to read a comma-delimitted list (aaa,bbb,ccc) from a text file and assign those values to a list, x, such that: x = [aaa, bbb, ccc] The code that I have come up with looks like this: x = [] f = open(r'c:\test.txt', 'r') x.extend(f.readlines()) x ['aaa,bbb,ccc'] If

Re: [Tutor] Reading List from File

2008-07-31 Thread S Python
Hi Everyone, Thanks for the variety of responses in such a short amount of time. This distribution list is incredible. Sorry for the delayed reply as I wanted to test what everyone suggested, so here goes: --- @Amin: I tried your suggestion, but perhaps I don't

Re: [Tutor] Reading List from File

2008-07-31 Thread S Python
= csv.Reader(myfile, delimeter = ',') should be data = csv.reader(myfile, delimeter = ',') 2008/7/31 S Python [EMAIL PROTECTED] Hi Everyone, Thanks for the variety of responses in such a short amount of time. This distribution list is incredible. Sorry for the delayed reply as I wanted

Re: [Tutor] Reading List from File

2008-07-31 Thread S Python
Date: Thu, 31 Jul 2008 11:34:56 -0700 Subject: Re: [Tutor] Reading List from File S Python wrote: f = open(r'C:\test.txt', 'r') foo = f.readline.split(',') readline is the function/method name readline() executes that function/method and returns a value try typing in 'type(f.readline

Re: [Tutor] (no subject)

2008-07-29 Thread S Python
Hi Morgan, Have you installed Python on your computer? If you are using Microsoft Windows, you can download and install Python from here: http://python.org/download/releases/2.5.2/ and select python-2.5.2.msi. Once it's installed, you should have a directory on your machine called C:\python25

Re: [Tutor] wanting to learn

2008-06-11 Thread Python Nutter
to learn a language like php, asp, .net but I never took the time to learn them. I have recently found Python and believe this is the language that I will hang-my-hat-on and learn. I was web designer a while back, moved into security, then found python, other than that almost the same path

Re: [Tutor] I am a web designer wanting to learn Python

2008-05-28 Thread python
Wesley, Don't be so modest - your Core Python Programming (by Wesley Chun) is also a great book for those looking to learn Python. Malcolm ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What lib should I use?

2008-05-25 Thread python nutter
a) urllib b) urllib2 c) beautifulsoup a + b are built-ins. c you have to download and install from http://www.crummy.com/software/BeautifulSoup/ Cheers, Python Nutter ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] listing classes

2008-05-20 Thread python
Thomas, import types [ name for name in dir(A) if type(eval('A.'+name)) == types.ClassType ] The == types.ClassType doesn't seem to pick out the classes. Also, I think you should be returning eval( name ) vs. name so that the OP gets a list of objects vs. names? (My take on what the poster

[Tutor] Why next vs. __next__ ?

2008-04-21 Thread python
Is there a reason why generators have a special method named next vs. __next__? All other Python's special names have the double underscore prefix/suffix. http://docs.python.org/ref/specialnames.html Are there other special names like next that don't have the double underscore delimiters?

[Tutor] When to use % vs. locale.format()?

2008-04-21 Thread python
Are there any best practices guidelines that discuss when one should use % vs. locale.format? The locale.format() seems closer to the new new Python 3.0 print-as-a-function vs. statement ... with the added benefit of localized output. Malcolm ___ Tutor

[Tutor] When to use __new__ vs. __init__ ?

2008-04-18 Thread python
Any guidelines on when to use __new__ vs. __init__ when sub-classing? Thanks! Malcolm ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] When to use __new__ vs. __init__ ?

2008-04-18 Thread python
Thanks Kent! Malcolm ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Best practice for installing new packages (eggs)

2008-04-17 Thread python
, is are there conventions for where to put core packages, experimental packages, and packages that one is building themselves? Also, is it safe to assume that installing a 3rd party package won't (unexpectedly) affect other parts of my Python environment. I'm running Python 2.5.2 on Windows XP Pro SP2. Here

Re: [Tutor] Remove specific chars from a string

2008-04-16 Thread python
Ricardo, Thanks for the tip on how to use maketrans. I was trying to over-complicate things on my side. The string module lives in 3.0 ... only the duplicate methods have been removed. Regards, Malcolm ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Hoping to benefit from someone's experience...

2008-04-15 Thread python
Mark, Here's how we work with RTF: We create a Word document formatted exactly like we want with special markers (unique text) inserted in places where we want to programmatically add text. We save this document to RTF (this RTF becomes our template file), remove all the carriage returns and

[Tutor] Best practice: Use % operator or locale.format?

2008-04-14 Thread python
Does the % operator always respect locale or should one use locale.format() instead? Are there guidelines where one should use one string formatting technique vs. another? Thanks! Malcolm ___ Tutor maillist - Tutor@python.org

[Tutor] Nested, line by line, file reading

2007-12-16 Thread jon vs. python
Hi everyone, I have a file with this content: 1 1 1 1 1 1 1 2 1 1 I wanted a little script that would print the line containing 2 and every line containing 1 after it. I've tried this: def p(): f = file(prueba.txt,'r') for startline in f.read(): if startline.find(2) != -1:

[Tutor] Python 2.4 or Python 2.5?

2007-04-20 Thread python
Im confused When i had python 2.4 all my scripts work correctly should i reinstall python 2.4? Or should I keep 2.5? Where can I find information on coding for python 2.5? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo

[Tutor] sys.argv?

2007-04-17 Thread python
I've been reading the python tutorial trying to get used to the style tryna understand it. So I come across this: sys.argv[0] in the tutorial on python.org. What is sys.argv? How does it work? Can someone give me a simple example on how to use

[Tutor] range() help

2007-04-17 Thread python
Alright I'm a bit confused when looking at how range works. I'm reading lesson 4.3 in the python tutorial. http://docs.python.org/tut/node6.html I came across this: range(-10, -100, -30) [-10, -40, -70] How come it prints on -40 or -70. Does -70 come from -70 - -100? This is really

[Tutor] Python Browser based?

2007-04-17 Thread python
How can I used python online. I'm getting my hoster to install python and I'm wondering how Do I use python online? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] celcius to farenheit converter.

2007-04-17 Thread python
I found this site and I'm practicing coding and I write this script, but I'm unsure why its not working. Everything goes well until it gets to the part where it tries to calculate the formula. Inputs work fine anyone know what I did wrong? ### #Temperature

[Tutor] Some questions.

2007-04-12 Thread python
Hello my name is lamonte and I'm interesting in getting better @ python so I guess this is the correct place then :). One question is whats the best GUI library to build from? Anyone recommend any good tutorials that helped them get good @ learning python? I know some decent basics and soon

Re: [Tutor] Accessing class attributes: use methods only?

2007-02-19 Thread Python
is saying you should not generally be twiddling attributes in an object. Kent is suggesting that if you do decide to twiddle attributes in Python, just do it directly. If later on you decide you need some method logic to control the attribute twiddling, you can use property to invoke methods when

[Tutor] Help Please

2007-01-28 Thread Python Freak
Hi, This may be too elementary for most of you, but could you please help me with the following question? I would like to use comprehensive lists and lists of lists. Where do I start? Question: Consider a digraph with 10 vertices, labeled 1 through 10. You are given the following adjacency

[Tutor] Help Please

2007-01-28 Thread Python Freak
Hi, This may be too elementary for most of you, but could you please help me with the following question? I would like to use comprehensive lists and lists of lists. Where do I start? Question: Consider a digraph with 10 vertices, labeled 1 through 10. You are given the following adjacency

Re: [Tutor] Redirect from a CGI script

2007-01-20 Thread Python
:http://python.org/\r\n\r; I have a Win Xp pro machine with Python2.5. Paulino On Sat, 2007-01-20 at 02:10 +, Paulino wrote: Thank you Andre, well it doesn't work either! This works, #!/usr/bin/python print Location:http://python.org/\r\n\r

Re: [Tutor] Redirect from a CGI script

2007-01-20 Thread Python
On Sat, 2007-01-20 at 10:13 -0800, Danny Yoo wrote: On Sat, 20 Jan 2007, Paulino wrote: Still doesn't work. [some text cut] I tryed all the sugestions from Andre with no succes. The cgi script as only these two lines: 'print Content-type:text/html\r\n 'print Location:

Re: [Tutor] Set changing order of items?

2007-01-19 Thread Python
On Fri, 2007-01-19 at 20:05 +, Adam Cripps wrote: On 1/19/07, Simon Brunning [EMAIL PROTECTED] wrote: On 1/19/07, Adam Cripps [EMAIL PROTECTED] wrote: I'm adding strings to a Set to prevent duplicates. However, the strings are meant to be in the correct order. When I add the string to

Re: [Tutor] Perfect Python web stack?

2007-01-17 Thread Python
On Wed, 2007-01-17 at 16:46 +0200, OkaMthembo wrote: 1) MySQL vs PostGRES PostGRES is a more sophisticated SQL server. It should probably be the default choice. However, I'm primarily using MySQL. The reasons: easy administration - I think supporting dozens of remote

Re: [Tutor] How to convert a long decimal into a string?

2007-01-16 Thread Python
On Tue, 2007-01-16 at 12:28 -0800, Dick Moores wrote: So I go with working up an algorithm for first converting n to an int (for example, multiplying the above n by 1000), converting to a string, putting the decimal point back in between indices 2 and 3, then using that string as n (thereby

Re: [Tutor] Length of longest item in a list, using a list comp

2006-12-28 Thread Python
On Thu, 2006-12-28 at 11:27 -0800, Tony Cappellini wrote: I want to use a list comp to get the length of the longest string in a list, but can't quite get the syntax right. l1=['abc', 'abcde', 'abcfdtea'] longest=0 [x for x in l1 if len(x) longest] Use max to get the longest

Re: [Tutor] Ftp files

2006-12-19 Thread Python
On Tue, 2006-12-19 at 07:11 -0800, ray sa wrote: Hi I have just started to learn Python and think it is a superb language. I am faced with an issue that I would like some help with. I need to fetch files on a daliy basis from a unix machine. I would like to run a batch command for this. I

Re: [Tutor] help

2006-12-09 Thread Python
On Sat, 2006-12-09 at 20:19 +0500, Kamran Haider wrote: Hi I have got some python related queries. I am working on an MRes project which involves a bit of programing in python. Actually, I am using a python program developed by someone, which gives pairwise genetic distances between a set

Re: [Tutor] ***SPAM*** List to dictionary

2006-12-07 Thread Python
On Thu, 2006-12-07 at 08:22 -0700, Mike Hansen wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Luke Paireepinart Sent: Wednesday, December 06, 2006 10:54 PM To: tutor@python.org Subject: Re: [Tutor] ***SPAM*** List to dictionary

Re: [Tutor] Best Known Method for Filtering redundant list items.

2006-12-01 Thread Python
sense. How it is implemented does not really matter here. http://en.wikipedia.org/wiki/Set If you want a collection of ordered objects, you don't want a set. Not even if the current implementation of sets in Python did

Re: [Tutor] Best Known Method for Filtering redundant list items.

2006-11-30 Thread Python
On Thu, 2006-11-30 at 12:51 -0800, Chris Hengge wrote: Anyone point me to something more efficient then list2 = list(set(list1)) Older Pythons will force you to import sets and use sets.Set for item in list1: if item not in list2: list2.append() This just seems to take

Re: [Tutor] Best Known Method for Filtering redundant list items.

2006-11-30 Thread Python
Right after hitting send I realized I fail to preserver order. If preserving order is important, we're back to using more complex code. On Thu, 2006-11-30 at 16:01 -0500, Python wrote: On Thu, 2006-11-30 at 12:51 -0800, Chris Hengge wrote: Anyone point me to something more efficient

Re: [Tutor] Python Linux Distro Anyone

2006-11-29 Thread Python
On Tue, 2006-11-28 at 22:45 -0500, Amadeo Bellotti wrote: I was thinking it would be really nice if i could make a Pocket Linux distro that of course fits on one or two floppies (outdated I no but still are amazing) thats just the Linux kernel, bash, and python. with of course a lot of tiny

Re: [Tutor] What are the issues in running Python script on another machine (developed on Windows but will be using on Linux)

2006-11-27 Thread Python
On Sun, 2006-11-26 at 15:14 +, Asrarahmed Kadri wrote: Hi folks, I have a couple of programs that I want to test on a different machine.. I have developed these on Win-XP platform, but I want to test them on my college's machine, which is running Linux. Are there any

  1   2   3   >