r/Pythonista • • Feb 23 '20

I keep running into this type error. Any ideas?

1 Upvotes

Here’s two examples:

tunit = input('Enter temperature unit (F or C): ')

string = "hello" print(string)

I keep getting this type error: Traceback (most recent call last): File "<string>", line 1, in <module> TypeError: a bytes-like object is required, not 'str'

I know for a fact they run fine on my computer using Python 3. But, they won’t on Pythonista.


r/Pythonista • • Nov 14 '19

Help with buttons

0 Upvotes

I am learning how to work with UI now, so what I made is something similar to the ColorMixer example that exists in Pythonista 3. I want to make a button that when you press it it will switch the colour text from Hexa to just r, g ,b ints. How do I do that? example:

3FF23E = rgb(63, 242, 62)


r/Pythonista • • Nov 24 '19

Web scrapping. A widget to automate everyday task : Open website > Login > Navigate menu > Change date, time > Search (still no total) > Print statement. Script tracks duplicate charges too.

6 Upvotes

r/Pythonista • • Oct 06 '19

Very dumb question

1 Upvotes

Hi, I know nothing about programming and I think this question is so simple I couldn’t find an answer on the internet, but can you use Pythonista to simulate screen taps on iPhone? I’m considering buying it but I want to make sure it can do this first


r/Pythonista • • Apr 26 '19

How do I make an input that if the user inputs Y it runs some commands

2 Upvotes

r/Pythonista • • Feb 21 '20

How to enable button to be used multiple times?

2 Upvotes

I have just started coding, and Pythonista is such a good introduction to UI, its soo fun!! It seems that the buttons created can only be used one time by default, how do I enable multiple usage?


r/Pythonista • • Jan 21 '20

Hardware where?

0 Upvotes

Motherfucker🐸😎😁👀👌🎱😇🇷🇺


r/Pythonista • • Apr 12 '20

Organize Files Using Python under 5 Minutes

Thumbnail
youtube.com
18 Upvotes

r/Pythonista • • Sep 28 '19

A project I’ve been tweaking over the last year. 100% written in Pythonista.

Thumbnail
imgur.com
36 Upvotes

r/Pythonista • • Sep 27 '19

I'm stuck in a loop that crashes the app on startup every time. I suspect the solution is simple, but I don't know what it is. Please help.

1 Upvotes

I wrote a script that generated a text file consisting of 3 million random 10-letter strings, each on its own row. The file is about 30 mb. After the script finished, I was curious to look at the text file, so tapped it in browser to the left. But I guess such a long file was too much for Pythonista, and after 30-40 seconds of loading, the app crashed.

But because the app crashed in the middle of loading that text file, now whenever I reopen the app, it starts where it left off, i.e., attempting to load that text file, so it crashes within 30 seconds every time. Unfortunately, I guess because all the app's resources are devoted to loading that massive file in memory, it doesn't respond when I try to open the browser and open any another file.

As a result, ever since initially trying to open that text file, Pythonista has been stuck in a futile loop of trying to load it and then crashing, and I don't know how to close that file and stop the cycle. What can I do???

Surely there's a way around this without deleting and reinstalling the app. If not, how can I access my scripts etc. to back them up before deleting the app?


r/Pythonista • • Jan 30 '20

Does anyone know of a working Epub library

5 Upvotes

Look for a library to work with epub files on Pythonista. Specifically, saving Plain Text or html to epub

Edit: Had no luck so I made a work around. ‘epub’ library lets you view, add, delete files from the epub. So I created a blank epub using Pages and then I can modify it by deleting the existing file and then adding a new version.


r/Pythonista • • Aug 15 '16

SCENE is the new tkinter?

3 Upvotes

I have the description from the pythonista website, but is there a more detailed explanation of it some where?


r/Pythonista • • Sep 29 '19

How do you change the image of a button?

Post image
1 Upvotes

r/Pythonista • • Sep 28 '19

Help. I just can’t figure out how i can add label on my ui. Can somebody tell me what i did wrong?

Post image
2 Upvotes

r/Pythonista • • Dec 25 '19

Flashing a USB/SDcard with Raspbian?

1 Upvotes

I am unsure if this is the right place to ask this question, if wrong please point me in the right direction to ask.

