Re: Cannot find reference 'bluetoothctl' in 'sh.py' less... (Ctrl+F1)

2018-11-15 Thread tommy yama
Hello there

Have you tried it with npm?

https://www.npmjs.com/package/bluetoothctl

On Thu, 15 Nov 2018, 15:10 dieter  srinivasan  writes:
> > As am newbie to python, I am planning to automate BT functionality test
> > using Bluez "bluetoothctl" utility  by writing python wrapper and robot
> > framework integrated with Jenkins
> > ...
> > *$ pip3 install bluetoothctl*
> > *Collecting bluetoothctl*
> > *  Could not find a version that satisfies the requirement bluetoothctl
> > (from versions: )*
> > *No matching distribution found for bluetoothctl*
>
> "pip[*]" is a tool to install Python packages -- typically from
> the Python package index (-->"https://pypi.org";).
> The error message above indicates that "bluetoothctl" is not
> managed by this package index.
>
> I assume that it is not a Python package at all (but rather some
> command line utility in some operating system package). At least
> on my Ubuntu 18.04, "bluetoothctl" is an operating system utility.
>
> *from sh import bluetoothctl*
>
> *mac = "your bluetooth mac"*
> *bluetoothctl("connect", mac)*
>
> > In the pycharm, I see the below error message :
> >
> > *Cannot find reference 'bluetoothctl' in 'sh.py' less... (Ctrl+F1) *
> > *Inspection info: This inspection detects names that should resolve but
> > don't. Due to dynamic dispatch and duck typing, this is possible in a
> > limited but useful number of cases. Top-level and class-level items are
> > supported better than instance items.*
> >
> > Could you please help me to resolve the above issue, like why am I seeing
> > the above issue it seems to be some importing "bluetoothhctl" module
> issue
> > (sorry if my understanding is wrong)
>
> I do not know the "sh" package. It might be a utility
> that turns a command line utility into a Python callable --
> implicitely on "import" of the corresponding name.
>
> If this is the case, it may confuse "PyCharm" (which does not
> expect such dynamism). You could then safely ignore this confusion.
>
> Try to execute your code. Should you get an exception
> (e.g. an `ImportError: cannot import "bluetoothctl" from module "sh"`),
> then come back.
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Unable to install Python on my windows 8 PC

2018-11-15 Thread eryk sun
On 11/15/18, dieter  wrote:
> Prospero Akai  writes:
>> I forgot to check the 'Add To Path' box while installing python from
>> www.python.org. I uninstalled then try to install again but I have been
>> getting this error message since then:
>>
>> one or more issues caused the setup to fail. please fix the issues and
>> then retry setup. for more info see the log file.
>>
>> 0x80072ee7-Unspecified error

This is an HRESULT error (i.e. 0x8???) wrapping the Windows
subsystem (i.e. 0x8007) error code ERROR_WINHTTP_NAME_NOT_RESOLVED
(0x2EE7, the server name cannot be resolved). Try installing the
offline version:

https://www.python.org/ftp/python/3.7.1/python-3.7.1-amd64.exe

> When I remember right, then modern Python versions require Windows 10.
> Check the installation requirements for the Python version you try
> to install.

A feature release of Python supports Windows releases that have at
least extended support (e.g. free security updates) from Microsoft
[PEP 11]. Extended support for Windows 7 ends on 2020-01-14. Python
3.8 will be released on 2019-10-20 [PEP 569], so it's the last version
to support Windows 7.

Extended support for Windows 8.1 ends on 2023-01-10. I suppose 3.9
will be released mid 2021 and 3.10 in late 2022, so probably 3.10 will
be the last version to support Windows 8.1.

Extended support for Windows 10 ends on 2025-10-14. Depending on
release timing, the last version to support Windows 10 probably will
be either 3.11 (mid 2024) or 3.12 (late 2025).
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: IDLE Default Working Directory

2018-11-15 Thread eryk sun
On 11/14/18, Irv Kalb  wrote:
>
> When working with data files, I tell students to put their project (their
> main program and any other related files) in a folder.  Then, in their calls
> to "open", I tell them to just give the name of the data file e.g.,
> 'MyData.txt', or a path relative from the current folder, e.g.,
> 'MyData/DataFile.txt'.  That makes things simple in a teaching environment
> and works on both Macs and Windows.

