argparse and filetypes

2011-03-22 Thread Bradley Hintze
Hi, I just started with argparse. I want to simply check the extension of the file that the user passes to the program. I get a ''file' object has no attribute 'rfind'' error when I use os.path.splitext(args.infile). Here is my code. import argparse, sys, os des = 'Get restraint definitions fro

Functions continuing to ru after returning something?

2010-08-30 Thread Bradley Hintze
I may be having a brain fart, but is it at all possible to have a function first return a value then continue its calculation. Like this simple example: my_var = 5 def my_function(): return my_var my_var +=1 This obviously won't work as written but is there a cleaver way around this. --

Floating numbers

2010-08-12 Thread Bradley Hintze
Hi all. Is there a way I can keep my floating point number as I typed it? For example, I want 34.52 to be 34.52 and NOT 34.520002. -- Bradley J. Hintze Graduate Student Duke University School of Medicine 801-712-8799 -- http://mail.python.org/mailman/listinfo/python-list

passing file from command line startup

2010-08-11 Thread Bradley Hintze
Hi all, Is there a way that I can startup my script and pass it a file? For example: ~$ python myscript.py mytext.txt and then access mytext.txt in myscript.py? As a long shot, for myscript.py I tried def __init__(fle): print fle expecting the full path to mytext.txt to be printed but tha

Re: Hello

2010-07-09 Thread Bradley Hintze
There are lots of great editors out there. It really depends on personal preference. It also depends on your OS. I us Mac OSX and like jEdit (my lab mate likes bbEdit). When I was on windows I liked notepad2. On linux i really like gEdit. Any of these will work great for a beginner! Bradley On F

Re: mod_python and css

2010-06-24 Thread Bradley Hintze
I had some issues with WSGI install. It was duious at best as it failed and seemed very unstable. Is this a trusted application? On Thu, Jun 24, 2010 at 3:19 PM, Thomas Jollans wrote: > On 06/24/2010 09:10 PM, Bradley Hintze wrote: >> Hi all, > > about your question, no id

mod_python and css

2010-06-24 Thread Bradley Hintze
Hi all, the mod_python mailing list is pretty dead so I thought I'd try asking my question here. I am using mod_python and am having trouble with my .py scripts that output HTML. the HTML comes out alright but my style sheets are not being rendered. I am sure that this has to do withe a mod handl

Re: Processing HTML form

2010-06-17 Thread Bradley Hintze
On 2010-06-17, Bradley Hintze wrote: > >> I apologize in advance for my lack of knowledge, I really do not know. >> I would guess server but I quite honestly I am not clear what an 'HTTP >> client' or 'HTTP server' refers to. I am running a webpage and

Re: Processing HTML form

2010-06-17 Thread Bradley Hintze
written in Python. I want to make the program available on the web where I receive user input from HTML forms. The user input will then be used as parameters for the program. I hope this clear things up. Thanks, Bradley On Thu, Jun 17, 2010 at 3:46 PM, Grant Edwards wrote: > On 2010-06-17

Processing HTML form

2010-06-17 Thread Bradley Hintze
Hi, I am a newbie to anything web related, I know a bit of HTML though. I've been programing in python for a year or so so I know the language at an intermediate level. I am wondering if its possible to get info from an HTML form and pass it to my python code and return a page based on the code