PyGILState API and Py_Main

2014-12-18 Thread Adrien Bruneton

Hello all,

I am having a hard time understanding what is the proper use of 
PyGILState_Ensure/Release.
My understanding is that one should always be matched with the other, 
and that this high level API auto-magically deals with the ThreadState 
creation.


However the following piece of code (executed with a simple "print 
'hello world' " script as argv) triggers the message:


Fatal Python error: auto-releasing thread-state, but no 
thread-state for this thread


Minimal code:

void initPython(int initsigs)
{
  if (Py_IsInitialized() == 0)
{
  Py_InitializeEx(initsigs);
  // Put default SIGINT handler back after 
Py_Initialize/Py_InitializeEx.

  signal(SIGINT, SIG_DFL);
}

  int threadInit = PyEval_ThreadsInitialized();
  PyEval_InitThreads(); // safe to call this multiple time

  if(!threadInit)
PyEval_SaveThread(); // release GIL
}

int main(int argc, char ** argv)
{
  initPython(1);
  PyGILState_STATE _gstate_avoid_clash = PyGILState_Ensure();
  int ret = Py_Main(argc, argv);
  PyGILState_Release(_gstate_avoid_clash);  // this one triggers the 
Fatal error

  Py_Finalize();
  return ret;
}


Removing the last PyGILState_Release works, but I have a bad feeling 
about it :-)

Any help would be welcome! Thanks in advance.
Adrien.

--
https://mail.python.org/mailman/listinfo/python-list


how to generate a wsdl file for a web service in python

2014-12-18 Thread brice DORA
hi to all I am new to python and as part of my project I would like to create a 
SOAP web service. for now I've developed my python file with all the methods of 
my future web service, but my problem now is how to generate the wsdl file ... 
my concern may seem to move so bear with me because I am a novice in this 
field. thank you in advance
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Classes - "delegation" question.

2014-12-18 Thread Steven D'Aprano
dieter wrote:

> "Ivan Evstegneev"  writes:
>> I have a question about "delegation" coding pattern(I'm working with
>> Python 3.4).
> 
> Unlike Java, Python supports "multiple inheritance". This means
> that you need "delegation" much more rarely in Python.
> Python does not have much special support for delegation: usually,
> you must delegate explicitely - maybe using a delagating decorator.


You might *need* delegation more rarely, but some people believe that
delegation and composition is a better design pattern than inheritance:

http://learnpythonthehardway.org/book/ex44.html

http://en.wikipedia.org/wiki/Composition_over_inheritance#Benefits

http://joostdevblog.blogspot.com.au/2014/07/why-composition-is-often-better-than.html

http://stackoverflow.com/questions/2068158/why-does-cocoa-use-delegates-rather-than-inheritance?lq=1


However, be warned that there are two subtly different models for
delegation. Here's the one that people seem to forget:

http://code.activestate.com/recipes/519639-true-lieberman-style-delegation-in-python/



-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PyQt: user interface freezed when using concurrent.futures.ThreadPoolExecutor

2014-12-18 Thread Mark Summerfield
On Thursday, December 11, 2014 4:53:04 AM UTC, iMath wrote:
> I think the user interface shouldn't be freezed when using 
> concurrent.futures.ThreadPoolExecutor here,as it executes asynchronously ,
>  but it doesn't meet my expectations,anyone can explain why ? any other 
> solutions here to not let user interface freezed?
> 
> code is here
> http://stackoverflow.com/questions/27393533/user-interface-freezed-when-using-concurrent-futures-threadpoolexecutor

It looks to me that what you are doing is sharing a single core between your 
GUI and your processing. Threading isn't usually a good approach to Python 
concurrency that is CPU-bound.

Simply changing ThreadPoolExecutor to ProcessPoolExecutor will improve 
performance, but will still allow the UI to freeze.

