hat's not enough explanation for you, you'll have to provide some
code for us to look at.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
e used to recover the object when given a string later:
That is, for each object obj do:
objMap[str(obj)] = obj
and later with the string in hand, do
obj = objMap[string]
One other word of warning. It is best to not use a variable named
"string" as Python has a builtin type of t
W. Watson wrote:
> In what library would I find gif.save(path), where path is the name and path
> of a file, and the method would produce a file in a gif format?
>
> Is there a fits.save(path) somewhere? fits is commonly used in astronomical
> work.
>
You may want to install PIL (the Python
pointing out the obvious to me
Gary
_
"Accept no assertions without evidence." --Goompah wisdom from "Omega" by
Jack McDevitt--
_
"Nature is complete because it does not serve itself." --"Tao De Jing" by
Lao Tze--
--
http://mail.python.org/mailman/listinfo/python-list
gt; (admittedly most objects don't), but only None is None.
>
>
You don't have that quite right. The only way something can *equal*
None is if it *is* None.
None is not a value an object can have, but rather it is a (singleton)
object that can be referenced. Setting something *eq
d, but it is not (as your definition suggests)
object-fascist. We use objects to great effect in Python, when it is
natural to do so, but the language does not force it on us.
Gary Herron
> --
> Regards,
>
> Maneesh KB
>
> Comat Technologies
>
> Bangalore
&
todp...@hotmail.com wrote:
> How can you make python round numbers to the nearest 5:
>
> Example:
>
> 3 => 0
> 8 => 10
> 23.2 => 20
> 36 => 35
> 51.5 => 50
round(n,-1) rounds to the nearest 10, so
round(n*2,-1)/2 will round to the ne
the stdin of the parent is a real (or possibly
pseudo-) terminal, which appears not to be the case for programs run
through Eclipse.
Gary Duzan
--
http://mail.python.org/mailman/listinfo/python-list
falo as ridable
# Now use ridable as any module...
If each defines a class of its own name, but the classes have identical
interfaces, then try
if ...:
from horse import Horse as Ridable
else:
from buffalo import Buffalo as Ridable
# Then instantiate
animal = Ridable(...)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
'm not sure how that will work.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Vincent Davis wrote:
> Do to laking knowledge my google searches have not turned up an answer for me.
> I know this is wrong it uses the items in the list as the filename,
> how do I refer to the dataname and not the items in it.
>
> def savedata(dataname):
> filename = str(dataname) # this do
ulFn(...):
...
Then your main Python file imports it and uses the things define in a.py
like this:
import a
ob = UsefulClass(...)
a.UsefulFn()
Good luck,
Gary Herron
> --
> http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list
greg wrote:
> SuPy 1.0
>
>
> SuPy is a plugin for the Sketchup 3D modelling application
> that lets you script it in Python.
>
> http://www.cosc.canterbury.ac.nz/SuPy/
That URL fails with a 404 - not found. (At least for me at this moment
in time.)
>
> This is a first version and is
for Python.
pyglet provides an object-oriented programming interface for
developing games and other visually-rich applications for Windows, Mac
OS X and Linux.
You might also consider SDL and its python bindings.
Gary Herron
Thanks Guy's
--
http://mail.python.org/ma
n...@stinemates.org wrote:
> Gary
>
> Your email client is set to HTML mode and looks terrible for those of us
> who prefer plain view. It also appears your client is not properly
> sending your message in text/plain encoding.
>
>
> --
> http://mail.python.org/m
d object, Intel 80386, version 1
> (SYSV), not stripped
>
> How could I fix this?
>
It looks like you have it installed incorrectly, How did you install
it. What platform/system are you on?
PIL usually uses a PIL.pth file. Does that exist? Where? And what are
its contents?
Ga
Can someone recommend a good tutorial for Python 3, ideally that has tasks or
assignments at the end of each chapter.
Please,
--
http://mail.python.org/mailman/listinfo/python-list
I'm stuck on a tutorial Hands on Python3
Exercise 1.13.7.3. ** Complete the following function. This starting code is in
joinAllStub.py. Save it to the new name joinAll.py. Note the way an example is
given in the documentation string. It simulates the use of the function in the
Shell. This is a
lists here to obscure things. Try this:
Here b is a list that contains three references to a. Modify a, and
all three references to a show the modification:
>>> a = [1,2,3]
>>> b = [a,a,a]
>>> a.append(4)
>>> b
[[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]]
omething:
return iterSomething(output)
else:
return output
So either way, *something* is returned, and in the case of the recursive call,
the innermost result is returned back up through all levels of the recursion.
Is that what you wanted?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Lie Ryan wrote:
> On Tue, 16 Dec 2008 12:07:14 -0300, Federico Moreira wrote:
>
>
>> Hi all,
>>
>> Im parsing a 4.1GB apache log to have stats about how many times an ip
>> request something from the server.
>>
>> The first design of the algorithm was
>>
>> for line in fileinput.input(sys.argv[1
, but
numpy has a nice (efficient) way to do this:
>>> import numpy
>>> s = 'bgrBGRcbaCBA'
>>> a=numpy.array(s, 'c') # Initialize an array
>>> a.shape = (4,3)# Reinterpret as a ?? by 3 array
>>> b=a[...,::-1] # reverse the second dimension
>>> print b.tostring() # Convert back to a string.
rgbRGBabcABC
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
pe
''r''# (That's four single quotes although your font may make it
look like two double quotes.)
is an empty string
''
followed by another empty string (using raw syntax)
r''
The last piece of the puzzle is a (seemingly) little know feature
ular expression module, use re.sub like this:
>>> import re
>>> re.sub('[0-9]', '',
"ttccatttctggacatgacgtctgt6901ggtttaagctttgtgaaagaatgtgctttgattcg")
'ttccatttctggacat
dly. No matter what I passed as an
> argument (and no matter what I set the value of DEBUG to be), it
> started printing the exact literal string:
>
> DEBUG: %s
>
> whenever it was called. It was as if the function couldn't see the
> parameter msg, which was
) > 50:
return chr( random.randrange(0, 26) + 97)
else:
return chr( random.randrange(0, 26) + 65)
or
return chr( random.randrange(0, 26) + [26,97][random.randrange(0,
100) > 50]
or
... probably other ways can be found ...
but what's wrong with you original code?
Gary Herron
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
ot, it returns a -1
indicating so.
You'll have to describe what you expected and why you expected it before we
will be able to see a problem that needs solving. (And then the problem will
most likely be in your expectations, not in the find method.)
Gary Herron
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
'''exercise to complete and test this function'''
import string
def joinStrings(items):
'''Join all the strings in stringList into one string,
and return the result. For example:
>>> print joinStrings(['very', 'hot', 'day'])
'veryhotday'
'''
word = [items]
for item in it
'''exercise to complete and test this function'''
import string
def joinStrings(items):
'''Join all the strings in stringList into one string,
and return the result. For example:
>>> print joinStrings(['very', 'hot', 'day'])
'veryhotday'
'''
for i in items:
return (''
''' program.
1.What type of data will the input be? What type of data will the output be?
2.Get the phrase from the user.
3.Convert to upper case.
4.Divide the phrase into words.
5.Initialize a new empty list, letters.
6.Get the first letter of each word.
7.Append the first letter to the lis
'''Test animation of a group of objects making a face.
Combine the face elements in a function, and use it twice.
Have an extra level of repetition in the animation.
'''
from graphics import *
import time
def moveAll(shapeList, dx, dy):
''' Move all shapes in shapeList by (dx, dy).'''
mmcclaf wrote:
I have to make some queries for 4 tables I have. The following
relations are:
Classes(class, type, country, numGuns, bore, displacement)
Ships (name, class, launched)
Battles (name, date)
Outcomes (ship, battle, result)
The three queries I'm stuck on are the following:
1. Find
Hello,
Python newbie here. I am working with Python and geoprocessing in
ArcGIS. I'm taking a training course online and the exercise I'm
working on makes mention of using PythonWin instead of Idle.
I am using version 2.5 and have not been able to locate PythonWin. The
download just includ
of efficiency, and as such each implementation/version of
Python may make its own choices. Writing a program that depends on the
string identity policy would be considered an erroneous program, and
should be avoided.
The question now is: Why do you care? The properties of strings do
tring whenever a new string is created.
Clearly that's not going to be efficient. However, the C implementation of
Python does a limited version of such a thing -- at least with strings of
length 1.
Gary Herron
a = "a"
b = "a"
a == b
True
a is b
Robert Kern wrote:
On 2009-03-06 13:46, Gary Herron wrote:
Emanuele D'Arrigo wrote:
Hi everybody,
while testing a module today I stumbled on something that I can work
around but I don't quite understand.
*Do NOT use "is" to compare immutable types.* **Ever! **
We
Robert Kern wrote:
On 2009-03-06 14:23, Gary Herron wrote:
Robert Kern wrote:
On 2009-03-06 13:46, Gary Herron wrote:
Emanuele D'Arrigo wrote:
Hi everybody,
while testing a module today I stumbled on something that I can work
around but I don't quite understand.
*Do NOT u
Steven D'Aprano wrote:
Gary Herron wrote:
Emanuele D'Arrigo wrote:
Hi everybody,
while testing a module today I stumbled on something that I can work
around but I don't quite understand.
*Do NOT use "is" to compare immutable types.***Ever
Steven D'Aprano wrote:
Gary Herron wrote:
Robert Kern wrote:
...
Use "is" when you really need to compare by object identity and not
value.
But that definition is the *source* of the trouble. It is *completely*
meaningless to newbies. Until one ha
Emanuele D'Arrigo wrote:
On 6 Mar, 19:46, Gary Herron wrote:
It is an implementation choice (usually driven by efficiency considerations) to
choose when two strings with the same value are stored in memory once or twice.
In order for Python to recognize when a newly created strin
me 'execfile' is not defined
(following tutorial in David Beazley's Python Essential Reference).
Is execfile not supported in 3?
That's correct.
From http://docs.python.org/dev/3.0/whatsnew/3.0.html you can find this
line:
Removed execfile(). Instead of execf
thon3 tutorial to go with your Python3 installation.Once you are
familiar with either version of the language, you will find that the
differences are not very large, but using out-of-sync tutorials and
implementations will be the source of much frustration.
Welcome to Python.
Enjoy.
Gar
or not is also not relevant.
What does matter is this: If every instance wants access to a single
value (immutable or not), use a class attribute, otherwise use an
instance attribute.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Maxim Khitrov wrote:
On Sat, Mar 14, 2009 at 2:07 PM, Gary Herron wrote:
Maxim Khitrov wrote:
Very simple question on the preferred coding style. I frequently write
classes that have some data members initialized to immutable values.
For example:
class Test(object):
def __init__
Maxim Khitrov wrote:
On Sat, Mar 14, 2009 at 4:31 PM, Gary Herron wrote:
Perhaps a different example would help explain what I'm trying to do:
class Case1(object):
def __init__(self):
self.count = 0
self.list = []
def inc
Maxim Khitrov wrote:
On Sat, Mar 14, 2009 at 5:38 PM, Matthew Woodcraft
wrote:
Gary Herron writes:
I think this code is in poor taste: it's clear that it will confuse
people (which is what Maxim was asking about in the first place).
Careful now -- I didn't write that. (
hich according to those rules, (if inst.x is not yet defined)
has both an instance and a class reference in the same statement.
After that, x.inst is defined in the instance, so both sides refer to that.
Gary Herron
Tx,
John
--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list
u follow the "best
practice" for defining instance variables:
That is, set instance variables to their initial value in the __init__
method.And if you need a class default value, name it differently:
For example:
class C:
default_x = 123
def __init__(self):
self.x = self.de
overlapping
lifetimes may have the same id() value. (Implementation note: this
is the address of the object.)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list
#I adjusted the 2nd main function so i test what im trying to do can someone
point me in the right direction please
Exercise 2.3.3.1. ** Rename the example file locationsStub.py to be
locations.py, and complete the function printLocations, to print the index of
each location in the string s
is a statement:
print tn.read_all()
If you want one script to work for both Windows and Linux, then you
should probably
be running the same version of Python on each. At least both versions
should be on
the same side for the Python 2.x/3.x version change.
Gary Herron
The same script w
I have the DOS box with the message
Localhost CGI server started
But when i try this
Back in the www directory,
1.. Open the web link http://localhost:8080/adder.html (preferably in a new
window, separate from this this tutorial).
2.. You should see an adder form in your browser again.
tp://en.wikipedia.org/wiki/Off-by-one_error
Google can provide many more.
My personal view is that 0-based loops/indices is *far* more natural,
and the 1-based loops/indices are a *huge* source of off-by-one errors.
But I'm sure others will argue over that point.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ta. Would that help you to either create the needed
buffer? Or perhaps you could by-pass the need for a buffer, and just
use the byte string.
Gary Herron
Help appreciated,
Simon Hibbs
--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list
e
print>>outfile, ...
form in Python 2.5. In Python 3.X, the
print(...)
function will get you the functionality (I think) you want.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
o a (perhaps) long string to store. When the string is retrieved,
unpickle to reconstruct an equivalent object. This new version of the
original foo may or may not be adequate for your use.
Gary Herron
Thanks in advance,
Julien
--
http://mail.python.org/mailman/listinfo/python-list
; if isinstance(inst, str) else inst) for inst in a]
The parentheses around the conditional are unnecessary, but help with
readability I think.
Better yet:
def QuoteIfString(inst):
...
b = [QuoteIfString(inst) for inst in a]
would be much more readable, and you could document
*why* you are doing this in the def of QuoteIfString
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ectories Python starts with.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Jeremy Banks wrote:
Hi. I'm sure there've been debates about this before, but I can't seem
to figure out what to search for to pull them up, so I'm asking here.
It seems to me that a lot of things could be made much easier if you
could use primaries other than basic identifiers for the target of
Jeremy Banks wrote:
Thanks for your comments.
On Thu, Apr 23, 2009 at 11:52, Gary Herron wrote:
[...]
There's no need for a specific addition to the syntax to do this.
Try this:
def foo_bar():
return(...)
foo.bar = foo_bar
[...]
and this:
def fo
t I want to do, except get an existing module and then
execute my xyz.py file's code block in the context of that module, I
think. Any help would be much appreciated!
thanks,
-- Gary
--
http://mail.python.org/mailman/listinfo/python-list
- "Steven D'Aprano" wrote:
> On Mon, 27 Apr 2009 21:46:13 -0400, Gary Oberbrunner wrote:
>
> > ...Now after importing foo.bar, I'd like to load
> > another file of code (say xyz.py), but *into* foo.bar's namespace.
...
>
> import foo.bar
so don't worry about the differences
-- they are minor and evolutionary not revolutionary.)
Gary Herron
My essential question is "Is Python 2.6 similar enough to Python 3.0
to justify its complexity of installation?" Upgrading to Jaunty is NOT
an option
(http://welco
sting talk on using generators for
building and linking together individual stream filters. Its very cool
and surprisingly eye-opening.
See "Generator Tricks for Systems Programmers" at
http://www.dabeaz.com/generators/
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ot;Seattle Mariners"
and
"Seattle Mariners"["roster"] makes no sense.
Gary Herron
I get an error:
Traceback (most recent call last):
File "./gamelogs.py", line 53, in
teams[team]["roster"] = ["player1", "player2"]
TypeErr
on/gherron 11563 2009-04-24 09:33:12 .emacs
So the module correctly reads the tar-gzip file, and finds its contents.
Now, what is it you were trying to do?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
commutative then
some of them could be done in parallel.
That should read "associative" not "commutative".
For instance A+B+C+D could be calculated sequentially as implied by
((A+B)+C)+D
or with some parallelism as implied by
(A+B)+(C+D)
That's an application of the associativity of addition.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
s division of 4 by 5.0, but rather that the value of 0.8 itself
cannot be represented exactly in IEEE 754. Just try
>>> print repr(0.8) # No division needed
'0.80004'
Gary Herron
I have the same feeling towards databases.
--
http://mail.python.org/mailman/listinfo/python-list
R. David Murray wrote:
Gary Herron wrote:
MRAB wrote:
Grant Edwards wrote:
On 2009-05-21, Christian Heimes wrote:
seanm...@gmail.com schrieb:
The explaination in my introductory Python book is not very
satisfying, and I am hoping someone can explain the
plete guesswork.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
u've tried, and see if someone is
willing to make suggestions or answer specific question about your
attempt at a solution?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Marius Retegan wrote:
Hi,
On Fri, May 29, 2009 at 2:09 AM, Gary Herron
mailto:gher...@islandtraining.com>> wrote:
Marius Retegan wrote:
Hello
I have simple text file that I have to parse. It looks
something like
this:
parameters1
;*' instead of fixed width, and then supply the actual width as a
separate parameter:
>>> print '%*d' % (5,123)
123
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
bc90021 wrote:
...and the exact error message was?
Here is a tip: if you want people to help you, then you have to help
them to help you. Personally, I wouldn't respond to anymore of your
questions because you seem incapable of posting the information that was
requested.
So far, the peop
or the purpose of the
group. And you've done both and been reprimanded for it. Now, either
go away, or change your attitude and join the group. (You would be
welcome if the attitude changed.) Either way, this group will be it's
usual friendly self.
Gary Herron
Gary He
uch a way?
What does it even mean to "access a statement"?
Do you even have a list of "statements" from which we are to work?
Python is a little unusual in what it considers statements.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Ohad Frand wrote:
Hi Gary
Sorry that I was not clear, I hope that this time I will explain myself
better.
I can get list of all builtin functions in python by dir(__builtins__).
This return a list of string with most known names to python language
such as:
[... 'issubclass',
, 2, 3) as func1!
># there must be some better way than args[0]?
>
>def func1(*args):
>
>print args # (1, 2, 3)
>func2(args)
func2(*args) # <<<<<<==
>
>func1(1,2,3)
Gary Duzan
Motorola H&NM
--
http://mail.python.org/mailman/listinfo/python-list
tinfo/python-list
ReportLabs is a quite extensive open-source project for generating PDF
files.
http://www.reportlab.org/
Enjoy,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
y.
Of course this leaves unanswered the question of *how* you are supposed
to import that code. I've never used PythonCard so I can't help
further, but I suggest looking at the documentation and examples
supplied. And perhaps waiting for someone with experience with
PythonCard
uses in that function. Then it's clear that "print
a" is trying to access the local variable before the assignment gives it
a value.
You were expecting that the "print a" pickups it the outer scope "a" and
the assignment later creates a local scope "
e line
self.file = file
does just that. "self" is the name of the object being created,
"self.file" is an attribute named "file" of that object, and the
assignment stores the supplied value there.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
John Henry wrote:
On May 13, 1:49 pm, Gary Herron <[EMAIL PROTECTED]> wrote:
John Henry wrote:
Hi list,
I can't understand this. The following import statement works fine:
from PythonCard.templates.dialogs import runOptionsDialog
but thi
dedicated to OOP. Years could be
spent learning to apply its concepts. A web search would find a flood
of such information.
Gary Herron
On Wed, May 14, 2008 at 12:25 AM, Gary Herron
<[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] wrote:
Hello!
I have trouble underst
h pass
through the loop, and unpack that.
for x in range(width):
fourbytes = pixelComponent[:4] # first 4 bytes
pixelComponent = pixelComponent[4:] # All but first four bytes
buffer = unpack("!f", fourbytes)
There are probably better wa
kind of question. Just try it!
>>> a = 'abcdefghi'
>>> b = a[:4]
>>> print a,b
abcdefghi abcd
Notice that the [:4] index does not change the original array.
Gary Herron
I'm getting weird results now..
-M
--
John Machin wrote:
On May 16, 2:11 am, Gary Herron <[EMAIL PROTECTED]> wrote:
Marlin Rowley wrote:
All:
I've got a script that runs really slow because I'm reading from a
stream a byte at a time:
// TERRIBLE
for y in range( height ):
for
help. I'd start by looking here:
http://wiki.python.org/moin/AdvocacyWritingTasks/GlueLanguage
Good luck,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Marlin Rowley wrote:
Gary,
I'm getting streaming tile data from a renderer in order to allow the
user to see the rendering of tiles in real-time to create the total
image. I'm NOT reading an entire image scanline-by-scanline. The
renderer streams in a series of floats (for each t
Marlin Rowley wrote:
Hey Gary!
Please keep such discussions on the public python-list -- not personal
e-mail.
Scroll down for an answer to your latest question.
Here's what I have that renders fine but I see some optimization that
can be done (as you mentioned):
# Tile Gener
OR: shred and rebuild the dictionary each time:
new_dict = {}
for pid,value in procs_dict.items():
if value.poll() != None:
# do the counter updates
pass
else:
new_dict[pid] = value
procs_dict = new_dict
Gary Herron
I know that I can
just /not/ delete from the dictionary a
, so yet
another solution would have to be found then.
Gary Herron
I'm afraid this will do the same exact thing. A for loop on a dict
iterates over the dict keys, so both statements are strictly
equivalent from a practical POV.
--
http://mail.python.org/mailman/listinfo/python-list
--
#x27;g', 'g'],
['b', 'b', 'b', 'b'],
['a', 'a', 'a', 'a']],
[['r', 'r', 'r', 'r'],
['g', 'g', 'g', 'g&
turns a "new view" of the
array. This explains why I copied the array before extracting bytes
out of it -- you really do need the elements in the new order for the
next operation.
Gary Herron
> Dat
Astan Chee wrote:
Hi,
Im trying to do glGenLists while a program is running and it keeps
returning 0 and whenever I try to do a glCallList, it fails with a
'invalid value' error.
Is this a known issue? why would my program give valid glGenList while
being initialized but not while it is runnin
to be:
[0,4,8,12][1,5,9,13]
[2,6,10,14][3,7,11,15]
[16,20,24,28][17,21,25,29]
[18,22,26,30][19,23,27,31]
How do I do this?
That's s little ambiguous, but one of the following two
transpose-reshape-print's might be what you want.
Gary Herron
import numpy
a = numpy.array([[[0,1,2,3],
[4,5,6
r[i-1]
!= c])
or, maybe clearer as two lines:
r = [c for i,c in enumerate(str) if not i or str[i-1] != c]
new_str = ''.join(r)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
again, and if it is not the
*exact* same problem, why are we seeing so many similar version of
it? It's starting to feel like a slight abuse of my time to see this
problem on the newsgroup again.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
A_H wrote:
Help!
I've scraped a PDF file for text and all the minus signs come back as
u'\xad'.
Is there any easy way I can change them all to plain old ASCII '-' ???
str.replace complained about a missing codec.
Hints?
Encoding it into a 'latin1' encoded string seems to work:
>>> pr
Gary Herron wrote:
A_H wrote:
Help!
I've scraped a PDF file for text and all the minus signs come back as
u'\xad'.
Is there any easy way I can change them all to plain old ASCII '-' ???
str.replace complained about a missing codec.
Hints?
Encoding it into
601 - 700 of 1014 matches
Mail list logo