> His lab maintains a significant amount of Perl code
this sounds like a full-time job on its own. everyone brings up a
good point... use the right tool for the job. if it's one-liners,
that's what perl -e is made for. for everything else that you
mentioned above, Python is the the one, prefera
Chris Lasher escribió:
> How about os.rename
>
> http://docs.python.org/lib/os-file-dir.html
>
> On 10/15/06, Alfonso <[EMAIL PROTECTED]> wrote:
>> Is there an alternative in python to use shutil.move()?
>
That's exactly what I was looking for. Thank you very much. Don't know
how I didn't find it
On Sun, Oct 15, 2006, Michael P. Reilly wrote:
>
> On 10/15/06, Bill Campbell <[EMAIL PROTECTED]> wrote:
>
> Is there a python equivalent of the perl readlink() function
> (e.g. one that returns the relative path in cases where a command
> such as ``ln -s ls /usr/local/bin/gls'' creat
Points well taken. In fact, the example he demonstrated to me as a
one-liner was a regular expression as a line filter in
Emacs--essentially just a grep. There's no Pythonic equivalent to
this. Right tool for the right job, as you said. He was half-joking
about not learning Python if it lacked the
I tried creating sessions for each appand then did htis codedef session_mw(app): sessionStore = DiskSessionStore(storeDir="%s/sessions/" % os.getcwd(), timeout=5) sessionStore= sessionStore.createSession() return SessionMiddleware(sessionStore, app) def initsession(session): session['id
The code in my last email that I stated worked, is doing exactly what I want (perhaps there is a better method, but this is working)The slash detection is for the subdirectories located inside of a zip file. The name list for a file located inside a zipped folder shows up as folder/file.ext in wind
[Chris Lasher]
> My professor and advisor has been "inspired" by me to give Python a
> try. He's an avid Perl user, and challenged me with the following:
>
> What is the Python equivalent to perl -e ''?
The initally attractive but unsatisfying answer is:
python -c ''
The reason it's "unsatis
Chris Hengge wrote:
> After getting some sleep and looking at my code, I think I was just to
> tired to work through that problem =P
>
> Here is my fully working and tested code..
> Thanks to you all for your assistance!
>
> if "/" in afile:
> aZipFile = afile.rsplit('/', 1)[-1] # Split file
Haha! I'll relay that message! Thanks Kent and Glenn!
Chris
On 10/15/06, Glenn T Norton <[EMAIL PROTECTED]> wrote:
> Chris Lasher wrote:
>
> >My professor and advisor has been "inspired" by me to give Python a
> >try. He's an avid Perl user, and challenged me with the following:
> >
> >What is th
On 10/15/06, Bill Campbell <[EMAIL PROTECTED]> wrote:
Is there a python equivalent of the perl readlink() function(e.g. one that returns the relative path in cases where a commandsuch as ``ln -s ls /usr/local/bin/gls'' created the link?Reading the documentation on the various
os.path functions, th
Chris Lasher wrote:
>My professor and advisor has been "inspired" by me to give Python a
>try. He's an avid Perl user, and challenged me with the following:
>
>What is the Python equivalent to perl -e ''?
>
>Embarassingly, I had no answer, but I figure, someone on the list will
>know. His use of P
Chris Lasher wrote:
> My professor and advisor has been "inspired" by me to give Python a
> try. He's an avid Perl user, and challenged me with the following:
>
> What is the Python equivalent to perl -e ''?
python -c
More details here:
http://linuxcommand.org/man_pages/python1.html
Kent
_
My professor and advisor has been "inspired" by me to give Python a
try. He's an avid Perl user, and challenged me with the following:
What is the Python equivalent to perl -e ''?
Embarassingly, I had no answer, but I figure, someone on the list will
know. His use of Python is at stake; he threat
After getting some sleep and looking at my code, I think I was just to tired to work through that problem =PHere is my fully working and tested code..Thanks to you all for your assistance!if "/" in afile:
aZipFile = afile.rsplit('/', 1)[-1] # Split file based on criteria. outfile = open(aZi
Is there an alternative in python to use shutil.move()?
It copies the files and then removes the source file insted of just
moving directly the file (don't know much about file systems, but I
suppose that when you move using the shell, if both source and
destination are in the same partition, i
Thank you for your answer, Jonathon.
I have found that the problem ocurs only with programs that make use of
glade files for the interface. With pure pygtk programs without using
glade files, making a launcher with a simple double click works
perfectly. But if the program builds his interface b
>> You can start it from a shell script
>> #!/bin/sh
>> ./MyWebServer.py 2>>/path/to/output.log
>>
"Paulino" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> well, I'm running this CGIserver on windows...
You can still use redirection although its not as powerful as unix.
Just try
well, I'm running this CGIserver on windows...
Glenn T Norton escreveu:
> Paulino wrote:
>
>> How can I redirect the output of an CGIHTTPServer from the console to
>> a logfile?
>> ___
>> Tutor maillist - Tutor@python.org
>> http://mail.python.org/mai
Paulino wrote:
>How can I redirect the output of an CGIHTTPServer from the console to a
>logfile?
>___
>Tutor maillist - Tutor@python.org
>http://mail.python.org/mailman/listinfo/tutor
>
>
>
You can start it from a shell script
#!/bin/sh
./MyWebServ
> How I can open Excel or OOCalc spreadsheet file 'remotely' from python
> programm? I mean how to execute Excel or Calc with appropriate
> spreadsheet file?
there was a similar question on the main newsgroup a few days ago,
slightly related to this post, but the answers will be helpful here.
ht
How can I redirect the output of an CGIHTTPServer from the console to a
logfile?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Thank you,
Yes I have other scripts working fine.
The OS is WXP and the server is the python's CGIHTTPserver (for an intranet use only)
-
Hi Paulino,
> This is a peace of a CGI script i have.
>
> 1 import cgi
> 2 form=cgi.FieldStorage()
> 3 try :
> 4 ano=form["ano"].value
> 5
Hi Paulino,
> This is a peace of a CGI script i have.
>
> 1 import cgi
> 2 form=cgi.FieldStorage()
> 3 try :
> 4 ano=form["ano"].value
> 5 conta=form["conta"].value
> 6 except KeyError :
> 7 print 'Please enter values in the
> fields '
> 8 sys.exit(0)
>
>
> When the excption occ
Very simple: os.startfile([file])
ex:
>>> import os
>>> os.startfile("d:\\documentos\\eleicoes2005-dn.xls")
It works with any file tipe in windows, the file is opened with it's associated application.
Basil Shubin wrote:
> Hi ,friends!
>
> How I can open Excel or OOCalc spreadsheet file
This is a peace of a CGI script i have.
1 import cgi
2 form=cgi.FieldStorage()
3 try :
4 ano=form["ano"].value
5 conta=form["conta"].value
6 except KeyError :
7 print 'Please enter values in the
fields '
8 sys.exit(0)
When the excption occurs, no message is shown on the browser.
Basil Shubin wrote:
> Hi ,friends!
>
> How I can open Excel or OOCalc spreadsheet file 'remotely' from python
> programm? I mean how to execute Excel or Calc with appropriate
> spreadsheet file?
You can use win32com to drive Excel using its COM interface. The sample
chapter from the O'Reilly b
Chris Hengge wrote:
> I was using afile.split("/"), but I'm not sure how to impliment it...
Did you see my hint below? Is there something you don't understand about it?
Kent
>
> if "/" in afile: (for some reason I can't add 'or "\" in afile' on this
> line)
> outfile = open(afil
Chris Hengge wrote:
> I must have not been clear.. I have a zip file with folders inside..
> When I extract it.. I dont want the folder structure, just the files..
>
> using split doesn't seem to help in this situation.. unless I'm not
> putting the results in the right spot..
Can you show us wh
Hi ,friends!
How I can open Excel or OOCalc spreadsheet file 'remotely' from python
programm? I mean how to execute Excel or Calc with appropriate
spreadsheet file?
Thanks in advance!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mai
Hi, friends!
Is there exist python extension or library for writing or exporting data
into the Excel and/or OO Calc file?
Excuse me for crossposting.
Thanks in advance!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/t
I must have not been clear.. I have a zip file with folders inside.. When I extract it.. I dont want the folder structure, just the files.. using split doesn't seem to help in this situation.. unless I'm not putting the results in the right spot..
Thanks again though. On 10/15/06, Luke Paireepinar
On 10/14/06, Chris Hengge <[EMAIL PROTECTED]> wrote:
Guess nobody has had a chance to point me in the write direction on this problem yet?Thats ok, I've gotten a ton of other code written, and I'll come back to this tricky part later.This particular project I've been working on to automate some of
32 matches
Mail list logo