The approach I use for concurrency in GUI applications is for the GUI to run in 
the main thread (the default, and there's no choice) and to create a "manager" 
thread that does almost no work. This means that the GUI thread gets almost all 
the processing on the core on which it runs. Whenever there is work to do it is 
passed to the manager thread which immediately gives it to someone else. The 
someone else is a process pool. This ensures that the GUI doesn't freeze even 
in the face of lots of processing (because the processing is done in one or 
more separate processes).

In my book "Python in Practice", http://www.qtrac.eu/pipbook.html there's an 
example of how to do this in chapter 4. The example uses Tkinter but I use 
exactly the same approach in PyQt and PySide. This chapter also discusses many 
issues related to Python concurrency.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to generate a wsdl file for a web service in python

2014-12-18 Thread Burak Arslan

On 12/18/14 11:58, brice DORA wrote:
> hi to all I am new to python and as part of my project I would like to create 
> a SOAP web service. for now I've developed my python file with all the 
> methods of my future web service, but my problem now is how to generate the 
> wsdl file ... my concern may seem to move so bear with me because I am a 
> novice in this field. thank you in advance


Hi,

You can use Spyne to generate the wsdl file.

http://spyne.io/docs/2.10/manual/02_helloworld.html
https://github.com/arskom/spyne/blob/master/examples/helloworld_soap.py

There's also [email protected] for your soap-specific questions.

best,
burak

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Please help - Python role in Emeryville, CA - Full-time - $100K+

2014-12-18 Thread David H. Lipman
It depends on if this a Job Posting, specific to Python, is allowed and not 
considered spam.
 
 -- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
On Wed Dec 17 2014 at 11:04:16 PM Juan Christian 
wrote:
Thanks. That was a great answer. I'll redo my code. It's running and will
only run in my Docker container (Ubuntu Server 14.04.1) so I'll use cron.

Indeed, currently I'm using something like that:

while True:
if 9 < datetime.now().hour < 24:
# do stuff
sleep(randint(3, 6) * 60)
else:
# see you in 9 hours
sleep(9 * 60 * 60)

I knew it wasn't a good approach, but as least it was running as intended!


I read the cron doc, it's really simple to use, but one think I didn't see
out-of-the-box is a way to set a random time, like 'execute this in a 5~10
min interval', I can only set specific times like 'execute this each
minute, each hour, each 10min' and so on.

I found a 'fix' for that using $RANDOM in the crontab. Another workaround
would be to set a fixed 5min interval in cron and inside my script have a
random int (0 or 1), when 0, the script doesn't execute and 1 it execute,
so that way I'd have a little 'randomness' that I need.

Which approach would be the best?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-18 Thread Simon Evans
@Steven D'Aprano,
I input the following to Python 2.7, which got the following:- 

>>> from bs4 import BeautifulSoup
>>> with open("ecologicalpyramid.html","r") as ecological_pyramid:
...  soup= next(ecological_pyramid,"lxml")
...  producer_entries = soup.find("ul")
...
Traceback (most recent call last):
  File "", line 1, in 
IOError: [Errno 2] No such file or directory: 'ecologicalpyramid.html'
>>>

- I kept to your instructions to input the 'Enter' after the fourth line and 
then before the fifth line, ie between the indented block and the unindented 
one, which as above, doesn't give me a chance to actually input the fifth line. 
If I do it both ways, ie: pressing enter after the fourth and before the fifth 
or just pressing enter after the fourth and then after the fifth line of input, 
which again it won't actually let me input because before I do, I still get an 
error return.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to schedule my script?

2014-12-18 Thread Ian Kelly
On Thu, Dec 18, 2014 at 5:37 AM, Juan Christian 
wrote:
> I read the cron doc, it's really simple to use, but one think I didn't
see out-of-the-box is a way to set a random time, like 'execute this in a
5~10 min interval', I can only set specific times like 'execute this each
minute, each hour, each 10min' and so on.
>
> I found a 'fix' for that using $RANDOM in the crontab. Another workaround
would be to set a fixed 5min interval in cron and inside my script have a
random int (0 or 1), when 0, the script doesn't execute and 1 it execute,
so that way I'd have a little 'randomness' that I need.
>
> Which approach would be the best?

What kind of random distribution of the time between executions are you
looking for? A random sleep lends itself easily to a uniform distribution.
The latter approach that you describe would result in a geometric
distribution.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PyQt: user interface freezed when using concurrent.futures.ThreadPoolExecutor

2014-12-18 Thread Michael Torrie
On 12/18/2014 04:16 AM, Mark Summerfield wrote:
> It looks to me that what you are doing is sharing a single core
> between your GUI and your processing. Threading isn't usually a good
> approach to Python concurrency that is CPU-bound.

Except that his code was not CPU-bound to begin with.  His real problem
is that his callback is starting *and* waiting for all the threads to do
their work without returning to the main loop, thus blocking the GUI.
As for the threads, they are I/O bound--he's simply trying to do
concurrent HTTP downloads.  So blocking in the GIL is not the issue
here.  In fact, in lieu of using proper asynchronous I/O, threading of
some kind is probably not a bad solution here, but he has to do it
within the Qt Framework, using signals to notify the GUI when a thread
is finished, or using a synchronization primitive such as a queue, as
recommended by your book in fact.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-18 Thread Michael Torrie
On 12/18/2014 09:19 AM, Simon Evans wrote:
> @Steven D'Aprano,
> I input the following to Python 2.7, which got the following:- 
> 
 from bs4 import BeautifulSoup
 with open("ecologicalpyramid.html","r") as ecological_pyramid:
> ...  soup= next(ecological_pyramid,"lxml")
> ...  producer_entries = soup.find("ul")
> ...
> Traceback (most recent call last):
>   File "", line 1, in 
> IOError: [Errno 2] No such file or directory: 'ecologicalpyramid.html'
   ^^^
This is the problem here. And it's not a syntax error.

> - I kept to your instructions to input the 'Enter' after the fourth
> line and then before the fifth line, ie between the indented block and
> the unindented one, which as above, doesn't give me a chance to actually
>input the fifth line. If I do it both ways, ie: pressing enter after the
>fourth and before the fifth or just pressing enter after the fourth and
>then after the fifth line of input, which again it won't actually let me
>input because before I do, I still get an error return.

Did you read the actual error message? In this case it's not a syntax
error.  Do you understand what the error actually is and why it's
happening?  (IE did your read what the error was? Hint. It's not the
same as your previous errors.)

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to schedule my script?

2014-12-18 Thread Michael Torrie
On 12/17/2014 01:42 PM, Juan Christian wrote:
> On Wed Dec 17 2014 at 6:25:39 PM John Gordon  wrote:
> If you want to solve your problem entirely within Python, look at the
> "scheduler" module. (Although even this isn't a complete solution, as you
> still have to make sure the program is running in the first place...)
> 
> 
> My script is running fine, Win/OSX/Linux and I don't want to ruin that
> using system specific things.

Wrong.  You don't have to change or ruin your script.  If your script is
done right, you put all the real work inside of callable functions
anyway, and probably have some sort of "main" function that gets called
in a manner similar to this:

if __name__=="__main__":
my_main()

If so, then you create platform-dependent code in another file that
simply imports your existing, working script as a module and runs that
main function.  On Windows you write a service API wrapper.  On Linux
you can run the script directly from cron.  On Mac you can just bundle a
launchd control file (or use cron).

If your script is not coded in such a fashion as to make turning it into
an importable module easy, I highly recommend changing your to work in
this way.  Once my python programs get halfway useful I always try to
reorganize my code in such a way that it can be used as a module.
Because invariable I find that I do want to add another layer, and the
modules are ideal for this.  Nearly every script has the "if
__name__=='__main__'" block at the end of the file, where it provides
standalone features such as a command-line interface, or provides
testing of the module's features.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to schedule my script?

2014-12-18 Thread Josh English
On Wednesday, December 17, 2014 11:11:11 AM UTC-8, Juan Christian wrote:
> I know about the schedule modules and such but they work in situations like 
> 'run this in a X hours/minutes/seconds interval', I already have my code in a 
> while loop with sleep (it's a bit ugly, I'l change to a scheduler soon).
> 
> 
> What I really want is, for example:
> 
> 
> 24/7/365
> 9:00 AM -> Start
> 11:59 PM -> Stop
> 
> 
> 9:00 AM ~ 11:50 PM -> Running
> 12:00 AM ~ 8:59 AM -> Stopped
> 
> 
> I want my script to start at a given time and stop at another given time, is 
> that possible?

Windows comes with a Task Scheduler but as I'm playing with it, it only seems 
to allow starting a program, but not actually shutting it down. 

I would consider including a timed shutdown in your program or build another 
app, as is suggested below, to send SHUTDOWN commands to running apps. How you 
would link the running processes, I do not fully understand.
-- 
https://mail.python.org/mailman/listinfo/python-list


SQLObject 1.7.3

2014-12-18 Thread Oleg Broytman
Hello!

I'm pleased to announce version 1.7.3, a release with minor
documentation update of branch 1.7 of SQLObject.


What's new in SQLObject
===

* Extend setup.py: include docs and tests into the egg.

For a more complete list, please see the news:
http://sqlobject.org/News.html


What is SQLObject
=

SQLObject is an object-relational mapper.  Your database tables are described
as classes, and rows are instances of those classes.  SQLObject is meant to be
easy to use and quick to get started with.

SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite,
Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB).

