[Tutor] installing Turbogears without using Internet

2007-05-14 Thread ShivKumar Anand
hello Tutors, I want solution to my problem. I want to install Turbogears and Cherrypy without using internet. means that locally is i have eggs. how it is possible? Shiv Kumar _ Palate Teasers: Straight from Master Chef! http://

Re: [Tutor] Generating simple HTML from within Python

2007-05-14 Thread Duncan Gibson
> I've been searching for a module to allow simple HTML generation, but > most of them appear to be more concerned with *parsing* HTML and XML. > The only one that looks promising from reviews dating back to 1998 or > so is HTMLgen, but the link on starship.python.net appears long dead. > > So my

Re: [Tutor] web spider

2007-05-14 Thread Sönmez Kartal
Hello, I'm working on a web spider project right now. And, I suggest you look at sgmllib and urllib modules of standard library, then you will realize some stuff in your mind. Happy coding... -- Sönmez Kartal ___ Tutor maillist - Tutor@python.org h

[Tutor] Adding a (Python) Command Button in Maya

2007-05-14 Thread Preecha Bundrikwong
Dear Tutor, I'm pretty new to Python. I want to add a command button in Maya. Once clicked, it runs Python's script/program. I'm not sure where I should write to ask Python or Maya; Not in details, please tell me briefly so that I can investigate more from there. Your suggestion would be highly

Re: [Tutor] Getting value from web page

2007-05-14 Thread Kent Johnson
Vladimir Strycek wrote: > Hi all, > > i have a page which when i download from web by python and put tu > variable have something like: > > > > 119/1157/43/40 > > > neer end ( actualy this is only thing on that page + ) > > What i need actualy is to get th

Re: [Tutor] installing Turbogears without using Internet

2007-05-14 Thread Kent Johnson
ShivKumar Anand wrote: > hello Tutors, > > I want solution to my problem. I want to install Turbogears and Cherrypy > without using internet. means that locally is i have eggs. how it is > possible? http://peak.telecommunity.com/DevCenter/EasyInstall#installing-on-un-networked-machines Kent _

[Tutor] ActivePython and CPython

2007-05-14 Thread OkaMthembo
Hi guys, What are the difference between ActiveState's Python distributions and the standard Python distribution from python.org, and which is better? Also, what IDE will give a user the ability to view HTML designs of a web application as well as the code view (like Dreamweaver does with PHP pag

Re: [Tutor] ActivePython and CPython

2007-05-14 Thread Senthil_OR
What are the difference between ActiveState's Python distributions and the standard Python distribution from python.org , and which is better? Answer: Python from python.org is Open Source Software developed under OSI compatible license. Bunch of Python Developers are w

Re: [Tutor] Adding a (Python) Command Button in Maya

2007-05-14 Thread Senthil_OR
From: Preecha Bundrikwong Sent: Monday, May 14, 2007 3:24 PM To: tutor@python.org Subject: [Tutor] Adding a (Python) Command Button in Maya I'm pretty new to Python. I want to add a command button in Maya. Once clicked, it runs Python's script/program. I'm not sure where I should write to ask P

Re: [Tutor] ActivePython and CPython

2007-05-14 Thread Alan Gauld
"OkaMthembo" <[EMAIL PROTECTED]> wrote > What are the difference between ActiveState's Python > distributions and the standard Python distribution from > python.org, and which is better? I prefer the ActiveState version for windows, I haven't tried their Luinux/Mac versions. Basically the Wind

Re: [Tutor] ActivePython and CPython

2007-05-14 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote > Answer: PyDev for Eclipse turns Eclipse into a pretty good IDE for > Python. Agreed, I downloaded pydev over the weekend and have been playing. The editor isn't exactly vim/emacs but its as good as IDLE/Pythonwin However I think the OP wants an HTML preview and I

Re: [Tutor] Web GUI for a network management tool

2007-05-14 Thread Thanos Panousis
I know jfreechart is java only. It looks quite capable but the colleagues here say its not the easiest tool to use. I was about to start with a JSP solution for my web interface. But a short tutorial convinced me that writing this thing in java/jsp is simply crazy My god, coming from everyday

