Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
mbt
Aug 13, 2012

Frequent Handies posted:

There's a good answer on Stackoverflow using pywin32clipboard and another answer lower down using ctypes that doesn't require additional imports. I used the first answer ages ago to do some clipboard work.

:( I wish it were that simple. My problem is I'm trying to write a (perfectly legitimate) path of exile script that gets item data. Normally when you hover over an item and press ctrl-C, the item's data is copied to your clipboard. Unfortunately that ctrl-c functionality is shared between a few very popular utilities, so I wondered if I could force windows to 'copy' unknown text without pressing the keys. I've used some of those answers in the past, and if I knew what I wanted any of those answers would have worked :shobon:

Adbot
ADBOT LOVES YOU

Hadlock
Nov 9, 2004

There's probably some glue code module that will allow you to access a .net function to accomplish your goal either directly or via powershell

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
This is a bit Python but probably more Windows. I'll ask here and move to the Windows threat if I get nothing.

I've written some Python to use PyAutoGUI/Pillow/OpenCV to do some image finding and clicking. I run that on my server as my main computer is a Mac and PyAutoGUI just goes funny with a Retina display. I use Windows Remote Desktop to remote in and when the session is open it goes on its merry way. The problem is, if I close Remote Desktop it stops working. I can leave a normal Selenium script running, and it will happily scrape without the Remote Desktop window being open, but Pillow doesn't.

The relevant part of the error that it throws is...

Python code:
  region=self.region, confidence=0.95)
  File "C:\Users\Dom\venv\lib\site-packages\pyscreeze\__init__.py", line 300, in locateCenterOnScreen
    coords = locateOnScreen(image, **kwargs)
  File "C:\Users\Dom\venv\lib\site-packages\pyscreeze\__init__.py", line 270, in locateOnScreen
    screenshotIm = screenshot(region=None) # the locateAll() function must handle cropping to return accurate coordinates, so don't pass a region here.
  File "C:\Users\Dom\venv\lib\site-packages\pyscreeze\__init__.py", line 315, in _screenshot_win32
    im = ImageGrab.grab()
  File "C:\Users\Dom\venv\lib\site-packages\PIL\ImageGrab.py", line 41, in grab
    size, data = grabber()
OSError: screen grab failed
I'm assuming the problem is that Windows will still run calculations but won't generate an output if RDP is not on. Can anyone think of a creative solution? Is there a Python way to virtualise a monitor? Is there a way to make Windows not do this?

the yeti
Mar 29, 2008

memento disco



In a Python 3.7 script, I’m using Argparse to deal with command line args before passing them to an API. I have 1 positional argument that is the method the API should invoke, and the rest are arguments to that method.

Unfortunately since the variety of methods the API accepts don’t necessarily have many args in common, the number of .add_argument() calls I’m making is going way up- nothing wrong with that in itself but it’s disorganized and in that state there’s nothing stopping one from passing a method to the API with args it doesn’t use.

Right offhand I see two ways to mitigate/clean this up:

1, parse the args in two passes, first getting the method and any universal args, then using the method name to create an argument parser with just the args specific to that method ignoring the rest.

2, create some kind of data structure that maps argument to the methods it pertains to, and also the info that needs to go into add_argument(), allowing me to get the method from sys.argv[1] and then iterate over my data structure calling add_argument() and filling in the data for those records that match up with the method


#1 seems to be what Python intends, by way of sub parsers, but then you’d still have the same argument being handled in multiple places, and that seems less than optimal.

I feel like 2# is the most thorough solution but also kind of convoluted :shrug:

the yeti fucked around with this message at 17:40 on Mar 19, 2019

Spaz Medicine
Feb 22, 2008

the yeti posted:

In a Python 3.7 script, I’m using Argparse to deal with command line args before passing them to an API. I have 1 positional argument that is the method the API should invoke, and the rest are arguments to that method.

