op.
>
> If anyone has any ideas, please let me know.
>
>
> Thanks,
> John S.
>
> I looked at the file. It is an xml file. There are several xml modules
included with python that will help you to read this file.
Joel Goldstick
__
subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
google crawling web pages in python
I did a quick check and there are some tutorials. I agree with above -- if
you are new to programming, the last thing you need to tackle first are
regular expressions!
--
Joel G
you update with links to the csv files. If you don't have
security concerns (eg an internal webserver) you could just put them in a
directory and not create index.html file so that the listing of csv files
would show
--
Joel Goldstick
___
Tutor
org/mailman/listinfo/tutor
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
I recently used this code:
split_line = line.split(' ', 1)
which
~
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
I haven
; note all outputs in txt file.
>
You need to use append mode when you open the file
http://docs.python.org/library/functions.html?highlight=open#open
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change su
why not:
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> s = u'La Pe\xf1a'
>>> print s
La Peña
>>>
or "license" for more information.
>>> s = u'La Pe\xf1a'
>>> print s
La Peña
>>> import sys
>>> sys.getdefaultencoding()
'ascii'
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ading
>> zero? Like: 'Wed, 4 Aug 2010 17:58:42 +'
>>
>> It looks like it's not in the docs.
>>
>> Thanks
>>
>> Eduardo
>>
>
%e worked for me on Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
your list is.
>
> Thank you,
> ~Corey Richardson
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Tue, Aug 10, 2010 at 6:22 PM, Steven D'Aprano wrote:
> On Wed, 11 Aug 2010 06:09:28 am Joel Goldstick wrote:
> > The str part of str.join() is the string where the result is stored,
> > so you can start off with an empty string: ""
>
> I don't und
Most people use 4 spaces.
You can use any number of spaces, but you need to be consistant
The elif indentation must match its matching if statement. In this case
neither are indented
The block which executes under the elif is indented to the same level as
that under the original if
Joel Goldstick
n2.4/site-packages/Numeric'
> '/usr/lib/python2.4/site-packages/gtk-2.0'
>
>
> HTH,
>
> Emile
>
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or chang
___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
en write the value to the output file.
--
Joel Goldstick
On Tue, Aug 17, 2010 at 6:29 AM, Nitin Das wrote:
> I think in both the while loops , for loops are iterating over the new
> lines, as a result col1,col2,col3,col4,col5,col6,col7 as a result after both
> the while loop finishes the
__
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
return uitkomst gives the outcome to even.
> But the intepreter thinks otherwise.
>
> I work on a Win7 machine with Python 2.7
>
> Roelof
>
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listi
t; http://mail.python.org/mailman/listinfo/tutor
>
>
it is spelled wrong -- should be calendar
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
;s the python way to solve this
>>
>>
>> I am not sure what do you want to achieve by this ?
>> What is the problem statement ?
>>
>> The problem statement is that I must count how many times the target is in
>> the nested_list.
>> So I thougt that every nested list the function is called again so this
>> list is also iterated.
>>
>
> Let's say n, l = 2, [2, 9, [2, 1, 13, 2], 8, [2, 6]]
> Simply Flatten the list l, which will be then be; flatten(l) = [ 2, [2, 9,
> 2, 1,13, 2, 8, 2, 6 ]
> Now count for n; flatten.count(n)
>
>
>
> --
> ~l0nwlf
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Thu, Sep 9, 2010 at 10:26 AM, Luke Paireepinart
wrote:
> Shouldn't there be a way to do this without type checking? Duck typing!
>
> Your post got me thinking. Maybe better to test if the object can return
an iter method. If it throws an error, then look at its value. If it
doesn't, then its
On Thu, Sep 9, 2010 at 12:07 PM, Steven D'Aprano wrote:
> On Fri, 10 Sep 2010 01:05:22 am Joel Goldstick wrote:
> > On Thu, Sep 9, 2010 at 10:26 AM, Luke Paireepinart
> >
> > wrote:
> > > Shouldn't there be a way to do this without type checking? Duck
&g
] line and replace chosenword in the append(... with
words[index]
3. your list doesn't contain any duplicate words. Since your program is
supposed to catch this, you should add a duplicate to see if it works.
(No!)
4. I think your line del words[index] is supposed to help out with
On Thu, Sep 9, 2010 at 5:42 PM, Joel Goldstick wrote:
>
>
> On Thu, Sep 9, 2010 at 4:51 PM, lists wrote:
>
>> Hi tutors,
>>
>> Still on my Python learning journey! I've just competed an exercise
>> which asks the student to "Create a program that cr
special cases, I doubt it would be worth
> the time or trouble to formally make the request.
>
> Maybe I should ask if there is a better way to do what I want to do
> here. Is there?
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
27;m too inexperienced
with Python to consider myself good at it, I think the key to using python
is to 'get it' as to the fundamental
data types in python and how they make things easier to solve problems.
One of the earliest programming
books I read was 'Algorithms + Data Structures = Programs' by Niklaus
Wirth. The book used Pascal, which I think
the author wrote. But no matter the language, learn what data structures it
offers, and why and then your algorithms
will become simpler and more elegant. If you find yourself doing weird
things with your code, see if you can rethink
how you organize your data
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
lp(os) while in your python shell to learn what methods are
available. Traversing a tree is also sometimes called 'walking'
good luck
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
uld probably write a function to see if you can do
> > that. That's pretty easy
> >
> > 2. You need to traverse a tree. I see you are using os module. You
> > should try help(os) while in your python shell to learn what methods
> > are available. Traversing a tree is
>> You really have two problems here:
> >>
> >> 1. You need to know how to write an empty file with the name
> >> litter.py. You should probably write a function to see if you can do
> >> that. That's pretty easy
> >>
> >> 2. Y
s: `and the moral of that is--"Oh,
> 'tis love, 'tis love, that makes the world go round!"'
>
> So I think I have to replace the '.
>
> Roelof
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
That is a completely different problem than the one you originally posed. I
doubt that what you inserted above is actually completely correct. It opens
with a back tick, has a back tick before and, then ens with what looks like
a double quote then a single quote
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
>
> --
> Bob Gailer
> 919-636-4239
> Chapel Hill NC
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
How abou
On Mon, Sep 13, 2010 at 6:41 PM, Steven D'Aprano wrote:
> On Tue, 14 Sep 2010 04:18:36 am Joel Goldstick wrote:
>
> > How about using str.split() to put words in a list, then run strip()
> > over each word with the required characters to be removed ('`")
>
&g
e method I would
use is to strip each string of anything beyond its leading digits, save that
as a key, use the string as the value. Then sort by key
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
d_count[stripped_words] += 1
13 except KeyError:
14 word_count[stripped_words] = 1
15
16 ordered_keys = word_count.keys()
17 ordered_keys.sort()
18 ##print ordered_keys
19 print "All the words and their frequency in 'a
this:
"""'")"""
its hard to make out.. so with double spacing (you can't do this.. just to
illustrate:): """ ' " ) """
>
>
>
--
Joel Goldstick
__
r message
> Ciera
>
post your code.. and also windows/linux/mac?
if you post code and error message it will be easier to help
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.pyth
t I
> don't understand how
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
___
Tutor maill
On Thu, Sep 16, 2010 at 11:46 AM, Rance Hall wrote:
> On Thu, Sep 16, 2010 at 9:24 AM, Joel Goldstick
> wrote:
> > I typed in this:
> >
> >
> > 3 l = []
> > 4
> > 5 for i in range(0,10):
> > 6 l.append(i+1)
> > 7
> > 8
ontaining
> only one entry. How should I do that?
>
> You can loop through all the entries in d, and remove the entries that have
length one. Hope that isn't too much of a hint
>
> Question 2 : where should I have found this answer myself? (apart from
> here)
>
>
&g
our program or in the
sys.path list
you don't use the extension.
import filename
is all you need, not import filename.py
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
file.class or class.method
> etc.
>
>
>
> I googled this, but didn’t find it.
>
>
>
> Thank you,
>
> Mike
>
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
python.org/library/stdtypes.html#built-in-types
>
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
>
>
>
> -Joe
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
fileobj = open(filename, mode='wb')
will open the file. Do you have any documenta
On Tue, Sep 21, 2010 at 1:23 PM, bob gailer wrote:
> On 9/21/2010 12:34 PM, Joel Goldstick wrote:
>
>
>
> On Tue, Sep 21, 2010 at 12:03 PM, Joe Bennett wrote:
>
>> I have some binary files created by a program written in C++... Anyone
>> have any experience with th
On Tue, Sep 21, 2010 at 1:23 PM, bob gailer wrote:
> On 9/21/2010 12:34 PM, Joel Goldstick wrote:
>
> On Tue, Sep 21, 2010 at 12:03 PM, Joe Bennett wrote:
>>
>> I have some binary files created by a program written in C++... Anyone
>> have any experience with this
return index
index = index + 1
return -1
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
e
to a, your first value is stored, in a[0], etc. Read about slices.
They're fun, and informative to understand indexing concepts in python
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Mon, Sep 27, 2010 at 1:52 PM, Steven D'Aprano wrote:
> On Tue, 28 Sep 2010 02:12:55 am Joel Goldstick wrote:
>
>> a=[]
>> i=0
>> for l in open("file.txt", "r"):
>> a[i]=l
>> i+=1
>
> Did you try it before posting?
>
That
r
>
I don't know how you are figuring out your size, but if you note
below, you can create a list with one element value 0, then multiply
it by length you need and result is than length of array filled with
0s
x = [0] * 4
>>> x
[0, 0, 0, 0]
--
Joel Goldstick
___
our code, but I am not sure what dbf module you
are using. I am running UBUNTU 9.10 and can't find a dbf module in
the repository.
What are you running?
--
Joel Goldstick
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
..@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
#
I copied your code between the hash lines and get this:
File "my_turtle.py", line 19
if (abs(turtle.position()[0]) > turtle.window_height()/2) or
^
SyntaxError: inval
ng the information for the file changing operation from the
>> contents of a document.
>>
>> As you can imagine, I'm pretty green in Python programming and I was
>> hoping
>> the learn by doing method would work. I need t
supposed to return a list of environmental variables in a given
> order.
> Sadly only the header displayed.
> I have looked through over and over, please what am i doing wrong.
> This is from Deitel How to program python, Chapter 6.
>
> thanks and best regards.
> --
>
did you lose the indentation in copying code to email?
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
uot; in the
>> case of a file.
>>
>
> This is what I do unless the files are _really big_
>
> For-me-really-big-is-over-200Mb-ish-ly y'rs,
>
> Emile
>
> Why not loop with readline() and then the slice. That way only one line at
> time in memory
>
--
9]
> >>> r = [round(2*x)/2.0 for x in n] # double, round, then divide by 2.0
> >>> r
> [1.0, 1.0, 1.0, 1.5, 1.5, 1.5, 1.5, 1.5, 2.0, 2.0]
> >>>
>
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
excel, or any other spreadsheet can
read the file. Python offers csv support, its easy to understand, produces
small files, and being a text format, it is easy to debug problems.
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
self.liorder.append(str(graphname[0]).lstrip('u'))
>
> __
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
o
> be very intuitive.
>
Here is a discussion of how to iterate over a dictionary in sorted order:
http://stackoverflow.com/questions/364519/in-python-how-to-i-iterate-over-a-dictionary-in-sorted-order
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Tue, Oct 12, 2010 at 2:46 PM, Josep M. Fontana wrote:
>
>
> On Tue, Oct 12, 2010 at 8:37 PM, Joel Goldstick
> wrote:
>
>>
>>
>> On Tue, Oct 12, 2010 at 1:52 PM, Josep M. Fontana <
>> josep.m.font...@gmail.com> wrote:
>>
>>> Tha
On Tue, Oct 12, 2010 at 3:39 PM, Sander Sweers wrote:
> On 12 October 2010 21:15, Joel Goldstick wrote:
> > When the dictionary is retrieved, its order depends on the hashed values
> > rather than the keys themself.
>
> If (big IF here) you really need an ordered
oad(F). The thing you are trying to load is a file that was a
copy of the contents of the url. It is html, and not 'pickled'
I think you are missing a line or two of code from your example tutorial
>
> Roelof
>
> ___
> Tutor m
e front of
> these results but in fact those 'u's lie outside the string, they
> are a part of Python's representation of a unicode string,
> not a part of the string.
>
> So if you remove the call to strip() your code will return
> the result you expected.
&
t;
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
To take a string of comma separated integers and convert to a list of
floats:
>>> x = u'1,2,3,4'
>>> y = x.split(',')
>>> z = [float(f) for f in y]
>>> z
[1.0, 2.0, 3.0, 4.0]
>>>
--
Joel Goldstick
_
joining of each
element of the list, but also you need to have the correct argument for
getinfo. In your first example you append ".txt" to p, but in the loop
example you fail to append it. See my earlier post
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
the below will work.
>
> [int(n) for n in u'1,2,3,4'.replace(',', '')]
>
> Greets
> Sander
>
or this:
>>> s = '1, 200 , -3,4' # or whatever
>>> [int(x) for x in s.split(',')]
[1, 200, -3, 4]
or this:
To take a
replaced by the same
> string followed by the string corresponding to the year value in the
> dictionary (also a string)
> --
>
> I run this and I don't get any errors. The names of the files in the
> directory, however, are not changed. What am
h item would you like to change: ")
In the line about you have mismatched parentheses. This confuses the parser
___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
):
print(Entries[In] + ": " + str(In))
change = int(input("Which item would you like to change: ")
Entries[change]=str(input("Please enter a nem name: ")
> else:
> #do nothing
>
Actually, I caught two mismatched parens. In the line startin
rder. It does not include the special
entries '.' and '..' even if they are present in the directory.
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
> envsql: select envVariable, envValue from ODS_ENV_DICT where envName =
> 'ST2'
>
> envDB systest2
>
> Traceback (most recent call last):
>
> *File "H:\workspace\test\src\root\nested\example.py", line 33, in
> *
>
> envDict[envVariable].a
ting the application on the web,
install issues disappear, and you might get more hits on your site.
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
don't think that is what you want, but since floating point arithmetic is
done in binary there are rounding errors.
You might want to look at the decimal module
> _______
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mail
etattr__(self, attr, value):
>self[attr] = value
>
>def set_with_dict(self,D):
>""" set attributes with a dict """
>for k in D.keys():
>self.__setattr__(k,D[k])
> _____
filename
> self.name = f
> if new:
> # new table (table file must be
> # created or opened and truncated)
> self.stream = file(f, "w+b")
> else:
> # tabe file must exist
> self.stream = file(f, ("r+b", "rb")[bool(readOnly)])
>
>
>>
>>
>
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
Do you have write privilege in the directory where you want to create the
file?
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ariable is it won't process the SQL
> statement any longer because of the quotes around it. The format has to stay
> in (' "PATH" = X')
> for it to ingest correctly, another way would be "\"PATH\" = 1"
illist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
just the word
> following the tag w/ the form: line[start: stop], it prints nothing
> (it seems b/c my stop variable is incorrect).
>
> I would greatly appreciate any help you have. This is a much
> simplified example from the script I'm actually writing, but I need to
> figure out a way to el
t;
>
> Is python really worth the pain or should I just skip it ?
>
>
>
> Thank you so much.
>
>
>
>
>
> *Abdulhakim Haliru*
>
> * *
>
>
>
> ___
> Tutor maillist
ibe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
bin is new in 2.6 .. check your version
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ou want.
Then add back the 0x prefix
q.e.d.
>>> h = hex(546)
>>> h
'0x222'
>>> n = h[2:]
>>> n
'222'
>>> n.zfill(5)
'00222'
>>> '0x' + n.zfill(5)
'0x00222'
>>>
This can all be simplified (well .. shortened!) to
>>> '0x' + hex(543)[2:].zfill(5)
'0x0021f'
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
em? If you do want leading zeros
because it makes your display look more proper, then you do the string
formatting to get what you need.
Go back and read some tutorials or the python manual to understand data
types.
--
Joel Goldstick
___
Tutor mailli
ange subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
Just some quick ideas:
Read about Generators. Using Hugo's snippet for reading a file a line at a
time, you can write a function to yield a single line of the file for each
call. Do this f
ython
"""
Read a file containing a long string of ones and zeros
Separate each bit with a comma, then write the whole csv thing
to an output file.
This can be read by an excel like application with one bit in each
row of the first column
"""
f = open('./robert.txt',&
ions:
> http://mail.python.org/mailman/listinfo/tutor
>
>
"but that path doesn't actually exist... replace that path with either
r"d:/temp/spssio32.dll" or with "d://temp//spssio32.dll"; otherwise the /t
will be transformed into a tab.
Nick"
I don
ike it could cause other
problems with the code. I don't do python on windows, and have unremembered
a lot I used to know about windows. So, my question is, isn't there another
way to do this?
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
r.writerow(aRow)
> else:
> aRow1 = [""+filepath+","+filename+",0"]
> writer.writerow(aRow1)
> print "El archivo esta listo"
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Mobile Banking Solutions | Transaction Processing | Enterprise Application
> Development
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
shing
And of course this list!
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
_
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
True means not zero, not "". Any numeric value but 0 is true. so you have
True and True.
I thi
_
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
Oops. I misread your post. I (why I don't know) thought I saw a = 5, b =
4.
a and b are names.
stuff to
> read is great, explaining it here is great, writing short example code is
> great too, anything helps.
>
> What is it about you... that intrigues me so?
>
>
>
> ___
> Tutor maillist -
to do that.
The for i in range(1::): will give you an error. The range parameter needs
to be something with a length, like a string, or a list, or a tuple.
Can you show a little bit of your data file, and give us the traceback and
output of your program?
> _____
mail.python.org/mailman/listinfo/tutor*<http://mail.python.org/mailman/listinfo/tutor>
>
>
> *
> This message and any attachments (the "message") are confidential, intended
> solely for the addressee(s)
have you tried help(config.get) in the python interactive shell?
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
not binary. Then your \n will be
translated into whatever end of line sequence your operating system
requires.
http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-files
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe
information contained in the message. If you are not the intended
>> recipient, you should delete this email and notify the sender immediately.
>>
>> Any views or opinions expressed in this email are those of the sender
>> only, unless otherwise stated. All copyright in any Capita material in this
>> email is reserved.
>>
>> All emails, incoming and outgoing, may be recorded by Capita and monitored
>> for legitimate business purposes.
>>
>> Capita exclude all liability for any loss or damage arising or resulting
>> from the receipt, use or transmission of this email to the fullest extent
>> permitted by law.
>>
>
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
- Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
Joel Goldstick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
e a
> different way?
>
>
>
>
>
>
>
> What is it about you... that intrigues me so?
>
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/m
een created.
>
> On Wed, Apr 6, 2011 at 4:06 PM, michael scott wrote:
>
>> Is this really a python tutor question? Oh, well, try this:
>> http://lmgtfy.com/?q=sqlite+test+if+table+exists
>>
>> --
>> Joel Goldstick
>>
>>
>> My apologies, I
1 - 100 of 526 matches
Mail list logo