Django Tutorial (Database setup) Question

2015-09-27 Thread Cai Gengyang
Hello all !

So I am going through the (Database setup) chapter of this tutorial 
(https://docs.djangoproject.com/en/1.8/intro/tutorial01/) --- Its the section 
right after the first chapter on "Creating a project"

I opened up mysite/settings.py as per the instructions on the Django tutorial. 

However, when I try to run the following command : $ python manage.py migrate 
to create the tables in the database, 

CaiGengYangs-MacBook-Pro:Weiqi CaiGengYang$ python manage.py migrate  input 

I get the following error message : 

/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python:
 can't open file 'manage.py': [Errno 2] No such file or directory  output 

Any idea how to solve this issue? 

Thanks a lot ! 

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


Re: ConnectionError handling problem

2015-09-27 Thread Gonzalo V
Hi Cameron.
i had the same problems and you have to tell to python what to do with the
connect problem.
try this:

...
except *urllib.error.HTTPError* as e:
if e.getcode()==504:
disp = "SIN RESPUESTA DEL SERVIDOR" #(No answer from the
server)
nombre=''
origen=''

precioAhora=''
print(e.getcode(),disp)
pass


that works for me. You can handle any error. 404, and 500 and more. but you
have to tell him to python what to do.

greeting from Chile. Sorry my english.



Saludos,
Gonzalo

2015-09-25 3:24 GMT-04:00 Cameron Simpson :

> On 24Sep2015 22:46, shiva upreti  wrote:
>
>> On Friday, September 25, 2015 at 10:55:45 AM UTC+5:30, Cameron Simpson
>> wrote:
>>
>>> On 24Sep2015 20:57, shiva upreti  wrote:
>>> >Thank you Cameron.
>>> >I think the problem with my code is that it just hangs without raising
>>> any >exceptions. And as mentioned by Laura above that when I press CTRL+C,
>>> it >just catches that exception and prints ConnectionError which is
>>> definitely >a lie in this case as you mentioned.
>>>
>>
> Ok. You original code says:
>
>  try:
>r=requests.post(url, data=query_args)
>  except:
>print "Connection error"
>
> and presumably we think your code is hanging inside the requests.post
> call? You should probably try to verify that, because if it is elsewhere
> you need to figure out where (lots of print statements is a first start on
> that).
>
> I would open two terminals. Run your program until it hangs in one.
>
> While it is hung, examine the network status. I'll presume you're on a
> UNIX system of some kind, probably Linux? If not it may be harder (or just
> require someone other than me).
>
> If it is hung in the .post call, quite possibly it has an established
> connecion to the target server - maybe that server is hanging.
>
> The shell command:
>
>  netstat -rn | fgrep 172.16.68.6 | fgrep 8090
>
> will show every connection to your server hosting the URL "
> http://172.16.68.6:8090/login.xml";. That will tell you if you have a
> connection (if you are the only person doing the connecting from your
> machine).
>
> If you have the "lsof" program (possibly in /usr/sbin, so
> "/usr/sbin/lsof") you can also examine the state of your hung Python
> program. This:
>
>  lsof -p 12345
>
> will report on the open files and network connections of the process with
> pid 12345. Adjust to suit: you can find your program's pid ("process id")
> with the "ps" command, or by backgrounding your program an issuing the
> "jobs" command, which should show the process id more directly.
>
>
> Cheers,
> Cameron Simpson 
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


PY3.5 and nnumpy and scipy installation problem

2015-09-27 Thread Ek Esawi
Hi Steven,


Thank you for the prompt response. What I meant by not working is the
following: once I had py3.5 working, I downloaded numpy and scipy and
unzipped them. After that I tried to install them. But there is no install
file for either. There was a setup file which I thought would do the same.
However, when I double clicked it, it showed a python window for a sec and
that’s all.


When I went to IDEL and typed import numpy as np I got the following error
message which suggests PY did not find numpy.


>>> import numpy as np

Traceback (most recent call last):

  File "", line 1, in 

import numpy as np

ImportError: No module named 'numpy'

>>>



Thanks again, EK
-- 
https://mail.python.org/mailman/listinfo/python-list


Python IDLE won't start

2015-09-27 Thread Jacob Chaar
Hi there,

 

So, I download Python 3.5.0 and I while I execute the Python IDLE, it won't
start up.  Also, I try to open the python command line and a message error
pop up. 

 

If you can help me, it will be really appreciate. 

 

Regards,

Jacob Chaar

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