Re: [Tutor] Web GUI for a network management tool

2007-05-14 Thread Kent Johnson
Thanos Panousis wrote: > I was about to start with a JSP solution for my web interface. But a > short tutorial convinced me that writing this thing in java/jsp is > simply crazy My god, coming from everyday python development it > just shocked me to see how much code these guys are actually > w

Re: [Tutor] Adding a (Python) Command Button in Maya

2007-05-14 Thread Michiel Duvekot
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > Sent: Monday, May 14, 2007 9:31 AM > To: [EMAIL PROTECTED]; tutor@python.org > Subject: Re: [Tutor] Adding a (Python) Command Button in Maya > > > From: Preecha Bundrikwong >

Re: [Tutor] Parsing text file

2007-05-14 Thread Dave Kuhlman
On Sun, May 13, 2007 at 03:04:36PM -0700, Alan wrote: > I'm looking for a more elegant way to parse sections of text files that > are bordered by BEGIN/END delimiting phrases, like this: > > some text > some more text > BEGIN_INTERESTING_BIT > someline1 > someline2 > someline3 > END_INTERESTING_B

[Tutor] How to test for a remainder from division

2007-05-14 Thread Matt Smith
Hi there, I'm trying to write a short function to test whether a year is a leap year or not. To do this I need to check whether the year divides exactly by 4, 100 and 400. I can't think of an easy way to test whether there is a remainder or not. The best I can come up with so far is: if (year / 4

Re: [Tutor] How to test for a remainder from division

2007-05-14 Thread Luke Paireepinart
Matt Smith wrote: > Hi there, > > I'm trying to write a short function to test whether a year is a leap > year or not. To do this I need to check whether the year divides exactly > by 4, 100 and 400. I can't think of an easy way to test whether there is > a remainder or not. The best I can come up

Re: [Tutor] How to test for a remainder from division

2007-05-14 Thread Eric Walstad
Hey Matt, Skirting your question that looks like a modulo issue[1]... Maybe isleapyear[2] will work for you: import calendar calendar.isleap(2007) -> False calendar.isleap(2008) -> True I hope that helps, Eric. [1] http://docs.python.org/ref/binary.html [2] http://docs.python.org/lib/modul

Re: [Tutor] easiest way to get true/false of odd/even number

2007-05-14 Thread shawn bright
nevermind, i found it. 4 %2 = 0 (even) 5 %2 = 1 (odd) pretty simple shawn On 5/14/07, shawn bright <[EMAIL PROTECTED]> wrote: Hey there all, i know this sounds kinda easy, but i was wanting the least verbose way to get a True / False of a number being odd (not even) thanks shawn __

Re: [Tutor] How to test for a remainder from division

2007-05-14 Thread Bill Campbell
On Mon, May 14, 2007, Luke Paireepinart wrote: >Matt Smith wrote: >> Hi there, >> >> I'm trying to write a short function to test whether a year is a leap >> year or not. To do this I need to check whether the year divides exactly >> by 4, 100 and 400. I can't think of an easy way to test whether t

Re: [Tutor] How to test for a remainder from division

2007-05-14 Thread Arthur Coleman
Hi, I believe it should be if !(year % 4) or !(year % 100) or !(year % 400) Since 4*n % 4 = 0 for n integer Arthur -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Luke Paireepinart Sent: Monday, May 14, 2007 2:32 PM To: Matt Smith Cc: Python Tutor Subje

Re: [Tutor] How to test for a remainder from division

2007-05-14 Thread John Fouhy
On 15/05/07, Arthur Coleman <[EMAIL PROTECTED]> wrote: > Hi, > > I believe it should be if !(year % 4) or !(year % 100) or !(year % 400) FWIW, the correct leapyear test is: if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0): # then year is a leap year Year 2100 will not be a leap ye

Re: [Tutor] How to test for a remainder from division

2007-05-14 Thread Bob Gailer
Luke Paireepinart wrote: > Matt Smith wrote: > >> Hi there, >> >> I'm trying to write a short function to test whether a year is a leap >> year or not. To do this I need to check whether the year divides exactly >> by 4, 100 and 400. I can't think of an easy way to test whether there is >> a rem

