led successfully.
Is your web server using Python 2 or Python 3 to execute WSGI?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies&quo
whack-job newsgroups that would love to
> discuss that aspect of it.
Sounds like the plot to the latest Kingsman movie.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
te column.
Without this screenshot, we would have had only the user's (incorrect)
assertion that the file existed, and no way to diagnose the true issue.
Granted, this was an environment issue and not a code issue, but I can
imagine situations where the same sort of thing could apply t
In <151517608506.368831.5093080329614058603@welt.netz> "Kim of K."
writes:
> print(emo('now you see emos'))
> OF COURSE THIS SHIT DOES NOT WORK.
What device did you run this on? Your average terminal window isn't
going to support emojis...
--
John
hy should software be any different?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
r
> So "text" seems to be a string. Why does json.loads return an error?
Because, although text is the right type, it does not contain a
valid json string.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by b
much less frequently.)
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
200)]
[100, 101, 102, 103, 104, 200, 201, 202, 203, 204]
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
u actually mean that *you* want to select a value in
your code?
I could go on, but you get my point. We need lots more information
before we can even begin to help you.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com
= groupkey[tuple([0,3])] + [[0,1]]
The right-hand side of your expression is rightly complaining that
groupkey[(0,3)] doesn't exist.
Would you expect to say
a = a + 1
When a doesn't exist? Your code tries to do much the same thing.
--
John Gordon A is for Am
rl in the loop?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
conn = psycopg2.connect(cstr)
return conn.cursor()
def updatedb(dbtype):
db = dbconnect(dbtype)
db.execute("DML code")
print "updated " + dbtype
'close connection
It would probably be even better to return conn, as that would allow
upda
ndividually, so I would think
> the order of the dict's fields does not matter since you'd manually
> specify each field's data.
The original example used a loop to get all of the dict fields and
add them to the GUI, instead of adding each field individually.
--
John Gord
> > end_date = start_date + relativedelta(months=delta_period) +
> > timedelta(days=-delta_period)
> Where do you define 'delta_period', and what is your question?
There is no question; it is an answer in response to the original
post asking how to add months to a datet
e interactive, you could require that the user
supply a file in the current directory containing the username and
password.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edw
hen all
> programs will be started on the same virtual desktop and I want to
> start them on different ones.
The window manager doesn't allow you to specify a target desktop? That
seems like a pretty heinous feature omission.
--
John Gordon A is for Amy, who fell down the s
lt-in facilities for starting
programs would be better. Why are you using Python instead?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashl
In Gregory Ewing
writes:
> Once you're in the clutches of Apple, there is no Escape.
Ha!
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "Th
Python. How can this problem be fixed?
When does the error occur? During installation? Or after installation
when you're trying to run a python program?
What version of Windows do you have?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B
ever one you prefer. self.class_attr may be more
convenient because you don't have to provide a specific class name.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey,
responding to expected patterns in their output.
Pexpect allows your script to spawn a child application and control it
as if a human were typing commands.
https://pexpect.readthedocs.io/en/stable/
--
John Gordon A is for Amy, who fell down the stairs
gor...@pa
ERROR No file named '$HOME/file.txt'
vi $(grep -l foo *.txt) ERROR No file named '$(grep -l foo *.txt)'
None of these commands would work if bash didn't "alter the input going to
another program".
--
John Gordon A is for Amy, who fell
(r.content)
You're using http: instead of https:, and you're using ?katty instead
of ?name=katty, and therefore the host does not recognize your request
as an API call and redirects you to the normal webpage.
--
John Gordon A is for Amy, who fell down the
",
> "with several strings",
> "as a demo"
> ]'
json.dumps() has an 'indent' keyword argument, but I believe it only
enables indenting of each whole element, not individual members of a list.
Perhaps somet
name; you could have
called it "hamburger" and python would treat it just the same.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
oesn't use pickle format, so your reader program would have to
be modified to read this format. And you'll run into the same problem if
the reader expects to keep all the data in memory.
--
John Gordon A is for Amy, who fell down the st
In John Gordon writes:
> In
> mike.rei...@gmail.com writes:
> with open("json.dat", "r") as fp:
> data = json.load(fp)
> for item in data:
> if item['name'] == 'myField2':
Oops, that should be 'm
value.
That data looks like a list of dictionaries:
import json
with open("json.dat", "r") as fp:
data = json.load(fp)
for item in data:
if item['name'] == 'myField2':
print item['id']
-
object has no attribute 'modlist'
>>> ldap.dn
>>> import ldap.modlist
>>> ldap.modlist
Why the difference?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
In <6e030fd0-93c1-4d23-8656-e06c411b6...@googlegroups.com> chris alindi
writes:
> simple while loop range(10) if user press esc exits loop
range() is typically used with for loops, not while loops.
what is your while condition?
what use is the range() value?
--
Jo
Then I ran it:
> ~$ python test.py argument1 argument2
> ['test.py', 'argument1', 'argument2']
Options cannot be passed *on the hash-bang line*.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basi
In <8500044a-c8d1-43ad-91d9-e836d52bd...@googlegroups.com> SS
writes:
> I would like to be able to handle that error a bit better. Any ideas?
Wrap the socket.gethostbyname() call in a try/except block.
--
John Gordon A is for Amy, who fell down the stairs
gor...@
In <9d24f23c-b578-4029-ab80-f117599e2...@googlegroups.com> Sayth Renshaw
writes:
> So why can't i assign the result slice to a variable b?
Because shuffle() modifies the list directly, and returns None.
It does NOT return the shuffled list.
--
John Gordon A i
le(a)
> print(b[:3])
> For example here i just want to slice the first 3 numbers which should
> be shuffled. However you can't slice a noneType object that b becomes.
> So how do i get shuffle to give me my numbers?
a = [1,2,3,4,5]
shuffle(a)
print(a[:3])
--
John Gord
omething which runs
locally on your computer, such as Microsoft Word or a game.
But Django is for building websites, not local applications.
So Django probably isn't what you want.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for B
ed that they were all fairly short,
none more than 80 pages or so. I suspect these books are somewhat lighter
fare than the typical O'Reilly tome.
Not necessarily a bad thing, but worth mentioning.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com
In <622ea3b0-88b4-420b-89e0-9e7c6e866...@googlegroups.com> Doug OLeary
writes:
> >>> from lxml import etree
> >>> doc =3D etree.parse('config.xml')
> Now what? For instance, how do I list the top level children of
> ?
root = doc.getroot()
for
(0)
Or, if you really want to use a list comprehension:
[f.append(0) for f in fups if len(f) < 5]
However there's no reason to use a list comprehension here. The whole
point of list comprehensions is to create a *new* list, which you don't
appear to need; you just need to modify
thing; it modifies the existing list in-place.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
sented as a string*. The same is
not true for integers.
* Okay, python 2.7 does have some issues with Unicode.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Go
controls whether new pages
are opened in a new tab or a new window. Perhaps that is your issue?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gash
has been mutated in the very statement that
> you are quoting
No. An entirely new tuple is created, and 'a' is rebound to it. The
existing tuple is not mutated.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assa
fine even if group doesn't exist,
> It always says that user is member of
The query returns a user who is not a member of the named group?
That's odd.
What is the search base and scope?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com
particular group
Do the same search as above, returning the "member" attribute. Get
the search result and then inspect the list of returned members.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for
default logging format; it's used when you haven't supplied any
format of your own. The snippet of xlreader.py does not define any format,
so it seems like that's where it's coming from.
(This seems pretty straightforward; am I missing something?)
--
John Gordon
for x in newlist:
print(x)
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
return results['ID']
else:
return 'something else'
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tin
27;??
It loops through the child items in entry, looking for one with a
'key' value of 'Track ID'. If it finds one, it sets found=True and
loops one more time, returning the text of the *next* child element.
It depends on the 'key' element being directly followed by the
ode prints i and THEN adds one to it.
So i is 4, it gets printed, then 1 is added to it, so it becomes 5
and then the loop exits.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
ing at 5, and only stop when i is 6.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
In meInvent bbird
writes:
> how to for loop append a list [] when using parallel programming
items = []
for item in parallelized_object_factory():
items.append(item)
If you want a more specific answer, ask a more specific question.
--
John Gordon A is
g for help with logging, or communicating with the pump?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.py
ur name changed in previous post?
My comment was that the recursive calls weren't indented in the
"if deep > 0" block, therefore DFS was being called infinitely with smaller
and smaller values of deep. But it appears you have fixed that issue.
--
John Gordon
In <4f853aa2-cc00-480b-9fd7-79b05cbd4...@googlegroups.com> meInvent bbird
writes:
> https://drive.google.com/file/d/0Bxs_ao6uuBDULVNsRjZSVjdPYlE/view?usp=sharing
I already responded to your earlier post about this program. Did you
read it?
--
John Gordon A is for
he function, but the recursive calls aren't inside that
if block. DFS keeps calling itself with smaller and smaller values of
deep.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
here.
> Share if any examples available.
Create your own sample XML illustrating each desired combination.
Then write test cases for each.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for B
ob?
Are the permissions on the zipfile correct, and all parent directories?
How, specifically, are you importing the module? Are you doing something
like this:
zipfile = zipimport.zipimporter('file.zip')
zipfile.load_module('mymodule')
--
John Gordon
ounter < 7:
> if (pints[counter] < lowPints):
> lowPints = pints[counter]
> counter = counter + 1
> return lowPints
And getLow() has a very similar problem.
I suspect you want to unindent the 'counter = counter + 1' statement
so that it is NOT insid
ion 3.4.3 if you
are using Windows XP.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
ething else?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
en rename it afterwards,
instead of rewriting the original file.
import os
f_in = open('win.txt', 'r')
f_out = open('win_new.txt', 'w')
for line in f_in.read().splitlines():
f_out.write(line + " *\n")
f_in.close()
f_
bit version.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
P, try using an older 3.4 version of Python.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
It has to be a function
or a class.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
taxError: 'return' outside function
Show us the complete definition of promptUser_PWord().
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "Th
en't
callable. promptUser_PWord() has to be a function or a class.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
htt
; > callable. promptUser_PWord() has to be a function or a class.
> >
> Yes, but I guess the OP's program will run into the SyntaxError when
> trying to import the module, i.e., before it ever encounters the
> TypeError: 'module' object is not callable.
Good poi
inding out if a name is registered? There
are lots of possible ways to do it. Do you have one in mind?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "Th
valuates to
j = len(data)
which would yield 5 for a five-element list, but the last actual element
is in data[4].
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
--
In <871t7sbkex@elektro.pacujo.net> Marko Rauhamaa writes:
> Ethan Furman :
> > No, it isn't. Using '\' for line continuation is strongly discouraged.
> Why would you discourage valid syntax?
Some things that are permissible may not be desirable.
--
J
You shouldn't have to rewrite any of
the actual code.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
contain
> > something named 'hexdump'?
> Yes
In that case, the problem is most likely a circular import issue, as you
mentioned. The only way to fix it is to reorganize your modules.
How did this error come up? Did the code work previously? If so, what
changed?
--
Jo
#x27;utilities' module? Does it, in fact, contain
something named 'hexdump'?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb
transmat_ = transmat
> model.means_ = means
> model.covars_ = covars
> # Generate samples
> X, Z = model.sample(50)
> -
sample() is a method in the GaussianHMM class. (In this case, it's
a method in the _BaseHMM class, from which GaussianHMM inherits.)
--
John Gord
it even
show up as a choice?
Is there something special about the /private directory?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrum
Do you have any
> suggestions?
I don't really know much about Macs...
Can you run Preview and open the temporary file successfully?
When launched from scipy, Does Preview run as a user other than yourself?
What are the permissions on the temporary file when it's originally
create
> IndexError: invalid index to scalar variable.
> //
The built-in function sum() returns a single value, not a list, so this
is a reasonable error.
I suspect the code actually intended to call numpy.sum(), which does
return a list (or something like a list).
--
John Gordon
ble
SCIPY_PIL_IMAGE_VIEWER. If that variable is not present, it uses
'see' by default.
Do you have a suitable image viewing program installed on your computer?
If so, try setting the SCIPY_PIL_IMAGE_VIEWER environment variable to the
name of that program.
--
John Gordon
your
Request object. Try doing that.
(It works in your browser because it defaults to GET automatically.)
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, &qu
re is almost always *MANY* ways to
> achieve the same output.=20
The koan reads:
There should be one-- and preferably only one --obvious way to do it.
You left out the rather important word "obvious".
--
John Gordon A is for Amy, who fell down the stairs
gor...
e in a loop, so perhaps you're seeing the 'if'
branch on one loop iteration, anf the 'else' branch on the next iteration?
I see that your if and else branches both contain a screen.addstr()
call. Are you seeing both of these outputs?
--
John Gordon A is fo
back (most recent call last):
> File "", line 1, in
> print((results["gengyang"])["score"])
> TypeError: list indices must be integers, not str
Lists are indexed by number, not by name.
You want something like this:
for result in results:
u meant to have this piece of code indented under the while
loop above?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
.
> Could you explain a little to me?
> Thanks,
> def eList(val, list0=[]):
> list0.append(val)
> return list0
> list1 = eList(12)
> list1 = eList('a')
That is a default parameter. If eList() is called without an argument for
list0, it will use [] as the defa
e contents of
the tuple were ever to change, it would be much easier to simply change
it in once place (the definition of sz), rather than having to edit
several different occurrences of (n_iter,) in your code.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.co
x27;t specifically need a sequence. Is the same true for the
'size' keyword argument of np.random.normal()?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Go
not contain newline characters.
If it did, you would see the effect of re.M.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
'
> >>> as=cats[2]
> SyntaxError: invalid syntax
> >>> as=cats
> SyntaxError: invalid syntax
> >>> as
> SyntaxError: invalid syntax
'as' is a python language keyword, and cannot be used for variable names.
--
John Gordon
when i gets incremented, but it doesn't work like that. When you
increment i, you also have to reassign s1 and s2.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list
at can arise during execution of the
> requests.get(url)?
The best way is probably to do nothing at all, and let the caller handle
any exceptions.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
ke all three of your if statements start out with this condition:
if wb1_sheet1.cell(row=cell + 1, column=2).value == 0 and
wb1_sheet1.cell(row=cell + 1, column=3).value == 0
So you could reorganize your code by putting an if statement at the top
that only checks this condition. Then, indented under
u using to try to save? Is it a text editor?
What happens when you try to save? How do you know it didn't work?
Do you get an error message?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
;.
In my opinion, when comparing a variable to a constant, it's more natural
to have the variable on the left and the constant on the right, so that's
one strike against this code.
Another strike is that the code isn't consistent with itself; it puts the
variable on the left in t
ept of "not"?
I wasn't commenting directly to the "ask not..." quote; I was referring
upthread to the choice between
not 0 <= x <= 10
and
x < 0 or x > 10
Both are of course understandable, but in my opinion, the latter one takes
slightly less effort to gro
at, I don't believe that you cannot figure out how to
Certainly we can understand it. But it takes ever-so-slightly more effort
to do so.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
In alister
writes:
> I would stick with the OP's current solution
> Readability Counts!
I agree. 'if x < 0 or x > 10' is perfectly fine.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is fo
is
created, the ID of those two objects can be the same.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://ma
this directory" ?
Django is a web application framework. So, you have to use it together with
a web server. The "document root" is the directory where the web server
expects to find files to be served as web pages.
You said you put the Django project code in a subdirectory of your ho
at variable as an argument to convert_kilo.
The updated code would look like this:
def main():
kilo = get_input()
convert_kilo(kilo)
def get_input():
kilo = float(input('Enter Kilometers: '))
return kilo
def convert_kilo(kilo):
miles = float(kilo * 0.6214)
print( k
may not be your problem, as you haven't told us exactly
what is going wrong.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Ti
1 - 100 of 491 matches
Mail list logo