Beginning question #compilersetup, #windows7, #vs2010

2015-09-27 Thread Jeff VanderDoes
All,

I'm fairly new to Python and was excited to start playing with it until I
ran into need to compile some extensions under windows 7 64 bit.  I've done
some searching but after more hours than I care to count being unsuccessful
setting up MS visual studio (2015, 2012, and 2010) with service packs and
SDKs I can tell I'm spinning my wheels and going nowhere fast.

After trying to search through archives and the net I get some things that
are really old or are unique to their situation but just not what I would
expect for such a widely used language.

Are there any instructions/pointers that someone could point me to to be
able to set up visual studio for use with python.  I figure I'd just start
with 3.5 but have tried under 3.4 and even went back to 2.7 with no luck.
I see I'm not the only one with frustration with the error about not find
vcvarsall.bat and the like.

Thanks for your help!

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


Re: Python IDLE won't start

2015-09-27 Thread Cai Gengyang
On Sunday, September 27, 2015 at 4:41:54 PM UTC+8, Jacob Chaar wrote:
> Hi there,
>  
> So, I download Python 3.5.0 and I while I execute the Python IDLE, it won't 
> start up.  Also, I try to open the python command line and a message error 
> pop up. 
>  
> If you can help me, it will be really appreciate. 
>  
> Regards,
> Jacob Chaar


It worked for me ...

Step 1 : Download Python 3.5 from here --- https://www.python.org/downloads/
Step 2 : Install it 
Step 3 : Click on the 'IDLE' button --- for me , I am using a Mac so I click on 
'Finder', then type IDLE in the search field on the top right corner of the 
'Finder'. 
Step 4 : Click on the IDLE and it opens up, a happy looking 'Python 3.5.0' 
shell there. There is however a warning that this version may be unstable. 
However, I am able to execute commands on it like 1 + 2 = 3
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python IDLE won't start

2015-09-27 Thread mm0fmf via Python-list

On 26/09/2015 18:14, Jacob Chaar wrote:

Hi there,

So, I download Python 3.5.0 and I while I execute the Python IDLE, it
won’t start up.  Also, I try to open the python command line and a
message error pop up.

If you can help me, it will be really appreciate.

Regards,

Jacob Chaar