Unfortunately since the variety of methods the API accepts don’t necessarily have many args in common, the number of .add_argument() calls I’m making is going way up- nothing wrong with that in itself but it’s disorganized and in that state there’s nothing stopping one from passing a method to the API with args it doesn’t use.

Right offhand I see two ways to mitigate/clean this up:

1, parse the args in two passes, first getting the method and any universal args, then using the method name to create an argument parser with just the args specific to that method ignoring the rest

2, create some kind of data structure that maps argument to the methods it pertains to, and also the info that needs to go into add_argument(), allowing me to get the method from sys.argv[1] and then iterate over my data structure calling add_argument() and filling in the data for those records that match up with the method

I feel like 2# is the most thorough solution but also kind of convoluted :shrug:

Have you tried using subparser? I think it will help. It lets you create a different set of arguments for different values of a positional command:

https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_subparsers

mbt
Aug 13, 2012

Sad Panda posted:

I'm assuming the problem is that Windows will still run calculations but won't generate an output if RDP is not on. Can anyone think of a creative solution? Is there a Python way to virtualise a monitor? Is there a way to make Windows not do this?
I'm a bit confused at this setup. You want to capture your macs screen but instead rdp from a windows server? And you're running imagegrab on the rdp window of the mac?

Either way try pyvirtualdisplay, I'm pretty sure it was written for this purpose.

Joke option get another monitor and duplicate displays then use a webcam pointed at it to capture input.

the yeti
Mar 29, 2008

memento disco



Spaz Medicine posted:

Have you tried using subparser? I think it will help. It lets you create a different set of arguments for different values of a positional command:

https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_subparsers

I was prob editing while you replied :shobon:

quote:

#1 seems to be what Python intends, by way of sub parsers, but then you’d still have the same argument being handled in multiple places, and that seems less than optimal.

I like that functionality a lot to be sure! I’m just not sure how to handle say, if 8 of 25 methods have a ‘—start_date’ arg —that’s 8 times it’s repeated.

SurgicalOntologist
Jun 17, 2004

This might be an opportunity to switch to a more modern argument parsing library, such as the popular click, or my personal favorite, docopt. They each have their own solution to this kind of thing. Check them out and see if they appeal. I would hate to use argparse for anything complicated.

Spaz Medicine
Feb 22, 2008

the yeti posted:

I was prob editing while you replied :shobon:


I like that functionality a lot to be sure! I’m just not sure how to handle say, if 8 of 25 methods have a ‘—start_date’ arg —that’s 8 times it’s repeated.

You can create some argument parser which contains the repeated arguments (make sure to pass add_help=False), and the use the parents argument of the add_parser method to automatically include them. It can still get pretty ugly, but AFAIK that's the best way to handle it with Argparse.

the yeti
Mar 29, 2008

memento disco



SurgicalOntologist posted:

This might be an opportunity to switch to a more modern argument parsing library, such as the popular click, or my personal favorite, docopt. They each have their own solution to this kind of thing. Check them out and see if they appeal. I would hate to use argparse for anything complicated.

You know somehow it never occurred to me to investigate third party libraries for this, I’ll take a look!

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Sad Panda posted:

This is a bit Python but probably more Windows. I'll ask here and move to the Windows threat if I get nothing.

I've written some Python to use PyAutoGUI/Pillow/OpenCV to do some image finding and clicking. I run that on my server as my main computer is a Mac and PyAutoGUI just goes funny with a Retina display. I use Windows Remote Desktop to remote in and when the session is open it goes on its merry way. The problem is, if I close Remote Desktop it stops working. I can leave a normal Selenium script running, and it will happily scrape without the Remote Desktop window being open, but Pillow doesn't.

The relevant part of the error that it throws is...

