Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-06 Thread Matt Ruffalo
On 2016-08-04 15:45, Random832 wrote: > On Thu, Aug 4, 2016, at 15:22, Malcolm Greene wrote: >> Hi Chris, >> >> Thanks for your suggestions. I would like to capture the specific bad >> codes *before* they get replaced. So if a line of text has 10 bad codes >> (each one raising UnicodeError), I woul

Re: All of a sudden code started throwing errors

2018-11-14 Thread Matt Wheeler
ntextmanager def pushd(path): old_dir = os.getcwd() os.chdir(path) try: yield finally: os.chdir(old_dir) ``` (I tend to just copy this into projects where I need it (or write it again), as a whole dependency for something so tiny seems like it would be overk

Re: Generators, generator expressions, and loops

2018-11-16 Thread Matt Wheeler
> On 16 Nov 2018, at 14:54, Steve Keller wrote: > More elegant are generator expressions but I cannot think of a way > without giving an upper limit: > >for i in (2 ** i for i in range(100)): >... > > which looks ugly. Also, the double for-loop (and also the two loops > in the

Python string with character exchange

2019-07-14 Thread Matt Zand
I am new to Python. I am trying to solve below Python question: Given a string, return a new string where the first and last chars have been exchanged. -- Cheers, Matt Zand Cell: 202-420-9192 Work: 240-200-6131 High School Technology Services <https://myhsts.org/> DC Web Makers

Re: Python string with character exchange

2019-07-15 Thread Matt Zand
Thanks Reto. I got it now. Matt On Sun, Jul 14, 2019 at 2:26 PM Reto wrote: > On Sun, Jul 14, 2019 at 12:20:56PM -0400, Matt Zand wrote: > > Given a string, return a new string where the first and last chars have > > been exchanged. > > This sounds awfully like a homework

Re: issue with regular expressions

2019-10-22 Thread Matt Wheeler
On Tue, 22 Oct 2019, 09:44 joseph pareti, wrote: > the following code ends in an exception: > > import re > pattern = 'Sottoscrizione unica soluzione' > mylines = []# Declare an empty list. with open ('tmp.txt', 'rt') as myfile: # Open tmp.txt for reading tex

Re: How to turn a defaultdict into a normal dict.

2020-06-16 Thread Matt Wheeler
t; >>> from collections import defaultdict > >>> d = defaultdict(list) > >>> d["x"] > [] > >>> d.default_factory = None > >>> d["y"] > Traceback (most recent call last): > File "", line 1, in > KeyE

Re: How to remove "" from starting of a string if provided by the user

2020-08-12 Thread Matt Wheeler
On Tue, 11 Aug 2020, 02:20 Ganesh Pal, wrote: > The possible value of stat['server2'] can be either (a) > "'/fileno_100.txt'" or (b) '/fileno_100.txt' . > > How do I check if it the value was (a) i.e string started and ended > with a quote , so that I can use ast.literal_eval() > BAFP > def ma

Re: list of dictionaries search using kwargs

2020-12-07 Thread Matt Wheeler
for item in self.data:     if all(item[k] == v for k,v in kwargs.items()):         return item Or return [item for item in self.data if all(item[k] == v for k,v in kwargs.items())] to return all matches Beware though that either of these will be slow if your list of dicts is large. If the list

Re: dict.get(key, default) evaluates default even if key exists

2020-12-15 Thread Matt Ruffalo
On 15/12/20 15:26, Grant Edwards wrote: > On 2020-12-15, Mark Polesky via Python-list wrote: > >> I see. Perhaps counterintuitive, > I guess that depends on what programming language you normally think > in. Python's handling of function parameters is exactly what I > expected, because all of the

Re: Is there any way to check/de-cruft/update Python packages installed using pip?

2020-12-29 Thread Matt Wheeler
On 29 Dec 2020, 14:48 +, Chris Green , wrote: > I seem to have quite a lot of old python packages installed over the > years using pip and would like, if I can. to clear some of them out. > > > Is there any way to tell if a python package was installed by me > directly using pip or was installe

Re: [OT] A Moronicity of Guido van Rossum

2005-10-02 Thread Matt Garrish
before... > Burns: I'm afraid it's not that simple. As punishment for your desertion, it's company policy to give you the plague. Smithers: Uh, sir, that's the plaque. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: morphological image processing in Python

2005-10-03 Thread Matt Feinstein
de these operations, nore do >Numeric/numarray/scipy. > >Have I missed the one true Python mathematical morphology toolbox? > >Thanks in advance for any advice. Actually, numarray does support morphological array operations. See the chapter on 'Multi-dimensional image processing

Re: Processing an image with numarray.nd image

2005-10-04 Thread Matt Feinstein
* import numarray.nd_image as Filter import PIL.Image as Image im = Image.open(file_name) array_dat = reshape(array(list(im.getdata())), im.size) filt_array_dat = Filter.correlate(array_dat, my_filter) et cetera... Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread's, async_chat and asyncore

2005-10-04 Thread Matt Hammond
ttp://kamaelia.sf.net/ ). There's some more introductory material and a tutorial or two which should give you a better idea about the system. We'd be interested to know what you think, and whether you think you could build your application using it. regards Matt -- | Matt Ha

Re: What is executed when in a generator

2005-10-04 Thread Matt Hammond
s less overheads, as it is not a true function call - stack frames etc are not having to be set up fully. Instead they are (presumably) set aside between calls to s.next() Hope this helps Matt -- | Matt Hammond | R&D Engineer, BBC Research & Development, Tadworth, Surrey, UK. | ht

Python script to install network printers

2005-10-04 Thread Matt Chan
Hi, I am trying to create a python script to install a set of network printers. I have had success using an os.popen statement, using rundll32 and printui.dll. This takes way too long. Can someone point me in a quicker direction? thanks, Matt -- http://mail.python.org/mailman/listinfo/python

Re: Python script to install network printers

2005-10-04 Thread Matt Darby
Matt Chan wrote: >Hi, I am trying to create a python script to install a set of network >printers. I have had success using an os.popen statement, using >rundll32 and printui.dll. This takes way too long. Can someone point >me in a quicker direction? > >thanks, >Matt >

Re: check html file size

2005-10-04 Thread Matt Garrish
"Xah Lee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > would anyone like to translate the following perl script to Python or > Scheme (scsh)? Even if you weren't an incredibly offensive and petulant poster, what makes you think anyone would wri

Re: Python Newbie

2005-10-05 Thread Matt Feinstein
What toolkit is best for Windows development? >2. Which toolkits can I exclude from consideration? >3. What toolkit is most popular for Windows development? >4. Are there any impartial reviews of these packages anywhere? You have to give us a clue about what you mean by 'be

_BLOCK_TYPE_IS_VALID error in MSVC 7.1 with Boost and Python

2005-10-05 Thread matt . keyes
Hey all, i'm trying to create an application that both embeds and extends python through boost. i've got a rough framework up and running, but now that i'm finally to the python part i'm having troubles. Here's a rough run-down of my code: Base class (pure): template InputHandler { public: /

Re: Jargons of Info Tech industry

2005-10-08 Thread Matt Garrish
thers that sneak through the gate. > > Good for you. If I do that, I lose some customers. Your private war is a > joke, and one day you'll wake up. What a waste of energy. > LOL! Maybe this inane thread can finally die now... Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-09 Thread Matt Garrish
eople are interested in your personal discussions of email? Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2005-10-10 Thread Matt Feinstein
I guess I could use a primer in >OO programming). > >Any ideas? http://diveintopython.org/ Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Hatred FAQ

2005-10-15 Thread Matt Garrish
n-hand. > People need to use the first, luckily both come bundled with the > latest PC people just need to buy right now. Iirc this is called > marketing, you don't seem to have much clue about. > Er, that's not called marketing but a software/hardware bundle. Marketing would be the propaganda that tries to convince you that you need both. When you have no option that's not marketing but a monopoly, which sort of brings this all full-circle... Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Hatred FAQ

2005-10-15 Thread Matt Garrish
arp standards so that people who design sites take advantage of the proprietary features. Eventually the hope is that your OS and browser will become the only means of accessing the internet. And if your OS and browser are the only way to access the Internet, who in their right mind would use another system? Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Hatred FAQ

2005-10-15 Thread Matt Garrish
"John Bokma" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Matt Garrish" <[EMAIL PROTECTED]> wrote: > >> Eventually the hope is that your OS and browser >> will become the only means of accessing the internet. And if your OS >

Re: Installing Python at Work

2005-10-17 Thread Matt Feinstein
which is checked when additional (binary) modules are installed. I don't think there's any other 'non-local' behavior. Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Hatred FAQ

2005-10-23 Thread Matt Garrish
at the expense of all competition (except Crown Corporations and the like, which are created (in theory, anyway) in the interest of general population as opposed to it). Your question here appears to be one of ethics. Is MS ethically bankrupt for pursuing business practices that run counte

Re: Microsoft Hatred FAQ

2005-10-23 Thread Matt Garrish
"David Schwartz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Matt Garrish" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> I'd be interested in hearing what you think a right is? > >A right

Re: Microsoft Hatred FAQ

2005-10-23 Thread Matt Garrish
"David Schwartz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Matt Garrish" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>>A right is a scope of authority. That is, a sphere within which one

Re: Microsoft Hatred FAQ

2005-10-23 Thread Matt Garrish
"Alan Connor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > /kooks/alanconnor.shtml Yeah, that pretty much sums it up... Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Addressing the last element of a list

2005-11-08 Thread Matt Hammond
gt; a = [5]; b = a >>> a[0] = 6 >>> a,b ([6], [6]) Note that reassigning a: >>> a = [6] causes a to point to a new list, containing the value 6, whereas the 2nd example above modified the list by replacing an element of it. Hope this helps Matt -- | Matt Hammond | R

Re: any python module to calculate sin, cos, arctan?

2005-11-08 Thread Matt Feinstein
point versions of these functions >check out: > >http://calcrpnpy.sourceforge.net/clnumManual.html Unless you're using Windows. Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Re: any python module to calculate sin, cos, arctan?

2005-11-08 Thread Matt Feinstein
On Tue, 08 Nov 2005 06:43:51 -0800, Robert Kern <[EMAIL PROTECTED]> wrote: >Matt Feinstein wrote: >> On Tue, 08 Nov 2005 12:30:35 GMT, "Raymond L. Buvel" >> <[EMAIL PROTECTED]> wrote: > >>>http://calcrpnpy.sourceforge.net/clnumManual.html >>

Re: which feature of python do you like most?

2005-11-09 Thread matt . schinckel
>>>I have no idea why people are so facinating with python. > Hey, I'm fascinating even without python! >And so modest, too :-) People as good as us usually are. -- http://mail.python.org/mailman/listinfo/python-list

Data Structure in Python like STL Stack?

2005-11-28 Thread Matt Keyes
Is there a data structure in Python that is akin to the STL stack object in C++?   Thanks!-- http://mail.python.org/mailman/listinfo/python-list

Re: Data Structure in Python like STL Stack?

2005-11-28 Thread Matt Keyes
I didn't know the list has a pop function - that is what I was looking for.   Thanks for the help![EMAIL PROTECTED] wrote: What property of the STL stack is important to you?You can use a Python list as a stack. It has methods append() andpop() which run in amortized-constant-time. It can be tested

Re: unicode support

2005-01-09 Thread Matt Garrish
cannot define a function with unicode char. So why are you posting to a Perl newsgroup? You can "use utf8" if you want to write your Perl programs in utf-8 (though you should upgrade to 5.8 as well). Or is this your lame attempt at trolling at python group? Matt -- http://mail.p

Re: a new Perl/Python a day

2005-01-09 Thread Matt Garrish
ble. (i started > it because i always wanted to switch to python but too lazy and always > falling back to a lang i am an expert at, but frustrated constantly by > its inanities and incompetences.) > What language are you an expert at? It certainly isn't Perl. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: web camera or else ? 15-30 fps processing of camera videos.

2005-02-01 Thread Matt D
Newbie wrote: I am doing some robotics projects but my main area of interest is trying out several algorithms for the processing of the stream of data coming from the video. Same for me! From what I can tell, a cheap webcam will "just work" with a recent version of windows - i.e. plug it in usin

noob question

2005-06-25 Thread Matt Hollingsworth
ill, I would like to see what other people do and what are some good ideas for this kind of thing. Thank you for any and all ideas. cheers, -Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Which kid's beginners programming - Python or Forth?

2005-06-28 Thread Matt Feinstein
y buzz-word compliant. If you want to teach your kid something that will a basis for learning anything about current practices in programming, teach him Python. Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ten Essential Development Practices

2005-07-30 Thread matt . schinckel
Dark Cowherd wrote: >> GUI, Web development, Application Framework - it is shambles. >Yeah, I agree. When I finally make that GUI application I still don't >know whether I am going to use wx or PyGTK. I was part of the anygui development team, back when it was still active (I think I technically

Re: Advanced concurrancy

2005-08-04 Thread Matt Hammond
f or other people want to play with alternative communication & blocking mechanisms. I'd hope that even if the components and postboxes model doesn't work out in the long run, the underlying generator based microprocesses code could still be of some value to others! regards Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Advanced concurrancy

2005-08-04 Thread Matt Hammond
Ooops! In case you're wondering who I am, I'm working on Kamaelia with Michael Sparks at the BBC. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Kamaelia 0.2.0 released!

2005-08-08 Thread Matt Hammond
for whatever purpose. The potential for component re-use might mean less work for us! :-) regards Matt Hammond -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Gotchas in user-space matplotlib install?

2005-08-09 Thread Matt Feinstein
take the plunge would be appreciated. TIA... Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Re: Advanced concurrancy

2005-08-09 Thread Matt Hammond
allow transparent distribution of components in a >network... ;-) > I'll second that! regards Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is this?

2005-08-10 Thread Matt Hammond
s B". >>>> [[]]*2 > [[], []] >>>> [[], []] == [[]]*2 > True Same effect. But try the 'is' operator, to see if they are actually the same instances of 'empty list': >>>> [[], []] is [[]]*2 > True Hope this helps ... its my first go at explaining this kind of stuff, so apologies if it isn't as clear as it could be! Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

PyOpenGL

2005-08-10 Thread matt . walsh
Hey I'm a programmer looking to port some of my opengl ...although limited into a python app I've made... I'd like to know where to find any python/opengl source or a tutorial etc.. whatever I'd like to get a series of points that represent a 3d slope presented to the user. T

Re: performance of recursive generator

2005-08-11 Thread Matt Hammond
o python it could optimise it away, eg: yield *inorder(t.left) ... but AFAIK there isn't :-( so I guess you'll have to avoid recursive generators for this app! Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is this?

2005-08-12 Thread Matt Hammond
> old) gives: Ooops - you're absolutely right. I was cutting and pasting, but it seems I was a little overzealous with my editing! I've still got that in my terminal's history buffer, and it does indeed read: >>> [[], []] is [[]]*2 False -- | Matt Hammond |

Re: Why is this?

2005-08-12 Thread Matt Hammond
tances. Suppose I do concatenate two of the same object instance, then I get the same behaviour as with the multiply example: >>> T = [[]] >>> L = T + T >>> L[1].append(1) >>> L [[1], [1]] In fact, you could argue this is exactly what the multiply operation

Re: Permutation Generator

2005-08-15 Thread Matt Hammond
yield [ list[i] ] + tail ... >>> for o in permute([1,2,3]): ... print o ... [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 1, 2] [3, 2, 1] regards Matt On Fri, 12 Aug 2005 20:48:38 +0100, Michael J. Fromberger <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTEC

Re: Gotchas in user-space matplotlib install?

2005-08-15 Thread Matt Feinstein
version of Tcl/Tk, the need for other widget sets became somewhat academic. For GTK, Fedora Core 1 is apparently so far behind current levels of GTK that it is pointless to complain. Wx is still a possibility. All in all, not actually excruciating-- and now I have a working version of matplotlib

Re: Gotchas in user-space matplotlib install?

2005-08-15 Thread Matt Feinstein
On Mon, 15 Aug 2005 09:02:57 -0500, John Hunter <[EMAIL PROTECTED]> wrote: >>>>>> "Matt" == Matt Feinstein <[EMAIL PROTECTED]> writes: > >Matt> All in all, not actually excruciating-- and now I have a >Matt> working version of matplot

Off-screen rendering in PyOpenGL?

2005-08-17 Thread Matt Feinstein
Poking around in the PyOpenGL tarball... I can see that the wrapper for the WGL pixel format function includes flags for rendering to a bitmap and for hardware acceleration... so maybe I could get hardware-accelerated off-screen rendering under win32.. but what about linux? Matt Feinstein

Re: up to date books?

2005-08-18 Thread Matt Darby
John Salerno wrote: >Also, are Python and Ruby similar languages? Which would be better to learn? > > Knowing both, they are very similar. Python seems to be more mature and has better support. Threading is easier in Ruby, while Python is more intuitive across the board. I really like both,

Problem (or even bug?) with Tkinter

2005-08-19 Thread Matt Hammond
bit. I've just tested it on a Win2k machine witih python 2.3 and can type into both Entry widgets. regards Matt --- #!/usr/bin/env python import Tkinter class ProblemGUI(object): def __init__(self): super(ProblemGUI, self).__init__() self.window = Tkinter.Tk()

Re: Problem (or even bug?) with Tkinter

2005-08-19 Thread Matt Hammond
Thanks for that. I've tested your script and it seems to have the same problem, so I'll post your example across in comp.lang.tcl as you suggest. Seems I'm running tcl/tk 8.4.9, and wish 8.4 cheers Matt > I suspect a bug at tcl level. So can you execute the follow

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
rogrammer and do not wish to get involved in classes > and objects If you're using Tcl/Tk you're already using them ... what do you think your Slider widget is? :-) Hope this helps! regards Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadwort

Re: Problem (or even bug?) with Tkinter

2005-08-22 Thread Matt Hammond
d a way to make Tk cooperate better with SCIM. As a workaround for SUSE Linux 10.0 I might just unset XMODIFIERS during Tk's startup, so that at least typing ASCII will work. Altering the XMODIFIERS environment variable as he suggested solved the problem. -- | Matt Hammond | R&

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
so it fulfills the task. Note that we're passing "Calc" (the function itself), not "Calc(...)" (the result of calling the function) regards Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
ts it requires regards Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert float to string ...

2005-08-23 Thread Matt Hammond
> How can i convert a float value into a string value? Try: string_value1 = str(float_value) + ' abc' or: string_value1 = repr(float_value) + ' abc' Type in an interactive python session. help(str) or: help(repr) regards Matt -- | Matt Hamm

Re: time.mktime problem

2005-08-30 Thread Matt Hammond
print t1, t2 -2208988799.0 -2208905776.0 >>> print t1-t2 -83023.0 Suse 9.3, python 2.4 (all 64bit) Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Yielding a chain of values

2005-08-31 Thread Matt Hammond
n expression too. x = yield in iterable Would behave like a list comprehension. x would be assigned a list containing the results of the successive yields. Equivalent to: x = [ yield r for r in iterable ] regards Matt -- | Matt Hammond | R&D Engineer, BBC Research and Developmen

Re: scroll a frame to display several lines of widgets at a time

2005-09-02 Thread Matt Hammond
d 5 rows at a time? If the > latter, can I just grid over the previous 5 or do they have to be > explicitly removed first. > > Thanks. > > Bill -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Bindings for Dirac, (sorta announcement)

2005-09-15 Thread Matt Hammond
pare them by following the instructions you'll find within comments in the example python program. regards Matt Hammond http://kamaelia.sf.net/ -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapper module for Linux shared lib

2005-09-16 Thread Matt Hammond
greg/python/Pyrex/ -- | Matt Hammond | R&D Engineer, BBC Research & Development, Tadworth, Surrey, UK. | http://kamaelia.sf.net/ | http://www.bbc.co.uk/rd/ -- http://mail.python.org/mailman/listinfo/python-list

Python installation root directory problem

2005-09-22 Thread Matt Leslie
registry, then reinstalled, and experienced the same effect. Does anyone have any ideas what this might be? Thanks, Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Python installation root directory problem

2005-09-22 Thread Matt Leslie
bug tracker. Matt "Matt Leslie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I am trying to install python 2.4.1 on a windows XP machine. Whether I > choose to install 'for me' or 'for all users, and no matter where I sel

Re: recommended way of generating HTML from Python

2005-02-21 Thread Matt Goodall
much better solution. They let you express HTML > in HTML directly; you > communicate with a designer in a language the designer understands; you can > separate content and > presentation. Agreed. Although I would go further and say that it's important to choose a t

Need some Python help

2005-02-24 Thread Matt Upton
Hello, I am new to Python and am trying to produce script to run batch processes for ArcGIS 9.0 (ArcView). I have upgraded to Phython 2.4 from 2.1 and am using the Pythonwin to try to code but am running into a problem. Whenever I try to debug my program or run any code past the following code i

how to handle repetitive regexp match checks

2005-03-17 Thread Matt Wette
else: error (In Scheme I was able to do this cleanly with macros.) Matt -- http://mail.python.org/mailman/listinfo/python-list

Python Win32 Silent Install

2004-12-01 Thread Matt Gerrans
just thought I'd see if anyone can point me in the right direction... - Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3000 and "Python Regrets"

2004-12-01 Thread Matt Gerrans
Anyway, what's to worry about?When the time comes just whip out a little script that converts Python 1.6 (or whatever you like) to Python3K; it will only take seven lines of P3K code. -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting String to Class

2004-12-01 Thread Matt Gerrans
You didn't specify exactly how the string is parsed, so this is a guess: class Thingy(object): def __init__(self,rawinfo): self.StructId, vq,self.ProcessName = rawinfo.split() self.Version,self.QName = vq.split('.') def __str__(self): return '' % (self.StructId, self.Versio

Re: Python Win32 Silent Install

2004-12-01 Thread Matt Gerrans
That sounds easy enough, but I imagine the Acive State package requires some kind of licensing.I'm pre-installing on millions of consumer PCs. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Win32 Silent Install

2004-12-01 Thread Matt Gerrans
thon Success Story book before OSCON 2004 in July and have since put it on the back burner.I need to take a little vacation from work, so I can finish that. - Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: installing 2.4

2004-12-03 Thread Matt Gerrans
"Peter Hansen" <[EMAIL PROTECTED]> wrote: > Only pure Python code can run without change on a newer interpreter. Is the interpreter smart enough to rebuild a pyc (if the corresponding py file is there of course) file that was built by a previous version? -- http://mail.python.org/mailman/list

Re: Calling a C program from a Python Script

2004-12-09 Thread Matt Gerrans
his: for root, files, dirs in os.walk(path) for f in files: try: os.system( "cprog %s" % (os.path.join(root,f) ) I prefer naming like this, though: for directory, filenames, subdirs in os.walk(startpath): for filename in filenames: ... (particularly,

Re: How can I change the timestamps of directories? (os.utime(), WinXP)

2004-12-09 Thread Matt Gerrans
Are you able change this directories attributes in a command shell or with explorer?If so, have you tried win32file.SetFileAttributes()? -- http://mail.python.org/mailman/listinfo/python-list

Zip with a list comprehension

2004-12-10 Thread Matt Gerrans
This is probably so easy that I'll be embarrassed by the answer. While enhancing and refactoring some old code, I was just changing some map()s to list comprehensions, but I couldn't see any easy way to change a zip() to a list comprehension.Should I just let those sleeping dogs lie? (li

Re: Newbie question - default values of a function

2004-12-22 Thread Matt Gerrans
Actually i was not mutable. Try this: i = 1 id(i) i += 1 id(i) Change both of your sample functions to also print the id of the default variable and that might shed a little more light on the matter. "i = i + 1" is only changing the local reference called i to refer to an instance of a diffe

Matplotlib question-- Numeric or numarray?

2005-04-08 Thread Matt Feinstein
Numeric. But there's only one current, unlabeled, windows installer and there seems to have been a change, some time back before version 0.7, in how this question is dealt with. Can someone clarify? thnksndvnc Matt Feinstein -- There is no virtue in believing something that can be proved to b

My stupid newbie mistake

2005-04-11 Thread Matt Feinstein
I named a file 'try.py' and then was stumped, for a while, when >>> import try gave a syntax error... So, how about a 'YouAreUsingAReservedWordStupid' exception ? Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- h

Re: goto statement

2005-04-20 Thread Matt Feinstein
On Wed, 20 Apr 2005 10:23:58 +0100 (BST), praba kar <[EMAIL PROTECTED]> wrote: >Dear All, > > In Python what is equivalent to goto statement I'd like to that implemented in an interpreted language. Requires some time travel. Matt Feinstein -- There is no virtue in beli

Re: Ron Grossi: God is not a man

2005-04-24 Thread Matt Hayden
And y'all obviously don't care what kind of acoustic guitar your god/gods/invisible cloud dwellers/space alien higher intelligence plays. Which is a slightly OT but otherwise generally on-topic post for this NG. Sad that you don't care about the important stuff. -- http://mail.python.org/ma

New versions of numarray?

2005-04-25 Thread Matt Feinstein
Hi-- I notice that there are some new versions of numarray available for download-- is there any documentation on what's new/fixed/broken? Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Re: Which IDE is recommended?

2005-04-27 Thread Matt Feinstein
lations with numerical arrays and plotting with Matplotlib, then ipython is the right choice-- it has a special 'pylab' mode that is Matplotlib-aware, allowing you to make plots interactively (as well as various other useful features). Matt Feinstein -- There is no virtue in believi

Re: Ron Grossi: God is not a man

2005-04-27 Thread Matt Hayden
Johnny Gentile wrote: > C'mon. Everyone knows God plays a Martin. I dunno. I think God has a honkin' big collection so he won't offend ANY luthiers when they come to visit. SOMEONE has to set up his guitars... mh -- http://mail.python.org/mailman/listinfo/python-list

Jabberbot

2013-11-13 Thread Matt Graves
I'm using the jabberbot library and there is not a whole lot of documentation on it. Does anyone have experience with this library? This is basically the only example given: - from jabberbot import JabberBot, botcmd import datetime class SystemInfoJabberBot(JabberBot):

Re: Jabberbot

2013-11-13 Thread Matt Graves
On Wednesday, November 13, 2013 11:32:24 AM UTC-5, Mark Lawrence wrote: > On 13/11/2013 16:12, Matt Graves wrote: > > > I'm using the jabberbot library and there is not a whole lot of > > documentation on it. Does anyone have experience with this library? > > >

Downloading file

2013-12-12 Thread Matt Graves
I have direct links to a number of csv files to download. Copying and pasting it to my browser would take too long, how would i go to this site for example and get the file? Right when you go to the site the download should start www.example.com/files/document.csv -- https://mail.python.org/mai

Downloading multiple files based on info extracted from CSV

2013-12-12 Thread Matt Graves
I have a CSV file containing a bunch of URLs I have to download a file from for clients (Column 7) and the clients names (Column 0) I tried making a script to go down the .csv file and just download each file from column 7, and save the file as [clientname].csv I am relatively new to python, so

Re: Downloading multiple files based on info extracted from CSV

2013-12-16 Thread Matt Graves
On Thursday, December 12, 2013 5:20:59 PM UTC-5, Chris Angelico wrote: > import urllib > > import csv > > > > # You actually could get away with not using a with > > # block here, but may as well keep it for best practice > > with open('clients.csv') as f: > > for client in csv.reader(f

need to print seconds from the epoch including the millisecond

2013-12-26 Thread matt . doolittle33
i am using 2.7. I need to print the time in seconds from the epoch with millisecond precision. i have tried many things but have failed. heres my latest: from time import time, strftime from datetime import datetime, time # write date, time, then seconds from epoch

Re: need to print seconds from the epoch including the millisecond

2013-12-26 Thread matt . doolittle33
On Thursday, December 26, 2013 2:22:10 PM UTC-5, Dan Stromberg wrote: > On Thu, Dec 26, 2013 at 10:32 AM, wrote: > > > i am using 2.7. I need to print the time in seconds from the epoch with > > millisecond precision. i have tried many things but have failed. heres my > > latest: > > > >

<    1   2   3   4   5   6   7   8   >