Python 2.6 or 2.7 is required.


Where is SQLObject
==

Site:
http://sqlobject.org

Development:
http://sqlobject.org/devel/

Mailing list:
https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss

Archives:
http://news.gmane.org/gmane.comp.python.sqlobject

Download:
https://pypi.python.org/pypi/SQLObject/1.7.3

News and changes:
http://sqlobject.org/News.html

Oleg.
-- 
 Oleg Broytmanhttp://phdru.name/[email protected]
   Programmers don't die, they just GOSUB without RETURN.
-- 
https://mail.python.org/mailman/listinfo/python-list


problems with Methods in Python 3.4.2

2014-12-18 Thread Marcus Lütolf
Hello Dears,

1)I am trying to do this:



>>> dir(_builtins_)



I am getting this:

Traceback (most recent call last):

  File "", line 1, in 

dir(_builtins_)

NameError: name '_builtins_' is not defined



2)I am trying to do this:



>>> 'TTA',_add_('GGA')



I’am getting this :

Traceback (most recent call last):

  File "", line 1, in 

'TTA',_add_('GGA')

NameError: name '_add_' is not defined



3)I am trying to do this:



>>> -3  .abs()



I’am getting this

Traceback (most recent call last):

  File "", line 1, in 

-3 .abs()

AttributeError: 'int' object has no attribute 'abs'