Python code:
  region=self.region, confidence=0.95)
  File "C:\Users\Dom\venv\lib\site-packages\pyscreeze\__init__.py", line 300, in locateCenterOnScreen
    coords = locateOnScreen(image, **kwargs)
  File "C:\Users\Dom\venv\lib\site-packages\pyscreeze\__init__.py", line 270, in locateOnScreen
    screenshotIm = screenshot(region=None) # the locateAll() function must handle cropping to return accurate coordinates, so don't pass a region here.
  File "C:\Users\Dom\venv\lib\site-packages\pyscreeze\__init__.py", line 315, in _screenshot_win32
    im = ImageGrab.grab()
  File "C:\Users\Dom\venv\lib\site-packages\PIL\ImageGrab.py", line 41, in grab
    size, data = grabber()
OSError: screen grab failed
I'm assuming the problem is that Windows will still run calculations but won't generate an output if RDP is not on. Can anyone think of a creative solution? Is there a Python way to virtualise a monitor? Is there a way to make Windows not do this?

I'm a little fuzzy on the details here, but IIRC, you can do something like running Windows in a VM on your server. Something about how you can configure that makes Windows think you're connected locally, but actually you're connected with VNC.

Maybe that bit of info will help you figure it out...

NinpoEspiritoSanto
Oct 22, 2013




Seconding the click suggestion for the cli arg thing.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

Meyers-Briggs Testicle posted:

I'm a bit confused at this setup. You want to capture your macs screen but instead rdp from a windows server? And you're running imagegrab on the rdp window of the mac?

Either way try pyvirtualdisplay, I'm pretty sure it was written for this purpose.

Joke option get another monitor and duplicate displays then use a webcam pointed at it to capture input.

Poorly explained. I'll try again.

I've got some Python code. It uses Pillow, OpenCV and PyAutoGUI to do some clicking based on images. At the moment, it is running on an ESXi Windows 10 server that I connect to from a Macbook using Microsoft Remote Desktop. If the Remote Desktop window is open (on my Mac) then it plays wonderfully. If the Remote Desktop window is closed, it fails and throws the OSError that I posted earlier. I assume there is some check that is run that tells Windows that there's not really a display that it is outputting to.

I had a quick look at PyVirtualDispaly and it seems that it is *nix only.

Sad Panda fucked around with this message at 23:09 on Mar 19, 2019

the yeti
Mar 29, 2008

memento disco



Thanks, goons!

I need to try Click out sometime, but I don't think I wrote this app in a way that would make it easy to integrate, compared to docopt where I (think I) just need to write a helpfile and generate a parser I can drop in in place of the one I have.

mbt
Aug 13, 2012

Sad Panda posted:

Poorly explained. I'll try again.

I've got some Python code. It uses Pillow, OpenCV and PyAutoGUI to do some clicking based on images. At the moment, it is running on an ESXi Windows 10 server that I connect to from a Macbook using Microsoft Remote Desktop. If the Remote Desktop window is open (on my Mac) then it plays wonderfully. If the Remote Desktop window is closed, it fails and throws the OSError that I posted earlier. I assume there is some check that is run that tells Windows that there's not really a display that it is outputting to.

I had a quick look at PyVirtualDispaly and it seems that it is *nix only.

try mss for capturing images, from my quick test it doesn't care if you have monitors plugged in or if you specify a screencapture outside what actually exists

https://python-mss.readthedocs.io/examples.html

e: you still use the same processing code, those examples are pretty good at showing you how to transfer your code over

Foxfire_
Nov 8, 2010

Sad Panda posted:

Poorly explained. I'll try again.

I've got some Python code. It uses Pillow, OpenCV and PyAutoGUI to do some clicking based on images. At the moment, it is running on an ESXi Windows 10 server that I connect to from a Macbook using Microsoft Remote Desktop. If the Remote Desktop window is open (on my Mac) then it plays wonderfully. If the Remote Desktop window is closed, it fails and throws the OSError that I posted earlier. I assume there is some check that is run that tells Windows that there's not really a display that it is outputting to.

I had a quick look at PyVirtualDispaly and it seems that it is *nix only.

