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'' created the link?
Reading the documentation on the various os.path functions, the
only thing I see returns the fully resolved path
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
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
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
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
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 what
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(afile, 'w') #
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 book
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 'htmlbrbrbodypPlease enter values in the
fields/p/body/html '
8 sys.exit(0)
When the excption occurs, no message is
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
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 'htmlbrbrbodypPlease enter values in the
fields/p/body/html '
8 sys.exit(0)
When the
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
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.
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
./MyWebServer.py
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
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
C:\PATH
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
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,
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(aZipFile,
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 'some oneliner'?
Embarassingly, I had no answer, but I figure, someone on the list will
know. His use of Python is at
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 'some oneliner'?
python -c
More details here:
http://linuxcommand.org/man_pages/python1.html
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 'some oneliner'?
Embarassingly, I had no answer, but I figure, someone on the list will
know. His use
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,
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 the Python
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 based on
[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 'some oneliner'?
The initally attractive but unsatisfying answer is:
python -c 'some oneliner'
The
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
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'] =
0
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
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'' created the
30 matches
Mail list logo