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 bi
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
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:
http://mail.python.org/mailman/listin
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 li
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 containi
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 contain
"Neven Gorsic" 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 escape sequences) it
do
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 t
"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 m
> 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 fr
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 read
>
> 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.
___
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 file
>
> 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):
l
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 files\5.MOC-101
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 21/07/2008, Neven Goršić <[EMAIL PROTECTED]> wrote:
> >>> s='e:\mm tests\1. exp files\5.MOC-1012.exp'
> >>> os.path.split(s)
> ('e:\\', 'mm tests\x01. exp files\x05.MOC-1012.exp')
[...]
> The problem is that \1 and \5 is wrongly understood.
Yup, that's not surprising.
> I know that
> ever
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:
>> r"e:\mm tests\1. exp files\5.MOC-1012.exp".
>> I don't know how to make a string raw string if it is already
>> co
Neven Goršić wrote:
Hi!
In every manual and book I read only one way to make a raw string:
r"e:\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
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:
r"e:\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
Hi!
In every manual and book I read only one way to make a raw string:
r"e:\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 questi
> webbrowser.open_new(r"file://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 th
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(r"file://C:\__Library\folders\02394 Yale Style
> Manual\02394 Yale_Style_Manual.ht
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
webbrowser.open_new("file://C:\__Library\
25 matches
Mail list logo