Maybe if you told us the error (cut & paste it, don't retype it) we 
could help? Similarly knowing the OS you are using would help.


Without that info how can anyone help you?
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python IDLE won't start

2015-09-27 Thread Laura Creighton
In a message of Sat, 26 Sep 2015 13:14:44 -0400, Jacob Chaar writes:
>Hi there,
>
> 
>
>So, I download Python 3.5.0 and I while I execute the Python IDLE, it won't
>start up.  Also, I try to open the python command line and a message error
>pop up. 
>
> 
>
>If you can help me, it will be really appreciate. 
>
> 
>
>Regards,
>
>Jacob Chaar
>
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list
>

What OS are you running under?
Just just typing python in the command window work?  What about
python3?

If they work, so you have a python

run 'python -m idlelib' in the command window.

This should give you an error message.  Paste it in here and
we will see what we can do.

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


Re: Python IDLE won't start

2015-09-27 Thread Terry Reedy

On 9/27/2015 8:03 AM, Cai Gengyang wrote:


Step 1 : Download Python 3.5 from here ---
https://www.python.org/downloads/ Step 2 : Install it Step 3 : Click
on the 'IDLE' button --- for me , I am using a Mac so I click on
'Finder', then type IDLE in the search field on the top right corner
of the 'Finder'.


> Step 4 : Click on the IDLE and it opens up, a happy

looking 'Python 3.5.0' shell there. There is however a warning that
this version may be unstable.


The warning is about the Apple-supplied version of tcl/tk, not about 
Idle.  Any tkinter program could have a problem.




--
Terry Jan Reedy

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


Re: Beginning question #compilersetup, #windows7, #vs2010

2015-09-27 Thread Mark Lawrence

On 26/09/2015 22:40, Jeff VanderDoes wrote:

All,

I'm fairly new to Python and was excited to start playing with it until
I ran into need to compile some extensions under windows 7 64 bit.  I've
done some searching but after more hours than I care to count being
unsuccessful setting up MS visual studio (2015, 2012, and 2010) with
service packs and SDKs I can tell I'm spinning my wheels and going
nowhere fast.

After trying to search through archives and the net I get some things
that are really old or are unique to their situation but just not what I
would expect for such a widely used language.

Are there any instructions/pointers that someone could point me to to be
able to set up visual studio for use with python.  I figure I'd just
start with 3.5 but have tried under 3.4 and even went back to 2.7 with
no luck.  I see I'm not the only one with frustration with the error
about not find vcvarsall.bat and the like.

Thanks for your help!

Jeff




https://docs.python.org/devguide/setup.html#windows

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: Django Tutorial (Database setup) Question

2015-09-27 Thread Joel Goldstick
On Sun, Sep 27, 2015 at 3:32 AM, Cai Gengyang  wrote:

> Hello all !
>
> So I am going through the (Database setup) chapter of this tutorial (
> https://docs.djangoproject.com/en/1.8/intro/tutorial01/) --- Its the
> section right after the first chapter on "Creating a project"
>
> I opened up mysite/settings.py as per the instructions on the Django
> tutorial.
>
> However, when I try to run the following command : $ python manage.py
> migrate to create the tables in the database,
>
> CaiGengYangs-MacBook-Pro:Weiqi CaiGengYang$ python manage.py migrate 
> input
>
> I get the following error message :
>
> /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python:
> can't open file 'manage.py': [Errno 2] No such file or directory  output
>
> Any idea how to solve this issue?
>
> Thanks a lot !
>
> You need to be in the directory that contains manage.py

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



-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Django Tutorial (Database setup) Question

2015-09-27 Thread Cai Gengyang
I believe I am already in the same directory that contains manage.py , but I 
still get an error (a syntax error). Checked the lines in settings.py and can't 
find anything wrong with them either. Posted my entire code below :


CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls

manage.py   mysite

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python manage.py migrate

Traceback (most recent call last):

  File "manage.py", line 10, in 

execute_from_command_line(sys.argv)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 338, in execute_from_command_line

utility.execute()

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 303, in execute

settings.INSTALLED_APPS

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 line 48, in __getattr__

self._setup(name)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 line 44, in _setup

self._wrapped = Settings(settings_module)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 line 92, in __init__

mod = importlib.import_module(self.SETTINGS_MODULE)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
 line 37, in import_module

__import__(name)

  File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45

'django.middleware.csrf.CsrfViewMiddleware',

  ^

SyntaxError: invalid syntax

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ 





On Monday, September 28, 2015 at 12:09:04 AM UTC+8, Joel Goldstick wrote:
> On Sun, Sep 27, 2015 at 3:32 AM, Cai Gengyang  wrote:
> Hello all !
> 
> 
> 
> So I am going through the (Database setup) chapter of this tutorial 
> (https://docs.djangoproject.com/en/1.8/intro/tutorial01/) --- Its the section 
> right after the first chapter on "Creating a project"
> 
> 
> 
> I opened up mysite/settings.py as per the instructions on the Django tutorial.
> 
> 
> 
> However, when I try to run the following command : $ python manage.py migrate 
> to create the tables in the database,
> 
> 
> 
> CaiGengYangs-MacBook-Pro:Weiqi CaiGengYang$ python manage.py migrate  
> input
> 
> 
> 
> I get the following error message :
> 
> 
> 
> /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python:
>  can't open file 'manage.py': [Errno 2] No such file or directory  output
> 
> 
> 
> Any idea how to solve this issue?
> 
> 
> 
> Thanks a lot !
> 
> 
> 
> You need to be in the directory that contains manage.py 
> Gengyang
> 
> --
> 
> https://mail.python.org/mailman/listinfo/python-list
> 
> 
> 
> 
> 
> -- 
> 
> 
> 
> Joel Goldstick
> http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Django Tutorial (Database setup) Question

2015-09-27 Thread Cai Gengyang
I believe I am already in the same directory that contains manage.py , but
I still get an error (a syntax error). Checked the lines in settings.py and
can't find anything wrong with them either. Posted my entire code below :


CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls

manage.py mysite

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python manage.py migrate

Traceback (most recent call last):

  File "manage.py", line 10, in 

execute_from_command_line(sys.argv)

  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
line 338, in execute_from_command_line

utility.execute()

  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
line 303, in execute

settings.INSTALLED_APPS

  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
line 48, in __getattr__

self._setup(name)

  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
line 44, in _setup

self._wrapped = Settings(settings_module)

  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
line 92, in __init__

mod = importlib.import_module(self.SETTINGS_MODULE)

  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
line 37, in import_module

__import__(name)

  File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45

'django.middleware.csrf.CsrfViewMiddleware',

  ^

SyntaxError: invalid syntax

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$

On Mon, Sep 28, 2015 at 12:08 AM, Joel Goldstick 
wrote:

>
>
> On Sun, Sep 27, 2015 at 3:32 AM, Cai Gengyang 
> wrote:
>
>> Hello all !
>>
>> So I am going through the (Database setup) chapter of this tutorial (
>> https://docs.djangoproject.com/en/1.8/intro/tutorial01/) --- Its the
>> section right after the first chapter on "Creating a project"
>>
>> I opened up mysite/settings.py as per the instructions on the Django
>> tutorial.
>>
>> However, when I try to run the following command : $ python manage.py
>> migrate to create the tables in the database,
>>
>> CaiGengYangs-MacBook-Pro:Weiqi CaiGengYang$ python manage.py migrate 
>> input
>>
>> I get the following error message :
>>
>> /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python:
>> can't open file 'manage.py': [Errno 2] No such file or directory  output
>>
>> Any idea how to solve this issue?
>>
>> Thanks a lot !
>>
>> You need to be in the directory that contains manage.py
>
>> Gengyang
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
>
>
> --
> Joel Goldstick
> http://joelgoldstick.com
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Help with Debugging

2015-09-27 Thread Cai Gengyang
http://pastebin.com/RWt1mp7F --- If anybody can find any errors with this 
settings.py file, let me know !

Can't seem to find anything wrong with it ...
-- 
https://mail.python.org/mailman/listinfo/python-list


Fwd: Django Tutorial (Database setup) Question

2015-09-27 Thread Chris Warrick
Forwarding to list (forgot about this stupid reply all thing, sorry).


-- Forwarded message --
From: Chris Warrick 
Date: 27 September 2015 at 19:50
Subject: Re: Django Tutorial (Database setup) Question
To: Cai Gengyang 


On 27 September 2015 at 19:39, Cai Gengyang  wrote:
> http://pastebin.com/index/RWt1mp7F  Looking through my code , can't seem
> to find any errors yet. All the parentheses seem to be in place too, this is
> weird ...
>
> On Mon, Sep 28, 2015 at 1:01 AM, Chris Warrick  wrote:
>>
>> On 27 September 2015 at 18:18, Cai Gengyang  wrote:
>> > I believe I am already in the same directory that contains manage.py ,
>> > but I
>> > still get an error (a syntax error). Checked the lines in settings.py
>> > and
>> > can't find anything wrong with them either. Posted my entire code below
>> > :
>>
>> >   File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45
>> > 'django.middleware.csrf.CsrfViewMiddleware',
>> >   ^
>> > SyntaxError: invalid syntax
>>
>> There’s a typo on or before line 45. Pastebin your full settings.py
>> file, and try looking for errors (like missing parentheses) yourself.
>>
>> --
>> Chris Warrick 
>> PGP: 5EAAEA16
>
>

On further inspection, this might be a Django or Python problem… try
re-installing Django. I don’t really know what could be wrong here.

--
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Beginning question #compilersetup, #windows7, #vs2010

2015-09-27 Thread eryksun
On Sat, Sep 26, 2015 at 4:40 PM, Jeff VanderDoes
 wrote:
>
> I'm fairly new to Python and was excited to start playing with it until I
> ran into need to compile some extensions under windows 7 64 bit.  I've done
> some searching but after more hours than I care to count being unsuccessful
> setting up MS visual studio (2015, 2012, and 2010) with service packs and
> SDKs I can tell I'm spinning my wheels and going nowhere fast.

For 3.5 you should be able to just install Visual Studio 2015
Community Edition. This is the current release of Visual Studio, so if
you encounter problems, at least finding help won't be one of them.

2.7 is built with VS 2008, which is no longer supported. But, thanks
to Steve Dower, Microsoft distributes an unsupported version for
building Python 2.7 extension modules [1].

3.4 is built with the fairly old VS 2010, for which the free Express
edition is no longer available. But you should be able to configure a
command-line build environment. Install the Windows SDK 7.1 [2] and
the VC++ 2010 SP1 Compiler Update [3]. Then run the Windows SDK 7.1
Command Prompt [4], and enter

SetEnv /Release /x64

If you plan to do native debugging outside of Visual Studio, install
the Debugging Tools for Windows [5] when installing the SDK. You can
download public debug symbols for operating system components using
Microsoft's symbol server. To do this, create a "C:\Symbols"
directory, and set the following environment variable:


_NT_SYMBOL_PATH=symsrv*symsrv.dll*C:\Symbols*http://msdl.microsoft.com/download/symbols

Additionally you'll need Python's debug symbols, such as for 64-bit
3.4.3 [6]. I typically copy a PDB next to its related DLL/EXE. This is
what 3.5's installer does when you select the option to install debug
symbols (nice job, Steve!). You can also unzip the PDBs to a directory
that's in _NT_SYMBOL_PATH, or update the symbol path dynamically using
.sympath+ and .reload [7].

[1]: https://www.microsoft.com/en-us/download/details.aspx?id=44266
[2]: https://www.microsoft.com/en-us/download/details.aspx?id=8279
[3]: https://www.microsoft.com/en-us/download/details.aspx?id=4422
[4]: https://msdn.microsoft.com/en-us/library/ff660764
[5]: https://msdn.microsoft.com/en-us/library/ff551063
[6]: https://www.python.org/ftp/python/3.4.3/python-3.4.3.amd64-pdb.zip
[7]: https://msdn.microsoft.com/en-us/library/ff565407
-- 
https://mail.python.org/mailman/listinfo/python-list


PY3.5 and nnumpy and scipy installation problem

2015-09-27 Thread paul . anton . letnes
Easiest way of installing is removing the python you've installed already and 
installing continuum's anaconda python 3.x (for x = 4 or 5). It has "batteries 
included" - numpy, scipy and many others! 

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


PY3.5 and nnumpy and scipy installation problem

2015-09-27 Thread paul . anton . letnes
I'll heartily recommend anaconda python. It's got everything you need 
prepackaged. 

Remove what you installed before. 

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


Interacting with a web site, which lib?

2015-09-27 Thread paul . hermeneutic
Does anyone have an opinion on the relative merits of using the
following packages to interact with web sites?

Mechanize - cannot run under Python 3
Requests
Robobrowser
-- 
https://mail.python.org/mailman/listinfo/python-list


Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Tim Daneliuk
I am the author of https://www.tundraware.com/Software/twander, a cross 
platform, macro-
programmable file manager written in python/tkinter.

Of late, I am seeing core dumps of this program (which has been stable/mature 
for some
years) but only on VPS servers, both FreeBSD 10 and CentOS 6/7.

Is there are know problem here and/or can anyone suggest and approach to 
isolate the 
fault?

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


Re: Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Tim Daneliuk
On 09/27/2015 04:20 PM, Tim Daneliuk wrote:
> I am the author of https://www.tundraware.com/Software/twander, a cross 
> platform, macro-
> programmable file manager written in python/tkinter.
> 
> Of late, I am seeing core dumps of this program (which has been stable/mature 
> for some
> years) but only on VPS servers, both FreeBSD 10 and CentOS 6/7.
> 
> Is there are know problem here and/or can anyone suggest and approach to 
> isolate the 
> fault?
> 
> Thanks
> 


Correction:  It dumps core on FreeBSD 10.2 but on CentOS 6 I get:

Traceback (most recent call last):
  File "/usr/local/TundraWare/bin/twander.py", line 5464, in 
UI = twanderUI(UIroot)
  File "/usr/local/TundraWare/bin/twander.py", line 2152, in __init__
self.CmdBtn = Menubutton(self.mBar, text=COMMANDMENU, underline=0, 
state=DISABLED)
  File "/usr/lib64/python2.6/lib-tk/Tkinter.py", line 2710, in __init__
Widget.__init__(self, master, 'menubutton', cnf, kw)
  File "/usr/lib64/python2.6/lib-tk/Tkinter.py", line 1932, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError

This code runs fine on physical FreeBSD/CentOS/Debian servers, Rasperberry PIs 
running
Raspbian, OSX, VirtualBox and VMware Workstation Linux servers, Windows  so 
I suspect
this is somehow VPS related but not sure where to start.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Interacting with a web site, which lib?

2015-09-27 Thread Laura Creighton
In a message of Sun, 27 Sep 2015 15:05:37 -0600, paul.hermeneu...@gmail.com wri
tes:
>Does anyone have an opinion on the relative merits of using the
>following packages to interact with web sites?
>
>Mechanize - cannot run under Python 3
>Requests
>Robobrowser

I don't know anything about mechanize or robobrowser.
Requests is great stuff.  Test it with responses
https://github.com/getsentry/responses

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


Re: Interacting with a web site, which lib?

2015-09-27 Thread Gonzalo V
I am working with selenium for.python. easy and powerful

saludos,
desde un móvil.
El sep 27, 2015 6:01 p.m., "Laura Creighton"  escribió:

> In a message of Sun, 27 Sep 2015 15:05:37 -0600,
> paul.hermeneu...@gmail.com wri
> tes:
> >Does anyone have an opinion on the relative merits of using the
> >following packages to interact with web sites?
> >
> >Mechanize - cannot run under Python 3
> >Requests
> >Robobrowser
>
> I don't know anything about mechanize or robobrowser.
> Requests is great stuff.  Test it with responses
> https://github.com/getsentry/responses
>
> Laura
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Interacting with a web site, which lib?

2015-09-27 Thread Gonzalo V
Selenium

https://selenium-python.readthedocs.org/

i used pip for install it.



Saludos,
Gonzalo

2015-09-27 18:16 GMT-04:00 Gonzalo V :

> I am working with selenium for.python. easy and powerful
>
> saludos,
> desde un móvil.
> El sep 27, 2015 6:01 p.m., "Laura Creighton"  escribió:
>
>> In a message of Sun, 27 Sep 2015 15:05:37 -0600,
>> paul.hermeneu...@gmail.com wri
>> tes:
>> >Does anyone have an opinion on the relative merits of using the
>> >following packages to interact with web sites?
>> >
>> >Mechanize - cannot run under Python 3
>> >Requests
>> >Robobrowser
>>
>> I don't know anything about mechanize or robobrowser.
>> Requests is great stuff.  Test it with responses
>> https://github.com/getsentry/responses
>>
>> Laura
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Paul Rubin
Tim Daneliuk  writes:
> this is somehow VPS related but not sure where to start.

How are you expecting tkinter to work on a vps, when there is no window
system?  It wouldn't surprise me if tk is crashing.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Terry Reedy

On 9/27/2015 5:31 PM, Tim Daneliuk wrote:


Of late, I am seeing core dumps of this program (which has been stable/mature 
for some
years) but only on VPS servers, both FreeBSD 10 and CentOS 6/7.



Correction:  It dumps core on FreeBSD 10.2


Dumping core when there is no terminal server, instead of exiting 
gracefully, might be considered a bug.



but on CentOS 6 I get:

Traceback (most recent call last):
   File "/usr/local/TundraWare/bin/twander.py", line 5464, in 
 UI = twanderUI(UIroot)
   File "/usr/local/TundraWare/bin/twander.py", line 2152, in __init__
 self.CmdBtn = Menubutton(self.mBar, text=COMMANDMENU, underline=0, 
state=DISABLED)
   File "/usr/lib64/python2.6/lib-tk/Tkinter.py", line 2710, in __init__
 Widget.__init__(self, master, 'menubutton', cnf, kw)
   File "/usr/lib64/python2.6/lib-tk/Tkinter.py", line 1932, in __init__
 (widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError


Beside Paul's comment, I suggest running with 2.7.latest and tk 
8.6.latest if at all possible to get tkinter and tk bug fixed.


Also, Menubutton is considered obsolete for Window level menus, so it 
may not be maintained as well.  Just use Menu if at all possible.


--
Terry Jan Reedy

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


python.org bugs

2015-09-27 Thread Terry Reedy

1. No easy way to report bugs "Submit Website Bugs" takes me to
https://github.com/python/pythondotorg/issues
which wants me to get an account and login, even to report a typo, or in 
this case, a dead link.  I won't do that.


For bugs.python.org, one can report bugs here and someone who agree 
might file a bug.  Anyone here with github account?


2. https://github.com/python/pythondotorg/issues
links 'Grail' to grail.python.org, which seems to have been removed.

3. The site does not run link checks to find things like this itself.

--
Terry Jan Reedy

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


Re: Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Paul Rubin
Terry Reedy  writes:
> Dumping core when there is no terminal server, instead of exiting
> gracefully, might be considered a bug.

I wonder if it's a missing or wrong .so since there's no X and maybe
no X libraries.  That might lead to a crash.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help with Debugging

2015-09-27 Thread Steven D'Aprano
On Mon, 28 Sep 2015 03:45 am, Cai Gengyang wrote:

> http://pastebin.com/RWt1mp7F --- If anybody can find any errors with this
> settings.py file, let me know !
> 
> Can't seem to find anything wrong with it ...

Perhaps there is nothing wrong with it. What makes you think that there is?

Do you get an exception? If so, the exception will tell you where to start:
read the error message, look at the line it says the error occurred at, and
fix the problem.

If you need help, COPY and PASTE the *entire* traceback, starting from the
line "Traceback (most recent call last)" to the error message at the end,
and send it to us.



-- 
Steven

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


Re: python.org bugs

2015-09-27 Thread Chris Angelico
On Mon, Sep 28, 2015 at 9:57 AM, Terry Reedy  wrote:
> 1. No easy way to report bugs "Submit Website Bugs" takes me to
> https://github.com/python/pythondotorg/issues
> which wants me to get an account and login, even to report a typo, or in
> this case, a dead link.  I won't do that.
>
> For bugs.python.org, one can report bugs here and someone who agree might
> file a bug.  Anyone here with github account?

Sure, I'll file a bug for you. So far, though, this is no different
from pretty much any tracker I know of, except that github's tracker
requires a github account as opposed to a
specific-to-the-python-tracker account.

What's the issue, precisely?

> 2. https://github.com/python/pythondotorg/issues
> links 'Grail' to grail.python.org, which seems to have been removed.

Presumably this, but I don't follow.

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


Re: Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Tim Daneliuk
On 09/27/2015 05:29 PM, Paul Rubin wrote:
> Tim Daneliuk  writes:
>> this is somehow VPS related but not sure where to start.
> 
> How are you expecting tkinter to work on a vps, when there is no window
> system?  It wouldn't surprise me if tk is crashing.
> 

You may have heard about this thing called X Windows and this other thing called
ssh that easily permit VPS instances to run GUI code while displaying things
on a remote X server.


P.S. X applications like xterm work flawlessly on the hosts in question.

P.P.S.  You might want to dial down the snark, particularly since you seem
to be unfamiliar with the basics here.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Tim Daneliuk
On 09/27/2015 06:32 PM, Terry Reedy wrote:
> On 9/27/2015 5:31 PM, Tim Daneliuk wrote:
> 
>>> Of late, I am seeing core dumps of this program (which has been 
>>> stable/mature for some
>>> years) but only on VPS servers, both FreeBSD 10 and CentOS 6/7.
> 
>> Correction:  It dumps core on FreeBSD 10.2
> 
> Dumping core when there is no terminal server, instead of exiting gracefully, 
> might be considered a bug.
> 
>> but on CentOS 6 I get:
>>
>> Traceback (most recent call last):
>>File "/usr/local/TundraWare/bin/twander.py", line 5464, in 
>>  UI = twanderUI(UIroot)
>>File "/usr/local/TundraWare/bin/twander.py", line 2152, in __init__
>>  self.CmdBtn = Menubutton(self.mBar, text=COMMANDMENU, underline=0, 
>> state=DISABLED)
>>File "/usr/lib64/python2.6/lib-tk/Tkinter.py", line 2710, in __init__
>>  Widget.__init__(self, master, 'menubutton', cnf, kw)
>>File "/usr/lib64/python2.6/lib-tk/Tkinter.py", line 1932, in __init__
>>  (widgetName, self._w) + extra + self._options(cnf))
>> _tkinter.TclError
> 
> Beside Paul's comment, I suggest running with 2.7.latest and tk 8.6.latest if 
> at all possible to get tkinter and tk bug fixed.
> 
> Also, Menubutton is considered obsolete for Window level menus, so it may not 
> be maintained as well.  Just use Menu if at all possible.
> 

Unfortunately, CentOS tracks the corresponding RHEL component versions pretty 
much exactly (that's sort of the
point).  Moreover, this exact OS release level works flawlessly in other kinds 
of VMs and physical instances.


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


Re: Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Chris Angelico
On Mon, Sep 28, 2015 at 12:37 PM, Tim Daneliuk
 wrote:
> You may have heard about this thing called X Windows and this other thing 
> called
> ssh that easily permit VPS instances to run GUI code while displaying things
> on a remote X server.

I'd still be curious about the possibility of a missing/broken .so
file somewhere. On systems that don't have their own displays, stuff
can be missing or broken and nobody would notice. What happens if you
strace the thing? Are there any obvious issues with what it's loading
up?

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


Re: python.org bugs

2015-09-27 Thread Terry Reedy

On 9/27/2015 8:38 PM, Chris Angelico wrote:


What's the issue, precisely?


2. https://github.com/python/pythondotorg/issues


Sorry, this page
https://www.python.org/doc/essays/omg-darpa-mcc-position/
at "Python has been used to implement a web browser (Grail). "


links 'Grail' to grail.python.org, which seems to have been removed.


--
Terry Jan Reedy

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


Re: python.org bugs

2015-09-27 Thread Chris Angelico
On Mon, Sep 28, 2015 at 1:54 PM, Terry Reedy  wrote:
> Sorry, this page
> https://www.python.org/doc/essays/omg-darpa-mcc-position/
> at "Python has been used to implement a web browser (Grail). "

Got it, thanks.

https://github.com/python/pythondotorg/issues/828

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


Re: Help with Debugging

2015-09-27 Thread Cai Gengyang

This is my input and output error message (the whole thing) :


CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder 

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls 

manage.pymysite 

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python manage.py migrate 

Traceback (most recent call last): 

  File "manage.py", line 10, in  

execute_from_command_line(sys.argv) 

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 338, in execute_from_command_line 

utility.execute() 

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 303, in execute 

settings.INSTALLED_APPS 

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 line 48, in __getattr__ 

self._setup(name) 

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 line 44, in _setup 

self._wrapped = Settings(settings_module) 

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 line 92, in __init__ 

mod = importlib.import_module(self.SETTINGS_MODULE) 

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
 line 37, in import_module 

__import__(name) 

  File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45 

'django.middleware.csrf.CsrfViewMiddleware', 

  ^ 

SyntaxError: invalid syntax 

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ 





On Monday, September 28, 2015 at 8:10:26 AM UTC+8, Steven D'Aprano wrote:
> On Mon, 28 Sep 2015 03:45 am, Cai Gengyang wrote:
> 
> > http://pastebin.com/RWt1mp7F --- If anybody can find any errors with this
> > settings.py file, let me know !
> > 
> > Can't seem to find anything wrong with it ...
> 
> Perhaps there is nothing wrong with it. What makes you think that there is?
> 
> Do you get an exception? If so, the exception will tell you where to start:
> read the error message, look at the line it says the error occurred at, and
> fix the problem.
> 
> If you need help, COPY and PASTE the *entire* traceback, starting from the
> line "Traceback (most recent call last)" to the error message at the end,
> and send it to us.
> 
> 
> 
> -- 
> Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help with Debugging

2015-09-27 Thread Andrea D'Amore

On 2015-09-28 05:26:35 +, Cai Gengyang said:


  File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45

'django.middleware.csrf.CsrfViewMiddleware',

  ^

SyntaxError: invalid syntax


The syntax looks fine in the pastebin, did you possibly copy text from 
web thus pasting smartquotes or unprintables in your source file?



--
Andrea

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


Re: Help with Debugging

2015-09-27 Thread Cai Gengyang
I am glad to announce that it works now ! The error was an addition random 'qq' 
that somehow appeared in my settings.py file on line 44. Once I spotted and 
removed it , the code works. I have pasted the entire successful piece of code 
here for viewing and discussion ...

CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder
CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls
manage.py   mysite
CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python manage.py migrate
Operations to perform:
  Synchronize unmigrated apps: staticfiles, messages
  Apply all migrations: admin, contenttypes, auth, sessions
Synchronizing apps without migrations:
  Creating tables...
Running deferred SQL...
  Installing custom SQL...
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying sessions.0001_initial... OK
CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ 










On Monday, September 28, 2015 at 2:20:39 PM UTC+8, Andrea D'Amore wrote:
> On 2015-09-28 05:26:35 +, Cai Gengyang said:
> 
> >   File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45
> > 
> > 'django.middleware.csrf.CsrfViewMiddleware',
> > 
> >   ^
> > 
> > SyntaxError: invalid syntax
> 
> The syntax looks fine in the pastebin, did you possibly copy text from 
> web thus pasting smartquotes or unprintables in your source file?
> 
> 
> -- 
> Andrea
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Are There Known Problems With tkinter And VPS Servers?

2015-09-27 Thread Paul Rubin
Tim Daneliuk  writes:
> P.S. X applications like xterm work flawlessly on the hosts in question.

It could still be that tk requires some client libraries that are
missing, that xterm doesn't use.  xterm is a much older and cruftier
program.  Does Gnome work?  For that matter, does Idle work (it is
a tkinter client)?

I remember that a guy I used to work with ported tk to an embedded linux
box with a working X server and display, but still had a rather rough
time getting tk running.  All I can suggest is curling up with gdb for a
while.

This has a few diagnostic suggestions that seem worth a try:
http://ftp.ntua.gr/mirror/python/topics/tkinter/trouble.html

Next thing after that is probably curl up with gdb for a while.
-- 
https://mail.python.org/mailman/listinfo/python-list