On Sun, 26 Jan 2014 23:17:29 -0800, Ethan Furman wrote:
> On 01/26/2014 10:46 PM, me wrote:
>>
>> [...] I'm satisfied that the except: syntax yields undefined behavior,
>> and in my mind it shouldn't be
>> syntactically allowed then.
>
> Two points:
>
>1) Python is not C++
>
>2) You a
On 01/26/2014 10:46 PM, me wrote:
[...] I'm satisfied that the except: syntax yields
undefined behavior, and in my mind it shouldn't be
syntactically allowed then.
Two points:
1) Python is not C++
2) You asked for help; you received it. Coming back
with an attitude of "Python mus
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On behalf of the Python development team, I'm reasonably happy to announce the
Python 3.3.4 release candidate 1.
Python 3.3.4 includes several security fixes and over 120 bug fixes compared to
the Python 3.3.3 release.
This release fully supports OS
On Sun, 26 Jan 2014 23:12:18 -0800, Gary Herron wrote:
> On 01/26/2014 10:46 PM, me wrote:
>> In any case, thanks for the answers guys. I'm satisfied that the
>> except:
>> syntax yields undefined behavior, and in my mind it shouldn't be
>> syntactically allowed then.
>>
>> Updating to Exception,
On 01/26/2014 10:42 PM, me wrote:
My point of contention isn't so much about what specific syntax I should
be using as much as it is about being allowed to use a syntax that gives
erroneous results without triggering a syntax violation. If the bare
except: clause is syntactically legal then it
On Sun, 26 Jan 2014 23:03:51 -0800, Gary Herron wrote:
found the part I was missing based on another response. Didn't realize
that sys.exit() triggered an instance of "BaseException" and that
explains the weird behavior.
thx!
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 27 Jan 2014 00:47:13 -0600, Zachary Ware wrote:
> You've missed the point here. sys.exit() *does* raise an exception:
> SystemExit, a subclass of BaseException. In fact, you can implement
> sys.exit in pure Python like so:
>
> def exit(status):
> raise SystemExit(status)
>
> Your b
On 01/26/2014 10:46 PM, me wrote:
In any case, thanks for the answers guys. I'm satisfied that the except:
syntax yields undefined behavior, and in my mind it shouldn't be
syntactically allowed then.
Updating to Exception,e or Exception as e fixes the problem.
That's an irksome habit you hav
On 01/26/2014 10:17 PM, me wrote:
On Sun, 26 Jan 2014 21:04:57 -0800, Gary Herron wrote:
Never *ever* have a bare except like that. If it gets invoked, you have
no idea why. A simple typo like ixd instead of idx or a(idx) instead
of a[idx] would raise an exception but give you no idea why.
On Mon, Jan 27, 2014 at 12:46 AM, me wrote:
>
> In any case, thanks for the answers guys. I'm satisfied that the except:
> syntax yields undefined behavior, and in my mind it shouldn't be
> syntactically allowed then.
It's not undefined, though; it is explicitly defined. See my other
message, a
In any case, thanks for the answers guys. I'm satisfied that the except:
syntax yields undefined behavior, and in my mind it shouldn't be
syntactically allowed then.
Updating to Exception,e or Exception as e fixes the problem.
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, Jan 27, 2014 at 12:02 AM, me wrote:
> On Mon, 27 Jan 2014 00:36:20 -0500, Dave Angel wrote:
>
>> sys.exit() raises an exception, and you're deliberately eating
>> that exception.
>>
>
> I can buy that sys.exit (may) be throwing an exception...My point of
> contention isn't that I may be
On Mon, 27 Jan 2014 01:21:41 -0500, Terry Reedy wrote:
> On 1/27/2014 12:04 AM, Gary Herron wrote:
>
>> Do
>>try:
>>...
>>except Exception,e:
>>print e
>> at the absolute minimum.
>> (Python 3 syntax would differ slightly, but the advice is the same.)
>
> The 'python 3' s
On 1/26/2014 8:46 PM, Skip Montanaro wrote:
I think an interactive pylint (or pyflakes or frosty) type capability
would be useful, highlighting a subset of the messages it produces,
like variables which were assigned but never used, or using undefined
variables. It might be best supported by act
On 1/26/2014 8:29 PM, Steven D'Aprano wrote:
On Sun, 26 Jan 2014 18:31:49 -0600, Skip Montanaro wrote:
My son sent me a link to an essay about highlighting program data
instead of keywords:
https://medium.com/p/3a6db2743a1e/
I think this might have value, especially if to could bounce back an
On behalf of the Python development team, I'm quite pleased to announce
the third beta release of Python 3.4.
This is a preview release, and its use is not recommended for
production settings.
Python 3.4 includes a range of improvements of the 3.x series, including
hundreds of small improvemen
On 1/27/2014 12:04 AM, Gary Herron wrote:
Do
try:
...
except Exception,e:
print e
at the absolute minimum.
(Python 3 syntax would differ slightly, but the advice is the same.)
The 'python 3' syntax
except Exception as e:
works in 2.7 and perhaps 2.6. So use it unless you
On Sun, 26 Jan 2014 21:04:57 -0800, Gary Herron wrote:
>
> Never *ever* have a bare except like that. If it gets invoked, you have
> no idea why. A simple typo like ixd instead of idx or a(idx) instead
> of a[idx] would raise an exception but give you no idea why.
>
> Do
>try:
>..
On Mon, 27 Jan 2014 00:36:20 -0500, Dave Angel wrote:
> sys.exit() raises an exception, and you're deliberately eating
> that exception.
>
I can buy that sys.exit (may) be throwing an exception...My point of
contention isn't that I may be throwing one, but why would a subsequent
"raise" in t
me Wrote in message:
> I'm writing a linux daemon in python 2.x to process batches of GPS/GIS
> data and I'm running into something that seems to break the expected
> program flow in a REALLY BAD WAY.
>
> Consider the attached template script and execute it with the -h option.
> It is fallin
matt.s.maro...@gmail.com Wrote in message:
> School assignment is to create a tab separated output with the original given
> addresses in one column and then the addresses split into other columns (ex,
> columns for city, postal code, street suffix).
>
> Here is my code:
>
> inHandler = open(i
On 01/26/2014 07:42 PM, me wrote:
I'm writing a linux daemon in python 2.x to process batches of GPS/GIS
data and I'm running into something that seems to break the expected
program flow in a REALLY BAD WAY.
Consider the attached template script and execute it with the -h option.
It is falling t
School assignment is to create a tab separated output with the original given
addresses in one column and then the addresses split into other columns (ex,
columns for city, postal code, street suffix).
Here is my code:
inHandler = open(inFile, 'r')
outHandler = open(outFile, 'w')
outHandler.wri
I'm writing a linux daemon in python 2.x to process batches of GPS/GIS
data and I'm running into something that seems to break the expected
program flow in a REALLY BAD WAY.
Consider the attached template script and execute it with the -h option.
It is falling through to the except: clause eve
On Sunday, 26 January 2014 21:00:35 UTC-5, Jason Friedman wrote:
> I`m not reading and writing to the same file, I just changed the actual paths
> to directory.
>
>
>
> This is for a school assignment, and we haven`t been taught any of the stuff
> you`re talking about. Although I appreciate
In article ,
Chris Angelico wrote:
> That said, though, I grew up without syntax highlighting of any sort,
> and didn't think it particularly important; but now that I have
> editors with all those sorts of features, I do find them handy.
Same here, except I'd replace "find them handy" with "to
Steven D'Aprano writes:
> Hmmm, I'm not convinced, but then I wasn't convinced by syntax
> highlighting either until I had used it for a while. (I still think
> it's a nice-to-have rather than a must-have.)
I wouldn't rate syntax highlighting a must-have. But I do think it's
significantly more d
>
> I`m not reading and writing to the same file, I just changed the actual
> paths to directory.
>
> This is for a school assignment, and we haven`t been taught any of the
> stuff you`re talking about. Although I appreciate your help, everything
> needs to stay as is and I just need to create the
On Sunday, 26 January 2014 20:56:01 UTC-5, Chris Angelico wrote:
> On Mon, Jan 27, 2014 at 12:15 PM, wrote:
>
> > I`m not reading and writing to the same file, I just changed the actual
> > paths to directory.
>
>
>
> For next time, say "directory1" and "directory2" to preserve the fact
>
On Mon, Jan 27, 2014 at 12:15 PM, wrote:
> I`m not reading and writing to the same file, I just changed the actual paths
> to directory.
For next time, say "directory1" and "directory2" to preserve the fact
that they're different. Though if they're file names, I'd use "file1"
and "file2" - call
> What it is doing is color coding user-supplied identifiers, with different
> color for each one. I found that confusing to read.
I think it would take some time to get used to, and I don't think it
would be the only way I'd like to view my program.
I think an interactive pylint (or pyflakes or
On Mon, Jan 27, 2014 at 12:29 PM, Steven D'Aprano
wrote:
> Hmmm, I'm not convinced, but then I wasn't convinced by syntax
> highlighting either until I had used it for a while. (I still think it's
> a nice-to-have rather than a must-have.)
It's definitely just a nice-to-have. I've built miniature
On Sun, 26 Jan 2014 18:31:49 -0600, Skip Montanaro wrote:
> My son sent me a link to an essay about highlighting program data
> instead of keywords:
>
> https://medium.com/p/3a6db2743a1e/
>
> I think this might have value, especially if to could bounce back and
> forth between both schemes.
Hmm
On Sunday, 26 January 2014 19:40:26 UTC-5, Steven D'Aprano wrote:
> On Sun, 26 Jan 2014 13:46:21 -0800, matt.s.marotta wrote:
>
>
>
> > I have been working on a python script that separates mailing addresses
>
> > into different components.
>
> >
>
> > Here is my code:
>
> >
>
> > inFile
On Mon, Jan 27, 2014 at 11:51 AM, Chris Angelico wrote:
> On Mon, Jan 27, 2014 at 11:46 AM, Terry Reedy wrote:
>> The only use I can see for this is to track the usage of a particular name,
>> but that would be better done by just highlighting one name at a time.
>
> In SciTE, I can put the curso
On Mon, Jan 27, 2014 at 11:46 AM, Terry Reedy wrote:
> The only use I can see for this is to track the usage of a particular name,
> but that would be better done by just highlighting one name at a time.
In SciTE, I can put the cursor on a word and hit Ctrl-F3 to find other
instances of that word
On 1/26/2014 7:31 PM, Skip Montanaro wrote:
My son sent me a link to an essay about highlighting program data
instead of keywords:
https://medium.com/p/3a6db2743a1e/
What it is doing is color coding user-supplied identifiers, with
different color for each one. I found that confusing to read.
On Sun, 26 Jan 2014 13:46:21 -0800, matt.s.marotta wrote:
> I have been working on a python script that separates mailing addresses
> into different components.
>
> Here is my code:
>
> inFile = "directory"
> outFile = "directory"
> inHandler = open(inFile, 'r')
> outHandler = open(outFile, 'w')
My son sent me a link to an essay about highlighting program data instead
of keywords:
https://medium.com/p/3a6db2743a1e/
I think this might have value, especially if to could bounce back and forth
between both schemes. Is anyone aware of tools like this for Python? Bonus
points for pointers to a
On Sunday, 26 January 2014 18:44:16 UTC-5, Jason Friedman wrote:
> outHandler.write("FarmID\tAddress\tStreetNum\tStreetName\tSufType\tDir\tCity\tProvince\tPostalCode")
>
>
>
> ...
>
> FarmID Address
>
> 1 1067 Niagara Stone Rd, Niagara-On-The-Lake, ON L0S 1J0
>
> 2 4260 Mountai
ThanK you. It solved my problem.
Can someone tell me how can i print particular value inside list of key.
I know how to print J['PC2'][1] means will print IP. but I want the user to
input some element and I will print element just before that element.
e.g. if user inputs 192.168.0.2, program wil
On Sun, 26 Jan 2014 17:30:21 -0500, Luis Marsano wrote:
> I've installed python for all users with full permissions to all users
> (see picture).
> Python runs for all users.
> However, scripts only work when I run as Administrator. Running a script
> always results in an "ImportError: cannot impo
>
>
> outHandler.write("FarmID\tAddress\tStreetNum\tStreetName\tSufType\tDir\tCity\tProvince\tPostalCode")
>
> ...
> FarmID Address
> 1 1067 Niagara Stone Rd, Niagara-On-The-Lake, ON L0S 1J0
> 2 4260 Mountainview Rd, Lincoln, ON L0R 1B2
> 3 25 Hunter Rd, Grimsby, ON L3M 4A3
> 4
On 2014-01-26 21:46, matt.s.maro...@gmail.com wrote:
I have been working on a python script that separates mailing addresses into
different components.
Here is my code:
inFile = "directory"
outFile = "directory"
inHandler = open(inFile, 'r')
outHandler = open(outFile, 'w')
Shouldn't you be w
mick verdu wrote:
What I want is if host already exists it would
overwrite otherwise add to database. And if host doesn't exist it will first
add this host to database and then compare its IP with IPs of rest of hosts.
If ip matches with any of the other hosts, it will delete the host that it
jus
I've installed python for all users with full permissions to all users
(see picture).
Python runs for all users.
However, scripts only work when I run as Administrator.
Running a script always results in an "ImportError: cannot import name" error.
Here, for example, is the output of "pip -h" run as
On 26/01/2014 21:46, matt.s.maro...@gmail.com wrote:
I have been working on a python script that separates mailing addresses into
different components.
Here is my code:
inFile = "directory"
outFile = "directory"
inHandler = open(inFile, 'r')
outHandler = open(outFile, 'w')
outHandler.write("Fa
I have been working on a python script that separates mailing addresses into
different components.
Here is my code:
inFile = "directory"
outFile = "directory"
inHandler = open(inFile, 'r')
outHandler = open(outFile, 'w')
outHandler.write("FarmID\tAddress\tStreetNum\tStreetName\tSufType\tDir\tCi
On 26/01/2014 20:28, mick verdu wrote:
I have programming course and trying to learn things. This is of no human use.
I am just following exercises. Just have to do steps as asked.
A slightly OT observation... Mick, consider using more meaningful names
than t,z etc. You know what they stand
On Sun, 26 Jan 2014 10:47:11 -0800, mick verdu wrote:
> z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'],
> 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'], 'PC1':
> ['01:01:01:01:01:01', '192.168.0.1', '200'] }
>
> My solution:
>
> z=raw_input("Enter Host, Mac, ip and time")
>
I have programming course and trying to learn things. This is of no human use.
I am just following exercises. Just have to do steps as asked.
--
https://mail.python.org/mailman/listinfo/python-list
@Peter Otten:
I have lists for keys. What I want is if host already exists it would overwrite
otherwise add to database. And if host doesn't exist it will first add this
host to database and then compare its IP with IPs of rest of hosts. If ip
matches with any of the other hosts, it will delete
On 2014-01-26 10:47, mick verdu wrote:
> z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'],
> 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'],
> 'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200'] }
>
> My solution:
>
> z=raw_input("Enter Host, Mac, ip and time")
> t=z.split()
> t[
mick verdu wrote:
> z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'],
> 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'],
> 'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200'] }
>
> My solution:
>
> z=raw_input("Enter Host, Mac, ip and time")
> t=z.split()
> t[0]=z[1:]
> for key i
On 2014-01-26 12:15, Roy Smith wrote:
> > The set [A-z] is equivalent to
> > [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz]
>
> I'm inclined to suggest the regex compiler should issue a warning
> for this.
>
> I've never seen a character range other than A-Z, a-z, or 0-9.
> Well,
z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'],
'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'],
'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200'] }
My solution:
z=raw_input("Enter Host, Mac, ip and time")
t=z.split()
t[0]=z[1:]
for key in dic:
if t[2] in dic[key]:
On 26/01/2014 17:25, Chris Angelico wrote:
On Mon, Jan 27, 2014 at 4:15 AM, Roy Smith wrote:
In article ,
Chris Angelico wrote:
The set [A-z] is equivalent to
[ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz]
I'm inclined to suggest the regex compiler should issue a warning f
On 26/01/2014 17:15, Blake Adams wrote:
On Sunday, January 26, 2014 12:08:01 PM UTC-5, Chris Angelico wrote:
On Mon, Jan 27, 2014 at 3:59 AM, Blake Adams wrote:
If I want to set up a match replicating the '\w' pattern I would assume that
would be done with '[A-z0-9_]'. However, when I run t
On Mon, Jan 27, 2014 at 4:15 AM, Roy Smith wrote:
> In article ,
> Chris Angelico wrote:
>
>> The set [A-z] is equivalent to
>> [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz]
>
> I'm inclined to suggest the regex compiler should issue a warning for
> this.
>
> I've never seen a ch
On Sunday, January 26, 2014 12:08:01 PM UTC-5, Chris Angelico wrote:
> On Mon, Jan 27, 2014 at 3:59 AM, Blake Adams wrote:
>
> > If I want to set up a match replicating the '\w' pattern I would assume
> > that would be done with '[A-z0-9_]'. However, when I run the following:
>
> >
>
> > re.f
On Sunday, January 26, 2014 12:06:59 PM UTC-5, larry@gmail.com wrote:
> On Sun, Jan 26, 2014 at 9:59 AM, Blake Adams wrote:
>
> > Im pretty new to Python and understand most of the basics of Python re but
> > am stumped by a unexpected matching dynamics.
>
> >
>
> > If I want to set up a m
In article ,
Chris Angelico wrote:
> The set [A-z] is equivalent to
> [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz]
I'm inclined to suggest the regex compiler should issue a warning for
this.
I've never seen a character range other than A-Z, a-z, or 0-9. Well, I
suppose A-F
On Mon, Jan 27, 2014 at 3:59 AM, Blake Adams wrote:
> If I want to set up a match replicating the '\w' pattern I would assume that
> would be done with '[A-z0-9_]'. However, when I run the following:
>
> re.findall('[A-z0-9_]','^;z %C\@0~_') it matches ['^', 'z', 'C', '\\', '0',
> '_']. I woul
On Sun, Jan 26, 2014 at 9:59 AM, Blake Adams wrote:
> Im pretty new to Python and understand most of the basics of Python re but am
> stumped by a unexpected matching dynamics.
>
> If I want to set up a match replicating the '\w' pattern I would assume that
> would be done with '[A-z0-9_]'. How
On 26/01/2014 16:35, Martin Schöön wrote:
Today I stumbled upon www.siafoo.net when looking for
tutorials on reStructured Text today.
It looks like it could be good place to hang out to
pick up programming skills (I am not in the positions
help others, yet), is it?
/Martin
"Have an unfortuna
Im pretty new to Python and understand most of the basics of Python re but am
stumped by a unexpected matching dynamics.
If I want to set up a match replicating the '\w' pattern I would assume that
would be done with '[A-z0-9_]'. However, when I run the following:
re.findall('[A-z0-9_]','^;z %
Today I stumbled upon www.siafoo.net when looking for
tutorials on reStructured Text today.
It looks like it could be good place to hang out to
pick up programming skills (I am not in the positions
help others, yet), is it?
/Martin
--
https://mail.python.org/mailman/listinfo/python-list
On Sunday, January 26, 2014 2:42:57 PM UTC+5:30, Frank Millman wrote:
> "Rustom Mody" wrote:
> > Xml, originally a document format, is nowadays used as a data-format.
> > This conduces to humongous messing, first for the xml-library writers, and
> > thence to the users of those libraries because l
Le 26/01/14 09:05, Peter Otten a écrit :
Please remember to cut and past the traceback next time.
What is wrong?
My crystal ball says that you have a
from __future__ import unicode_literals
statement at the beginning of the module. If I'm right try
row[b"filename"]
Thanks a lot for you
On 2014-01-26 02:46, ngangsia akumbo wrote:
> Is it possible to write cartoon with 3D images using python?
>
> If yes , please locate me some resources. thank
Check out Blender which can be scripted using Python.
-tkc
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 26 Jan 2014 08:03:18 +0200, Frank Millman wrote:
> I do not expect anyone to read or edit the XML - it is just a storage
> format. I am sure it could be done in JSON or YAML as well.
But that's not what you originally said. You stated:
"here is how I would write your simple 'About' box"
On Sun, 26 Jan 2014 15:06:15 +1100, Chris Angelico wrote:
> Code isn't something to be afraid of.
Not according to the Laundry series by Charles Stross. The protagonist of
the series was "recruited" to the Laundry after the computer program he
was working on almost summoned Nyarlathotep the Cr
On Sunday, January 26, 2014 11:55:34 AM UTC+1, Mark Lawrence wrote:
> On 26/01/2014 10:46, ngangsia akumbo wrote:
>
>
>
> What have you done to locate resources for yourself?
I have searched but not found something very clear. That is why i asked.
--
https://mail.python.org/mailman/listinfo/p
On 26/01/2014 10:46, ngangsia akumbo wrote:
Is it possible to write cartoon with 3D images using python?
If yes , please locate me some resources. thank
What have you done to locate resources for yourself?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can
Is it possible to write cartoon with 3D images using python?
If yes , please locate me some resources. thank
--
https://mail.python.org/mailman/listinfo/python-list
"Rustom Mody" wrote in message
news:3683cd10-592b-4a3d-ba77-b963a1aa2...@googlegroups.com...
>
> Xml, originally a document format, is nowadays used as a data-format.
> This conduces to humongous messing, first for the xml-library writers, and
> thence to the users of those libraries because lib
On Sunday, January 26, 2014 10:53:32 AM UTC+5:30, Chris Angelico wrote:
> On Sun, Jan 26, 2014 at 3:47 PM, Rustom Mody wrote:
> > On Sunday, January 26, 2014 9:36:15 AM UTC+5:30, Chris Angelico wrote:
> >> Code isn't something to be afraid of. It's just text files like any
> >> other. After all, Py
lgabiot wrote:
> using Python 2.7.6
>
> I try to access a sqlite database using keyword lookup instead of
> position (much more easy to maintain code), but it always fail, with the
> error:
> Index must be int or string
>
> I have created the database, populated it, and here is the code that
> t
78 matches
Mail list logo