Please refer this paste: http://bpaste.net/show/vsTXLEjwTLrWjjnfmmKn/
and suggest me the possible solutions.
Regards,
Ajin Abraham
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
Ajin Abraham wrote:
Please refer this paste: http://bpaste.net/show/vsTXLEjwTLrWjjnfmmKn/
and suggest me the possible solutions.
Regards,
Quoting the paste:
i am executing these in Python 2.7 interpreter
import os
os.path.join(r'C:\win\apple.exe')
#will returns me = 'C:\\win\\apple.exe'
On 05/05/13 18:00, Ajin Abraham wrote:
Please refer this paste: http://bpaste.net/show/vsTXLEjwTLrWjjnfmmKn/
and suggest me the possible solutions.
There is no need for a paste bin for this. In six months time, when other
people are searching the mail archives looking for answers, the paste
Hi!
When I get file path from DirDialog, I get in a (path) variable.
Sometimes that string (path) contains special escape sequences, such as \x,
\r and so on.
'C:\Python25\Programs\rating'
When I try to open that file (whose name contains escape sequences) it
doesn't work.
I know
Neven Gorsic neven.gor...@gmail.com wrote
When I get file path from DirDialog, I get in a (path) variable.
Sometimes that string (path) contains special escape sequences, such as \x,
\r and so on.
'C:\Python25\Programs\rating'
When I try to open that file (whose name contains
On 4/18/2010 5:49 PM, Neven Goršić wrote:
Hi!
When I get file path from DirDialog, I get in a (path) variable.
Sometimes that string (path) contains special escape sequences, such
as \x, \r and so on.
'C:\Python25\Programs\rating'
When I try to open that file (whose name
On Mon, 19 Apr 2010 07:49:31 am Neven Goršić wrote:
Hi!
When I get file path from DirDialog, I get in a (path) variable.
Sometimes that string (path) contains special escape sequences, such
as \x, \r and so on.
'C:\Python25\Programs\rating'
That creates a string containing a
On Sun, Apr 18, 2010 at 06:48:47PM -0400, bob gailer wrote:
On 4/18/2010 5:49 PM, Neven Gor??i?? wrote:
When I get file path from DirDialog, I get in a (path) variable.
Sometimes that string (path) contains special escape sequences, such
as \x, \r and so on.
Since this is a tutorial list, it
instead of s='e:\mm tests\1. exp files\5.MOC-1012.exp'
try to use : s = r'e:\mm tests\1. exp files\5.MOC-1012.exp'.replace('\\',
'')
for me here is what it gives:
s = r'e:\mm tests\1. exp files\5.MOC-1012.exp'.replace('\\', '')
print s
e:\\mm tests\\1. exp files\\5.MOC-1012.exp
On Mon, Jul 21, 2008 at 9:44 AM, Monika Jisswel
[EMAIL PROTECTED] wrote:
instead of s='e:\mm tests\1. exp files\5.MOC-1012.exp'
try to use : s = r'e:\mm tests\1. exp files\5.MOC-1012.exp'.replace(
'\\', '')
for me here is what it gives:
s = r'e:\mm tests\1. exp
Thanks,
I am aware of goodies that raw string offers, but my question was how to
use it with variable that already contains string. :)
if you are reading the value from a file :
import re
for line in myfile:
if re.search(r'e:\mm tests\1. exp files\5.MOC-1012.exp', line):
line
Neven Goršić wrote:
I read from one file plenty of parameters and among them one file name
of other file.
That file name is 'e:\mm tests\1. exp files\5.MOC-1012.exp' and I hold
it in variable s.
As John pointed out, if you're really reading this string from a file
(with something like
I don't know in advance what the file name will be...
import re
for line in myfile:
if re.search(r'\', line):
line = line.replace('\\', '')
if you have lines that contain a \ in them that you don't want to substitute
then you need another if statement.
2008/7/21 Martin Walsh [EMAIL PROTECTED]:
Neven Goršić wrote:
I read from one file plenty of parameters and among them one file name
of other file.
That file name is 'e:\mm tests\1. exp files\5.MOC-1012.exp' and I hold
it in variable s.
As John pointed out, if you're really reading this
Thanks,
I am aware of goodies that raw string offers, but my question was
how to use it with variable that already contains string. :)
If you really have to, you may use something like this:
# Untested
def kludge(s):
s = 'r%s' % repr(s)
return eval(s)
Most people would frown at
Neven Gorsic [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Mon, Jul 21, 2008 at 9:44 AM, Monika Jisswel
[EMAIL PROTECTED] wrote:
instead of s='e:\mm tests\1. exp files\5.MOC-1012.exp'
try to use : s = r'e:\mm tests\1. exp files\5.MOC-1012.exp'.replace(
'\\', '')
for me
Hi!
In every manual and book I read only one way to make a raw string:
re:\mm tests\1. exp files\5.MOC-1012.exp.
I don't know how to make a string raw string if it is already
contained in a variable.
s.raw() or something like that ...
Thank you very much
PS. It seems like a very basic
Neven Goršić wrote:
Hi!
In every manual and book I read only one way to make a raw string:
re:\mm tests\1. exp files\5.MOC-1012.exp.
I don't know how to make a string raw string if it is already
contained in a variable.
s.raw() or something like that ...
Actually, there's no such thing as a
bob gailer wrote:
I'm guessing you want
x.raw() # to display
r\t
Is that true. That's the only way I can interpret your question.
Hm... or did you (speaking to the OP) intend for your script to
interpret strings you're reading from another source, like user input or
a text file, and
Neven Goršić wrote:
Hi!
In every manual and book I read only one way to make a raw string:
re:\mm tests\1. exp files\5.MOC-1012.exp.
I don't know how to make a string raw string if it is already
contained in a variable.
s.raw() or something like that ...
Looking up raw string in the docs
On Sun, Jul 20, 2008 at 5:48 PM, Steve Willoughby [EMAIL PROTECTED] wrote:
Neven Goršić wrote:
Hi!
In every manual and book I read only one way to make a raw string:
re:\mm tests\1. exp files\5.MOC-1012.exp.
I don't know how to make a string raw string if it is already
contained in a
Ewald Ertl's reply to Don Parris's question about r operator gave me the
idea of trying that out to solve my problem with file name scrambling when
trying to use webbrowser.open_new() to open a file on my computer in a
browser. It worked!
So, thie
On Mon, 8 Aug 2005, Tom Cloyd wrote:
So, thie
webbrowser.open_new(file://C:\__Library\folders\02394 Yale Style
Manual\02394 Yale_Style_Manual.htm)
does not work, but this
webbrowser.open_new(rfile://C:\__Library\folders\02394 Yale Style
Manual\02394 Yale_Style_Manual.htm)
I use
webbrowser.open_new(rfile://C:\__Library\folders\02394 Yale Style
Manual\02394 Yale_Style_Manual.htm)
does.
Thank you Ewald, for triggering the solution in my mind!
Now, if anyone can explain why webbrowser.open_new() does the
character substitution thing it was doing (and thus
24 matches
Mail list logo