> How can we know that one specific file is already exist in filesystem?
> for instance, I want to read zipfile by issuing code:
Take a look in the os.path module.
There is explanation of how to check for various aspects of files
(including existence) in my web tutor Operating System topic.
> i
On 4/4/06, Kaushal Shriyan <[EMAIL PROTECTED]> wrote:
> Hi ALL
>
> A simple query is that the python mailing List is python powered
>
> What does "python powered" means
The list, and many like it, use a piece of software called Mailman,
which is written in Python. A few years back, the tool of ch
Dear all Pythoners,
I am quiet new to python and now working with xml. I have an xml like this:
0x6B
0x78
0x4B
0x58
0x67
0x63
0x71
0x43
0x51
0x6A
and I want to
Michael Broe wrote:
> dict = {}
dict is the name of the builtin dictionary class, so you shouldn't use
it as the name of your dict - you shadow the built-in name. file is also
a built-in name.
>
> L = file[0]
> for R in file[1:]:# move right edge of window across the file
> if not L
ទិត្យវិរៈ wrote:
> Dear all Pythoners,
>
> I am quiet new to python and now working with xml. I have an xml like this:
>
>
>
>
>
> 0x6B
> 0x78
> 0x4B
> 0x58
> 0x67
> 0x63
> 0x71
> 0x43
Hello.
Is it possible to read the bits (the 0's and 1's) of a string or a file
with Python? What module would I use?
Thanks in advance,
Øyvind
--
This email has been scanned for viruses & spam by Decna as - www.decna.no
Denne e-posten er sjekket for virus & spam av Decna as - www.decna.no
___
Øyvind wrote:
> Hello.
>
> Is it possible to read the bits (the 0's and 1's) of a string or a file
> with Python? What module would I use?
I don't know exactly what you mean by "read the bits" but you can use
data = open('afile', 'b').read() to get the data into a string
byte1=ord(data[1]) to get
Hello everybody
I have been programming in object oriented languages for several years
and I'm learning python now.
I have missed protected method/variables in Python. How do you declare
methods/variables used only by a class and their derived classes?
Thanks in advance
--
Miquel Oliete (a.
>> Which language(s) do you know that has such a feature?
>
> I should came from Marco Cantu's Delphi 2005 book, that I have read just
> recently.
> But I am unable to find it again.
I'd be very surprised if it came from Delphi for two reasons:
a) I used Delphi a lot for several years and never c
"Øyvind" <[EMAIL PROTECTED]> wrote in message
> Is it possible to read the bits (the 0's and 1's) of a string or a file
> with Python? What module would I use?
Yes, you can read the bits by reading bytes and applying
bitmasks and bitwise operations.
You can get the bytes using the struct module
"Miquel Oliete" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have been programming in object oriented languages for several years
> and I'm learning python now.
Congratulations :-)
> I have missed protected method/variables in Python.
In what sense have you missed them? Have
> I have missed protected method/variables in Python. How do you declare
> methods/variables used only by a class and their derived classes?
hi Ktalà,
welcome to Python! you missed "protection" in OOP with Python bceause
there are no such declarations in Python!
1) there is a privacy *hint*, wh
w chun wrote:
>> I have missed protected method/variables in Python. How do you declare
>> methods/variables used only by a class and their derived classes?
>
> hi Ktalà,
>
> welcome to Python! you missed "protection" in OOP with Python bceause
> there are no such declarations in Python!
>
> 1)
> > - you can use __slots__ to restrict arbirtrary creation of
> (dynamic)
> > instrance attributes
>
> You can do this, but it is generally considered a misuse of
> __slots__ and potentially problematic.
>
I'll bite. What is the proper/intended use of __slots__? Does it have
something to do
Mike Hansen wrote:
>>> - you can use __slots__ to restrict arbirtrary creation of
>> (dynamic)
>>> instrance attributes
>> You can do this, but it is generally considered a misuse of
>> __slots__ and potentially problematic.
>>
>
> I'll bite. What is the proper/intended use of __slots__? Does i
Dear All,
I am having difficulty removing white spaces from my file. The file is 999
lines long and looks like the sample below:
001, new field,dial= 028 90 79 0154, dial=
002, borfiled, dial= 02890 618521, dial=
003, newcomp, dial=02890419689, dial=
The program, I am using to import the file d
Hello,
Suppose you have a situation where you have a large number of command-line
options that you will parse with getopt. You want to keep track of these
as you move around in the code and do various things.
Is it more Pythonic to:
Have the functions take large numbers of parameters.
or
Crea
Hi John,
It would be easier to do all of your whitespace elimination before you
append the string to your list(s).
Something like this I should get you started:
for line in input.readlines():
line = re.sub('[\s]+', '', line)
listy.append(line)
print listy
bonus points for appe
Dana Robinson wrote:
> Hello,
>
> Suppose you have a situation where you have a large number of command-line
> options that you will parse with getopt. You want to keep track of these
> as you move around in the code and do various things.
>
> Is it more Pythonic to:
>
> Have the functions take la
[Sorry for the initial misfire, John]
> [mailto:[EMAIL PROTECTED] On Behalf Of John Corry
> 001,newfield,dial=02890790154,dial=
> 002,borfiled,dial=02890618521,dial=
> 003,newcomp,dial=02890419689,dial=
Hi John:
I believe the common idiom in this case is
''.join( theString.split( ' ' ) )
>>> th
20 matches
Mail list logo