It's been awhile since I've had to care, but if I'm remembering right, when you drop your remote desktop session, that desktop stops existing and all the OS resources that were allocated for it get freed.

A desktop is a thing in Window's object model and participates in a bunch of stuff for both security and resources. Example: the administrator password prompt runs on its own desktop. You can't send or receive messages from windows on it from the default interactive desktop, they don't share clipboards, etc...

I think video memory will also be deallocated, so probably your immediate problem is that there isn't any buffer to screen grab from anymore. When you log back in, memory gets allocated again and all windows get told to repaint themselves.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

Meyers-Briggs Testicle posted:

try mss for capturing images, from my quick test it doesn't care if you have monitors plugged in or if you specify a screencapture outside what actually exists

https://python-mss.readthedocs.io/examples.html

e: you still use the same processing code, those examples are pretty good at showing you how to transfer your code over

That is a good point that I hadn't thought of. The scraping script that I have that works takes screenshots of things like error messages and does that just wonderfully when the Remote Desktop window is closed... so if I work out how to use PyAutoGUI/OpenCV with an image taken by MSS instead of captured by Pillow it might work.

edit - Nope. Tried that. MSS takes a shot but it is 1920x1080 of black. Selenium itself is able to take shots however.

Sad Panda fucked around with this message at 22:28 on Mar 20, 2019

mr_package
Jun 13, 2000
I'm writing a CRUD app and need to decide on my data storage format. I've started with XML but both native xml and lxml are really bad to work with. I've read the XPATH docs for lxml a hundred times and still cannot search the tree for a specific node. Should I just use JSON instead? YAML? I've used Python's json library before and IIRC converting to a dictionary was really easy, and once you have that working with the data is really easy.

It's frustrating because the data I'm working with formats well into XML. But my productivity is in the toilet fighting with lxml. Is there a point where it clicks, if I keep at it?

Hadlock
Nov 9, 2004

I don't think anyone has used XML in a greenfield project in years, for forward compatibility you should look at using json. XML has some advantages (it's fully extensible) but most users don't need that level of complexity. With JSON you're all wired up by default to work with pretty much any RESTful API on the planet out of the box, batteries included. I haven't seen XML on any greenfield project built after 2012 or so.

Parsing JSON didn't really click with me until I read the manual for (tangentally related) jq: https://stedolan.github.io/jq/manual/#Basicfilters

There is also yq (yaml) documentation: http://mikefarah.github.io/yq/

Parsing XML was a real struggle for me, as was json, but I was re(re-re-re)-reading the jq docs and suddenly json parsing just clicked for me.

Is there any reason why you can't store the data in a db using an ORM. Unless you need to export the doc for external users? Then you can just export to JSON or whatever crazy XML file you need to email to your peers.

Hadlock fucked around with this message at 01:08 on Mar 22, 2019

cinci zoo sniper
Mar 15, 2013




I’m not quite sure what your troubles with XML are, guys, but then again half of my work is built upon interacting with data providers that send us giant XMLs so I just had to accommodate that resort. Either way, if you need XML on a greenfield project you will know that you needed it - I would just make piles of poo poo in JSON and then rewrite into something else if necessary.

the yeti
Mar 29, 2008

memento disco



Just speaking for myself I did, and sometimes still do get tripped up by the extra complexities of XML as a tree of elements when 99% of the time I’m just de/serializing a list of objects and their attributes :shrug:

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

mr_package posted:

I'm writing a CRUD app and need to decide on my data storage format. I've started with XML but both native xml and lxml are really bad to work with. I've read the XPATH docs for lxml a hundred times and still cannot search the tree for a specific node. Should I just use JSON instead? YAML? I've used Python's json library before and IIRC converting to a dictionary was really easy, and once you have that working with the data is really easy.

It's frustrating because the data I'm working with formats well into XML. But my productivity is in the toilet fighting with lxml. Is there a point where it clicks, if I keep at it?

Why just those options?

Is sqlite not needs-suiting?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