Re: [Tutor] version and path

2007-05-14 Thread linda.s
how to check how many versions of Python i have in my mac machine? also, how to put the path to the version I desire? Thanks a lot! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to test for a remainder from division

2007-05-14 Thread Alan Gauld
"Bob Gailer" <[EMAIL PROTECTED]> wrote >> Matt: I'm not sure about your pseudocode, but have you tried to >> accomplish this with the modulus operator? >> It provides the remainder of integer division > No, it provides the modulus, and applies to float not just integer!. While modulus is techni

[Tutor] easiest way to get true/false of odd/even number

2007-05-14 Thread shawn bright
Hey there all, i know this sounds kinda easy, but i was wanting the least verbose way to get a True / False of a number being odd (not even) thanks shawn ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] ctypes typedef

2007-05-14 Thread Adam Pridgen
Hey everyone, I am messing around with the ctypes package, and I wasn wondering how I go about defining a new type, where I essentially call an int foo. For example in C, I would use the following statement: typedef int foo; Is there an equivalent statement using ctypes, or is there another way

[Tutor] Web

2007-05-14 Thread Jeff Molinari
How exacly can you use python to create a web site? I have a small program I'm working on that I would like to create available via internet but I dont know how to make python work through internet. - Be a better Globetrotter. Get better travel answers from

Re: [Tutor] How to test for a remainder from division

2007-05-14 Thread Kent Johnson
Eric Walstad wrote: > Hey Matt, > > Skirting your question that looks like a modulo issue[1]... > > Maybe isleapyear[2] will work for you: > > import calendar > > calendar.isleap(2007) -> False > calendar.isleap(2008) -> True And one of the nice things about Python, as well as having lots of

Re: [Tutor] version and path

2007-05-14 Thread Tom Tucker
I would use the traditional Unix find command to find the various versions installed. find / -name "python*" On 5/14/07, linda.s <[EMAIL PROTECTED]> wrote: > how to check how many versions of Python i have in my mac machine? > also, how to put the path to the version I desire? > Thanks a lot! >

Re: [Tutor] Web

2007-05-14 Thread Tom Tucker
Jeff, Can you clarify what you are looking to do. You have a small program that you want to distribute via Internet (allow users to view, download, etc)? You want to use Python to create a website? Integrate your program into a web page (modpython for example). On 5/14/07, Jeff Molinari <[EMAIL

Re: [Tutor] version and path

2007-05-14 Thread linda.s
On 5/14/07, Tom Tucker <[EMAIL PROTECTED]> wrote: > I would use the traditional Unix find command to find the various > versions installed. > > find / -name "python*" > > > > On 5/14/07, linda.s <[EMAIL PROTECTED]> wrote: > > how to check how many versions of Python i have in my mac machine? > > al

Re: [Tutor] version and path

2007-05-14 Thread Tom Tucker
If you let the command finish, you should have seen the following or something equivalent below. Running the find command I sent you works, however you will see some noise (Permission Denied message). These are common messages because your general user account is trying to access restricted parts

[Tutor] html links

2007-05-14 Thread max .
does anyone know of a tutorial for finding links in a web site with python. or creating files and asking ware to create a file. thanks ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] html links

2007-05-14 Thread Luke Paireepinart
max . wrote: > does anyone know of a tutorial for finding links in a web site with > python. I believe BeautifulSoup could help with this, but am uncertain. > > or creating files and asking ware to create a file. There are many ways to do this. The simplest would be: filepath = raw_input("Where wo

Re: [Tutor] How to test for a remainder from division

2007-05-14 Thread Matt Smith
Hi, Thanks for all the help, I guessed that there would be a module out there providing a function to do this but wanted to go through the process as a learning exercise. The modulus operator was just what I was looking for, I had been trying to check for a difference between the division and the

Re: [Tutor] html links

2007-05-14 Thread Sönmez Kartal
Hi, import urllib from BeautifulSoup import BeautifulSoup page = urllib.urlopen(url) # url is the page address, if you are reading a file in your hard drive you could use just open(filename) too, and no needing to urllib soup = BeautifulSoup(page) #links = [str(link) for link in soup.findAll('