4) finally, after printing



>>>abs._doc_()



I am getting this (and so on) :

Traceback (most recent call last):

  File "", line 1, in 

abs._doc_()

AttributeError: 'builtin_function_or_method' object has no attribute '_doc_'

What did I do wrong ? Thanks for help, Marcus Luetolf, M.D., 90 Bondastreet,
CH-7000 Chur, Switzerland.





---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
http://www.avast.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: problems with Methods in Python 3.4.2

2014-12-18 Thread André Roberge
On Thursday, 18 December 2014 13:28:33 UTC-4, Marcus Lütolf  wrote:
> Hello Dears,
> 1)I am trying to do this:
>  
> >>> dir(_builtins_)
You need two underscore characters on each sides:

dir(__builtins__)

>  
> I am getting this:
> Traceback (most recent call last):
>   File "", line 1, in 
> dir(_builtins_)
> NameError: name '_builtins_' is not defined
>  
> 2)I am trying to do this:
>  
> >>> 'TTA',_add_('GGA')
Same; magic methods have two underscore characters on each side.
>  
> I'am getting this :
> Traceback (most recent call last):
>   File "", line 1, in 
> 'TTA',_add_('GGA')
> NameError: name '_add_' is not defined
>  
> 3)I am trying to do this:
>  
> >>> -3  .abs()
abs(-3)  abs is a function in Python.

