Re: collaborative editing
Michele Simionato wrote: > Suppose I want to write a book with many authors via the Web. The book has > a hierarchical structure with chapter, sections, subsections, subsubsections, > etc. At each moment it must be possible to print the current version of the > book in PDF format. There must be automatic generation of the table of contents, > indices, etc. Conversions to many formats (Latex, DocBook, etc.) would be > welcome. Does something like that already exists? Alternatively, I would need > some hierarchical Wiki with the ability of printing its contents in an > structured way. > > > Michele Simionato Tkae a look at http://www.infrae.org/products/silva/ Regards, Mikhail -- http://mail.python.org/mailman/listinfo/python-list
Re: After the Deletion of Google Answers, . U Got Questions Fills the Gap Answering and Asking the Tough Questions
On 7 May 2007 10:45:51 -0700, [EMAIL PROTECTED] wrote: >My friend asked some tough questions >http://ugotquestions.blogspot.com/2007_05_01_archive.html >unlike yahoo answers ( Which Generates Content with Answers ) U got >questions picks only the best, Real Person Questions.,yeah so there is >this second book called E.T. and the BOOK OF THE GREEN PLANET... yeah, >what happens in it... i heard he dies, and what happend to elliot >this has been bugging me for years...so someone please tell >mehttp://ugotquestions.blogspot.com/2007_04_01_archive.html - i start >my car and shut it off 4 to 5 times it starts fine but when i continue >repeat this procedure for another 2 to 3 times then it dies. it doesnt >start at all. the headlights and all other lights dont go dim so might >not be the battery. then i have to wait for 3 to 5 minutes for it to >start again. it does crank slowly sometime then start. the alternator >was replaced 2 years ago so was the battery. the car has 129000miles >its 01 maxima. automatic. as far as i think it could be the >starter...http://ugotquestions.blogspot.com/2007/05/y-alert-yahoo- >answers_7473.html 1- if you ask anyone in the town that: Are you a >wise human? and he says yes, what you can say about him? 2- tree >mathematicians are talking about their trip to this town: 1st man >says: in my trip to the town, I ask John (a people of the town) are >you a wise human? and with his reply, I could not rcognize what is he. >2nd man says: I also ask John are you a loony human? and with his >reply, I could not recognize what is he too. 3rd man says: I also ask >John are you a wise devil? and with his...http:// >ugotquestions.blogspot.com/2007/05/y-alert-yahoo-answers_7075.html >Which major should I choose before law school if I want to practice >criminal and civil law and I also want in the future be a judge.The >majors that I like are criminal justice,politcal science and >finance.But I don't know which should I choose.I already know the >speech that law schools don't care about your mayor but I want to know >which one of those three could help me more in my goals fo practice >criminal and civil law and be a judge.Thanks a lothttp:// >ugotquestions.blogspot.com/2007/05/y-alert-yahoo-answers_6058.html >Everyday I wake up to my mom yelling about something I did. All she >does is come home from work sit on the couch and watch a movie she >gets from blockbuster everyday while we are suppose to be doing >chores. She dosnt let us watch her movies becuase she pays for them,. >we dont have cable and we havnt gone grocery shopping in two months >becuase she says we dont hav the money.( while she gets take out >everyday at work and a blockbuster movie everyday to. )She told me i >cant wash my clothes for... shaw loves this. Kill the DVD player -- http://mail.python.org/mailman/listinfo/python-list
Re: OMG BRITNEYS AT IT AGAIN AGAIN!!!!!! You stupid fucks! Can't you figger out why we white boys ain't fucking these white trash bitches?
On 11 May 2007 14:57:21 -0700, [EMAIL PROTECTED] wrote: >http://britneyboobs.blogspot.com/2007/05/britney-spears-slips-up-again-exposes.html >- Exclusive pics of Britney Spears.. Stoopid dog fuckers!We crackers went to school with these bitches for at least 6 grades and decided they are so ignorant that they do not need to reproduce because of their offsprings damage to the social order of the working class. Now here you come and think you have found hidden "gold" and give these dumbass whores your shit and they get preg and spew out a dozen kids like a bitch dog. Leave them bitches alone you dumbass!Take a hint..don't breed the trash hoes dude! Get it now? -- http://mail.python.org/mailman/listinfo/python-list
Re: pySQLite Insert speed
> > Hence (if I understand python convention), this can be > > solved by adding > > sqlx= copy.copy(sqlx) > > before the looping. And in tests adding this step saved about 5-10% in > > time. > > Now this I don;t really understand at all. What's the point of trying to > replace sqlx with a copy of itself? Perhaps if you explained what you > hope this will achieve I could comment more intelligently. > I am/was attempting to convert sqlx= 'INSERT INTO %s VALUES ( %s ) ' % (dtable,ph) to code that did to need to be re-evaluated. i.e. to insert the dtable and ph values as if they were hard coded. copy.copy --> A shallow copy constructs a new compound object and then (to the extent possible) inserts references into it to the objects found in the original. -- http://mail.python.org/mailman/listinfo/python-list
Re: pySQLite Insert speed
Steve, I think you were right the first time is saying > it should really be this: > sqlxb= 'INSERT INTO DTABLE2 VALUES (?, ?, ?, ?)' my copy.copy() has the equivalent effect. Running this test code produces the output below import copy print 'Test 1' pf= '?,?,?,?' sqlx1= 'INSERT INTO DTABLE2 VALUES ( %s ) ' % pf print sqlx1 print print 'Test 2' sqlx2= copy.copy(sqlx1) sqlx3= sqlx1 pf= '?,?,?, ' sqlx1= 'INSERT INTO DTABLE2 VALUES ( %s ) ' % pf print 'sqlx1= ', sqlx1 print 'sqlx2= ', sqlx2 print 'sqlx3= ', sqlx2 == output Test group 1 INSERT INTO DTABLE2 VALUES ( ?,?,?,? ) Test group 2 sqlx1= INSERT INTO DTABLE2 VALUES ( ?,?,?, ) sqlx2= INSERT INTO DTABLE2 VALUES ( ?,?,?,? ) sqlx3= INSERT INTO DTABLE2 VALUES ( ?,?,?,? ) I interpret this to mean that sqlx1 is not a simple string -- http://mail.python.org/mailman/listinfo/python-list
Re: pySQLite Insert speed
Oops I did make a mistake. The code I wanted to test should have been import copy print 'Test 1' pf= '?,?,?,?' sqlx1= 'INSERT INTO DTABLE2 VALUES ( %s ) ' % pf print sqlx1 print print 'Test 2' sqlx2= copy.copy(sqlx1) sqlx3= sqlx1 pf= '?,?,?, ' print 'sqlx1= ', sqlx1 print 'sqlx2= ', sqlx2 print 'sqlx3= ', sqlx2 and the results would == output Test group 1 INSERT INTO DTABLE2 VALUES ( ?,?,?,? ) Test group 2 sqlx1= INSERT INTO DTABLE2 VALUES ( ?,?,?,? ) sqlx2= INSERT INTO DTABLE2 VALUES ( ?,?,?,? ) sqlx3= INSERT INTO DTABLE2 VALUES ( ?,?,?,? ) Such that sqlx1 does to change with the re-assignment of 'pf' And of course immutables such as strings are immutable. Got it now. -- http://mail.python.org/mailman/listinfo/python-list
undo a dictionary
I found code to undo a dictionary association. def undict(dd, name_space=globals()): for key, value in dd.items(): exec "%s = %s" % (key, repr(value)) in name_space So if i run >>> dx= { 'a':1, 'b': 'B'} >>> undict(dx) I get >>> print A, B 1 B Here, a=1 and b='B' This works well enough for simple tasks and I understand the role of globals() as the default names space, but creating local variables is a problem. Also having no output arguemtns to undict() seems counterintuitive. Also, the function fails if the key has spaces or operand characters (-,$,/,%). Finally I know I will have cases where not clearing (del(a,b)) each key-value pair might create problems in a loop. So I wonder if anyone has more elegant code to do the task that is basically the opposite of creating a dictionary from a set of globally assigned variables. And for that matter a way to create a dictionary from a set of variables (local or global). Note I am not simply doing and undoing dict(zip(keys,values)) -- http://mail.python.org/mailman/listinfo/python-list
Re: undo a dictionary
> > And for that matter a way to create a > > dictionary from a set of variables (local or global). > > You have to be more specific: there are {} displays and dict(args) call > and other methods. Read the manual. My desire is to take a set of data items in an alpha-numeric range and oput them into a dictionary i.e., x1=1 x2=20 x3=33 to yield the dictionary { 'x1':1, 'x2':20, 'x3':33 } without having to type in as above but instead invoke a function maybe with syntax of dd=make_dict('x1--x99') -- http://mail.python.org/mailman/listinfo/python-list
Re: undo a dictionary
Gabriel, I meant the latter, so this helps > Or, do you mean you already have those names and values, perhaps mixed > with a lot more names, and want to extract only those starting with "x" > and following with a number? > > result = {} > for name, value in vars(): # or locals().items(), or globals().items(), or > vars(some_module) > if name[0]=='x' and name[1:].isdigit(): > result[name] = value But I got an error with 'for name, value in vars():' RuntimeError: dictionary changed size during iteration I think globals() has the same problem, but globals.items() works. I will need to read the docs to learn why '.items()' works but the changing global dictionary problem makes sense. I assume I need to use a non dynamic created list. Sometimes I get the error about 'too many variables to unpack' (can not consistently repeat the error however) In any event, thanks for the suggestions, everyone. Using a blank class for unpacking the dictionary makes the most sense, for safety sake. So you know the general issue is I want to switch between using dictionaries for storing data items and simple variable names for writing equations/formulas, So (a) and (b) below are preferred to (c) for readability (a) straight forward equation y = b0 + b1*Age + b2*Size (b) Class version y = b0 + b1*x.Age + b2*x.Size (c) Dictionary version y = b0 + b1*dd.get('Age') + b2*dd.get('Size') -- http://mail.python.org/mailman/listinfo/python-list
SMTP via GMAIL
After reading about and using the smtplib module, I thought code such as below would ignore the 'Cc: ' body line below when sending messages and instead simply use the RECEIVERS list session = smtplib.SMTP(SMTPserver,port) session.set_debuglevel(1) session.ehlo(SMTPuser) # say hello session.starttls() # TLS needed session.ehlo(SMTPuser) # say hello again session.login(SMTPuser, pw) FROM=SENDER RECEIVERS= (TO,CC) BODY= MakeBody(FROM,TO,CC,SUBJECT,MESSAGE) SMTPresult = session.sendmail(SENDER, RECEIVERS, BODY) Here the MakeBody() creates text like below From: FROM To: TO Cc: CC Subject: SUBJECT MESSAGE But when using smtp.gmail.com as the server I learned that any @gmail.com address in the Cc: text block would receive mail even if I changed the code to have the RECEIVERS list to ignore the CC addresses or not include the gmail address in the CC list as below RECEIVERS= (TO,) BODY= MakeBody(FROM,TO,CC,subject,message) SMTPresult = session.sendmail(SENDER, RECEIVERS, BODY) Other @zzz.com CC addresses need to be in the RECEIVERS list however. Also the gmail server changes the 'From: ' text to be the same as SENDER even if this is modified (a case not using FROM=SENDER. I found other servers send mail that displays the BODY specified From: address. Is this gmail specific or a quirk of the smtplib functions? I understand how Google might not want to send mail with FROM not = SENDER, but the CC behavior baffles me. And does anyone have a general routine that lets one also have Bcc: addresses usign SMTP? -- http://mail.python.org/mailman/listinfo/python-list
Re: SMTP via GMAIL
On Aug 5, 12:18 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > >But when using smtp.gmail.com as the server I learned that any > >@gmail.com address in the Cc: text block would > >receive mail even if I changed the code to have the RECEIVERS list to > >ignore the CC addresses or not include the gmail address in the CC > >list as below > > Interesting. If true, that is incorrect behavior. I ran some more tests and now I am pretty sure session.sendmail(SENDER, RECEIVERS, BODY) is only sending to the RECEIVERS list, ignoring the Cc: field in the body (as it should) What fooled me is that I was using my own gmail account (i.e., [EMAIL PROTECTED]) as a Cc: field and not putting it in the RECEIVERS list. It seems Gmail creates two links (or copies?) to the message: (1) as it is stored in the SENT box (as it should since the message was sent by my gmail account) and (2) another in my INBOX because the mail reading software reads the Cc: field. Other smtp servers such as comcast do not create the stored SENT mail and hence behave different in terms of how they treat Cc: fields of the same account ([EMAIL PROTECTED] in this case). Most important, using another gmail account (not [EMAIL PROTECTED]) as a Cc: field does not create another sent message (outside of what is in the RECEIVERS field). Sorry for confusion, and I do appreciate the tips as I now see how almost anything To:, Cc:, Bcc: combination can be handled by a proper RECEIVERS list. Below is python code that can be used by anyone that wants to test what I did (just fill in the SMTPuser and password variables) and then check you gmail inbox import sys, os, glob, datetime, time import smtplib ## Parameters for SMTP session port=587 SMTPserver= 'smtp.gmail.com' SMTPuser= '[EMAIL PROTECTED]' pw= 'fill in here' SENDER= SMTPuser ## Message details FROM= SENDER TO= '[EMAIL PROTECTED]' CC=FROM ##RECEIVERS= (TO, CC) ##proper way to send to both TO and CC RECEIVERS= (TO,) ## ignore the CC address subject= 'Test 1a' message='*** Email test *** ' print 'Starting SMTP mail session on %s as %s ' % (SMTPserver,SMTPuser) session = smtplib.SMTP(SMTPserver,port) session.set_debuglevel(0) # set debug level to 1 to see details session.ehlo(SMTPuser) # say hello session.starttls() # TLS needed session.ehlo(SMTPuser) # say hello again, not sure why session.login(SMTPuser, pw) ##Create HEADER + MESSAGE HEADER= 'From: %s\r\n' % FROM HEADER= HEADER + 'To: %s\r\n' % TO HEADER= HEADER + 'Cc: %s\r\n' % CC HEADER= HEADER + 'Subject: %s\r\n' % subject BODY= HEADER + '\r\n' + message print BODY SMTPresult = session.sendmail(SENDER, RECEIVERS, BODY) ## send email session.close() -- http://mail.python.org/mailman/listinfo/python-list
Creating arithmetic sequences
I wrote the code below to create simple arithmetic sequences that are iter-able I.e., this would basically combine the NUMPY arange(start,end,step) to range(start,end), with step not necessarily an integer. The code below is in its simplest form and I want to generalize the sequence types (multiplicative, cumulative, gauss ...), but first I need the simple SEQA( ) function to be more robust. The problem is the three test code functions produces different results based on step. I understand why steps such as 0.1 have rounding and machine math issues, and before I try to solve this I thought it was worth asking if this problem has been solved (so I do not re-invent the wheel). Another way to put my question, is there a PYTHON function that emulates SEQA() in APTECH’s GAUSS language and produces iterable lists ? Note I originally wrote the three versions below see which is fastest, but each is fast enough such that I care more about robustness now. ## Python arithmetic sequence implimentation ## MDB April 16 2008 from numpy import array, arange, floor import time # simple arithmetic sequence def seqa1(start,end,step=1): n= floor( (end-start) / float(step) ) x= [start,] for i in xrange(0,n): x.append(x[-1]+step) return x ##faster seq creation def seqa2(start,end,step=1): n= floor( (end-start) / float(step) ) x= [ start+i*step for i in xrange(0,n) ] return x ##fastest seq creation as array, also allow array --> different type def seqa3(start,end,step=1.0,type=array): x=arange(start,end,step) if type==array: pass elif type==list or type==None or type=='' : x=list(x) elif type==tuple: x=tuple(x) elif type==dict: x= dict(zip(range(1,len(x)),tuple(x))) elif type==set: x= set(x) return x if (1): start=1 end=2 step= 0.10 t0=time.time() x1=seqa1(start,end,step) print 'SEQA1 Time= ', time.time()-t0 t0=time.time() x2=seqa2(start,end+step,step) print 'SEQA2 Time= ', time.time()-t0 print 'Check for X1,X2 equivalence-- ', (x1==x2) t0=time.time() x3=seqa3(start,end+step,step,list) print 'SEQA3 Time= ', time.time()-t0 print 'Check for X2,X3 equivalence-- ', (x2==x3) -- http://mail.python.org/mailman/listinfo/python-list
DTD validation and xmlproc
I found Python code to validate a XML document basd on DTD file layout. The code uses the 'xmlproc' package and these module loading steps from xml.parsers.xmlproc import xmlproc from xml.parsers.xmlproc import xmlval from xml.parsers.xmlproc import xmldtd Unfortunately, the xml package no longer seems to hold the xmlproc module. As a standalone the xmlproc module seems to be no longer maintained and was subsumed in PyXML a few years ago and that package is no longer maintained (as best I can tell, or maybe was subsumed in the base Python 2.x packages) My problem is I can not get the old xmlproc package files that i did find to work with Python 2.5. I am willing to learn and use new xml procedures, but I found nothng pre-written to validate agaisnt a given DTD file. Any advice would be welcome, even a good tutorial on XML validation usiog Python. -- http://mail.python.org/mailman/listinfo/python-list
Re: DTD validation and xmlproc
> Regarding ... try lxml. > http://codespeak.net/lxmlhttp://codespeak.net/lxml/tutorial.htmlhttp://codespeak.net/lxml/validation.html > Thx Stefan, it seems that lxml does everything I need. I have not figured out all of the bells and whistles but the tutorials are getting me up to speed. Based 2 days of trial, I can recommend lxml without reservation. -- http://mail.python.org/mailman/listinfo/python-list
Python IDEs with F5 or hotkey shell interaction
I am looking for advice on Python Editors and IDEs I have read other posts and threads on the subject and my two questions at this time are mainly about the IDLE-like F5-run facilities. While I am fairly happy using IDLE, the debugger is unintuitive to me and I wanted a project manager and a better variable/ class browser and also the potential to edit/run other languages such as R and Tex/Latex. Windows and LINUX compatibility is desired too. I found numerous editor candidates from reading posts to this Python users group list and also documents such as http://wiki.python.org/moin/PythonEditors but few if any alternatives seem to have all of the ‘interactive’ power of IDLE—- not only a run program in a python shell hotkey but a persistent, after-a-run memory state can be accessed for interactive coding and exploration-- i.e. how IDLE works ! *** My first questions is what other editor/IDE have IDLE-like interactive features. Or to put it another way, is my appraisal below of the editors & IDEs I tried right (note some where looked at as much as a year ago). Python specific IDLEF5 run & Full shell interaction PythonWin F5 run & Full shell interaction, MS Windows only PyScripter F9 run & shell interaction, but script created variables are not persistent (???!) PyPEF5 run, but not an interactive shell DrPythonF5 run, but not an interactive shell in MS Windows (maybe in Linux) SPE (Stani) Could not get it to run in MS Windows (???!) PyScripter, PyPe and drPython all had nice features but interaction quirks. My second question is based on a belief that I should move to a more general IDE or editor to get LINUX compatibility and the ability to also edit R and LaTex programs. I have explored these Vim Cream/Vim UliPad SciTe Jext Editra Komodo Editor But none are close to being as interactive friendly as IDLE. I might look at Eclypse with pydev Jedit And these commercial/professional IDEs Wing Komodo IDE Zeus But before doing so I wanted to know form experienced users: ** How hard is it to configure any of the general editors/IDEs to run a Python shell using a hotkey (such as IDLEs F5) and whether any can be set up for full interactivity. I understand and appreciate the difficulties to get full IDLE-like interactivity, but what comes closest? -- http://mail.python.org/mailman/listinfo/python-list