I hope you provide code to change the working directory to the script
directory (e.g. based on __file__, assuming it's not a frozen script).
Don't let them assume that these are the same. A process can be
started with any valid working directory. If you double click on a
script in Explorer, it happens to set the working directory to the
script directory. That's not necessarily the case for the Win+R run
dialog, a shell command line, or generally any call that runs the
script (e.g. system, spawnl, or WinAPI ShellExecuteEx and
CreateProcess).
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: IDLE Default Working Directory

2018-11-15 Thread Terry Reedy

On 11/13/2018 9:04 PM, Christman, Roger Graydon wrote:

On 13 Nov 2018, at 09:51, Bev in TX  wrote:


On Nov 12, 2018, at 5:50 PM, Terry Reedy  wrote:

For me, open (command-O) opens 'Documents'.  I presume it should be easy enough 
to move into a 'py' subfolder.


The whole point is for Idle -> File -> Open (or command-O) to automatically 
open to a specific folder.

Bev in TX


Thank you, Bev in TX for clarifying my question.  That is indeed what I seek.


The problem is that having Open and SaveAs always opening in one 
specific directory is not always the right thing to do.  The OS, OS user 
settings, the method of starting IDLE, and the active window when Open 
or SaveAs is invoked.


https://bugs.python.org/issue22121 is about changing the installation 
default Shell directory on Windows, which is the closest thing to an 
application or session directory.  The current rules seems not to be 
documented, but I worked out some of them in msg224587.


https://bugs.python.org/issue28775 is about adding a user option to set 
the startup (Shell) directory in IDLE (when not overriden by the startup 
method).  I believe that this is what you are asking for, or at least 
the closest thing thereto.


 >  My course has proved cumbersome every time a student created a new 
program in class, since they would have to change folders.And when


I got to working with data files, I ended up with a little punt to avoid having 
to specify a complete path name to get to a workable directory.


My students are not programmers.  I have English majors, Education majors, and 
students in their first year at a University.  I won't say they are completely 
computer-illiterate, they can use a browser well enough.   But I expect none of 
them to have ever seen the command line, so I really don't want to go that 
route.

As far as activating IDLE on this Windows 10 system,

I go down to the search bar at the bottom left, type 'IDLE', and then up comes 
a list of various installations

we have lying around, including 2.7, 3.4, and 3.6 versions.   I have them just 
select the 3.6 version from the list to launch IDLE.I don't consider that 
quite the same as using a 'shortcut', since we are not clicking on any icon on 
the desktop.


If you right-click an IDLE search result and select 'open file 
location', you see a directory of shortcuts, any of which can be copied 
to desktop and then edited by selecting 'properties'.



I am not on the campus-wide labs right now, so I cannot really say much further 
-- and I haven't tried right-clicking on those items to see if configuration 
options show up, to talk to the %AppData% path, etc.


The Penn State computer labs are networked -- each computer has a C: drive, 
which I presume might be local to each machine -- but in any case, I think it 
is read-only
to the students.  And since they could easily sit down at a different machine 
on any day, I wouldn't want to rely on any configuration file or anything on 
the C drive anyway.

There is a networked U: drive (for users) that is campus wide, which is useful. 
 There is also a virtual V: drive, which simply maps to each individual's 
folder set aside for them on the U: drive.   That place would be ideal for my 
purposes as a place to save code and data files.


In this configuration, can users use Options => Configure IDLE => 
Settings (dialog) to set user options (such as the font size) and have 
their changes persist to another session, possibly on another machine?


But the default directory is somewhere else.   I would
have to get back on campus before I can quote exactly,
but wherever it is a readonly file space that's not the
Desktop or My Documents, or who knows what.

I'd preferably like to reset the default to the V: drive
(or even create a Python folder on that virtual V: drive).


We ran into this on #22121.  Although the startup directory should be a 
subdirectory of the home directory, there is typically no standard name 
for such, even across users on one machine.



And the real challenge is to come up with the simplest
solution that I can explain or show to first-time programming students in under 
a minute, which therefore does not involve the command-line interface.

I don't want to scare half the students away in the very first class, just 
trying to configure their development environment.


If that's impossible, then I guess I'll have to fire a note off to the  university tech 
support requesting them to play with that "Start In" option through %AppData%, 
or whatever it was.



--
Terry Jan Reedy

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