https://repl.it/site/blog/gfx?ref=updates

PyGame in the browser.

It's hilarious how they do this. They're running X Windows over VNC through websockets right into your browser.

mr_package
Jun 13, 2000
I was kind of assuming once the tree was parsed I could reference specific nodes in the ElementTree by id or whatever and then modify as needed. I wanted to use the ElementTree as the main data object and avoid converting into Python objects. The problem I'm finding is I keep needing to loop over the tree, this seems so inefficient. Maybe it's ok? But with JSON I can build a nested dictionary that reads/writes easily and is super easy to work with.
Here's simple XML example:
code:
<string_mappings>
  <string_key id="tooltip_alerts">
  <os>windows</os>
  <strings>
    <string xml:lang="en-US">Alerts</>
    <string xml:lang="pt-BR">Alertas</>
  </strings>
  </string_key>
</string_mappings>
How would you modify 'Alerts' to 'Alerts!' using lxml? Can you do it without looping over the whole tree? I keep getting list or text objects back instead of reference to the actual node. I'm sure this is my fault for mis-using the library. But I did quick test in JSON and found it easy:
code:
{ "tooltip_alerts": 
  {
    "os": "windows",
    "strings": {
        "en-US": "Alerts",
        "pt-BR":  "Alertas"
        }
  }
}
In the JSON example, I just do data = json.load(file_handle) and then I can modify with data['tooltip_alerts']['strings']['en-US'] = "Alerts!". I can not figure out how to reference the XML with anything close to this level of ease.

Note: wrote both these by hand, may be small mistake, but hopefully gets the point of what I'm working with across.

Thermopyle posted:

Why just those options?

Is sqlite not needs-suiting?
I want it to be text-based so that version control can track it, diff/merge/history/blame etc. that we get for free there, I'd have to implement in app/db logic if I used a database, and it seems like overkill to do it there. (I asked in the database thread and the response I got was basically "it's not impossible but probably don't do it".) This is basically a db for versioned config files, but slightly more complex because there is a relational component to the data. I try to explain the project there, if anyone is super curious about the background. https://forums.somethingawful.com/showthread.php?threadid=2672629&pagenumber=246#post493445630

cinci zoo sniper
Mar 15, 2013




mr_package posted:

I was kind of assuming once the tree was parsed I could reference specific nodes in the ElementTree by id or whatever and then modify as needed. I wanted to use the ElementTree as the main data object and avoid converting into Python objects. The problem I'm finding is I keep needing to loop over the tree, this seems so inefficient. Maybe it's ok? But with JSON I can build a nested dictionary that reads/writes easily and is super easy to work with.
Here's simple XML example:
code:
<string_mappings>
  <string_key id="tooltip_alerts">
  <os>windows</os>
  <strings>
    <string xml:lang="en-US">Alerts</>
    <string xml:lang="pt-BR">Alertas</>
  </strings>
  </string_key>
</string_mappings>
How would you modify 'Alerts' to 'Alerts!' using lxml? Can you do it without looping over the whole tree? I keep getting list or text objects back instead of reference to the actual node. I'm sure this is my fault for mis-using the library.

code:
from lxml import etree

doc = '<string_mappings><string_key id="tooltip_alerts"><os>windows</os><strings><string xml:lang="en-US">Alerts</string><string xml:lang="pt-BR">Alertas</string></strings></string_key></string_mappings>'

foo = etree.fromstring(doc)
loc = foo.xpath("//*[contains(@xml:lang,'en-US')]")
loc[0].text = 'Alerts!'

new_doc = etree.tostring(foo).decode('UTF-8')
// is rather lazy of me, you can isolatedly laser into your structure with fully expanded xpath query.

cinci zoo sniper fucked around with this message at 19:16 on Mar 22, 2019

fourwood
Sep 9, 2001

Damn I'll bring them to their knees.
code:
root.xpath('string_key[@id="tooltip_alerts"]')[0].xpath('//string[@xml:lang="en-US"]')[0].text = "Alerts!"
Is something like this off the mark?

