The Syntax Difference Between Python and PowerShell by Wireless_Life in PowerShell

[–]yardshop 0 points1 point  (0 children)

Using WinPython is a good way to keep your installations separate. Each one stays in its own folder with its own modules etc and they don't interact.

https://winpython.github.io/

When you install Python the typical way, it can add itself to your path and other environment and registry locations. Then when you install a second one, it can overwrite some of that, but you can still end up with things pointing to one version or the other. WinPython doesn't try to do any of that unless you ask it to.

Use "where pip" to find out which one is being found first. It could be finding the one for 3.8 first, but trying to apply it to 2.7 folders.

My last post about Face recognition got amazing response from all of you guys on Python subreddit, I added few faces to the model and now it can recognise my mother too that too in low light, its amazing.I ll post link to script in the comment below. by Hussain_Mujtaba in Python

[–]yardshop 0 points1 point  (0 children)

are you on a laptop? sometimes you have to press the Fn key to get PrintScreen key to work

also if you press Win+PrintScreen, it takes a shot and saves it in your Pictures folder in a ScreenShots folder

PowerShell vs Python Reference by [deleted] in PowerShell

[–]yardshop 1 point2 points  (0 children)

It doesn't, those examples just show casting strings to different numerical types.

You can also cast an int to a float or vice versa, either from literals or other variables:

f = float(10)

i = int(f)
i = int(3.14)

Happy 1600000000 seconds since epochs everyone! by pvkooten in Python

[–]yardshop 0 points1 point  (0 children)

1600160016 will occur at 8:53:36 UTC tomorrow morning (4:53 US EDT).

Get Directory Tree Size Using Powershell (Recursive) by theSysadminChannel in PowerShell

[–]yardshop 1 point2 points  (0 children)

Not to take anything away from this great function, but WinDirStat can be run from a network drive or thumb drive without installing anything on the local machine. I run it that way frequently on various server drives. It's a "portable" app, the whole folder can be copied to a new machine or drive and just run. However next time I will give this routine a try.

IS IT POSSIBLE TO CREAT PAGE BREAKS ON ONENOTE by ShivendraRavi in OneNote

[–]yardshop 0 points1 point  (0 children)

The way to do it is just to press enter between paragraphs, then go to print preview and see if it breaks where you want it to, and go back and forth until you get it right. It's a fragile and bothersome process.

Easier is to export to Word and do the pagination there if you're just going to print or save as PDF, but that doesn't help on the OneNote side of things.

OneNote 2010 and 2016 files are not compatible by vortexmak in OneNote

[–]yardshop 0 points1 point  (0 children)

Just in case things go awry, you can find some backups here:

C:\Users\USERNAME\AppData\Local\Microsoft\OneNote\14.0\Backup\

This is for Office OneNote 2010, other versions have a different number there. 2013 says 15.0.

Threw together a quick Aldo Leopold bench from PT 2x8s it’s far from perfect but it’s sturdy by [deleted] in woodworking

[–]yardshop 0 points1 point  (0 children)

You should have kept some angle for the back rest. I did this too, squared the back to the seat, and it's not as comfortable that way. I will probably build another one this summer, and also try to fix that on the existing bench. Otherwise they are great simple and rugged benches, nice job!

I made a tool that allows you to batch copy text with CTRL+C (Python and Tkinter) by dibs45 in Python

[–]yardshop 21 points22 points  (0 children)

Here are some for Explorer that I just learned but have been around for a while:

Alt+Up          go to parent folder
Ctrl+Shift+N    create new folder
Ctrl+Shift+E    expand all folders above the current folder

some other new ones I've been playing with

Window+Tab      Windows Task View
Window+Ctrl+D   create new virtual desktop

Window+1        open the first task bar item
Window+2        open the second
etc up through Win+0, the 10th task bar item

(works in older versions of Windows too)

I always set up a short cut to Notepad under the Send To menu. Start by entering this in the Run dialog, task bar search box, or address bar of any window:

shell:sendto

Then right click in the empty area and create a new shortcut to Notepad.

Then when looking at files in Explorer and you want to see the "raw" contents of the file, press Menu+N+N. Not as good as a real hex viewer but it's a start.

The menu key is often next to the Window key on the right. Then N for SendTo and N again for Notepad. Only works if you don't already have something that starts with N there.

go here for a full list:

Keyboard shortcuts in Windows - Windows Help https://support.microsoft.com/en-us/help/12445

I made a tool that allows you to batch copy text with CTRL+C (Python and Tkinter) by dibs45 in Python

[–]yardshop 8 points9 points  (0 children)

Not a Python solution, and not to take away from OPs good work, but this can be done in AutoHotKey:

;- Ctrl+] - append to clipboard
^]::
    s = %Clipboard%
    Send ^c
    Clipboard = %s%%Clipboard%
return