See http://lucumr.pocoo.org/2011/7/9/python-and-pola/ for a good explanation...

>  
> I'am getting this
> Traceback (most recent call last):
>   File "", line 1, in 
> -3 .abs()
> AttributeError: 'int' object has no attribute 'abs'
>  
> 4) finally, after printing
>  
> >>>abs._doc_()
>  

Guess why!  ;-)

> I am getting this (and so on) :
> Traceback (most recent call last):
>   File "", line 1, in 
> abs._doc_()
> AttributeError: 'builtin_function_or_method' object has no attribute '_doc_'
> 
> What did I do wrong ? Thanks for help, Marcus Luetolf, M.D., 90 Bondastreet, 
> CH-7000 Chur, Switzerland.
>  
> 
> 
> 
> 
> 
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   Diese E-Mail wurde von Avast Antivirus-Software 
> auf Viren geprüft.
>   
> www.avast.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: problems with Methods in Python 3.4.2

2014-12-18 Thread Gary Herron

On 12/18/2014 09:27 AM, Marcus Lütolf wrote:


Hello Dears,

1)I am trying to do this:

>>> dir(_builtins_)



It's __builtins__ not _builtins_  (double underscores at each end not 
single underscores)


I am getting this:

Traceback (most recent call last):

File "", line 1, in 

dir(_builtins_)

NameError: name '_builtins_' is not defined

2)I am trying to do this:

>>> 'TTA',_add_('GGA')



To call a method use "." not ",".   And the method you are trying to 
call is __add__ not _add_.  But why... just do "TTA"+"GGA"


I’am getting this :

Traceback (most recent call last):

File "", line 1, in 

'TTA',_add_('GGA')

NameError: name '_add_' is not defined

3)I am trying to do this:

>>> -3  .abs()



abs is a function not a method.  do: abs(-3)


I’am getting this

Traceback (most recent call last):

  File "", line 1, in 

-3 .abs()

AttributeError: 'int' object has no attribute 'abs'

4) finally, after printing

>>>abs._doc_()



Again, use double underscores abs.__doc__()


I am getting this (and so on) :

Traceback (most recent call last):

  File "", line 1, in 

abs._doc_()

AttributeError: 'builtin_function_or_method' object has no attribute 
'_doc_'


What did I do wrong ? Thanks for help, Marcus Luetolf, M.D., 90 
Bondastreet, CH-7000 Chur, Switzerland.





--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
Thanks, using cron here.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: problems with Methods in Python 3.4.2

2014-12-18 Thread John Gordon
In  
=?iso-8859-1?Q?Marcus_L=FCtolf?=  writes:

> >>> dir(_builtins_)
> >>> 'TTA',_add_('GGA')
> >>>abs._doc_()

These errors are due to using single underscores instead of double
underscores.  I.e. use __builtins__ instead of _builtins_.

> >>> -3  .abs()
> AttributeError: 'int' object has no attribute 'abs'

Integer objects don't have a built-in function named abs().  If you
want the absolute value of an integer, call abs directly, like so:

abs(-3)

-- 
John Gordon Imagine what it must be like for a real medical doctor to
[email protected] 'House', or a real serial killer to watch 'Dexter'.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: problems with Methods in Python 3.4.2

2014-12-18 Thread Terry Reedy

On 12/18/2014 12:27 PM, Marcus Lütolf wrote:

Learn to use dir to fine valid names.


1)I am trying to do this:

 >>> dir(_builtins_)

I am getting this:

Traceback (most recent call last):

File "", line 1, in 

 dir(_builtins_)

NameError: name '_builtins_' is not defined


>>> dir()
['__builtins__', '__doc__', '__loader__', '__name__', '__package__', 
'__spec__']


shows the defined names.


2)I am trying to do this:


'TTA',_add_('GGA')


I’am getting this :

Traceback (most recent call last):

File "", line 1, in 

 'TTA',_add_('GGA')

NameError: name '_add_' is not defined


>>> dir('a') shows string attribute names


3)I am trying to do this:


-3  .abs()


I’am getting this

Traceback (most recent call last):

   File "", line 1, in 

 -3 .abs()

AttributeError: 'int' object has no attribute 'abs'


dir(3) shows int attributes


4) finally, after printing

 >>>abs._doc_()

I am getting this (and so on) :

Traceback (most recent call last):

   File "", line 1, in 

 abs._doc_()

AttributeError: 'builtin_function_or_method' object has no attribute '_doc_'


dir(abs) ditto


What did I do wrong ?


You did not use the interactive help already available.  help() 
is also very useful.


--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


Re: Creating interactive command-line Python app?

2014-12-18 Thread Anssi Saari
[email protected] writes:

> um, what if I want to USE a command line for python WITHOUT downloading or 
> installing it

Then click on the little >_ icon on the web site and you have a python
prompt in your browser.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
On Thu Dec 18 2014 at 2:24:46 PM Ian Kelly  wrote:
What kind of random distribution of the time between executions are you
looking for? A random sleep lends itself easily to a uniform distribution.
The latter approach that you describe would result in a geometric
distribution.

I'm looking for a random, but controlled delay between executions.

Let's say I execute the script now, then in 5~10 min I'll execute again,
this time can be 5, 6, ... 10 minutes, this script pretends to do 'human
actions' so I can't be doing these 'actions' with a specific and rigid
times.

The delay between the executions can't be the same always.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Creating interactive command-line Python app?

2014-12-18 Thread sohcahtoa82
On Saturday, December 13, 2014 6:50:50 AM UTC-8, Steven D'Aprano wrote:
> [email protected] wrote:
> 
> > um, what if I want to USE a command line for python WITHOUT downloading or
> > installing it
> 
> Who are you talking to? What is the context?
> 
> Like all software, you can't use Python apps without all their dependencies
> being installed. If you use the Linux operating system, it will have Python
> already installed. Otherwise, you will have to install it.
> 
> If you can't install it, or don't want to, you can't use Python.
> 
> 
> -- 
> Steven

He replied to a post from nearly two years ago, but deleted all context.

And even that post was a bump reviving a post from 2005.

See the whole thread at 
https://groups.google.com/d/msg/comp.lang.python/sAiJ8bvBBKI
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Please help - Python role in Emeryville, CA - Full-time - $100K+

2014-12-18 Thread me
On Thu, 18 Dec 2014 00:08:18 +, Jared E. Cardon wrote:

> Hi,
> 
> I found your Python group on Google+ and I'm searching for someone with
> 3+ years of Python development experience for a full-time position in
> California.  Salary north of $100K and working for an amazing company. 
> Ideally I'd like to find someone who is nice, plugged into the movie and
> comic culture, and very skilled at python and web application
> development.
> 
> If you know of anyone local to the area who would be interested please
> put me in touch with them.  Feel free to post my request on the group
> page.
> 
> Thank you,
> Jared


Except that sisinc is a body shop and that 100k is low for any real 
programming job in California.  Used to be that contracting work paid W2 
at 150% of what you would make as a client direct hire.  Now the pimps 
look at you with a straight face and expect you to work for similar or 
less money than direct hire, with minimal to no benefits, and absolutely 
no job security.  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to schedule my script?

2014-12-18 Thread Chris Angelico
On Fri, Dec 19, 2014 at 9:13 AM, Juan Christian
 wrote:
> Let's say I execute the script now, then in 5~10 min I'll execute again,
> this time can be 5, 6, ... 10 minutes, this script pretends to do 'human
> actions' so I can't be doing these 'actions' with a specific and rigid
> times.

Why does this matter to you? Why am I getting the feeling that I
should not be helping you?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
On Thu Dec 18 2014 at 11:35:11 PM Chris Angelico  wrote:
Why does this matter to you? Why am I getting the feeling that I
should not be helping you?

Because that's what my project is all about, I need to fake some 'human
actions' inside the network to do some benchmarks and test internal stuffs.
This need to be 'flexible'.
-- 
https://mail.python.org/mailman/listinfo/python-list


newbie: installing setuptools

2014-12-18 Thread Surbhi Gupta
Hey, I am new to python and facing problem with installing packages. I am using 
VPython which requires Python 2.7.x from python.org; it will not work with 
versions of Python other than the one from python.org. So I need to install 
packages separately. 

I was trying to install scipy-0.14.0, it gives following error:
Warning (from warnings module):
  File "C:\Python27\lib\distutils\dist.py", line 267
warnings.warn(msg)
UserWarning: Unknown distribution option: 'test_suite'

So I thought maybe I need to install setuptools first. I ran setup.py file in 
IDLE. it runs fine and then I can import it in current session. But when I run 
session, it still says 'no module named setuptools'. Same thing happened when I 
tried to install nose.

  
 
-- 
https://mail.python.org/mailman/listinfo/python-list


Google Maps and Python: creating a map, embedding it, adding images, videos, markers, using python

2014-12-18 Thread Veek M
I'm messing with Google-Maps. Is there a way I can create a map, embed it on 
a page (CSS/HTML/Javascript for this bit), and add images, videos, markers - 
using python? Any libraries available?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to schedule my script?

2014-12-18 Thread Terry Reedy

On 12/18/2014 8:55 PM, Juan Christian wrote:

On Thu Dec 18 2014 at 11:35:11 PM Chris Angelico mailto:[email protected]>> wrote:
Why does this matter to you? Why am I getting the feeling that I
should not be helping you?

Because that's what my project is all about, I need to fake some 'human
actions' inside the network to do some benchmarks and test internal
stuffs. This need to be 'flexible'.


Tkinter's .after method makes it trivial to schedule and run a function 
at either regular or haphazardly variable intervals and add the result 
to a gui display.



--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Google Maps and Python: creating a map, embedding it, adding images, videos, markers, using python

2014-12-18 Thread Kev Dwyer
Veek M wrote:

> I'm messing with Google-Maps. Is there a way I can create a map, embed it
> on a page (CSS/HTML/Javascript for this bit), and add images, videos,
> markers - using python? Any libraries available?

Hello,

Googling for "google maps python client" returns

https://developers.google.com/api-client-library/python/apis/mapsengine/v1 

as the first result...

HTH

Kev

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: newbie: installing setuptools

2014-12-18 Thread Surbhi Gupta
On Friday, December 19, 2014 10:13:15 AM UTC+5:30, Surbhi Gupta wrote:
> Hey, I am new to python and facing problem with installing packages. I am 
> using VPython which requires Python 2.7.x from python.org; it will not work 
> with versions of Python other than the one from python.org. So I need to 
> install packages separately. 
> 
> I was trying to install scipy-0.14.0, it gives following error:
> Warning (from warnings module):
>   File "C:\Python27\lib\distutils\dist.py", line 267
> warnings.warn(msg)
> UserWarning: Unknown distribution option: 'test_suite'
> 
> So I thought maybe I need to install setuptools first. I ran setup.py file in 
> IDLE. it runs fine and then I can import it in current session. But when I 
> run session, it still says 'no module named setuptools'. Same thing happened 
> when I tried to install nose.

OK, the problem is now resolved: I just found out that we need to install from 
prompt instead of IDLE. 
Setuptools is installed, but I am not able to use easy_install from prompt. It 
says:
easy_install : The term 'easy_install' is not recognized as the name of a 
cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that 
the path is correct and try again.
At line:1 char:1
+ easy_install
+ 
+ CategoryInfo  : ObjectNotFound: (easy_install:String) [], 
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

still unsuccessful in installing Scipy.
-- 
https://mail.python.org/mailman/listinfo/python-list