NinpoEspiritoSanto
Oct 22, 2013




MariaDB and I think postgres let you easily implement versioning on tables. I personally go to json, SQL and toml for most of my needs.

cinci zoo sniper
Mar 15, 2013




While you can have temporal views on tables in PostgreSQL, which I would highly recommend over MariaDB in general, that is a really overkill solution for most problems, imo.

mr_package
Jun 13, 2000
Thanks this is actually helping a lot. e.g. once I have the node matching id attribute I can do a relative search using "./strings/*[contains(@xml:lang,'en-US')]" to get just the specific string element. Also one of the mistakes I made was reading *some xpath operation* returned a list and assuming it was a list of text; the searches here are returning lists of Elements which is obviously more useful.

JSON still looks like the better/simpler way for this but I'm still on the fence. Since I'll still need to read/write some XML as part of this project I might as well try and get good at it, rather than adding another file type just because it's easier. With a little practice xpath doesn't seem so horrible (no worse than regex or SQL right?) but it helps so much to have a working query to start from. Thanks again!

Tigren
Oct 3, 2003

Bundy posted:

MariaDB and I think postgres let you easily implement versioning on tables. I personally go to json, SQL and toml for most of my needs.

If it's a simple CRUD app and you don't need truly high concurrency, and you need a DB, use sqlite. It's a single file, which can of course be versioned. There's also sqldiff which lets you diff two sqlite databases. If you don't need an RDBMS, then just store your poo poo in a json file. Even if you don't need a relational DB, use sqlite. There are times when it's even faster than writing to the filesystem.

cinci zoo sniper
Mar 15, 2013




mr_package posted:

Thanks this is actually helping a lot. e.g. once I have the node matching id attribute I can do a relative search using "./strings/*[contains(@xml:lang,'en-US')]" to get just the specific string element. Also one of the mistakes I made was reading *some xpath operation* returned a list and assuming it was a list of text; the searches here are returning lists of Elements which is obviously more useful.

JSON still looks like the better/simpler way for this but I'm still on the fence. Since I'll still need to read/write some XML as part of this project I might as well try and get good at it, rather than adding another file type just because it's easier. With a little practice xpath doesn't seem so horrible (no worse than regex or SQL right?) but it helps so much to have a working query to start from. Thanks again!

Imo SQL>XPath>RegExp, but guess how those rank in terms of my experience? :v: In all fairness though, SQL is rather straightforward, provided that you are working with PostgreSQL 10+, MySQL 8, recent-ish MSSQL or close derivatives of thereof. The real hairy shitshow is MySQL 5, because you need to reinvent windows functions and whatnot on the go.

cinci zoo sniper
Mar 15, 2013




Although MySQL 8 still has lmao-tier poo poo, like preferred char->int conversion method being

Select charfield+0 as intfield from foo

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I've been using PyCharm as an IDE but the sluggishness of it is starting to wear on me. If I wanted something just as fully featured but faster should I be going with VS code or Atom?

cinci zoo sniper
Mar 15, 2013




Boris Galerkin posted:

I've been using PyCharm as an IDE but the sluggishness of it is starting to wear on me. If I wanted something just as fully featured but faster should I be going with VS code or Atom?

There literally is nothing as fully featured as PyCharm, it’s undisputedly the best-in-class universal Python IDE. Many people, however, don’t need all the batteries that come included with it, and in that case I’d heavily recommend VSCode or ST3 over Atom - I don’t think there is an actual irl use case where Atom should be recommended, especially over VSCode - Python or otherwise.

Just for the sake of curiosity, what do you find sluggish about PyCharm?

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I'm not sure if it's a PyCharm thing or a Java thing, but every time I use PyCharm on my laptop (MBP) when it's unplugged my whole computer just feels like it grinds to a halt and the entire system is slower in general. I don't have any measurements to back any of this up of course but force quitting PyCharm and then using my laptop to do other unrelated things feels snappier without PyCharm running in the background.