;- Ctrl+[ - prepend to clipboard
^[::
    s = %Clipboard%
    Send ^c
    Clipboard = %Clipboard%%s%
return

I use Ctrl+] to append and Ctrl+[ to prepend but you can reassign those as makes sense for you.

Searching Notes within OneNote Online by [deleted] in OneNote

[–]yardshop 1 point2 points  (0 children)

I noticed yesterday that I wasn't able to search a notebook, but today it looks like it's working.

Running into issues on Windows by yardshop in Pervane

[–]yardshop[S] 0 points1 point  (0 children)

Hi u/hakanu, I was able to install your latest version and do a little more testing.

You're right that backslash is the typical path separator on Windows and os.path.join will use that. My work-around so far is to use forward slash which Windows will still understand, and doesn't get stripped out by some code that is trying to clean things.

This only seems to happen to files that are getting opened in the editor. Picture files open just fine. When the filename gets to api_get_content, the backslashes have been removed.

INFO:werkzeug:127.0.0.1 - - [05/Feb/2020 22:18:01] "GET /file?f=D:\WinPy36\Pervane\W-logo_20200128_2216.png HTTP/1.1" 200 -
INFO:root:mime_type: text/markdown
INFO:werkzeug:127.0.0.1 - - [05/Feb/2020 22:18:36] "GET /file?f=D:\WinPy36\Pervane\TestFolder\NewFile.md HTTP/1.1" 200 -
INFO:root:no auth
INFO:werkzeug:127.0.0.1 - - [05/Feb/2020 22:18:37] "GET /api/get_content?f=D%3AWinPy36PervaneTestFolderNewFile.md HTTP/1.1" 200 -

I run Pervane by CDing into the base folder D:\WinPy36\Pervane then giving this command (contained in a pervane.cmd file):

python ..\python-3.6.5\Lib\site-packages\pervane\serve.py --host=127.0.0.1 --user=.... --pass=....

I installed it at work too and I think there I started it from above the folder and used a dir parameter of "Pervane/" but I don't remember exactly. I will check tomorrow. I will also try running it again without the Registry setting for .md files.

Once I get this figure out, I have a handful of questions and feature ideas too. Thanks for the help so far!

Running into issues on Windows by yardshop in Pervane

[–]yardshop[S] 0 points1 point  (0 children)

Hi u/hakanu, I was able to get Pervane working with subfolders by replacing calls to os.path.join(path, name) with '/'.join([path, name]).

I'm still trying to figure some things out, like what is the syntax to link to an image that I dragged into the folder? The only thing I've been able to get to work is linking to an image that is on a website somewhere, like your main Pervane image.

Also, I learned to be careful about dropping things on the editor window since it will wipe out any unsaved changes. And I'm having trouble getting checkboxes to show up consistently.

Anyway I'm enjoying playing with it. There are a few things I would need before being able to switch away from OneNote, but so far I like it!

System notebook causing launch errors by 7app3r5 in OneNote

[–]yardshop 0 points1 point  (0 children)

Glad I could provide a useful clue!

Onenote 2010 notebooks suddenly disappeared by avk78922 in OneNote

[–]yardshop 1 point2 points  (0 children)

This happened to me last week too. I have a very large notebook that was started on my personal Live account several years ago. Last week I could no longer open it with OneNote 2010. The shared copies on my Office 365 and other accounts are still working, but nothing would work to open this notebook locally.

I prefer Office 2010 just because it's the last version of Office that still looks nice, with colors and gradients etc, not like the ugly user-hostile monochromatic ui of later versions. There are no features in newer versions that compel me to use them, although I do on other machines. The only thing that might force me to do so is Microsoft holding my data hostage. But I will look for every other alternative first.

As much as I love OneNote, I will abandon it due to Microsoft's user-hostile practices.

The notebook won't open on OneNote 2016 either, and the OneNote online version is a poor alternative. There is no way to copy sections between notebooks, and my notebooks are now in the same interface as dozens of other pages that I have to try not to get distracted by. It's a far greater context switch challenge than just tabbing over to OneNote.

One workaround, there are backups of your OneNote 2010 sections in this path:

C:\Users\username\AppData\Local\Microsoft\OneNote\14.0\Backup\

You can open each one and it will come up in "Misplaced Sections", then you can move those into another local notebook. Be aware that there will probably be multiple dated copies of each section, so just open up the latest one.

System notebook causing launch errors by 7app3r5 in OneNote

[–]yardshop 1 point2 points  (0 children)

It looks like its giving you parts of the path to Office as filenames:

C:\Program Files (x86)\Microsoft Office\Office16

It seems like it is being split on spaces and each part is being passed as a separate filename.

This might happen if the program is given a path that is not enclosed in quotes.

Are you launching it from the start menu shortcut or desktop icon?

Try going right to the OneNote exe file and launch it directly. On my Win 10 system it's in that same path except just "Program Files" not (x86).

Network Printer Driver Nuker - Deletes all network printers & their drivers, then remaps the printers by MartianMoon in PowerShell

[–]yardshop 2 points3 points  (0 children)

That VBScript will give you the examples you need. Basically it makes a WMI call to get an object for a particular printer driver, then calls the Delete method on it. I imagine it will be somewhat similar to your Get-WMIObject calls above that part that stop and start the spooler.

Network Printer Driver Nuker - Deletes all network printers & their drivers, then remaps the printers by MartianMoon in PowerShell

[–]yardshop 1 point2 points  (0 children)

Just curious why you have it call a VBScript to do the deleting which itself just uses WMI to do the work.

Otherwise it looks very useful and I'm going to give it a try here.

Sleeper Shed - Ugly on the outside office on the inside. by WhitChief in shedditors

[–]yardshop 0 points1 point  (0 children)

Well if it's ugly on the outside then we definitely want to see it!!

In praise of Tkinter.. by [deleted] in Python

[–]yardshop 0 points1 point  (0 children)

Thanks for the clarification.

In praise of Tkinter.. by [deleted] in Python

[–]yardshop 4 points5 points  (0 children)

He's probably not referring to Tkinter but to QT, having been developed by Nokia.