Hadlock posted:If I want a dead simple, easy to use cross-platform 2d graphics api (not full screen) what is my go-to these days? The only other thing I've used so far is tkinter and it always felt really clunky. I guess there's QT but I haven't revisited that in ages This might be heresy in the Python thread, but as someone who likes python and hates javascript, I had a good time using Godot for 2D games. The scripting language is very python-like and easy to get the hang of if you are used to python.
|
|
# ? Nov 7, 2021 03:23 |
|
|
# ? May 15, 2024 02:24 |
|
Is Godot support for python sort of like how unity offers c# / .net scripting support? I did a quick Google search, looks like it's written in c++ but most of the python questions are "is python actually supported?" dating to 2019
|
# ? Nov 7, 2021 08:35 |
Hadlock posted:Is Godot support for python sort of like how unity offers c# / .net scripting support? I did a quick Google search, looks like it's written in c++ but most of the python questions are "is python actually supported?" dating to 2019 It doesn’t support Python, it just offers a scripting language that syntactically is a carbon copy of Python in many respects. A lot of people end up thinking it’s actually Python, for whatever reason.
|
|
# ? Nov 7, 2021 12:19 |
|
I'm looking to make a representation of a gamebook in Python, being familiar with Lua. In Lua, I'd define a game state, a table containing the hero's current stats, inventory, and so forth, as well as the page the reader is currently on. I'd then want to have a function that would take a game state and return a sequence of game states that can be reached with a single decision from that game state. To do so, I'd have a handful of helper functions; for example, freechoice(g, possiblepages) would take the gamestate g and return a sequence of game states, each one with the player having turned to a different page in the sequence possiblepages. Then I'd define this:code:
code:
e: corrected code. FredMSloniker fucked around with this message at 05:05 on Nov 12, 2021 |
# ? Nov 10, 2021 19:00 |
|
Ranzear posted:Just found out dictionaries are now ordered in 3.7+, but they didn't add any native way to sort by key. That's the most pythonian thing ever. I think they've actually been ordered for quite some time, but it wasn't official. I remember having pretty rowdy arguments over this fact in an old job. With my take being "If its not official, dont count on it, the underlying implementation might change." cos I certainly remember falling into that trap in a much early python (I've been using python since the 90s) and discovering that no, it was not.
|
# ? Nov 12, 2021 01:57 |
|
cinci zoo sniper posted:It doesn’t support Python, it just offers a scripting language that syntactically is a carbon copy of Python in many respects. A lot of people end up thinking it’s actually Python, for whatever reason. Yeah its *definately* not Python. That said, its pretty easy to write it if you know python. Its not like "Boo" or whatever unities pseudo-python was called. It seems to think like a proper python, except, well its not, and in some very major ways. I do enjoy GDScript though.
|
# ? Nov 12, 2021 01:59 |
|
I haven't seen any response to my earlier post. Was this the wrong place to ask? Is there a better place?
|
# ? Nov 13, 2021 19:24 |
It’s not clear what you are doing or why, so chances are no one has anything meaningful to reply.
|
|
# ? Nov 13, 2021 19:59 |
|
Yeah I can't really tell what is happening (do all of those functions return a modified game-state?) but I can definitely answer that that doesn't feel like Python. My guess is a more-Pythonic way would involve OOP with game state object and methods on it that do things and manipulate the state via object attributes.
|
# ? Nov 13, 2021 20:27 |
|
My thought would be to have each of your "pages" be defined in a JSON file, and when your code starts it grabs the first page from the file, prints the text associated with it, and then each option the user selects takes them to a different page. Maybe have a dictionary set aside to track certain choices if you want to get more involved. Defining a whole class/set of classes around it feels overkill unless you want to do a lot of similar games that may vary just a bit, or if your gamebook aspects are going to get more and more in-depth - I was picturing something very CYOA or Lone Wolf, but if you got more and more detailed you may want to amp up the underlying structure a bit.
|
# ? Nov 13, 2021 21:29 |
|
what youre trying to do will probably work exactly as is in python, which supports higher order functions/is a functional language, which means your functions can be map values etc. the syntax you have them in has the map key as a list of a single integer which is weird though i think if you can fit your entire game into code neatly you should definitely do that and not read from the filesystem for every page turn
|
# ? Nov 13, 2021 21:43 |
|
FredMSloniker posted:I'm looking to make a representation of a gamebook in Python, being familiar with Lua. In Lua, I'd define a game state, a table containing the hero's current stats, inventory, and so forth, as well as the page the reader is currently on. I'd then want to have a function that would take a game state and return a sequence of game states that can be reached with a single decision from that game state. To do so, I'd have a handful of helper functions; for example, freechoice(g, possiblepages) would take the gamestate g and return a sequence of game states, each one with the player having turned to a different page in the sequence possiblepages. Then I'd define this: This is a little confusing, you are passing an entry of g to a dictionary to access a function that takes the entirety of g? I have some random tips: Use partial instead of lambdas, the difference is subtle but I believe that partial is the better fit here Try not to use magic numbers. Use enums to specify what 1, 2, 3, etc correspond to; enums are better than integers because they make your code more readable, which will be important if you ever need to look at it again Don't use single letter variable names except for really ephemeral stuff. lambda g: freechoice(g, [2, 3]), is fine, def nowturnto(g): is just barely over the imaginary line where you should give g a descriptive name. Don't pass lists around as constant arguments; use tuples instead. And assign those arguments to some variable so that they're described in code. What is [2,3]? The answer should be immediately apparent from the variable name that it's assigned to. If you're passing around some persistent state (g) between a bunch of functions, you may want to consider defining a class. Maybe call it GameState, give it whatever attributes you think a game state deserves. It can possess methods like nowturnto Speaking of, use descriptive snake case: turn_to_page is better than nowturnto
|
# ? Nov 13, 2021 22:36 |
|
cinci zoo sniper posted:It’s not clear what you are doing or why, so chances are no one has anything meaningful to reply. Basically this: I'm not sure what exactly you're trying to do or why you're trying to do it the way you are. If g is a gamestate object I don't know why you'd pass that object to a bunch of functions instead of using a method. I also don't know why you'd want to have a dictionary defining the set of pages instead of just having a Page class with your pages defined by (and loaded from) a more coherent format and a method of that class that does what nowturnto is currently doing so that you can write something like Python code:
Python code:
QuarkJets posted:Try not to use magic numbers. Use enums to specify what 1, 2, 3, etc correspond to; enums are better than integers because they make your code more readable, which will be important if you ever need to look at it again I was also going to say something about using lambda to assign functions with contextless numerical arguments to numerical keys in a dictionary but I assume those are actually page numbers? Wallet fucked around with this message at 00:07 on Nov 14, 2021 |
# ? Nov 14, 2021 00:02 |
|
A while back, I was working with web scraping into CSVs in a project involving selling them, trying to be a rival to aggdata.com. I'd been using an ordered dictionary for each record, which was a mistake because I didn't need to access values using keys, but it would have been helpful for stepwise refinement to be able to directly insert new key-value pairs. For a function which handles a certain aspect of the response, the fields which are easiest to scrape together may not be the fields which are adjacent, so insertion is required. I could have used lists and made it clear which element corresponded to which field using comments instead. By the time I realized, I'd have a lot of code to change, but I've studied database management since, and I'm going to change to using a proper database if I go back to that project anyway.Python code:
Python code:
galenanorth fucked around with this message at 03:41 on Nov 14, 2021 |
# ? Nov 14, 2021 00:13 |
|
I'm 100% sure that between a dict, a list, or a named-tuple, you would have been best off using a dataclass instead. Or possibly a pandas dataframe, but that's pretty weighty. It depends on what you actually want to do with the data
|
# ? Nov 14, 2021 01:54 |
|
All right, let me back up a few steps and try again. I want to write a program that will 'solve' a gamebook that uses random numbers at some point (Lone Wolf or Fighting Fantasy, for instance). At any given point while playing the gamebook, you have a page that you're on and your hero's condition, which I collectively refer to as a game state. As a first step, I want a function that will take a game state and return the possible game states you can reach with your next decision, as well as a flag to let me know whether it's a free choice or depends on randomness. (I'll use this later when scoring paths through the book.) In order to not have to repeat a lot of code, I want to break the pages/numbered sections/entries/whatever the given game book calls them into several categories. For instance, it might have a page where you get to freely choose between a number of options. (The number might be one.) It might have a page where you check if you have a given item; if you do, you turn to one page, and if not, you turn to another. It might have a page where you roll a die and turn to a corresponding page. More complicated pages can be broken into internal subpages; for instance, page 10 might say 'if you have this ability, turn to page 27; otherwise, choose whether to turn to page 38 or 76'. I can break that into page 10 ('if you have this ability, turn to page 27; if not, turn to page 10a') and page 10a ('freely choose between pages 38 and 76'). I can then create a function for each category of page that, given a game state and various other arguments, returns a list of the game states resulting from that page and gamestate, as well as a flag letting me know if the choice was random or not. In this case, page 10 would check the game state for whether the character has the specified ability and return a list of a single gamestate, with the page changed to the appropriate page; on the other hand, page 10a would return a list of two gamestates, one for each possible choice. The master function would then check what page the input game state is on, call the appropriate function with the game state and page-specific arguments, and return that output. How would you go about doing that? Is anything about this description unclear?
|
# ? Nov 14, 2021 06:03 |
|
FredMSloniker posted:All right, let me back up a few steps and try again. What does the solution to a gamebook look like? Is it a list of unique final game states, and that's why you want to iterate over all possible game states in these decision trees?
|
# ? Nov 14, 2021 06:41 |
|
okay yeah, IMO at least (I am passingly familiar with the Fighting Fantasy concept but it's been forever since I've touched one of those books or thought about it in detail), you'd want to basically compress the transitions from section to section into a JSON file and load that into memory. (this is so you can do multiple books within the same system, if that's something you care about, and probably better than writing a function or creating an instance of a class representing each game page or w/e - although you could if you hated yourself) you then start the program by calling a function that will start at the beginning page of the book and proceed from there; at each decision point, you'd end up doing a recursive call for each potential outcome you have (succeed on a check, fail a check, proceed with an item, succeed or fail a check only if you have a given item, etc.). when you hit an end state, you can spit out the tree of decisions leading up to that point/the state of your character at the end of play and then you can sort them based on... total items collected? "bad" vs. "good" endings? number of good random outcomes vs. bad ones? like it may be possible to end the book by saving the Faire Elf Mayden on page 129, but you may or may not get there at full health, you may or may not have X in your inventory, you may have defeated the evil wizard or let him escape, etc. - as long as there are no loops (which I don't recall being a concern in these books) you should be good.
|
# ? Nov 14, 2021 07:30 |
|
QuarkJets posted:What does the solution to a gamebook look like? Is it a list of unique final game states, and that's why you want to iterate over all possible game states in these decision trees? For something like a Fighting Fantasy book, I'd be looking at score. Specifically, I score any game state on the final page of the book 1, and any other game state that ends the adventure (whether it's an instant death page or the character has taken too much damage or what) 0. Any game state from which you can make a free decision has the highest score of the game states those decisions lead to. Any choice that must be made randomly has the weighted average score of the game states it leads to. I might, at some point, look at other ways to score things - for instance, since you don't 'win' Fabled Lands books, I might score by how much of the content you're able to see before you die - but that'll work for now. The 'solution' to the gamebook, therefore, is being able to say 'okay, if you make this choice, you have a 40% chance of winning; if you make this choice, you have a 50% chance of winning; and if you make this choice, you're doomed'. As for loops, that's a concern. The most obvious source of them is combat; in the Fighting Fantasy books, it's possible to draw a given combat round. (Lone Wolf, by contrast, has someone losing health each roll, so combat always ends in a finite number of turns.) I already know how to tweak things to avoid that particular loop, though. I can do loop detection for more general cases by saying that you cannot revisit a given game state more than once in a game (not just a given page, but the exact same situation), and if you would have no choice but to do so at some point, that counts as a loss. (Fighting Fantasy sometimes has you turn to a page to get information, then go back to the previous page. 'Has read this information' would therefore need to be a flag in the game state. I might also apply this to avoid 'cheating', i.e. you have to have read some information to use it in the current run.) ...hm. While looking this over for typos, I've realized this means that a given game state would also have to contain all previous game states in order to be properly scored. I'll have to think on how to solve this at some point that isn't 'I'm about to go to bed'. At any rate, my biggest concern is memory usage. That's actually why I'm looking at Python in the first place. I can use a database to store something like a dictionary where the keys are serialized current game states and the values contain destination game states, decision types, and scores (if calculated), right? That way I don't have to have the entire state space in memory at once. (I still have to be careful not to let the state space get too big - this isn't going to solve chess - but maybe it can solve checkers.) And Python has a built-in database library. I admit I don't know a lot about databases, though. Is there some sort of dead-simple instruction on making a database where I can set the value of a (string) key, read the value (if any) of a key, and avoid corrupting the whole thing if the program shuts down early (so I can resume calculations at a later date)? And if two entities would compare identical by value (i.e., if I have two game states that I would consider 'the same'), does json.dumps() return identical strings for both?
|
# ? Nov 14, 2021 08:00 |
|
FredMSloniker posted:At any rate, my biggest concern is memory usage. That's actually why I'm looking at Python in the first place. I can use a database to store something like a dictionary where the keys are serialized current game states and the values contain destination game states, decision types, and scores (if calculated), right? That way I don't have to have the entire state space in memory at once. (I still have to be careful not to let the state space get too big - this isn't going to solve chess - but maybe it can solve checkers.) And Python has a built-in database library. That's right quote:I admit I don't know a lot about databases, though. Is there some sort of dead-simple instruction on making a database where I can set the value of a (string) key, read the value (if any) of a key, and avoid corrupting the whole thing if the program shuts down early (so I can resume calculations at a later date)? And if two entities would compare identical by value (i.e., if I have two game states that I would consider 'the same'), does json.dumps() return identical strings for both? Python has a zillion good database libraries so it's a matter of choosing something that makes sense. Do you want a for-realsies database or something that just exists in memory or a file? If you just want to store key-value pairs to disk then h5py (hdf5) is a powerful option, and pytables basically squishes together SQL with hdf5 files in a cool way.
|
# ? Nov 14, 2021 08:27 |
|
QuarkJets posted:I'm 100% sure that between a dict, a list, or a named-tuple, you would have been best off using a dataclass instead. Thank you. It's been long enough that I'd started on it before 3.7 came out. My initial plan is just to sell the CSVs as scraped directly from the website, without any other operations done to them except for formatting. My main offering over competitors is that the data is all formatted the same way, instead of formatted inconsistently using the same formatting as the website. When I have enough data sets, I'd start to sell combinations, like "all coffee shop locations in a certain area" or "all restaurants in a certain area that are competitors in selling chicken-based products" and set up an API which charges per-request. I found out that my state has a minimum $42/month sales tax on top of the $50-$100 in Google advertising expenses, even if I make zero sales in a month, so I'm waiting until I have enough savings to go back to the project, though. Edit: Actually, I found out I only need to register as a business if I make more than $3,000/year on it, and the minimum tax is only if I make more than $10,000/year. I don't know how I missed that. galenanorth fucked around with this message at 03:50 on Nov 15, 2021 |
# ? Nov 14, 2021 16:05 |
|
galenanorth posted:Thank you. It's been long enough that I'd started on it before 3.7 came out. My initial plan is just to sell the CSVs as scraped directly from the website, without any other operations done to them except for formatting. My main offering over competitors is that the data is all formatted the same way, instead of formatted inconsistently using the same formatting as the website. When I have enough data sets, I'd start to sell combinations, like "all coffee shop locations in a certain area" or "all restaurants in a certain area that are competitors in selling chicken-based products" and set up an API which charges per-request. As a person who buys marketing data boy howdy this sounds awful. Why would you not put it in a DB, in a standard format for the fields of interest, and then be able to query that DB for whatever a customer might want? Maybe they want coffee shops within 10 miles of a zip code? Obviously you can then offer an API or If the answer is: because I’m bad at DBs and RDS is expensive, I kinda like Googles big query for stuff I only need to query once in a blue moon and don’t want to spend time setting up a proper dB for. Ive gotten a lot Mileage out of big query for basically no cost and no set up time and lots of Python examples.
|
# ? Nov 16, 2021 06:19 |
|
I got caught up in what a few competitors (RedLionData, ScrapeHero, using Google Places API) were doing rather than what made sense to me. Also, I was thinking of being able to use the codebase I'd already written before learning to use databases to try and sell CSVs while I update to the new version, but it'd probably be better to launch later and make a better first impression. I'm thinking of using Django with PostgreSQL. When it's done or I have a first draft, can I link the website here or in some other thread and let you look over it?
|
# ? Nov 16, 2021 11:14 |
|
Yea though I can tell you with big query you get to sidestep the “knows about DBs” part pretty well. It’s worth checking out you can literally make a table from a CSV upload and it has a great query editor and Python examples. Note: I wouldn’t use it as a Django backend. If you’re thinking of using Django I also highly recommend checking out Zappa. It makes deploying serverless Django a breeze. (Which will also make hosting your site nearly free) It’s honest to god easier to set up than AWS elastic beanstalk/EC2. Maybe not easier than Heroku though. Edit: also like Zappa because it makes setting up your SSL cert and DNS config super easy if you’re using AWS for those as well (Route 53/ACM is what AWS calls those bits) EDIT2: Not sure how many opinions youre looking for but I actually have a site that is exactly this use case except I provide other data I scrape. I use Django + Django Rest Framework because it makes auth super easy and secure, Django CMS lets me have marketing pages editable by laypeople, and many other great things about Django. That said, there are definitely much easier, all python ways to do what you want if you're not familiar with Djangos rather opinionated way of doing things so if you'd like more thoughts there LMK. CarForumPoster fucked around with this message at 14:52 on Nov 16, 2021 |
# ? Nov 16, 2021 12:44 |
|
hi python pals, humbly asking for a lil help with something p elementary here- abt fifteen years ago I became Very Depressed and dropped my interests in coding/IT/electronics. I've been in recovery for a couple years now! Prolonged depression left me with some cognitive decline, which I'm finding is reversible, but I have to rebuild a lot of foundational skill rather than jumping back in where I left off. I'm havin fun with it, looking forward to being able to take on lil contracts to help with rent/medicals/food/a better computer than my current pentium g620 box been coding since BASIC lessons in kindergarten and I'm pushing 40 now, tho I have never coded for money or worked with others (aside from modifying stuff from git/stackoverflow), which brings me to my point: I want to get a sense for if my coding is idiosyncratic in a way that is not useful- if I'm building algorithms based on old pre-Y2K habits, or, new habits fostered in isolation, that may be less than optimal. I guess I'm asking for a code review? idk industry terms rly, lol, as I said- just been a script jockey for my own hobby purposes, trying to get better at seeking help from other ppl online for things like this. ok so thx for indulging me in that preface, this year has been a Big Deal for me in terms of recovery, so- it's a bit personally important. On to the code! I am building a command line interface to aid in running a TTRPG session/campaign. I'm not messing much with classes, structs, or mutators yet- I remember vaguely how they work, but after so much time away I'm finding I have to conceptualize these things all over again (sweigart's work is v useful here, dude knows how to teach a neurodivergent autodidact)- So I have ideas for where I want it to end up, but for now, I'm just cobbling together basic dice functionality- this will take a string in XdY(+/-)N format (or dY, Xd, d+N, etc) and kick out two results: a sum of all dice, and, a list of individual dice rolls. It's also a bit janky because I haven't really done extensive error handling yet, but I've been successfully using it at the game table as a basic dice roller gmfunctions.py (sans comments): Python code:
Python code:
gmcli.py with comments: image link I get a sense that this is kind of a perly way to do it, but idk if there's anything wrong with that rly sry if this is too big a post or something, thanks to u for lookin at it!! Peanut Butler fucked around with this message at 01:17 on Nov 25, 2021 |
# ? Nov 25, 2021 01:08 |
|
Peanut Butler posted:gmfunctions.py with comments: image link Find yourself a copy of Clean Code. It's Java, not Python, but many of the lessons are still applicable: effective variable names, comments that aren't superfluous or confusing, function/method names that aren't simply lies, etc. I'm not saying any of these things apply to you specifically, I mean in general it's a good book and may help to get you thinking about how you write code and how you can write better code in the future For style, you can read through PEP8 for specific points, but there are also tools that can help you on your way. PyCharm is a really great IDE and will show you squiggles wherever it senses that you're doing something weirdly. Open your code up in PyCharm and see what it says. I also like flake8, you can run it as a command line utility and it'll dump out a list of everything that you're doing wrong (or that maybe is a little weird). Let's look at some of your code: Python code:
I think it's better to compare string lengths than to compare to an empty string, so if len(values[0]) == 0: Get in the habit of writing good docstrings. I did look at the version with comments. Python has neat assignment tricks like dictionary assignment and conditional operators. I'll try to use some so you can check them out. Unless you really need a list, I think it's preferrable to return tuples. Or better yet, to yield values in a generator, but that wouldn't make sense here. This code is a little confusing to read without the comments. It would be a lot cleaner and easier to read if you extracted the parameters into named parameters, updated the parameters as-needed, and then returned them as a tuple. Here's how I'd write it: Python code:
Let's look at the next function: Python code:
Python code:
Last code block I'm just going to start working on it. Group your imports. Use len(var) == 0 rather than comparing to empty strings. Use 'in' for multiple stringle comparisons. Use f-strings. You can pass objects directly to print() without converting them to strings first, e.g. print(str(some_integer)) is the same as print(some_integer) Python code:
Also, numpy can generate arrays of random integers in a single line, you could forego having a roll_dice function and just write this: Python code:
QuarkJets fucked around with this message at 09:22 on Nov 25, 2021 |
# ? Nov 25, 2021 09:11 |
|
QuarkJets posted:Also, numpy can generate arrays of random integers in a single line, you could forego having a roll_dice function and just write this: Just use random.choices() and sum(), there's no need to start pulling in massive dependencies for stuff like this. Here's my stab at the dice thrower: Python code:
|
# ? Nov 25, 2021 14:46 |
|
QuarkJets posted:
Is using an underscore in your for loop there common? When I'm teaching for loops in Python students seem to get very confused if we declare a variable there but never actually use it inside the loop - wondering if I could show it using an underscore and say "yeah, this is just a reminder that we're not actually using the number from the range".
|
# ? Nov 25, 2021 22:20 |
|
Epsilon Plus posted:Is using an underscore in your for loop there common? When I'm teaching for loops in Python students seem to get very confused if we declare a variable there but never actually use it inside the loop - wondering if I could show it using an underscore and say "yeah, this is just a reminder that we're not actually using the number from the range". Yes, underscore is the idiomatic way of representing "variable I don't care about and never intend to use". Some common uses: Python code:
Python code:
Loezi fucked around with this message at 22:31 on Nov 25, 2021 |
# ? Nov 25, 2021 22:26 |
Epsilon Plus posted:Is using an underscore in your for loop there common? When I'm teaching for loops in Python students seem to get very confused if we declare a variable there but never actually use it inside the loop - wondering if I could show it using an underscore and say "yeah, this is just a reminder that we're not actually using the number from the range". Yes, it’s an ordinary convention for marking throwaway variables. Please note, however, that _ in the interpreter takes value of the most recently evaluated expression.
|
|
# ? Nov 25, 2021 22:30 |
|
Epsilon Plus posted:Is using an underscore in your for loop there common? When I'm teaching for loops in Python students seem to get very confused if we declare a variable there but never actually use it inside the loop - wondering if I could show it using an underscore and say "yeah, this is just a reminder that we're not actually using the number from the range". Yeah linters even acknowledge this use and will otherwise complain about the unused variable
|
# ? Nov 25, 2021 22:46 |
|
cinci zoo sniper posted:Yes, it’s an ordinary convention for marking throwaway variables. Please note, however, that _ in the interpreter takes value of the most recently evaluated expression. Also convention to use an underscore as a prefix for functions/etc that aren't intended to be imported/used elsewhere. Not sure which convention came first but I think of them as sort of thematically related. Just like the _ on its own there's no special behavior associated with it (except in the case of double underscore prefixes for class attributes which is a whole thang).
|
# ? Nov 25, 2021 22:46 |
Wallet posted:Also convention to use an underscore as a prefix for functions/etc that aren't intended to be imported/used elsewhere. Not sure which convention came first but I think of them as sort of thematically related. Just like the _ on its own there's no special behavior associated with it (except in the case of double underscore prefixes for class attributes which is a whole thang). There is also a pattern for callbacks, so (sorry for phone formatting) def print_three(): print(3) but def confirm_foo_execution(_): return True
|
|
# ? Nov 25, 2021 22:51 |
|
Loezi posted:
A fully invalid string is going to return AttributeError instead of ValueError and the blanket try/except in run() makes me squirm a little (and Pycharm for example will squiggle you for this) particularly since it's both catching and masking the actual exception by not at least reporting it, e.g.: Python code:
Python code:
Wallet fucked around with this message at 23:10 on Nov 25, 2021 |
# ? Nov 25, 2021 23:04 |
|
hey thx for the help! gonna delve into this and prolly have some questions when I get back from thxgiving vacation
|
# ? Nov 26, 2021 07:30 |
|
Wallet posted:Also a missing modifier is still going to throw an exception anyway, no? I think it might have been a thing in python 2.x but "" != None. This should catch it in either case though: Whoops, that what I get for making a last second swap from findall to fullmatch. Nicely spotted.
|
# ? Nov 26, 2021 08:37 |
PyCharm 2021.3 is revamping notebooks and remote development again. Alexa, play Deja Vu by Initial D.
|
|
# ? Dec 1, 2021 20:18 |
|
Is working with notebooks in Pycharm currently bad? I don't do notebooks too much and when I do I honestly just use JupyterLab which seems good.
|
# ? Dec 1, 2021 20:52 |
Protocol7 posted:Is working with notebooks in Pycharm currently bad? I don't do notebooks too much and when I do I honestly just use JupyterLab which seems good. Working with literal notebooks does fail to utilize the available functionality properly, in my opinion. It's a functional experience, has been for years, but I still feel nowhere near "native" development experience. Also, some of the more involved notebook setups won't work at all in PyCharm, but I only use them when I'm pressed to do so. Working in scientific mode, via # %% comment notation, feels great, however. The introduction of the notation was like their third or fourth attempt at making the notebook-style coding experience suck less, which is what my post was getting at - they've continuously failed at making a dent in the USP of VSCode or Jupyter. Fleet is now a dedicated attempt to take a crack at VSCode's remote development faculties, whereas this is the other half then, and will get ported to Fleet if it works.
|
|
# ? Dec 1, 2021 21:05 |
|
|
# ? May 15, 2024 02:24 |
|
man im really not sure if this should go in this thread or the HTML thread but uhh i'm making a REST API in flask, ive got some of this poo poo set up: Python code:
so for example if someone were to search 'hbag', it'd take them to '/flags/users/hbag' but since it's a HTML form, i have no idea how to get around that, since adding an 'onsubmit' function seems to just run that function and THEN submit the form regularly anyway
|
# ? Dec 8, 2021 02:49 |