Then there's also the feeling that PyCharm is just a mess of features cobbled together and getting help/information about something is seemingly impossible for me. Don't get me wrong it's a great tool--when it works without issues.

But right now for example, I'm trying to type up some documentation in an rst file. rst files require 3 space indentations, which I've configured in a global .editorconfig file. I can see that PyCharm is reading this file correctly because the bottom status bar tells me that my Makefile has tabs and a regular bash script has 2 spaces, both of which are also configured in the same .editorconfig file. For whatever unknown reason though, it doesn't want to apply my 3 space rule to any of the rst files I'm editing. For yet another unknown reason, another instance of PyCharm that I've opened a different project in does correctly apply my 3 space rule to the rst files in that window. So I have two instances of PyCharm running side by side, both reading the same exact .editorconfig file, yet only one of them is working properly. Why? Who knows. But it's small things like this (in addition to the perceived slowness) that just keep coming up all too often and I'd just rather have something that "just works."

Hadlock
Nov 9, 2004

Boris Galerkin posted:

I've been using PyCharm as an IDE but the sluggishness of it is starting to wear on me. If I wanted something just as fully featured but faster should I be going with VS code or Atom?

VScode has sort of replaced Atom as best open source code editor. Sublime is another good option but I haven't heard anything about it in probably a year. I don't know if I would call them fully fledged IDE though. VScode is my go to code editor though. The last time I saw anyone using Atom in the wild was 2017.

Edit: mildly interesting article from visual studio magazine (visual studio, not VScode):

https://visualstudiomagazine.com/blogs/data-driver/2018/12/2018-vs-code.aspx

Hadlock fucked around with this message at 13:50 on Mar 24, 2019

cinci zoo sniper
Mar 15, 2013




That indentation thing sounds really weird yeah, unless there is some project-specific settings fuckery. Although I want to point out that iirc ReST spec does not actually ask for 3 space indentation - it should also work with tab indentation or any number of spaces that is >2, so long that it's consistently applied.

necrotic
Aug 2, 2005
I owe my brother big time for this!
IntelliJ IDEs have known performance issues with Retina displays and I've been unable to use them as my daily driver because of it. Noticable lag moving the cursor around or typing, and even worse lag resizing or using GUI elements.

cinci zoo sniper
Mar 15, 2013




necrotic posted:

IntelliJ IDEs have known performance issues with Retina displays and I've been unable to use them as my daily driver because of it. Noticable lag moving the cursor around or typing, and even worse lag resizing or using GUI elements.

This could explain plenty about sluggishness, I've yet to use any of IntelliJ stuff on a Mac - I only have to deal with the mess that Windows HiDPI scaling is for various GUI frameworks.

Hadlock posted:

VScode has sort of replaced Atom as best open source code editor. Sublime is another good option but I haven't heard anything about it in probably a year. I don't know if I would call them fully fledged IDE though. VScode is my go to code editor though. The last time I saw anyone using Atom in the wild was 2017.

Edit: mildly interesting article from visual studio magazine (visual studio, not VScode):

https://visualstudiomagazine.com/blogs/data-driver/2018/12/2018-vs-code.aspx

Thankfully it would take a mismanagement to eclipse Ballmer's to kill Visual Studio proper (I'd off myself if I had to go back to RStudio for doing R work).

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I will spend any amount of money on computer hardware to continue using Jetbrains IDEs.

(though, I use VS Code effectively for a lot of stuff that is just a few hundred lines/one-off/throwaway)


I will note, that I'm using PyCharm at this very moment with VS Code also open on another monitor and they're basically indistinguishable from each other performance-wise (once they're running. PyCharm takes ages to load since one of the updates in the past 6 months) on my i5-4670k from 2013, 32GB of RAM, and Windows 10.

Thermopyle fucked around with this message at 18:14 on Mar 24, 2019

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply