Thanks for replying still! Appreciate the help.
On Fri, Jun 22, 2012 at 12:25 PM, Benjamin Kaplan
wrote:
> damn
>
> On Thu, Jun 21, 2012 at 9:24 PM, Benjamin Kaplan
> wrote:
> > On Thu, Jun 21, 2012 at 8:42 PM, Xander Solis wrote:
> >> Hello Python list,
> >>
> >> Noob here with a newbie questi
On 6/21/2012 11:42 PM, Xander Solis wrote:
Hello Python list,
Noob here with a newbie question. I'm reading and working on the
exercise of the book, Learn Python the Hard way 2.0. When I use this
code, I get "None" on the output. My question is why does this happen?
None is the default return
Thanks Andrew and Michael!. That did the trick.
def get_numbers(first_num, second_num, operator):
if operator == 'add':
value = first_num + second_num
elif operator == 'minus':
value = first_num - second_num
elif operator == 'divide':
value = first_num / second
damn
On Thu, Jun 21, 2012 at 9:24 PM, Benjamin Kaplan
wrote:
> On Thu, Jun 21, 2012 at 8:42 PM, Xander Solis wrote:
>> Hello Python list,
>>
>> Noob here with a newbie question. I'm reading and working on the exercise of
>> the book, Learn Python the Hard way 2.0. When I use this code, I get "No
On Fri, 22 Jun 2012 11:42:28 +0800
Xander Solis wrote:
> Noob here with a newbie question. I'm reading and working on the
> exercise of the book, Learn Python the Hard way 2.0. When I use this
> code, I get "None" on the output. My question is why does this happen?
>
> def get_numbers(first_num,
On Thu, Jun 21, 2012 at 8:42 PM, Xander Solis wrote:
> Hello Python list,
>
> Noob here with a newbie question. I'm reading and working on the exercise of
> the book, Learn Python the Hard way 2.0. When I use this code, I get "None"
> on the output. My question is why does this happen?
>
> def get
On 6/21/2012 10:42 PM, Xander Solis wrote:
> Hello Python list,
>
> Noob here with a newbie question. I'm reading and working on the
> exercise of the book, Learn Python the Hard way 2.0. When I use this
> code, I get "None" on the output. My question is why does this happen?
Your function prints
The last three lines print the return value from the "get_numbers"
function, which isn't returning anything. In python, the default
return value is None, and that's why you're seeing it.
Michael
On Thu, Jun 21, 2012 at 11:42 PM, Xander Solis wrote:
> Hello Python list,
>
> Noob here with a newb
Hello Python list,
Noob here with a newbie question. I'm reading and working on the exercise
of the book, Learn Python the Hard way 2.0. When I use this code, I get
"None" on the output. My question is why does this happen?
def get_numbers(first_num, second_num, operator):
if operator == 'ad
On 22/06/2012 3:10 AM, KACVINSKY Tom wrote:
I found what I was looking for:
python setup.py bdist_wininst
bdist_wininst is for creating installers for Python packages which
install into an existing Python directory structure. It isn't used to
create a installer for Python itself (which
On Friday, June 22, 2012 08:30:16 AM Chris Angelico wrote:
> On Fri, Jun 22, 2012 at 1:34 AM, inq1ltd wrote:
> > Can't find _thinter
>
> Is this supposed to be _tkinter?
>
> Try copying and pasting the entire error message, including traceback.
> That often helps. At the moment, I can't know whe
On Fri, Jun 22, 2012 at 8:30 AM, J wrote:
> I'm wondering now... the way it works is that the program is run from
> a user terminal/console. however, on the other side (after the reboot
> is done) it runs via an autostart script after the user is logged in,
> and thus runs outside of the terminal
On Thu, Jun 21, 2012 at 5:54 PM, Chris Angelico wrote:
> On Fri, Jun 22, 2012 at 7:47 AM, J wrote:
>> \xe2\x86\xb3
>
> This is the UTF-8 encoded form of U+21B3, which is the DOWNWARDS ARROW
> WITH TIP RIGHTWARDS character that you're showing. That's what the
> "bytecode" you're seeing is. You may
On Fri, Jun 22, 2012 at 1:34 AM, inq1ltd wrote:
> Can't find _thinter
Is this supposed to be _tkinter?
Try copying and pasting the entire error message, including traceback.
That often helps. At the moment, I can't know whether the error is in
your transcription of the message or if in a source
On Thu, 21 Jun 2012 10:44:08 -0700, Paul Rubin
wrote:
>There are both kinds. The first kind is called a Virtual Private Server
>(VPS). The second kind is called shared hosting.
Thanks much for the infos.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Jun 22, 2012 at 7:47 AM, J wrote:
> \xe2\x86\xb3
This is the UTF-8 encoded form of U+21B3, which is the DOWNWARDS ARROW
WITH TIP RIGHTWARDS character that you're showing. That's what the
"bytecode" you're seeing is. You may be able to ask the underlying
program to make its output in a cle
I have a bit of a problem I hope you could help me sort out with some
code I'm porting from 2.x to 3.
I have a program with a wrapper for Popen that is called to run
certain linux shell commands and gather system info. Essentially the
code looks something like this:
process =
subprocess.Popen(
Hi,
I have uploaded greenlet 0.4.0 to PyPI:
http://pypi.python.org/pypi/greenlet
What is it?
---
The greenlet module provides coroutines for python. coroutines allow
suspending and resuming execution at certain locations.
concurrence[1], eventlet[2] and gevent[3] use the greenlet module
On 21/06/2012 19:16, hisan wrote:
sample_json1={{
"globalControlId": 72,
"value": 0,
"controlId": 2
},
{
"globalControlId": 77,
"value": 3,
"controlId": 7
}
}
sample_json2={
{
"globalControlId": 77,
"value": 3,
In hisan
writes:
> sample_json1={{
>"globalControlId": 72,
>"value": 0,
>"controlId": 2
>},
>{
>"globalControlId": 77,
>"value": 3,
>"controlId": 7
>}
> }
> sample_json2={
>{
>"globalControlId": 77,
>"value": 3,
>
On 06/21/2012 02:03 PM, Rotwang wrote:
> On 21/06/2012 18:07, Dave Angel wrote:
>> On 06/21/2012 11:19 AM, Rotwang wrote:
>>> Hi all, I'm using Python 2.7.2 on Windows 7 and a module I've written
>>> is acting strangely. I can reproduce the behaviour in question with
>>> the following:
>>>
>>> ---
On 21/06/2012 18:37, Dennis Lee Bieber wrote:
On Thu, 21 Jun 2012 16:19:41 +0100, Rotwang
declaimed the following in gmane.comp.python.general:
import threading, Tkinter, os, pickle
class savethread(threading.Thread):
def __init__(self, value):
threading.Thread.__init__(self)
sample_json1={{
"globalControlId": 72,
"value": 0,
"controlId": 2
},
{
"globalControlId": 77,
"value": 3,
"controlId": 7
}
}
sample_json2={
{
"globalControlId": 77,
"value": 3,
"controlId": 7
},
{
"globalContr
On 21/06/2012 18:07, Dave Angel wrote:
On 06/21/2012 11:19 AM, Rotwang wrote:
Hi all, I'm using Python 2.7.2 on Windows 7 and a module I've written
is acting strangely. I can reproduce the behaviour in question with
the following:
--- begin bugtest.py ---
import threading, Tkinter, os, pickle
I found what I was looking for:
python setup.py bdist_wininst
But... I follow all of the instructions for building Python on Windows and then
follow the instructions for using bdist_wininst, and I get this:
C:\Users\tky\Python\Python-2.6.8>PCbuild\amd64\python.exe setup.py bdist_wininst
run
Gilles writes:
> Do Python hosters provide a VM so that it's just like a remote Linux
> server where I'm free to install whatever I want, or do they force
> users to use specific versions of Python and specific frameworks eg.
> Django?
There are both kinds. The first kind is called a Virtual Pri
On Thursday, June 21, 2012 11:46:30 AM inq1ltd wrote:
> On Thursday, June 21, 2012 04:19:41 PM Rotwang wrote:
> > Hi all, I'm using Python 2.7.2 on Windows 7 and a module I've written is
> > acting strangely. I can reproduce the behaviour in question with the
> > following:
> >
> > --- begin bugte
Rotwang writes:
> Hi all, I'm using Python 2.7.2 on Windows 7 and a module I've written
> is acting strangely. I can reproduce the behaviour in question with
> the following:
>
> --- begin bugtest.py ---
>
> import threading, Tkinter, os, pickle
>
> class savethread(threading.Thread):
> def _
On Thu, 21 Jun 2012 10:12:07 -0700, Temia Eszteri
wrote:
>
>Try appending the dump command with f.flush() and os.fsync().
>
>~Temia
Actually, wait, no. The behavior you're describing is indicating that
the thread in question isn't even getting a chance to execute at all.
I'd recommend going with
On Thu, 21 Jun 2012 16:19:41 +0100, Rotwang
wrote:
>Hi all, I'm using Python 2.7.2 on Windows 7 and a module I've written is
>acting strangely. I can reproduce the behaviour in question with the
>following:
>
>--- begin bugtest.py ---
>
>import threading, Tkinter, os, pickle
>
>class savethread
On 06/21/2012 11:19 AM, Rotwang wrote:
> Hi all, I'm using Python 2.7.2 on Windows 7 and a module I've written
> is acting strangely. I can reproduce the behaviour in question with
> the following:
>
> --- begin bugtest.py ---
>
> import threading, Tkinter, os, pickle
>
> class savethread(threading
On Thursday, June 21, 2012 04:19:41 PM Rotwang wrote:
> Hi all, I'm using Python 2.7.2 on Windows 7 and a module I've written is
> acting strangely. I can reproduce the behaviour in question with the
> following:
>
> --- begin bugtest.py ---
>
> import threading, Tkinter, os, pickle
try this;
f
On Thu, 2012-06-21 at 21:25 +1000, John O'Hagan wrote:
> Sometimes a function gets called repeatedly with the same expensive argument:
>
> def some_func(arg, i):
> (do_something with arg and i)
>
> same_old_arg = big_calculation()
> for i in lots_of_items:
> some_func(same_old_arg, i)
>
py help,
Can someone let me know where to get
help with inno setup.
I get an error;
Can't find _thinter
Sounds like a path problem.
Everything works until it is packaged with
inno v5.5.
jd
--
http://mail.python.org/mailman/listinfo/python-list
Hi List,
I am using python to run command line utilities on Linux machine.
I came across textfsm and feel that it fits my requirements.
Here is the structure of the output from the 2 utilities
Command 1:
Id AddressPort Location State Tenant count Max tenants Description
-- --
Hi all, I'm using Python 2.7.2 on Windows 7 and a module I've written is
acting strangely. I can reproduce the behaviour in question with the
following:
--- begin bugtest.py ---
import threading, Tkinter, os, pickle
class savethread(threading.Thread):
def __init__(self, value):
th
On Thu, 21 Jun 2012 14:20:23 +0200
Thomas Rachel
wrote:
> Am 21.06.2012 13:25 schrieb John O'Hagan:
>
> > But what about a generator?
>
> Yes, but...
>
> > def some_func():
> > arg = big_calculation()
> > while 1:
> > i = yield
> > (do_something with arg and i)
> >
On 21 Jun 2012 12:19:20 GMT
Steven D'Aprano wrote:
> On Thu, 21 Jun 2012 21:25:04 +1000, John O'Hagan wrote:
>
> > Sometimes a function gets called repeatedly with the same expensive
> > argument:
> >
> > def some_func(arg, i):
> > (do_something with arg and i)
> >
> > same_old_arg = big_c
Hi,
that's really great stuff! I love it! Thx :)
Am Thu, 21 Jun 2012 13:00:36 +0200
schrieb Christian Heimes :
> Am 21.06.2012 10:03, schrieb Bastian Ballmann:
> > Any suggestions how I could just get the import of
> > module.to.inspect? Thanks && have a nice day!
>
> You could try a completel
david.gar...@gmail.com wrote:
I am looking for the fastest way to parse a log file.
currently I have this... Can I speed this up any? The script is
written to be a generic log file parser so I can't rely on some
predictable pattern.
def check_data(data,keywords):
#get rid of duplicates
Am 21.06.2012 13:25 schrieb John O'Hagan:
But what about a generator?
Yes, but...
def some_func():
arg = big_calculation()
while 1:
i = yield
(do_something with arg and i)
some_gen = some_func()
some_gen.send(None)
for i in lots_of_items:
some_gen.send(i)
On Tue, 12 Jun 2012 11:39:50 +0200, Gilles wrote:
>I'm an amateur programmer, and would like to know what the main
>options are to build web applications in Python instead of PHP.
When I need to host my Python application (preferably in Europe since
my users will be located there), what are the o
On Thu, 21 Jun 2012 21:25:04 +1000, John O'Hagan wrote:
> Sometimes a function gets called repeatedly with the same expensive
> argument:
>
> def some_func(arg, i):
> (do_something with arg and i)
>
> same_old_arg = big_calculation()
Since big_calculation() is only called once, the cost of
Sometimes a function gets called repeatedly with the same expensive argument:
def some_func(arg, i):
(do_something with arg and i)
same_old_arg = big_calculation()
for i in lots_of_items:
some_func(same_old_arg, i)
A simple case like that looks OK, but it can get messy when groups of arg
Am 21.06.2012 10:03, schrieb Bastian Ballmann:
> Any suggestions how I could just get the import of module.to.inspect?
> Thanks && have a nice day!
You could try a completely different approach and use the compiler
package to inspect the abstract syntrax tree of a compiled module. The
approach has
We have a very chaotic database (on MySql) at the moment, with for
example table names used as keys to query other tables (but that's just
an example).
We are going to redesign it but first I still have to replace the
perl+vbscript system with only one Python program, so I still have to
deal with
Hi all,
I am trying to write a function that returns a list of imports a given
module is doing. The "problem" is I dont want to get the imports of the
imports, but that's the case with my current solution.
import __builtin__
old_import = __builtin__.__import__
def import_hook(name, globals=None,
47 matches
Mail list logo