By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,854 Members | 876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,854 IT Pros & Developers. It's quick & easy.

journal stuff

P: n/a

;; Fedora! Slask! .emacs!

;;; uncomment this line to disable loading of "default.el" at startup
;; (setq inhibit-default-init t)

;; turn on font-lock mode
(global-font-lock-mode t)

;; this command makes Emacs set the key "f5" to copy any text that is highlighted
(global-set-key [f5] "\M-w")

;; this command makes the "f6" key paste your copied text
(global-set-key [f6] "\C-y")

;; enable visual feedback on selections
(setq transient-mark-mode t)

(defun linux-c-mode ()
"C mode with adjusted defaults for use with the Linux kernel."
(interactive)
(c-mode)
(setq c-indent-level 8)
(setq c-brace-imaginary-offset 0)
(setq c-brace-offset -8)
(setq c-argdecl-indent 8)
(setq c-label-offset -8)
(setq c-continued-statement-offset 8)
(setq indent-tabs-mode nil)
(setq tab-width 8))

(setq auto-mode-alist (cons '("/home22/j/c/foster.*/.*\\.[ch]$" . linux-c-mode)
auto-mode-alist))

;; this sets syntax highlighting so that html, C and various other programming
;; languages and style appear colored - this allows for easier understanding of
;; text inside the Emacs buffer.
(global-font-lock-mode t)

;; Please do not make backup files
(setq make-backup-files nil)

;; Turn off auto-saving
(setq auto-save-default nil)

;; this sets line numbers
(setq line-number-mode t)

;; this sets the background to grey
(set-background-color "grey40")

;; this sets the foreground color or the text itself.
(set-foreground-color "black")

;; this sets the cursor color
(set-cursor-color "DarkOrange2")

(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
)
(custom-set-faces
;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(mode-line ((((type x w32 mac) (class color)) (:background "grey75" :foreground "black" :box (:line-width -1 :color "gray2" :style pressed-button)))))
'(region ((((class color) (background dark)) (:background "DarkOrange2"))))
'(scroll-bar ((t (:background "grey75" :foreground "CadetBlue4" :box (:line-width 2 :color "AliceBlue" :style released-button))))))

#!/usr/bin/python
"""form.py - a python cgi script with forms"""

# import various functionality
import os
import sys
import cgi

# debugging
import cgitb; cgitb.enable()

# uncomment for more debugging
# cgi.test()

# The all-important header
print "Content-type: text/html\n\n"
print ""

print "<header><title>form.py</title></header>"
print """<link rel=stylesheet type="text/css" href="../css/form.css">"""

print '''<h1>Journals at Archemix.</h1> Simply select the journals you want to be included in your inbox from the pull-down menu. If you want to pick more than one journal simply hold down the control key when you select. This woll generate a message so that you can see that you have selected every thing you want to receive. This can be changed at anytime so feel free to adjust your list whenever you want to.
<hr>

<form method=POST action="form.py">
<p>Please enter your first name and last initial;
<p><input name="name" type="text" value="">
&nbsp <p> &nbsp
<p><select multiple name="Example">
<option selected label="none" value="none">No Magazine</option>
<optgroup label="Elsevier">
<option value="science">Science</option>
<option value="prosci">Protein Science</option>
<option value="cell">CELL</option>
</optgroup>
<optgroup label="Molecules">
<option label="4" value="MolecularCell">Molecular Cell</option>
</optgroup>
</select>

<form method=POST action="form.py">
<input type=submit value="Submit"> &nbsp <input type=reset value="Reset"></form>'''

# The fields and their values
form = cgi.FieldStorage()
field = form.getlist("Example")

print "<p><font size=+2>Your name:", form["name"].value
print "</font>"

for mag in field:
print "<br>You are on the list for:", mag

# write them to a file
file = open("file_cgi.txt", "a")
file.write("<p>name - " + form["name"].value)

for name in field:
file.write("<br><font color='orange'>")
file.writelines(name)
file.write("</font>")
file.close()

## InputFile = open("file_cgi.txt", "r")
## Input = InputFile.read()
## InputFile.close()
## print "<div class='InputFile'>", Input
## print "</div>"


Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.