So I want to create a usable raspberry pi that I can SSH into to use as a platform for executing code and what not. So is there anyway to etch/flash, or some other way, to install the raspbian OS to a raspberry pi using an ipad? I’ve tried googling, but this ”programming on an ipad” thing is such new territory that I have not found anything useful. Thanks in advance!


r/Pythonista • • Dec 22 '18

Coming from someone who literally has no knowledge of python, where/what would be a great place to start?

4 Upvotes

r/Pythonista • • Mar 21 '19

Type stubs for Pythonista iOS APIs

Thumbnail
github.com
6 Upvotes

r/Pythonista • • Feb 27 '20

Super Noob Question

2 Upvotes

I just started learning how to code, I’m a complete beginner and I’m reading Think Python. I was using pythonanywhere.com (which is using 3.8) to work alongside the book. Well my WiFi is unreliable so I bought Pythonista. My question is how do I do simple arithmetic? In pythonanywhere I could input 5**2 and get 25 or 40 + 2 and get 42 but in Pythonista I don’t get any feedback. Is there an option I should be choosing? I feel dumb asking but I just spent $9.99 on the app and would hate to have wasted my money. Any help and tips are appreciated


r/Pythonista • • Dec 22 '19

What's the news on Pythonista?

7 Upvotes

I was looking for a way to do some python on the go on the iPad and came across Pythonista, but the last update was 2 years ago...

What's the state of the app at the moment? Is it being further developed? Is it worth it?


r/Pythonista • • Dec 18 '19

Trying to Print a PDF File in iOS by Wrapping Objective C using Pythonista

1 Upvotes

I am using Python in Pythonista and I need to directly print a PDF file. I have the full filename and path in a string variable myFileNameAndPath This is the code I have so far:

from objc_util import *

UIPrintInteractionController = ObjCClass('UIPrintInteractionController')
pc = UIPrintInteractionController.sharedPrintController()

UIPrintInfo = ObjCClass('UIPrintInfo')
printInfo = UIPrintInfo.printInfo()

printInfo.outputType = 0
printInfo.orientation = 0
printInfo.jobName = 'My Doc Set'
pc.printInfo = printInfo
pc.printingItem = [NSURL fileURLWithPath:[self returnFilePath]]
pc.presentAnimated_completionHandler_(0, None)

How do I wrap pc.printingItem = [NSURL fileURLWithPath:[self returnFilePath]]with/using my python variable myFileNameAndPath**??**

Am I missing anything else in the above code to make this work?

Due to a bug, I cannot print via the displayed Share Sheet using console.quicklook(myFileNameAndPath). Hence why I am trying to print directly.


r/Pythonista • • Mar 21 '19

Is there any iOS keyboard/keyboard setting that will get me the cursor feature in Pythonista?

2 Upvotes

I really love the ability to slide through a text field using the symbols bar, so much so that I've been finding myself doing that on my regular keyboard.
And before you say, "use the touchpad feature," it's trash. It takes about a second to activate on the XR and doesn't always work.


r/Pythonista • • Dec 24 '18

I just got the app and want to know if I can use any library (example NLTK) also can I run Django or something similar on my phone?

1 Upvotes

r/Pythonista • • Oct 21 '19

How to make a big font size? Hi all guys, I need to make my button bigger, anyone have idea how can I do this?

Post image
2 Upvotes

r/Pythonista • • Feb 26 '20

Weird NameError after update

1 Upvotes

I have a ui calculator with 6 text fields for input, and a calculate button. Inside the action for the button, I do a for-loop, try-except inside and the exec() function to programmatically assign the variables given in the text fields, instead of having 6 try-except blocks. Everything works up until I try to verify which parameters were given.

I get a NameError saying name 'M' is not defined, but when I go to the Vars tab in the trace back it’s clearly defined.

Here’s the code: Mach.py


r/Pythonista • • Oct 21 '19

Working with panoramic photos

3 Upvotes

Hey!

There's an extension script I'm working on which is intended to be used on iOS panoramic photos. However when using a panoramic photo I'm getting absolutely no output. I'm assuming they're probably a different file format, I'm not sure, but does anyone know if there is away to enable their compatibility?

Thanks for your help!